Friday, December 4, 2009

bbs特色词汇

小钻风
原是西游记里的巡山小妖的名字. 这里是为公共站务ID mitbbs起的外号。此ID刚刚由walklooktalk在sysop版公布时,大家决定叫它总钻风,因为其职能类似于总版主,但小钻风这个名字最后沿用了下来。这个ID由walklooktalk在北京的雇员轮流值班,为提高论坛流量而到各版挑选文章置顶,也经常越过各版版主处理版务,由此引起很多怨言。但由于是雇员,从不像其他站长一样耍态度。

LD
领导,一般指配偶,引申出小LD,指家里的孩子。

LP、LG
老婆、老公的简称。

WSN
Family版经常出现的称呼.可男可女.猥琐男或者猥琐女的简称.特点是心理幼稚但是不阴暗, 行为诡异但是不偏激。

外F女
外嫁女的贬义用法,F估计代表英文Fuck,原指海外华人中对洋人盲目推崇进而随便与其上床的女生,后泛指因为绿卡或金钱等不纯目的而找洋人做男友或老公的中国女子,通常在Dreamer版上出现。这个词应该是源于对一些外嫁女子在网上炫耀自己的涉外爱情和家庭经历,而引起某些人群的不平。


意等同于英文词"TROLL",泛指那些投人所好有争议/夸大其词/或者纯属编造的贴子,来引发网友讨论,这样的贴子常被人称为"坑",发此类贴子的行为被称为"挖坑"。

发包子
凡文章获得版主加精 (M上),发文用户自动获得10元伪币。借此,网友们管发文章让版主加精为发包子行为,一个包子等于10伪币。

毛上、搞上
毛上指的是版主将版面的文章mark以保留该文章,标记符号为m,故取其谐音称为毛上;而搞上是指版主将版面文章加入文摘区,标记符号为g,故取其谐音称为搞上。

饭米粒
特指“我爱我家”版(FAMILY的谐音读法)。


饭米粒版对婚姻问题的标准回复,后来范围扩展至所有问题。很多id上来不看文章,照着原贴就是一个字“离”。后来版主StoryTeller试图令行禁止,成效不大。

八区
泛指"中国新闻"(CHINANEWS),"世界新闻"(WORLDNEWS),以及SALON,HISTORY,MILITARY等等版面,八区的叫法源于这些版面最初在TELNET界面下统属第8版块,该版块因涉及时事新闻较多,持不同见解的人言词激烈,很多时候八区版面火药味浓重,易引发争吵,"八区"在不少网友眼中常常被视为吵架的地方。

BT
源于拼音"变态"。起初用于自认为正常人类对被认为非正常人类的蔑称. 此称谓最初出现于mitbbs dreamer版2000年左右,那个时候dreamer风格转换,忧郁的文青正在被一些被称为新生代变态的新ID为首的新成员所代替。后来这个词逐渐在 MITBBS被泛化,现在已经变成英语里面"dude"一样的称呼。BT 也指 Balance Transfer 多用于Money版。

88一下
即八卦一下。

PENG
源于"肚皮舞运动"(Joke)版面,该用法源于大约1999年左右的一则新闻:英国陆军因为军费缺乏,打靶演习无法用实弹,只好在射击时口中发出射击声音。ID katy时任Joke斑竹,并转载了该新闻,建议今后见到老笑话就用"Peng"表示。"PENG"一词后扩散至整个BBS,涵盖面也扩大到任何性质的贴子,不仅仅只是笑话贴,包括贴子是重复的或者某人说过同样的话,都可以用PENG来表达。后来在 情爱幽幽(Love)版继续演化为 “BENG”。


最初称为裸奔。一般是指网友在版面上帖出自己的照片供大家欣赏取乐,有时也有如交友等特殊目的。常用的口号有:某某奔一个!奔上十大!你小你先! 等等. 2003-2004年度裸本成为mitbbs维护人气的一个重要节目,前著名女光棍,资深ID Janet曾制作并且不定期发布裸奔大全。


指专门show东西物件的,照片里没有人物只有物品。

胖子
Shopping(购物版)的常用词汇,指购物的时候使用的折扣券。因为美国商店的折扣券,英文为“Coupon”和中文“酷胖”或“哭胖”谐音,久而久之网友就改称之为“胖子”,而且显得更加琅琅上口。

死呆婆
美国著名办公用品商Staples的中文谐音,源自Mitbbs人气大版Shopping。该店因良好的客户服务、遍及美国城乡的销售网络、以及诸多的促销活动而深受Shopping版网友的推崇,某些网友的第一桶金即出自Staples。Staples目前已进入中国市场,其中文官方译名为“史泰博”。

RenPinWenTi
人品问题(rpwt)的另类表达。mitbbs南来北往,网友众多,模糊拼音的使用受到广大网友的普遍好评。

医院
ebay, 鉴于购物天堂(Shopping)版版主禁止在版上讨论ebay买卖,所以大家用“医院”这词代替ebay。典故出自前任汽车版主,shopping版资深ID coven在shopping版用隐晦的语言讲述自己在ebay因做托被封杀id及株连马甲的故事。另外由于ebay鱼龙混杂,故又用厕所一称呼代替。

病人
ebay 购物者

JHQ
精华区,多用于提示新手参考精华区,而不是一味问问题。

buffet deal (简称 buffet)
ebiz版 形容一笔交易的利润的量词。。。指获利,够享用一顿buffet...非常形象。

BSO
Bloodly Show off 不管人说啥都可以re:bso!)

Sunday, November 22, 2009

c# create and write to excel file

Following my previous post c# how to read write excel spreedsheet and C# quit excel appliction after using COM objectI wanted to continue the topic with a focus on write to excel spreedsheet.

Using Microsoft.Office.Interop.Excel is the easiest option and with Excel 2007 installed, you can get version 12 of this dll. It allows user to save files as Excel 2007 format, or the old 97-03 format.

Firstly, Let’s look at some sample code.

        private static void NAR( object o )
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject( o );
}
catch( Exception ex )
{
Console.WriteLine( ex.ToString( ) );
}
finally
{
o = null;
}
}

public override void save( FileWriter writer )
{
string filename = writer.FileName;

TimeSeries[] series = checkCompatibleTimeSeries( (Data[])data.ToArray( typeof( Data ) ) );
int count = series[0].itemCount( );
if( count == 0 )
throw new DataFileIOException( this, "Time series to save to " + filename + " are empty" );

// Instantiate Excel and start a new workbook.
Excel.Application objApp;
Excel._Workbook objBook;
Excel.Workbooks objBooks;
Excel.Sheets objSheets;
Excel._Worksheet objSheet;
Excel.Range range;

objApp = new Excel.Application( );
objBooks = objApp.Workbooks;
objBook = (Excel._Workbook)( objBooks.Add( Missing.Value ) );
objSheets = (Excel.Sheets)objBook.Worksheets;
objSheet = (Excel._Worksheet)( objSheets.get_Item( 1 ) );

if( objSheet == null )
{
throw new Exception( "Worksheet could not be created. Check that your office installation and project references are correct." );
}

try
{
( (Excel.Range) objSheet.Cells[ 1, 1 ] ).set_Value( Missing.Value, "Date" );
( (Excel.Range) objSheet.Cells[ 1, 2 ] ).set_Value( Missing.Value, filename );


for( int rowIndex = 0; rowIndex < count; rowIndex++ )
{
( (Excel.Range) objSheet.Cells[ rowIndex + 2, 1 ] ).set_Value( Missing.Value,
series[ 0 ].timeForItem( rowIndex ) );

for( int columnIndex = 0; columnIndex < data.Count; columnIndex++ )
{
( (Excel.Range) objSheet.Cells[ rowIndex + 2, columnIndex + 2 ] ).set_Value( Missing.Value,
series[ columnIndex
][ rowIndex ] );
}
}
objApp.DisplayAlerts = false;
objApp.AlertBeforeOverwriting = false;
objBook.SaveAs( filename, format , Missing.Value, Missing.Value, Missing.Value, Missing.Value, Excel.XlSaveAsAccessMode.xlShared, Excel.XlSaveConflictResolution.xlLocalSessionChanges, Missing.Value, Missing.Value, Missing.Value, Missing.Value );

objBooks.Close( );
objApp.Quit( );
}
catch( Exception theException )
{
throw theException;
}
finally
{

if( objBooks != null )
objBooks.Close( );
if( objApp != null )
objApp.Quit( );
NAR( objSheet );
NAR( objSheets );
NAR( objBooks );
NAR( objBook );
NAR( objApp );
}

GC.Collect( );
GC.WaitForPendingFinalizers( );

}



Some tricky part of the code is the SaveAs Method. In order to disable the pop up alert messagebox, you need to do few things. (I believe most people do want to disable it since this must have been handled in the GUI part). Excel.XlSaveAsAccessMode.xlShared is the essential key to solve this problem. If it is not used, then  Excel.XlSaveConflictResolution.xlLocalSessionChanges wouldn’t work. Both “objApp.DisplayAlerts = false;” and “ objApp.AlertBeforeOverwriting = false; ” are used in the Excel dll Version 11 and will be overwrite by the XlSaveConflictResolution.



The code is fairly straight forward, the please refer to my old post on how i clean up the resources before quit.

Monday, November 16, 2009

c# detect excel install location in registry and open file

