用正則表示式取代。
正則表示式:"\s+"
注意反斜線!
程式範例:(C#)
Robert 發表在 痞客邦 留言(0) 人氣(21)
(1) W3C 建議放在 <head></head> 中。
(2) 不論擺在哪裡,都是從頭讀到尾的執行順序。(call function除外)
Robert 發表在 痞客邦 留言(0) 人氣(353)
「yyyy-MM-ddTHH:mm:ss.fffZ」
例:「2016-03-29T15:20:35.777Z」
Robert 發表在 痞客邦 留言(0) 人氣(1,157)
範例:
public class AutoStudent {
// Singleton
private static AutoStudent instance = null ;
public static AutoStudent getInstance() {
if ( instance == null ) {
synchronized ( AutoStudent.class ) {
if ( instance == null ) {
instance = new AutoStudent();
}
} // synchronized
}
return instance;
} // getInstance()
private AutoStudent()
{
}
} // public class AutoStudent
Robert 發表在 痞客邦 留言(0) 人氣(81)
OCP: the Open-Closed Principle
Software entities (class, modules, functions, etc.) should be open for extension, but closed for modification.
一個軟體個體應該要夠開放使得它可以被擴充,但是也要夠封閉以避免不必要的修改。這樣解釋鄉民們應該還是看不懂,接著看 Robert 在書中所說得這段話就會很清楚了 (p. 99):
When a single change to a program results in a cascade of changes to dependent modules, the design smells of Rigidity. The OCP advises us to refactor the system so that further changes of that kind will not cause more modifications. If the OCP is applied well, then further changes of that kind are achieved by adding new code, not by changing old code that already works.
Robert 發表在 痞客邦 留言(0) 人氣(17)
Robert 發表在 痞客邦 留言(0) 人氣(1,915)