星期日, 12月 31, 2006

Agile Software Development相關教學

WebCasts

  • Test-Driven Development in Microsoft .NET (James Newkirk, Alexei Vorontsov)
  • Test-Driven Development, by Example (Kent Beck)
  • Test-Driven Development, A Pratical Guide (David Astels)
  • Unit Testing in Java (Johannes Link)

網站

Blogs

星期一, 12月 25, 2006

顯示容易看的MSBuild Log

若要在Dashboard上顯示容易看的MSBuild Log,只要在「C:\Program Files\CruiseControl.NET\webdashboard\dashboard.config」中加上以下設定即可

<xslreportbuildplugin description="MSBuild Details" actionname="MSBuildDetailsBuildReport" xslfilename="xsl\msbuild.xsl"/>

星期四, 12月 07, 2006

實作Equals method以及equality operator需遵守的規則

MSDN上提到:

The following rules outline the guidelines for implementing the Equals method and the equality operator (==):


  1. Implement the GetHashCode method whenever you implement the Equals method. This keeps Equals and GetHashCode synchronized.


  2. Override the Equals method whenever you implement the equality operator (==), and make them do the same thing. This allows infrastructure code such as Hashtable and ArrayList, which use the Equals method, to behave the same way as user code written using the equality operator.


  3. Override the Equals method any time you implement the IComparable Interface.


  4. Consider implementing operator overloading for the equality (==), not equal (!=), less than (<), and greater than (>) operators when you implement IComparable.


  5. Do not throw exceptions from the Equals or GetHashCode methods or the equality operator (==).

有空再來探討其背後的原因

Java與C#的string equal與==

根據陈叙远的世界


java:
String s1 = "abc";
String s2 = new String("abc");
String s3 = "a" + "bc";
System.out.println(s1.equals(s2));
System.out.println(s1.equals(s3));

System.out.println(s1 == s2);
System.out.println(s1 == s3);

c#:
String s1 = "abc";
String s2 = new String(new char[] {'a', 'b', 'c'});
String s3 = "a" + "bc";

Console.WriteLine(s1.Equals(s2));
Console.WriteLine(s1.Equals(s3));

Console.WriteLine(s1 == s2);
Console.WriteLine(s1 == s3);

运行结果是:
java:
true
true
false
true

c#:
true
true
true
true


星期二, 12月 05, 2006

Excel如何做到類似SQL select功能?

  1. 先利用MATCH巨集確認符合條件的資料的順位, 如 =MATCH(F6,$A$1:$A$150,0)
  2. 利用=INDIRECT("B" & A6) 取用相關資料

轉換Pukiwiki到Trac wiki

暫時找不到好的解決方案, 先採用下列Ultraedit macro來轉換

InsertMode
ColumnModeOff
HexOff
UnixReOn
Top
Find RegExp "^\*\*\*\s*(.*)$"
Replace All "=== \1 ==="
Find RegExp "^\*\*\s*(.*)$"
Replace All "== \1 =="
Find RegExp "^\*\s*(.*)$"
Replace All "= \1 ="
Find RegExp "^---\s"
Replace All " * "
Find RegExp "^--\s"
Replace All " * "
Find RegExp "^-\s"
Replace All " * "
Find RegExp "\[#........\]"
Replace All ""
Find RegExp "\[\[(.+)\]\]"
Replace All "[wiki:\1]"
Find "|"
Replace All "||"
Find RegExp "~$"
Replace All "[[br]]"

星期四, 11月 30, 2006

修改subversion log訊息

TortoiseSVN有提供修改log訊息的功能:

若你很興奮地改了log訊息想存回,會得到以下回應:
解決方法為:
到subversion repository的hooks目錄中,新增或編輯一個名為pre-revprop-change的檔案,內容改為

#!/bin/sh
exit 0
即可,不過為了安全起見,改完後沒事還是把他還原成不能隨意更動log的狀態比較好