public void OpenInExcel(string filename)
{
string dir = "";
RegistryKey key = Registry.LocalMachine;
RegistryKey excelKey = key.OpenSubKey(@"SOFTWARE\MicroSoft\Office");
if (excelKey != null)
{
foreach (string valuename in excelKey.GetSubKeyNames())
{
int version = 9;
double currentVersion=0;
if (Double.TryParse(valuename, out currentVersion) && currentVersion >= version)
{
RegistryKey rootdir = excelKey.OpenSubKey(currentVersion + @".0\Excel\InstallRoot");
if (rootdir != null)
{
dir = rootdir.GetValue(rootdir.GetValueNames()[0]).ToString();
break;
}
}
}
}
if (dir != "")
{
ProcessStartInfo startInfo = new ProcessStartInfo();

startInfo.FileName = dir + @"Excel.exe";
startInfo.Arguments = "\"" + fileName + "\"";
startInfo.UseShellExecute = false;

using (Process process = new Process())
{
process.StartInfo = startInfo;
try
{
process.Start();
}
catch (Exception ex)
{
Console.WriteLine("\n\nCould not start Excel process.");
Console.WriteLine(ex);
}
}
}
else
{
MessageBox.Show("Can't Open in excel because excel is not installed.");
}
}

c# revert a LinkedList

void ReverseLinkedList(LinkedList ls)
{
if ( ls == null || ls.Head == null )
return;
ListNode head = ls.Head;
ListNode current = head.Next;
while(current!=null)
{
ListNode tmp = current;
current = current.Next;
tmp.Next = head;
head = tmp;
}
ls.Head.Next = null;
ls.Head = head;
}

c# merge sort algorithm implementation

        private int[] MergeSort(int[] a)
{
if ( a.Length == 1)
return a;
int middle = a.Length / 2;
int[] left = new int[middle];
for (int i = 0 ; i < middle ; i ++)
{
left[ i ] = a[ i ];
}
int[] right = new int[a.Length - middle];
for( int i = 0; i < a.Length - middle; i++ )
{
right[i] = a[i+middle];
}
left = MergeSort( left );
right = MergeSort( right );

int leftptr = 0;
int rightptr = 0;

int[] sorted = new int[a.Length];
for(int k = 0 ; k < a.Length; k++)
{
if ( rightptr == right.Length || ((leftptr < left.Length ) && (left[leftptr] <= right[rightptr])))
{
sorted[ k ] = left[ leftptr ];
leftptr++;
}
else if( leftptr == left.Length || ((rightptr < right.Length ) && (right[rightptr] <= left[leftptr] )))
{
sorted[k] = right[rightptr];
rightptr++;
}
}
return sorted;
}

c# Quick Sort Algorithm Implementation

private void QuickSort( int[] a, int left, int right ) 
        { 
            if( a == null ) 
                return; 
            int i = left; 
            int j = right; 
            int pivot = a[( left + right ) / 2]; 
            while( i <= j ) 
            { 
                while( a[i] < pivot ) 
                    i++; 
                while( a[j] > pivot ) 
                    j--; 
                if( i <= j ) 
                { 
                    int tmp = a[i]; 
                    a[i++] = a[j]; 
                    a[j--] = tmp; 
                } 
            } 
            if( j > left ) 
            { 
                QuickSort( a, left, j ); 
            } 
            if( i < right ) 
            { 
                QuickSort( a, i, right ); 
            } 
        }

c# insert sort algorithm implementation

        private void insert_sort( int[] s )
{
for( int k = 1; k < s.Length ; k++ )
{
int value = s[k];
for( int i = 0; i <= k - 1; i++ )
{
if( value < s[i] )
{
for( int j = k - 1; j >= i; j-- )
s[j + 1] = s[j];
s[i] = value;
break;
}
}
}
}

Saturday, October 31, 2009

键盘上的符号发音

~
tilde (sounds like til-da); be prepared to explain to computer-illiterate people saying "you know, the wave-shaped thingy"

!
exclamation; commonly read as bang in case of #!/bin/sh

@
at

#
pound; but commonly read as shee in case of #!/bin/sh, not sure why

$
dollar

%
percent

^
caret; not many people know this word so be prepared to say "no, not carrot; it's the character above 6, an arrow pointing up"

&
ampersand

*
star; some read asterisk

(
opening parenthesis (some may shorten it saying paren)

)
closing parenthesis

_
underscore; once I heard people say underbar

+
plus

-
minus; as symbol before arguments in commands, some people including me read dash, easier to say one syllable

=
equals

`
backtick or backquote

{
opening brace

}
closing brace

[
opening bracket

]
closing bracket

|
pipe or vertical bar

\
backslash; be prepared to explain to some computer-illiterate people

:
colon

;
semicolon

"
double quote

'
single quote

<
less than; some may read left angle bracket

>
greater than

,
comma

.
dot; period if in English text

?
question mark

/
slash or forward slash; some computer-illiterate people may be confused about / and \

space

(), [] and {}
may also be called brackets in general. In that case, they specifically call [] square brackets and {} curly brackets. I never like this. Open and Closing may also be called left and right.

Thursday, October 8, 2009

c# copy excel data and paste into datagridview table

This post is about managing the memory data object after ctrl+c is used in Excel. You will learn how data are organised in memory and should be able to apply it anywhere. The code example tries to read the data in DataObject out and paste it in datagridview.            


DataObject o = (DataObject) Clipboard.GetDataObject(); 
if (o.GetDataPresent(DataFormats.Text))
{
int rowOfInterest = DataGridView.CurrentCell.RowIndex;
string[] selectedRows = Regex.Split(o.GetData(DataFormats.Text).ToString( ).TrimEnd( "\r\n".ToCharArray() ), "\r\n");

if (selectedRows == null || selectedRows.Length == 0)
return;

foreach (string row in selectedRows)
{
if (rowOfInterest >= DataGridView.Rows.Count)
break;

try
{
string[] data = Regex.Split(row, "\t");
int col = DataGridView.CurrentCell.ColumnIndex;

foreach (string ob in data)
{
if (col >= DataGridView.Columns.Count)
break;
if (ob!=null)
DataGridView[col, rowOfInterest].Value = Convert.ChangeType( ob, DataGridView[col,rowOfInterest].ValueType );
col++;
}
}
catch (Exception enterException)
{
//do something here
}
rowOfInterest++;
}
}

Sunday, September 6, 2009

Microsoft Excel 2003 Shortcut Keys

General Shortcuts

New Workbook....................................................... CTRL N

Open Existing Workbook ....................................... CTRL O

Save Workbook ....................................................... CTRL S

Save Workbook As ..........................................................F12

Print Workbook.......................................................CTRL P

Print Preview ........................................................CTRL F2

Spell Check Workbook ......................................................F7

Excel Help menu ...............................................................F1

What’s This Help Tool .........................................SHIFT F1

Moving Around Shortcuts

Move to next cell down & accept data entry............ENTER

Move to prev cell up & accept data entry ...SHIFT ENTER

Move one cell right & accept data entry.......................TAB

Move one cell left & accept data entry ............ SHIFT TAB

Move one cell up, down, left, or right ....................

Move to edge of current data region..........CTRL

beginning of row ......................................................HOME

Beginning of worksheet.................................CTRL HOME

Last used cell on worksheet ..............................CTRL END

Down one screen.......................................................PG DN

Up one screen ............................................................PG UP

One screen to right ..........................................ALT PG DN

One screen to left ............................................. ALT PG UP

Next sheet in workbook .................................CTRL PG DN

Previous sheet in workbook .......................... CTRL PG UP

Move to next unlocked cell............................................ TAB

Go To ................................................................................F5

Find......................................................................SHIFT F5

Find Next..............................................................SHIFT F4

Data Entry Shortcuts

Start a new line in the same cell..................... ALT ENTER

Enter Array Formula...................... CTRL SHIFT ENTER

Display the Formula Palette .................................CTRL A

Insert Function arguments ....................... CTRL SHIFT A

Insert a hyperlink....................................................CTRL K

Edit the active cell ............................................................F2

Paste Function......................................................SHIFT F3

Calculate all workbooks....................................................F9

Calculate active workbook .......................... CTRL ALT F9

Calculate active worksheet..................................SHIFT F9

Start a formula ....................................................................=

Insert AutoSum formula..............................................ALT =

Enter date .................................................................CTRL ;

Enter time ....................................................CTRL SHIFT :

Cancel Data Entry......................................................... ESC

Fill down ................................................................CTRL D

Fill to the right .......................................................CTRL R

Fill range with current entry ....................... CTRL ENTER

Copy .......................................................................CTRL C

Copy formatting ........................................ CTRL SHIFT C

Copy value from cell above ........................CTRL SHIFT "

Paste Once .............................................................. ENTER

Paste Multiple Times..............................................CTRL V

Paste formatting only ................................ CTRL SHIFT V

Cut..........................................................................CTRL X

Clear cell Contents................................................DELETE

Delete Selection........................................CTRL HYPHEN

Insert Blank Cells .......................................CTRL SHIFT +

Edit a cell comment ..............................................SHIFT F2

Paste Range Names ...........................................................F3

Create Range Names ................................CTRL SHIFT F3

Define Range Name...............................................CTRL F3

Delete selection .......................BACKSPACE or DELETE

Delete text to the end of the line ................CTRL DELETE

Redo ....................................... ALT SHIFT BACKSPACE

Repeat Last Command ......................................................F4

Insert a new worksheet .......................................SHIFT F11

Create a chart using selected range................................F11

Group sheets................... SHIFT CTRL PG DN or PG UP

Undo....................................................................... CTRL Z

Formatting Shortcuts

Style dialog box ...................................ALT ' (apostrophe)

Format Cells dialog box.........................................CTRL 1

General number format ............................CTRL SHIFT ~

Currency Format ......................................CTRL SHIFT $

Percentage Format .................................CTRL SHIFT %

Date Format..............................................CTRL SHIFT #

Time Format ...........................................CTRL SHIFT @

Comma Format......................................... CTRL SHIFT !

Apply the outline border ......................... CTRL SHIFT &

Remove outline borders ............................CTRL SHIFT _

Bold........................................................................CTRL B

Italics ...................................................................... CTRL I

Underlining............................................................CTRL U

Strikethrough ..........................................................CTRL 5

Hide rows................................................................CTRL 9

Unhide rows.............................................. CTRL SHIFT (

Hide columns ...............................................CTRL 0 (zero)

Unhide columns ........................................ CTRL SHIFT )

Toggle displaying values or formulas.....................CTRL `

Display the AutoComplete list ...................................ALT

Selecting Ranges

Select current region ..................................CTRL SHIFT *

Extend selection one cell...........................SHIFT

Extend selection to last used cell ......... CTRL SHIFT END

Select the entire column .......................CTRL SPACEBAR

Select the entire row............................ SHIFT SPACEBAR

Select the entire worksheet......................................CTRL A

Select all objects on sheet ....... CTRL SHIFT SPACEBAR

Select the current array ........................................... CTRL /

Select all cells with comments....................CTRL SHIFT O

Select unmatching values ........................................ CTRL \

Select Direct Successors .......................................... CTRL [

Select all Successors ................................... CTRL SHIFT {

Select Direct Predecessors....................................... CTRL ]

Select all Predecessors ............................... CTRL SHIFT }

Select visible cells in current selection ....................... ALT ;

Friday, September 4, 2009

南昌小吃,太屌!!

1.南昌炒粉
品种:如猪肉炒粉、牛肉炒粉、肥肠炒粉、鸡蛋炒粉、豆芽菜炒粉、三鲜炒粉、黄花菜炒粉……
久负盛名的南昌米粉江西南昌生活论坛# n# C! o) o/ m8 E( o1 B+ d
具有洁白、细嫩、久漂不烂、久炒不碎的特点。南昌米粉历史悠久,主要制作原料是优质晚米。要经过浸米、磨浆、滤干、采浆等多道工序。吃法也方便、简洁,可以凉拌米粉、炒煮米粉,放入姜沫、蒜沫、麻油、酱油、猪油、葱花、咸菜沫,最不可少的是南昌人喜欢的辣椒和胡椒粉。那可真是肉嫩,粉韧、味鲜。所以来南昌不妨尝一下美味可口的南昌米粉,也会让您回味无穷。江西南昌生活论坛6 S$ H7 ]$ }5 l$ t+ p

南昌炒粉.jpg

2.藜蒿炒腊肉
“鄱阳湖的草,南昌人的宝”——说的就是这道菜。藜蒿是鄱阳湖区特有的一种水草,中医认为其味甘、性平、微毒,可清热、利湿、杀虫。藜蒿取其嫩茎与腊肉合炒,加些韭菜才能“衬”出藜蒿的“原香”。上桌时腊肉咸香柔软,藜蒿脆嫩香甜。湘菜中也有这道菜,但是取藜蒿根炒,且陆上藜蒿不够香脆。

藜蒿炒腊肉.jpg

3.白糖糕江西南昌生活论坛# W# Q! C4 Z. p* o" t& ?- u$ Z

Y4 W. e% 以前是街头的早点,现在多为酒店的特色主食。白色的糯米多层叠起,弯转成圈,入油炸至金黄,白糖、米粉混合撒于糕上,糯软香甜,表酥内嫩bbs.tiboo.cn% b; d2 o; u9 t# z& Q7 R: G9 S
原料 糯米粉,澄面粉,白糖,食用油,清水,猪油江西论坛,南昌论坛,南昌社区,南昌生活论坛,江西南昌论坛' b5 W+ P/ {, [
做白糖糕最主要的原料就是糯米粉。和面的比例为500克糯米粉:50克澄面:25克白砂糖:200克开水,为了避免油炸时白糖糕发黏,可以适量加少许猪油。和好面后,将面团搓成30厘米左右的长条,将长条绕三圈且两端相连,一个白糖糕雏形就出来了!白糖糕先用小火炸上两分钟,此时的油温为30—40℃。再用高火炸两分钟,注意不要把它炸老了,起锅后将白糖糕粘糖装盘。掌握好火候的白糖糕显得色泽金黄、松软。

白糖糕.jpg

4.牛舌头
原料
糯米粉、色拉油、红糖
做法
用白色和红色糯米粉相配,再用白、红糖搅芯子与糯米粉相配,中间成白色、红色(即加点红糖揉拌的粉)镶边。粉内要有糖料,制成后用70℃的油煎。
特点bbs.tiboo.cn4 t! k8 d8 s, Y) A' \牛舌头又叫牛招财,味道香甜爽口。

牛舌头.jpg

5.芥菜团子
   原料:芥菜、大米
   做法:

        用洗干净的大米、芥菜加少量水放在一起磨碎,再用白纱布进行过滤,然后蒸至半成熟,取出揉匀,再用模具做出团子的形状,大火蒸20分钟即可。_南昌论坛(江西论坛-吃喝玩乐在江西论坛)_地宝网论坛7 t" P8 b+ U5 |# C
特点江西论坛,南昌论坛,南昌社区,南昌生活论坛,江西南昌论坛$ M; l1 }2 L. z$ ^6 }* T; l
芥菜的维生素含量很丰富,用芥菜做成的团子美味营养。

芥菜团子.jpg

6.木瓜凉粉bbs.tiboo.cn& U* f. I% A3 `  t, W, v$ w
原料
木瓜粉或力之粉
做法
木瓜粉或力之粉和水调匀,煮熟成稀饭状,倒入木盆中冷却。冷却后的固体用竹片切成豆腐块状,再加入薄荷水、糖。
特点bbs.tiboo.cn# L" k; Q  T" L$ p, M: Y( ?( v
深受南昌民间欢迎的夏季防暑食品,俗称“力之豆腐”,吃起来凉爽可口·

木瓜凉粉.jpg

7.南昌瓦罐汤、南昌煨汤

南昌瓦罐汤、南昌煨汤.jpg

8.米粉蒸肉1 V/ ~( O3 g5 ^
南昌人每年立夏前后都喜欢蒸上一碗米粉蒸肉,据说立夏日吃了不会生痱子。人们把大米加八角、桂皮等香料炒熟后研磨成粉,将五花肉切成厚片浸渍上辣椒油、酱油,再加白糖、料酒、味精等调味品,然后倒入米粉拌匀,再将粘满米粉的肉一片片叠在碗内,上笼蒸熟至烂,吃时将肉扣在盘内即可。有的在肉内又拌入适量豌豆,使菜有粉香,又有碗豆清香,荤素鲜腻,别有风味。

米粉蒸肉.jpg

9.“品香斋” 蛋黄麻花江西论坛,南昌论坛,南昌社区,南昌生活论坛,江西南昌论坛- u; O) [1 e' U( h/ q& a3 D' P
提到麻花,很多人都会想到天津十八街麻花,其实南昌石头街麻花也曾赫赫有名。
一百多年前,南昌市石头街有个闻名的“品香斋”麻花店,生产的蛋黄麻花精细小巧,状如双龙盘绕,颜色金黄油亮,味道酥香爽口,人们常常远道而来购买。后来店铺搬到了中山路闹市地段。
如今尽管“品香斋”已经难觅踪迹,不过,蛋黄麻花已经成了最受南昌市民欢迎的小吃之一。记者在东南饼庄苏圃路店找到一位擅长做蛋黄麻花的师傅,他向我们介绍了蛋黄麻花的做法。9 V9 v: g% i; I; |! y# M& m; H+ Y( b
原料
面粉、鸡蛋、色拉油江西南昌论坛(江西论坛),为南昌地宝网创办的南昌最大的生活论坛,为南昌百姓生活提供交流平台。力求做最好的江西论坛!# \4 ^3 Q9 `* K) N! d$ E5 S( w- Z; S
做法江西南昌生活论坛1 g, u+ {; L2 p( e
面粉和鸡蛋的比例设置为1:1,也就是500克鸡蛋搭配500克面粉。先将鸡蛋打匀,之后与面粉一起和,待面粉和鸡蛋充分融合,揉搓均匀后,切成每个长度为30厘米左右的面粉条,并从中间对折拧成麻花状。准备热锅放油,油温应控制在适中,既不能过热也不能过低。用色拉油将切好的面粉条炸4—5分钟,色拉油能使麻花变得松软、浓香无比。蛋黄麻花和普通麻花的区别是特别酥松、爽口,不像普通麻花那么结

“品香斋” 蛋黄麻花.jpg

10.麻辣藕片
在南昌市中山路、胜利路、万寿宫等人流聚集的地方都能见到它的踪迹,其中最知名的要数中山路附近的皇殿侧,这里的麻辣藕片也被南昌人认为最正宗。鲜亮的颜色、油汪汪的色泽,一口咬下去,首先感觉到了莲藕的水灵和生脆,辣椒末带来的刺激由舌尖蔓延到舌根,仔细嚼嚼,最后又能品尝到隐藏在调料下莲藕本身的清甜。南昌街头经常有些MM买上一两块钱后边走边吃,辣得云里雾里却是欲罢不能。江西南昌生活论坛5 \+ N- i0 u6 R5 A8 n
原料
莲藕、酱油、醋、辣椒油、花椒粉、食盐、鸡精、姜末、蒜末、小葱末
做法
把藕洗净,切片,大概8厘米厚。烧开水后,用新鲜的莲藕在水里烫一下,千万不能煮熟,不然藕片将失去爽脆的口感,变得绵软。稍烫后捞出沥水晾干,将酱油、醋、辣椒油(烧油,再淋到辣椒粉上即可)、花椒粉(一点点就够了),食盐、鸡精、姜末、蒜末、小葱末一起拌匀,洒到藕片上,盖上盖子,上下抖动一番,腌制半小时后就入味了。

麻辣藕片.jpg

11.螺蛳龙虾

螺蛳龙虾.jpg

12.鳅鱼钻豆腐:bbs.tiboo.cn  p' `. o* h. n3 o; _: a7 K
江西论坛,南昌论坛,南昌社区,南昌生活论坛,江西南昌论坛, C2 s  Z4 G" O" m7 Z9 U5 P+ n4 x
这是南昌民间长久流传的一道名菜。制作前,先取冷水一盆,将小鳅鱼放入后,打入蛋清,一天后,待鳅鱼内脏物排出,洗净。用砂锅放在微火上加入好汤,把整块老豆腐和活鳅鱼同时下锅,汤热后,鳅鱼往豆腐里面钻。炖30分钟后,加入姜、冬笋、红萝卜等配料,少顷,将砂锅离火上桌。此时只见锅内汤清如镜,豆腐鳅鱼交错,味鲜可口,令人垂涎。

鳅鱼钻豆腐.jpg

13.南昌拌粉 ,凉拌粉
西南昌论坛(江西论坛),为南昌地宝网创办的南昌最大的生活论坛,为南昌百姓生活提供交流平台。力求做最好的江西论坛!& [; x4 d! m/ c' b, a  W6 U% I& l
    拌粉即可以当小吃,也可以当主食。非常便宜,只要一块或一块五一碗。在南昌的各大高校,各个胡同巷口里都有拌粉卖。几乎南昌人或来南昌的都会吃拌粉。拌粉,应该算是一种冷食,它是将米粉先在白开水(不加任何佐料)里面煮熟,然后捞起来用冷水冲净,冷却存放。食用前将米粉放入网勺内在开水里面微烫半分中,然后捞起倒入碗里,分别加入醋,酱油,辣椒油,生葱末,生香菜,熟花生仁等其他佐料,搅拌后即可食用。卖米粉的地方通常会准备各种佐料由你根据自己的喜欢添加,十分方便。

南昌拌粉 ,凉拌粉.jpg

14.水煮

水煮.jpg

    引用 使用道具 报告 评分 回复 TOP

    15.猪血或猪肝汤粉
    南浦路和船山路狮子入口那家江西论坛,南昌论坛,南昌社区,南昌生活论坛,江西南昌论坛! l2 i5 K% @1 n  U4 K4 v1 H6 b/ @
    和绳金塔三医院附近有一堆破房子里的一家
    猪血是比较碎的

    猪血或猪肝汤粉.jpg

      Thursday, September 3, 2009

      Calculate GUID from object or string

      private Guid CalculateGUID(object m)
      {
          ASCIIEncoding enc = new ASCIIEncoding();
          string code = m.GetHashCode( ).ToString();
          string key;
          if (code.Length < 16)
              key = code + new string( '*', 16 - code.Length );
          else if (code.Length == 16)
          {
              key = code;
          }
          else
          {
              key = code.Substring( 0, 16 );
          }

          return new Guid(enc.GetBytes(key)) ;
      }

      Saturday, August 29, 2009

      招聘-北京德明泰科技有限责任公司

      公司办公地点:上地城铁站附近
      职位一:C/C /C#程序员
      1、计算机专业,有工作经验者优先
      2、熟练C/C /C#,熟悉Windows编程,有MFC开发经验者优先
      3、熟练使用微软VS集成开发环境
      4、有数据库编程经验,熟练使用mysql、sqlserver、oracle等数据库中的一种或以上
      5、有较强的自学能力和沟通能力,能刻苦钻研技术,富有团队协作精神
      6、有良好的编码风格和文档编写习惯
      职位二:JAVA程序员
      1、计算机专业,有工作经验者优先
      2、熟练使用java编程,熟练使用JBuilder、Eclipse等开发工具
      3、有数据库编程经验,熟练使用mysql、sqlserver、oracle等数据库中的一种或以上
      4、有较强的自学能力和沟通能力,能刻苦钻研技术,富有团队协作精神
      5、有良好的编码风格和文档编写习惯
      职位三:Web程序员
      1、了解基本的计算机网络知识、熟悉关系型数据库的基本原理,具备数据库编程的基本技
      能。
      2、熟悉各类B/S架构,熟练掌握Asp.net相关语法,熟练使用VS.net等开发工具。
      3、熟悉HTML、CSS、Javascript语法,熟练使用页面开发工具。
      职位四:兼职美工
      1、相关专业,有工作经验者优先
      2、熟练使用photoshop等软件
      3、可兼职,可远程网络交活
      有意者请发送简历至 联系方式登陆后可见,附上自己的简历。我们会尽快与您取得联系。

       

      职位描述:
      1、日常公司文件整理,接听电话;
      2、前往社保、公积金、税务、工商等部门办理相关手续;
      3、完成总经理安排的临时事宜;

      性别要求:女性
      专业要求:不限,贴近计算机的专业最佳
      职位待遇:面议
      招聘人数:1人

       

      北京德明泰科技有限责任公司是一家由清华大学毕业生创办的软件开发企业,现诚觅精英加入我们,拟招聘岗位如下:

      职位名称:全职办公室工作人员

      职位要求:
      1、有清晰的口头表达能力,头脑灵活,有较强的学习能力。
      2、组织能力强,能独立处理事务。
      3、责任心强。

      Monday, August 17, 2009

      c# using reflection to get current class name

      If you are inside the class method, and don’t have access to an instance of the object, use:

      MethodBase.GetCurrentMethod().DeclaringType.FullName;

      If you hava access to an instance of the object, then:

      public static class SomeClass
      {
      public static string FullName
        {
          get { return typeof(SomeClass).FullName; }
        }
      }

      Thursday, August 13, 2009

      Software Outsourcing Company – Domintec.com 北京德明泰科技有限责任公司

      简介

      关于德明泰

      北京德明泰科技有限公司成立于2008年,主营业务是面向企业用户提供软件开发和IT相关服务。主要领域涉及企业日常运营管理系统,行业应用软件以及产品配套支持软件。

      我们的团队

      公司核心人员全部毕业于清华大学计算机系,依托清华大学雄厚的科研实力,公司在技术研发方面具有先天优势,善于科研攻关。此外公司还拥有一支十余人具有丰富经验的高水平的研发团队。

      公司创设人员曾就职于国家开发银行、汇丰银行、中国电子科技集团公司、中国科学院计算技术研究所、微软中国研发集团以及澳大利亚国家信息通信技术研究院等国内外著名公司,也曾在多项国家自然基金及863项目中担任核心开发工作,涉及多项技术专利。

      我们的核心竞争力

      德明泰成立伊始,即致力于为行业客户提供专业的、高水平的软件产品研发及服务。公司严格按照CMM-2标准执行项目,注重管理体系和文档体系的构建,采用国际领先的IT项目开发流程,快速准确的把握客户需求,为客户量身打造软件服务。

      公司具有IT、政府、金融、机械仪表等行业的大量成功项目经验,多背景多平台的经验使我们能够以最快的速度为用户解决棘手问题。

      项目方向

      公司为各行业客户研发通用的企业管理、销售、财务、会议管理等综合系统。为企业信息管理提供完整的解决方案,让企业用户的信息管理更具有灵活性,基于更高的成本效率来提高生产力,为企业用户提供一个安全、可靠、高效的管理与交互平台。

      项目实例:

      1)公司目前正在与中国科协技术协会合作开发通用会议平台系统,该系统可以为科协数百个专业协会提供统一架构的会议发布平台。项目在JSP + Oracle平台上构建。

      2)公司与北京古大仪表公司合作,为古大公司开发针对公司行业特点的销售管理系统,为提高公司销售效率,管理销售资源提供了软件保障。项目在ASP.NET + SQL Server平台上搭建。

      公司在仪表配套软件开发方面具有丰富的项目经验。为仪表行业重点客户开发了多套针对物位仪、雷达流量计等专业仪表的控制平台,程序工作稳定,性能优越,为客户占领市场做好了后勤保障。

      项目实例:

      1) 雷达流量计软件分析与开发。为古大仪表公司开发操作雷达流量计的软件,算法部分参考了国外先进雷达仪表的汇编代码。该系统基于MFC架构构建。

      2) 脉冲雷达、导波雷达、二线超声以及分体雷达仪表PC端上位机软件系统开发。该系统基于MFC架构构建。该上位机软件可以提供在计算机客户端读取雷达仪表数值以及操作写入控制命令等操作,软件支持网络远程操作。雷达仪表系列产品及软件均对稳定性有非常高的要求,因为产品经常会安装在无人值守的厂房中。所以用户对于软件的健壮性有非常高的要求。

      公司为国内外多家企业用户提供软件外包服务。项目涉及项目管理平台、计算机视觉算法、视频编码等多个领域。

      项目实例:

      公司与澳大利亚Wollemi公司合作,为其开发了应用于JAVA + MySQL平台的企业员工时间管理系统。软件使用Hibernate框架管理数据库对象,基于JAX-WS规范开发软件服务器端与客户端的连接。

      合作模式

      德明泰公司可充分发挥研发实力强、开发流程专业、行业经验广泛的优势。与国内外企业合作,为客户开发专门的软件模块以及为各类硬件产品开发配套的控制与应用软件。

      德明泰公司可凭借其在企业管理软件、会议系统等方面的经验,为客户开发整套解决方案。内容可涉及企业管理、电子商务及行业专用软件。ITO(Information Technology Outsourcing),即信息技术外包,是指服务外包发包商委托服务外包提供商向企业提供部分或全部信息技术服务功能,主要包括信息技术的系统、应用管理及技术支持的服务。

      业务流程外包(Business Process Outsourcing)就是企业将一些重复性的非核心或核心业务流程外包给供应商,以降低成本,同时提高服务质量。由于进行BPO的流程是重复性的,并采用了长期合同的形式,因此BPO远远超出了咨询的范围。如果BPO做得成功的话,它能够增加公司的价值。BPO与传统的IT外包(ITO)之间的区别在于,BPO能够帮助公司更快地完成外包。

      团队核心成员

      CEO - 中国电子科技大学通信系统硕士研究生毕业,高级工程师,曾就职于中国电子工业部第54研究所遥控遥测专业部,长期从事航空航天遥控遥测系统研发,从事的科研工作曾先后获得国家科技进步三等奖和电子工业部科技进步二等奖。曾与西门子公司通信集团工作十余年,历任北方区商务总监及联通事业部北方区总经理等职,有丰富的科研管理、项目管理等经验。

      高嵩 - 清华大学计算机系智能技术与系统国家实验室自然语言方向硕士研究生毕业,对搜索引擎的主流技术有深入研究,尤其擅长汉语句法、词法分析算法。拥有多项发明专利。

      朱冰 - 清华大学计算机系网络技术研究所硕士研究生毕业,曾就职于中国国家开发银行科技部,对银行系统及业务知识有丰富的了解。擅长计算机底层开发、汇编语言程序开发及单片机技术。

      曾参与、负责项目:

      1) 国家开发银行银行信贷管理系统。设计并推动包括中小企业贷款、助学贷款等业务的管理系统。采用J2EE跨平台架构,集中管理银行各类信贷业务。

      2) 北京市公安局网络设备管理系统。参与多个模块的设计与开发。

      3) 中国移动数据业务系统可用性模型研究与评估软件开发。以排队论等作为理论基础,采用独特算法,评估移动的数据业务系统的可用性并找出其性能瓶颈。

      姚亮 – 清华大学计算机系毕业,曾就职于中国电子科技集团公司信息化工程总体研究中心与汇丰银行,具有丰富的IT项目开发与管理经验。在中电集团任职期间参与多项国家军队重点工程的开发工作,积累了丰富的经验。在汇丰银行任职期间主要负责业务部门的IT项目管理工作,积累了丰富的项目管理经验。擅长成本分析,项目管理与时间管理。

      曾参与、负责项目:

      1) 第二炮兵部队某信息系统(绝密级,现装备于作战部队) - IT开发、测试,在项目中担任主要开发人员。项目持续一年,主要工作内容为MFC架构编程与Oracle代码升级。

      2) 水利部南水北调办公室峰谷电价泵站智能调度研究系统 – 担任主要IT开发人员,项目持续半年,主要工作内容为在Java RCP平台下开发应用程序,将水利工程的调度思想与算法在计算机程序中进行展现。

      3) 汇丰银行CRMS客户关系管理系统 – 负责用户需求分析、项目协调及用户培训工作。项目持续两年,主要工作内容为将汇丰银行香港区的成熟系统引入大陆区,在此过程中作为业务部门的代表,负责整理业务部门对系统的需求,协调与香港IT部门之间的开发进度,为业务人员提供针对新系统的培训。

      4) 汇丰银行BIR2(亚太区统一数据平台)大陆区子系统 – 负责业务部门项目管理。项目持续一年半。汇丰银行在亚太区新建了统一的数据分析及报表平台。在此过程中本人主要负责提供个人金融部的系统需求及管理项目进度。该项目在中国区投资为70万美元,参与部门涉及大陆区业务、财务、IT以及香港亚太区总部的相关部门。

      幕后黑手1 – 清华大学计算机系软件研究所硕士研究生毕业,曾就职于美国JEDA公司,擅长EDA相关设计开发以及Linux下应用程序开发。

      曾参与、负责项目:

      1) EDA系统级自动验证语言——基于System C的自动验证语言,自定义编译器,基于断言,显著提高模块验证效率,基于Linux平台,负责后台功能开发

      2) 系统级覆盖自动验证工具——包括数据覆盖,代码覆盖,比gcc提供的gcov功能更 强大,基于Linux平台,负责后台功能开发。

      3) TLM2.0验证工具:Linux平台下检验模块是否符合TLM2.0标准的自动验证工具,负责架构设计及核心代码开发。

      幕后黑手2 – 清华大学计算机系本科毕业,澳大利亚国立大学硕士研究生毕业。曾带队多家国内创业IT企业,曾就职于澳大利亚国家信息与通讯技术中心,现为澳洲科学与工业研究院软件咨询师。具有丰富的IT开发构架经验,国外领先的IT项目管理经验。擅长领域有MS .NET桌面平台软件开发及架构设计、Web 2.0网站构架、Unix系统下的开发集成。

      曾参与、负责项目:

      1) 澳洲国家水利水资源建模软件。加入团队后在.Net 3.5 平台下对超过80个子项目、1G源代码从事重构,优化调优工作;对分布开发的软件模块进行集成。

      2) 运动员训练自动化系统。构架系统使用独特的机器学习算法分析数据,通过数据库集中管理,客户端实现数据可视化。.Net 2.0 平台下企业级桌面软件的典型代表。

      3) Feedsky技术总监。负责核心后台RSS技术的构架开发、国内RSS第一人。负责指导公司网站前台的开发,主管与博客服务商之间的技术合作。

      4) Heiyou SNS社交论坛。

      5) 指导团队研发开源项目:TimeKeeper软件。该软件是公司办公自动化软件系列的雏形项目,旨在国内IT业界提倡开源,支持反盗版。软件基于 免费的开发环境(SMEServer + MySQL + Apache Tomcat + J2ME),使用三层结构构架,具有良好的拓展性。

      6) 引进国外先进的软件开发管理模式,为公司提供了包括远程办公、版本管理、文档管理、协同合作、事件追踪处理、报告效率考勤等各方面的框架和规范。为培养专业开发团队提供技术支持,定期开展技术培训。

      幕后黑手3 – 清华大学计算机系本科毕业,中国科学院计算技术研究所硕士毕业。曾就职于那里网络科技有限公司,期间担任核心程序员,负责网站整体的架构优化及核心代码实现;微软中国研发集团,期间担任软件测试工程师,参与搜索引擎开发及测试。精通C#,Java等流行编程语言,以及多种测试框架系统,擅长系统架构,具有丰富的大型项目管理经验。

      曾参与、负责项目:

      1) 那里(Naalee)网络平台,论坛。项目使用Java企业平台,JSP用于客户端显示,struts作为后台MCV基本框架,Spring为类仓库,ibatis为数据库接口。该平台可支撑上万人的日流量,实现了高稳定性及可扩展性。

      2) 微软搜索引擎后台可视化网页模块。该模块基于C++语言编写,达到了高效地对网页进行可视化特性分析,支持多项CSS规则,对最终的网页大小,各元素,页面主要内容正确识别率达95%。

      3) 微软搜索引擎相关度实验平台。该平台使用C#语言,基于C/S结构,使用http协议进行传输。实现了实验提交,分配,调度,结果收集,分发共享等多项功能,极大提高了实验效率。

      联系我们

      地址:北京市海淀区上地佳园2号楼1-401

      电话:010-62965885

      联系人: 姚亮

      手机:15210458108

      电子邮箱:yaoliang@domintec.com

      Wednesday, August 12, 2009

      Software Release Procedure Using Subversion

      如果你用Subversion作为版本管理软件,那么,软件发布的时候,你可以参考下列流程:

      1. branch一个,叫B_RE_0802。(本地的trunk copy可以切换为branch copy,或者本地的人直接下载一个)
      2. 在本地branch copy上修改release所需要改的东西(版本号,添加最新Manual,制作installer)。
      3. 从本地branch上build一个release出来。然后对此Branch进行Tag到服务器,此Tag为T_RE_0802。
      4. 从本地Branch Merge回Trunk copy,然后commit trunk copy。
      5. 有bug在branch上修改,然后merge回truck. 对0802Tag不要动,发B_RE_0802_f1 版本。

      最后借用Dechu的一段,讲讲Release之前的开发流程,要到Release阶段真不容易,哈哈哈。(微软真屌)

      1) pm work on spec, then all team members review, sign off
      2) dev work on design, then all team members review, dev start working
      3) test work on plan, then all team members revew, test start working
      4) CC - code complete by dev
      5) TCC - test case complete by test
      6) RTW - bugs fixed, test case passed, release to world

      Say No to NHibernate

      最近在做一个ERP项目下,团队在讨论是否使用NHibernate来做持久层。 NHibernate是Hibernate的一个.Net实现,更新远不如Hiberante本身不说,而且最近的一些其他项目中,NHiberante带来的负载成为了项目瓶颈,所以我决定抛弃,并给大家列出下列一些不用NHibernate的理由以供参考:

      1. 我们不会更改数据库,预见不到抛弃SQLServer的理由
      2. 使用Microsoft配套的LinQ2SQL,比开源的项目稳定。
      3. 在没有深入了解Hibernate的运行机制,贸然使用,效率会很低,不如传统的数据库连接池来的高效。
      4. 同3,没有足够经验的程序员写NHibernate代码,开发的速度很慢。

      Saturday, July 18, 2009

      c# Override GetHashCode when using dictionary in .Net

      In .Net, Dictionary is implemented as HashTable. As you might know, Hashtable rely on hash algorithm to perform. Last week, I was involved in a performance enhancement task. One of the key performance bottleneck was due to an unimplemented hash algorithm. The task was trying to insert object in dictionary and trying to retrieve it when necessary.
      Originally since the object is quite uncertain, and even some of the objects had override the GetHashCode method, it only returns 0, which then every object will get the same hash code. When ContainsKey called, the result is the dictionary get iterated, the algorithm checks so many Equals method. It is quite hard for us to write a genric hash algorithm for object, so I simply change the algorithm to return the hash code of GetType. Further detection of whether an object had override its GetHashCode method is added using reflection. (When an object property changs, ContainsKey method doesn't return the desired value for some object unless GetHashCode was overriden)

      Looking back at the solution, simple, override both method. Sometimes, it really comes down to understand what MSDN says.

      GetHashCode returns a value based on the current instance that is suited for hashing algorithms and data structures such as a hash table. Two objects that are the same type and are equal must return the same hash code to ensure that instances of HashTable and Dictionary</TKEY,> work correctly. To fix a violation of this rule, provide an implementation of GetHashCode. For a pair of objects of the same type, you must ensure that the implementation returns the same value if your implementation of Equals returns true for the pair.

      Here is some sample code.

                  public int GetHashCode( object obj )
      {
      MethodInfo mi = obj.GetType( ).GetMethod( "GetHashCode" );
      if( ((mi.Attributes & MethodAttributes.NewSlot) == MethodAttributes.NewSlot) )
      {
      ordinaryObjectMapping.Add( obj, true );
      return obj.GetHashCode( );
      }
      else
      {
      ordinaryObjectMapping.Add( obj, false );
      return obj.GetType( ).GetHashCode( );
      }
      }

      Friday, June 26, 2009

      C# Double Decimal Place using String Format

      String Format for Double [C#]

      The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString.

      Digits after decimal point

      This example formats double to string with fixed number of decimal places. For two decimal places use pattern „0.00“. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.

      [C#]

      // just two decimal places
      String.Format("{0:0.00}", 123.4567); // "123.46"
      String.Format("{0:0.00}", 123.4); // "123.40"
      String.Format("{0:0.00}", 123.0); // "123.00"


      Next example formats double to string with floating number of decimal places. E.g. for maximal two decimal places use pattern „0.##“.



      [C#]



      // max. two decimal places
      String.Format("{0:0.##}", 123.4567); // "123.46"
      String.Format("{0:0.##}", 123.4); // "123.4"
      String.Format("{0:0.##}", 123.0); // "123"


      Digits before decimal point



      If you want a float number to have any minimal number of digits before decimal point use N-times zero before decimal point. E.g. pattern „00.0“ formats a float number to string with at least two digits before decimal point and one digit after that.



      [C#]



      // at least two digits before decimal point
      String.Format("{0:00.0}", 123.4567); // "123.5"
      String.Format("{0:00.0}", 23.4567); // "23.5"
      String.Format("{0:00.0}", 3.4567); // "03.5"
      String.Format("{0:00.0}", -3.4567); // "-03.5"


      Thousands separator



      To format double to string with use of thousands separator use zero and comma separator before an usual float formatting pattern, e.g. pattern „0,0.0“ formats the number to use thousands separators and to have one decimal place.



      [C#]



      String.Format("{0:0,0.0}", 12345.67);     // "12,345.7"
      String.Format("{0:0,0}", 12345.67); // "12,346"


      Zero



      Float numbers between zero and one can be formatted in two ways, with or without leading zero before decimal point. To format number without a leading zero use # before point. For example „#.0“ formats number to have one decimal place and zero to N digits before decimal point (e.g. „.5“ or „123.5“).



      Following code shows how can be formatted a zero (of double type).



      [C#]



      String.Format("{0:0.0}", 0.0);            // "0.0"
      String.Format("{0:0.#}", 0.0); // "0"
      String.Format("{0:#.0}", 0.0); // ".0"
      String.Format("{0:#.#}", 0.0); // ""


      Align numbers with spaces



      To align float number to the right use comma „,“ option before the colon. Type comma followed by a number of spaces, e.g. „0,10:0.0“ (this can be used only in String.Format method, not in double.ToString method). To align numbers to the left use negative number of spaces.



      [C#]



      String.Format("{0,10:0.0}", 123.4567);    // "     123.5"
      String.Format("{0,-10:0.0}", 123.4567); // "123.5 "
      String.Format("{0,10:0.0}", -123.4567); // " -123.5"
      String.Format("{0,-10:0.0}", -123.4567); // "-123.5 "


      Custom formatting for negative numbers and zero



      If you need to use custom format for negative float numbers or zero, use semicolon separator;“ to split pattern to three sections. The first section formats positive numbers, the second section formats negative numbers and the third section formats zero. If you omit the last section, zero will be formatted using the first section.



      [C#]



      String.Format("{0:0.00;minus 0.00;zero}", 123.4567);   // "123.46"
      String.Format("{0:0.00;minus 0.00;zero}", -123.4567); // "minus 123.46"
      String.Format("{0:0.00;minus 0.00;zero}", 0.0); // "zero"


      Some funny examples



      As you could notice in the previous example, you can put any text into formatting pattern, e.g. before an usual pattern „my text 0.0“. You can even put any text between the zeroes, e.g. „0aaa.bbb0“.



      [C#]



      String.Format("{0:my number is 0.0}", 12.3);   // "my number is 12.3"
      String.Format("{0:0aaa.bbb0}", 12.3); // "12aaa.bbb3"

      Wednesday, June 24, 2009

      Wireless cellular network, packet scheduling, multi-user diversity effect, opportunity scheduling

      It has been several decades since the existence of wireless cellular network, which has brought tremendous conveniences to the world society with the developments on top. At present, the traditional telecommunications market is gradually merging its business with data together. As a result, the next-generation wireless cellular networks are heading towards the direction of all-IP packet networks. In addition, the proportion that data division business holds within all business of cellular network will become more importantly, which then makes the packet scheduling mechanisms become more important. With an increasing demand for the end-to-end quality of service, and the contradictions of significant increase in data traffic with the limited resources of the wireless resources, such as video, file transfer, and other data services, all of which are challenging the scheduling mechanisms in the network environment. Furthermore, how to improve the wireless cellular network system throughput to meet the requirements of the user's Quality of Service (QoS), how to provide a fair service to all users, have become the major issues which need to be addressed in the packet scheduling mechanisms for wireless cellular network.

      The packet scheduling mechanism for the wireless cellular network is based on cross-layer design concept, which will consider all layers to make scheduling decisions. For example, the physical layer, will have a multi-user diversity effect due to varying characteristics(无线衰落信道具有时变特性). Using (exploit) multi-user diversity effect (多用户分集效应) can effectively enhance the data throughput of the wireless cellular system. Scheduling such as the opportunity scheduling, is commonly used in the packet scheduling mechanism for the wireless cellular networks. This thesis mainly focus on the theoretical model of opportunity scheduling and its specific algorithms.

      With Regards to the theoretical model of opportunity scheduling, the author has classified and summarized the various existing theoretical models, including the division-level model and flow-level models. In terms of opportunity scheduling performance indicators and the typical opportunity scheduling algorithm in the division-level model and flow-level model of performance evaluation, experiment has also been conducted to analyse the existing methods and results. Finally, the author gives an predicting analysis of the theoretical tools that can be used in future in this area.

      Regarding the specific algorithms used in opportunity scheduling, existing algorithms were summarized and compared, including the scheduling algorithm which uses OFDM technology in the wireless cellular network. The author discovered that the traditional method usually pay more attention to improve system throughput, however fails to provide a fair and user-satisfactory QoS. A new algorithm, without the sacrificing of system throughput ,was presented, to ensure the relatively fairness between all users and each user's QoS demand are met.

      Sunday, June 21, 2009

      C# open folder dialog (FolderBrowserDialog)

      In .Net GUI Applications, Interaction with User on selecting files is a very basic topic. In the following code samples, I have demonstrate how to select files ( in comment code), more importantly, give an example code on how to get a folder name form the windows open dialog box. Something Interesting here is that you actually can’t get the folder name easily. (I mean select a folder, you can still select the file then get the full path, which include the folder name) The best option is to use FolderBrowserDialog !

      Ok, now here is the sample code. Enjoy.

              private void importToolStripMenuItem_Click(object sender, EventArgs e)
      {
      try
      {
      string startupPath = Application.StartupPath;
      using (FolderBrowserDialog dialog = new FolderBrowserDialog())
      {
      dialog.Description = "Open a folder which contains the xml output";
      dialog.ShowNewFolderButton = false;
      dialog.RootFolder = Environment.SpecialFolder.MyComputer;
      if(dialog.ShowDialog() == DialogResult.OK)
      {
      string folder = dialog.SelectedPath;
      foreach (string fileName in Directory.GetFiles(folder, "*.xml", SearchOption.TopDirectoryOnly))
      {
      SQLGenerator.GenerateSQLTransactions(Path.GetFullPath(fileName));
      }
      }
      }
      //using (OpenFileDialog dialog = new OpenFileDialog())
      //{
      // dialog.Filter = "xml files (*.xml)|*.xml";
      // dialog.Multiselect = false;
      // dialog.InitialDirectory = ".";
      // dialog.Title = "Select file (only in XML format)";
      // if (dialog.ShowDialog() == DialogResult.OK)
      // {
      // SQLGenerator.GenerateSQLTransactions(Application.StartupPath + Settings.Default.xmlFile);
      // }
      //}
      }
      catch (Exception exc)
      {
      MessageBox.Show("Import failed because " + exc.Message + " , please try again later.");
      }

      }

      Friday, June 19, 2009

      For Daniel and Victorial

      Two friends of mine will soon be moving to UK.  As a reader of getting down under forum, I would like them to read this post:

      ---------------------------------------

      As the British economy hits rock bottom, thousands of skilled workers are looking abroad to start up a brighter, more stable life in a different economy.

      Traditionally, Australia and New Zealand have been a favourite destination for British skilled migrants, but it seems now their economies are also feeling the rippling effects of the American and British recessions.

      There has been much debate as to whether Senator Chris Evans (Minister for Immigration and Citizenship) would lower the record rates of immigration to Australia in the 2009-10 Budget in response to his country’s prospective financial troubles.

      Evans has decided to keep this year’s record 133,000 skilled visas as a ceiling until the Government assesses the country’s economic situation in time for the mid-year Budget.

      This means that Australia still has plenty of places for skilled workers to move to Australia, and you could be joining the thirty-odd thousand other Britons moving to Australia permanently every year through the Australian migration program.

      Now we all know Australia has a better climate, nicer beaches, and the promise of a more comfortable, outdoor lifestyle than the UK, but, in this economic climate would skilled workers actually be better off by moving from the UK to Australia?

      How much money can you earn in Australia compared to the UK

      The following is a comparative table showing the median salaries for selected jobs in Australia and the UK, sourced from payscale.com (updated February 2009).  The results are based on the person having 10-19 years experience in that job, and the Australian salaries have been converted using the curencyconverter.com tool. 

      The following is a comparative table showing the median salaries for selected jobs in Australia and the UK, sourced from payscale.com (updated February 2009).  The results are based on the person having 10-19 years experience in that job, and the Australian salaries have been converted using the curencyconverter.com tool.

      A quick look at the table suggests the trend for higher salaries in Australia for skilled positions is evident, excluding the rather major difference for solicitors.

      Cost of living in Australia versus the cost of living in the uk

      A higher salary doesn’t mean much if you are paying higher prices for the everyday basics.  The following table shows the cost of basics as supplied by the Office of National Statistics (ONS) and the Australian Bureau of Statistics (ABS) for December 2008.

      Cost of living in Australia versus the cost of living in the uk. A higher salary doesn't mean much if you are paying higher prices for the everyday basics.  The following table shows the cost of basics as supplied by the Office of National Statistics (ONS) and the Australian Bureau of Statistics (ABS) for December 2008

      The table shows Australia is not the winner in every case, and in fact, the UK is the cheapest place in the world to buy bread.  Yet, although the overall picture gives the impression that the cost of living in Australia and the UK is vacillating, a closer look shows that the expensive staple items are considerably cheaper in Australia than in the UK, which would keep your wallet plumper for longer.

      For example, a family of four that consumes 2kgs of beef a week could save up to £303 after migrating to Australia from the UK, and a person filling up a car with 30L of petrol every week could save up to £280 per year.  These are substantial savings.

      Whereas milk, bread and flour may be cheaper to buy in the UK, the items that you need to outlay more cash on a weekly basis (such as meat and petrol) are cheaper in Australia.

      The Economist’s Big Mac index makes things loud and clear to understand.  The famous index compares the cost of a Big Mac in hundreds of countries as a way of comparing the cost of living around the world.  During February 2009, the index showed that a Big Mac was cheaper to buy in Australia than in the UK.

      A cheaper cost of living coupled with a higher chance of getting a better salary in Australia means that you would have more spending power and an increased cash flow.

      Australia property prices compared to the UK

      In most countries, an increased cash flow means a higher standard of living and the opportunity of living in a nicer home.

      Property prices across Australia have a huge variance, particularly because there is a massive difference between rural, coastal and city houses.  The same can be said for the UK, where just in the city of London, house prices can be almost triple the cost of similar types of houses elsewhere in the UK. 

      As a result, it becomes difficult to compare accurately house prices from specific regions in Australia with regions in the UK.  Yet the Reserve Bank of Australia has released a report that shows the trend in housing prices and affordability, called “Some Observations on the Cost of Housing in Australia”, written by the Head of Economic Analysis Department Anthony Richards.

      The following table is extracted from this report, which shows that Australia has been better off internationally than its major competitors in terms of income and relative house prices, despite there being a low level of housing accessibility and persistently high level of average housing prices.

      Australia property prices compared to the UK, Canada and the United States (US). The Real Estate Institute of Australia (REIA) confirmed in December 2008 that the Australian average median house price reached $447,659 (£203,660) in the September quarter - a decrease of $459,795 from the June quarter - with only Sydney having a median house price above $450,000

      The Real Estate Institute of Australia (REIA) confirmed in December 2008 that the Australian average median house price reached $447,659 (£203,660) in the September quarter – a decrease of $459,795 from the June quarter – with only Sydney having a median house price above $450,000.  In the Department for Communities and Local Government live tables, the average median house price in the September quarter for 2008 was sitting at £233,459.

      This difference in average house prices and the trend to have better income ratios in Australia and the UK means you would have a great chance of a better lifestyle in Australia, living in a nicer home with an increased cash flow.

      The Australian weather compared to the UK

      It will come as no surprise that Australia gets far more sun than the UK.  In fact, Australia gets around 300 days of sunshine annually, which is 70% of the year.  Moreover, when the rains come rolling in from the ocean or across the desert plains, it is not something the locals complain about; the tropical storms can give hours of entertainment and can be a quick relief for stifling heat.

      See below for a breakdown of how averages of temperature (degrees) compare in UK and Australian cities:

      The Australian weather compared to the UK - breakdown of how averages of temperature (degrees) compare in UK and Australian cities

      How many public holidays do you get in Australia compared to the UK?

      In Australia, be prepared to put your feet up for longer.  In the UK, along with the standard annual leave provided by employers, the Government provides workers eight annual public holidays.  In Australia, most workplaces give the same leave entitlements as UK companies, but the Australian Government has been slightly more generous.  Each state or territory has a different amount of public holidays, but all have at least 10 days off or more.  For example, in Tasmania you’ll be given 21 days off every year, plus your 4 weeks annual leave. 

      The following shows the amount of public annual holidays in the UK and each Australian state or territory:

      How many public holidays do you get in Australia compared to the UK?

      Sound appetising?  It’s advised that you beat the Budget and submit your application before the Australian Government considers restricting its migration program, and before you know it you’ll be enjoying a beer on the beach and soaking up the Australian sun!

      Friday, June 12, 2009

      夫妻相的多种解释

      说起夫妻相,估计谁都说得头头是道,但如果告诉你这个词背后还蕴藏了人体基因设置的重重机关,以前大脑活动和视觉悟之间的相互作用,估计没有几个人能说出其中的原委。
      当你初见一对夫妻,最先闪入脑子里的是什么?相信大多数人都会琢磨一下这两个人有没有“夫妻相”。现如今,在不少人的心目中,有没有“夫妻相”意义重,甚至成了有没有“夫妻缘”的重要指标,更有甚者双双跑去整容,为的就是整个夫妻相来。
      虽然整容的形为有点极端,但是,却真实地反映出“夫妻相”这个古老词语在现代人心中鲜活的生命力。别说普通人,就连古今中外的人人也逃不出这个“潜规则”,他们为世人所熟悉的面孔,早以演绎出诸多关于夫妻相的谈资。
      先看看孙中山和宋庆龄吧,孙中山是典型的国字脸,颧骨以下的肉比较突出,看上去很有魅力,目光深沉却明亮如炬。宋庆龄则是丰满的鹅蛋脸,鼻子很高,目光坚定,从两人的合影来看,五官比例、形状、神态、配合的天衣无缝。
      “夫妻相”是不分种族和国界的,最有名的典型,要数甲壳虫乐队歌手约翰-列侬和日本艺术家大野洋子,尽管他们一个是西方人,一个是东方人,本来想长出“夫妻相”来就是天方夜潭。可是现实中,他们不但十分相像,还十分恩爱。那两张脸,任何人都无法否定他们是多么的相似。充满灵感的眼晴,高高的鼻梁,坚定锐利的下巴……无怪乎他们的结合以后,总是在艺术界爆出惊人之举。
      有人认为,仅仅“是貌似”其实还不能够达标,光绪和珍妃就是一对苦命的“貌合神离”的夫妻,光绪长得是丰满的国字脸,办女相,而珍妃则长了一个方圆大脸,发人男相,二人神态光绪被囚,珍妃惨死的悲惨命运。夫妻的命运是否真的跟他们的长相有关,还仅仅是后人的演绎罢了?也就是说,人类在选择配偶时,究竟有没有“夫妻相”这个原因,夫妻相似到底有巧合还是确有科学依据?一些科学研究或许能给我们更加理性的推断俗话说:“不是一家人不进一家门。”夫妻相是怎么回事呢?
      其实夫妻相的大抵意思是因为常常接触,心灵相倾,习惯趋同,相互影响,以致到了面容相像。下面为大家进一步进行科学分析:

       

      说法一:视角倾斜和视力误差的结果!

      所谓“夫妻相”,只是人们视角的倾斜和视力的误差。正如外国人看到中国人都长的一样,我们看一群麻雀没有分别一样,对于一对夫妻,我们首先在心里就已经给他们下了定义,自然就着力去发现他们面貌上相像的地方,而很少去注意它们的不同。其实,人类男女间无论是谁,相貌的一个个“零件”上都是有一定的一致性的,特别是同种族、同一种肤色、同一地域间的人,更是在身材、面相上有更多的相似处。就不是夫妻,相貌某一点上相当者也不会少,何况大部分夫妻,生活在同一环境条件下,这种相似会更多一点。把这种种相似粘贴在一起,加上我们先入为主的心理认知,认为夫妻夫妻,应该相像,这本不足为奇。实际上,在不知情的情况下,误认一双男女为夫妻的也很多。事实上,“夫妻相”并不能说明什么,而夫妻间包括相貌在内的各种差异才是绝对的。

      说法二:夫妻相不一定是最好的夫妻
      有“夫妻相”的男女不一定就能是夫妻。找对像时人们大多要考虑相貌,但绝少有以自己的模样为标准找面相相似的另一半的。相貌上男的英俊,女的妩媚;男的有棱有角,女的楚楚动人,等等,这才是男女追求的目标。真的面貌相像的两口子则很少即便相像,这样的两口子也并不一定就是最好的夫妻。看那些“夕阳红”幸福晚霞中的老夫妻们,面貌相似的见不到几个。看不出“夫妻相”能在一个美满婚姻家庭生活中起到什么作用。即便是天赶地凑出一对“夫妻相”的夫妻,就一定能是幸福美满的夫妻么?生活中的夫妻不是图画上的夫妻,最实际的夫妻幸福应该是性格的相容,心灵的相慰,生活的相互关心,困难面前的相互支撑,富有面前的相互珍惜和提醒。没有这些内涵的夫妻,再相像又能怎么样呢?或许也有这样的相像而又美满的夫妻,但这样的例子毕竟太少了。 真实的社会生活中,在外人看来门当户对、郎才女貌的夫妻同床异梦并不少见;生活几十年,风过了雨过了一朝把手分的夫妻也不让人奇怪。一些夫妻高矮胖瘦俏平不一,但生活里却各有自己的幸福,各有各的快乐,平平安安地度过了一生;有的夫妻打打闹闹大半辈子,到老了儿孙满堂,相携相拥,满面幸福。这些情形,就不是相貌异同所能解释得了的。

      说法三:夫妻相貌不同很普遍

      夫妻间相貌的不同是普遍的。或许这种不同才是我们人类自身健康繁衍所真正需要的。在取长补短中,在基因匹配中,在凸凹相交中,在你来我往中,在心心相印里,在相对的貌相的丑与美的交融中,夫妻生活的质量才能得到提高,后代的体貌才得以优化。如果失去自然选择,人们以貌相配,那就不知道人类还能延续几日了。生活中的夫妻面貌相异,性格大多也有急有缓,生活中有磕磕碰碰的语言行为也是极正常的。有人面善而心硬,有的貌美而行不一定端。面貌固然可以在一定程度上反映人的特点,但以貌取人往往也是不牢靠、不准确的。“夫妻相”也是如此。趋同,趋像的本不足信,如果再以此为凭说明夫妻是否恩爱,家庭是否和睦,也就更站不住脚了。

      说法四:两情相悦才重要

      相像固然可爱,不同才显风流。容貌只是表象,内容才见端详。面容相像是别人评说的,两心相悦才是切身体会的。不管是否有“夫妻相”,但我确信,夫妻间你中有我,我中有你,相濡以沫,幸福美满是存在的。夫妻气味相投,两情相悦,一定会在生活方式上融合,行为举止上趋同,语言习惯上相似。如果说这就是“夫妻”的话,这是不容置疑的。至于“夫妻本是同林鸟,大难到来各自飞”的,即使长得似双胞胎一般,也是没有用处的。因为生活在一起就可以影响到对方相貌改变,形成相貌相近的“夫妻相”的说法,至今还得不到令人信服的理论和事实依据的支持。

      说法五:夫妻相有类型.

      1.和谐型夫妻相,有着和谐型面相的男女很容易被对方吸引。这个面相的关键是比例,有和谐面相的两个人脸上的三组数据大致相同,即额头的高度,人中的长度,下颌的长度。只拥有这个面相的人可能并不像,除非他们同时拥有回应型面相

      2.回应型夫妻相

      拥有回应型面相的人看起来很像对方,也就是人们常说的夫妻相,因为他们五官、脸型以及上眼睑线、上唇线和眉毛三部分的形状很相似。有着回应型面相的双方常常是同一类人,他们心灵相通,互为知己.

      3.亲缘型夫妻相

      一位拥有亲缘型面相的人,会让对方感到像亲人,这个人可能是他的姐妹、母亲或者奶奶。如果男方认为女方像亲人,他们会互相信任,有很深的依恋感

      4.集成型夫妻相
      以上三种面相的集合。
      5 自我定义型夫妻相

      也许你们不属于上述的任何一种夫妻相,究竟属于哪一种,只有你们商量着,自我定义了

      很多时候相处的时间越长的夫妻,人们对他们的评价也就越相似,许多结婚前并无特别相似之处的夫妻,经过10-25年以上的磨合以后相貌会变得很相像。这可能就是所谓的习惯成自然,相有心生吧

      Wednesday, June 10, 2009

      Yet Another Android Mobile Phone HelloWorld Tutorial

      注明:版权归德明泰所有。此为转载。

      开eclipse,新建一个android工程。
      先得用xml画布局。可以拿个例子干写,可以用我发的那个可视化工具,eclipse自己也有个大米花的功能,可以给控件设属性,总之配合着来吧,反正最终的xml也简单。写一个xml就行了,位置是res/layout/main.xml
      这是我写的
      <?xml version="1.0" encoding="utf-8"?>
      <LinearLayout
      android:id="@+id/main"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"
      xmlns:android="http://schemas.android.com/apk/res/android"
      >
      <EditText
      android:id="@+id/text"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:textSize="18sp"
      >
      </EditText>
      <Button
      android:id="@+id/button"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Click Me"
      >
      </Button>
      </LinearLayout>
      最外层是一个Layout的大面板,控件往上扔就行了。我弄了一个文本框一个按钮。layout属性的fill_parent表示是跟爸爸一样,就是填满。wrap_content的意思好像是根据内容定长度。其他的都简单。那个id要选好,前面的@+id/是固定的,后面要起一个名字,程序里就用丫。
      ec里能看到设计图。图懒得贴了,自己执行了看吧。
      然后就写代码呗。我就贴关键部分。其中带底色的是建了and工程自动生成的,其他是我写的。
      public class helloworld extends Activity {
          /** Called when the activity is first created. */
          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.main);
              clickMe = (Button)this.findViewById(R.id.button);
              editText = (TextView)this.findViewById(R.id.text);
              clickMe.setOnClickListener(new OnClickListener(){
                  @Override
                  public void onClick(View v) {
                      editText.setText("Hello world!!!");               
                  }});
          }
          private Button clickMe;
          private TextView editText;
      }
      先声明俩变量,按钮和文本框的。然后用this.findViewById,把控件找出来,id就是前面你丫写xml时候设的id。要用一个强制转换。这样那变量就跟实际的控件连上了,以后用就行了。
      下面就简单了,弄上个listener,不多说了。其实除了那画xml跟)this.findViewById,真没啥新鲜玩意儿了。。。跟写普通java程序一样了。
      简单吧!!!!
      最后来个效果图

      俩控件的水平方向layout都是fill_parent,所以撑满了

      Saturday, June 6, 2009

      DataGridView EditMode EditProgrammatically

      Problem: Whenever you want to write your own double click event for datagridview control, chances are, you will actually end up in edit mode. 

      How to solve: DataGridView EditMode property.

      From the MSDN,

      DataGridView EditMode Property : Gets or sets a value indicating how to begin editing a cell.

      The catch is:

      All DataGridViewEditMode values except for EditProgrammatically also allow a user to double-click a cell to begin editing it.

      Aha, that’s why the problem occur!! So, how do i use Edit EditProgrammatically?

      MSDN give the following explaination:

      Editing begins only when the BeginEdit method is called.

      So I implemented the following event handler to call BeginEdit method.

      private void dataGridView_ContextMenuViewEditCell(object sender, EventArgs e)
      {
      dataGridView.BeginEdit(true);
      }




      Then use contexmenu to register the event.




      dataGridView.ContextMenuStrip.Items.Add(
      new ToolStripMenuItem(Resources.Common_Label_Edit, Resources.Image_16_Edit,
      new EventHandler(this.dataGridView_ContextMenuViewEditCell)));




      And finnally,  contexmenu only pop up when right click, so focus needs to be set, same as left click.




      DataGridView.HitTestInfo hti = this.dataGridView.HitTest(e.X, e.Y);
      if (hti.RowIndex >= 0 && hti.RowIndex < dataGridView.Rows.Count)
      {
      dataGridView.CurrentCell = dataGridView[hti.ColumnIndex,hti.RowIndex];
      }


      Monday, June 1, 2009

      Subversion Trac rules tutorial

      A guide that I worte for company staff to follow.

      SVN:

      • Use TortoiseSVN client.
      • Our subversion has the usual trunk/branches/tags layout. Never develop on trunk! Do your part in branches and merge it back to trunk.
      • Recommended check in frequency is every hour! Comment is a MUST.
      • Exclude unnecessary files that are not required in compile. (eg, obj, exe) Pay attention to check-in huge files that can’t be re-versioned!
      • ONLY merge changes that can be compiled and tested into truck. ( and reviewed! Will have detailed discussion about this.)
      • Commit changes as a single logical change set for one purpose. Thus all code changes for a single bug fix or enhancement should be checked-in together. This allows one to better follow the history log of changes.
      • Check-in code at the directory level and all changed files, recursively in the directory and subdirectories will be checked in together.
      • Using Trac integrated with Subversion, refer to the Trac ticket in the Subversion check-in comment using a "#" in front of the Trac ticket number (eg. #65). This generates a hyperlink when the Subversion logs are viewed in Trac.
      • The "tags" branches are NOT to be used as working branches but are snapshots of an existing branch. The "tags" are for historical reference such as a release, well tested version or progress milestone.

      Trac:

      • Document project based information in Trac wiki. (eg, Anything that isn't obvious to fresh eyes gets documented on the Trac Wiki.)
      • Spend at least 0.5 hour a day documenting on the Wiki. This should get placed in the "Documentation" category on the time-tracking software.
      • Using Subversion integrated with Trac, refer to the Subversion specific revision in tickets using a “r” in front of the revision number (eg r103). This generates a hyperlink to view the source in Trac.