Software Engineering, Programming Note

Personal notes ~

2010年3月15日 星期一

Best Way to Check Empty String in C#

from http://dotnetperls.com/empty-string

Equality operator ==: 796 ms
string.Equals: 811 ms
string.IsNullOrEmpty: 312 ms
Length: 140 ms [fastest]
Instance Equals: 1077 ms
Using empty string methods

Here we see the five empty string tests shown in the graph and in the table above. Each of the five tests will be true, as the string str is empty. The code prints out the results of the tests, which you can see at the end.
=== Program that uses empty strings (C#) ===

class Program
{
static void Main()
{
// Example string
string str = "";

// Example tests
if (str == "")
{
// 1
// Test with op_Equality
System.Console.WriteLine(1);
}
if (string.Equals(str, ""))
{
// 2
// Test with static Equals method
System.Console.WriteLine(2);
}
if (string.IsNullOrEmpty(str))
{
// 3
// Test with IsNullOrEmpty
System.Console.WriteLine(3);
}
if (str.Length == 0)
{
// 4
// Test with Length property
System.Console.WriteLine(4);
}
if (str.Equals(""))
{
// 5
// Test with Equals method
System.Console.WriteLine(5);
}
}
}

2010年3月3日 星期三

WCF教學資源

http://www.cnblogs.com/frank_xl/archive/2009/05/22/1487383.html

2009年6月1日 星期一

Free UML Tools

Jude

Bouml

yEd Graph Editor
It's easy to use. --by Harry

ihmc

2009年3月15日 星期日































from http://www.falconpl.org/index.ftd?page_id=facts
 FalconPython*RubyPHP5LuaPerl
Document Templateyesnonoyesnono
Native regular expressionsnonoyesnonoyes
Coroutinesyesno | partialyesnoyesno
Multithreadingyespartialnononopartial
Embeddabilityhighlowlownohighlow
C Dynamic Library Interfaceyesvia ctypesnonopartialno
Native internationalizationyesnonononono
Compile-time Metaprogrammingyesnonononono
Procedural programmingyespartialnoyesyesyes
Object orientedyespartialyesyesnopartial
Prototype orientedyespartialnonoyespartial
Functional programmingyesnonononono
Tabular programmingyesnonononono
Message programmingyesnonononono
Raw VM loop speed (2)1023442 | 3401166701247369
Direct binary data accessyesnonononono
Data sharing & reflectionyesnonononono
Virtual filesystemyes (from 0.9)nonoyesnono
Library sizesmallhugelargeHuge(3)mediumhuge
LicenseFPLL or GPLPythonCustom or GPLPHPMITARTISTIC or GPL

2008年11月18日 星期二

物件導向設計(Object Oriented Analysis and Design)

轉自網路 http://ooadreason.blogspot.com/: 很吻合我的想法

物件導向設計(Object Oriented Analysis and Design)的精神在於將生活中的實際物件對應成系統裡的程式物件。簡單地說一下設計原則:

靜態物件(Data Model)的拆解原理如下:
有形的物件以一對一的原則生成Class
物件內能拆解出來的獨立物件也要有對應的Class
生成物件Class的同時為之定義一個專用的介面(提供置換用)
符合同樣介面的其他物件Class表示可以取代現在物件的位置

輸出物件(View)的拆解原理如下:
頁面、區域、欄位等等可視物件與可拆解物件以一對一的原則生成Class
生成輸出Class的同時為之定義一個專用的介面(提供置換用)
符合同樣介面的其他輸出Class表示可以取代現在物件的位置

除了靜態的物件,動態的動作(Controller)也需要拆解:
功能執行的流程邏輯由一個隱喻的Class來控制進行
每一個獨立動作視動作範圍拆解為一個方法或是另一個Class
生成動作Class的同時為之定義一個專用的介面(提供置換用)
符合同樣介面的其他物件Class表示可以取代現在物件的位置而存在

如此一來,一個功能需求實作的基本Class組成與關係大致成形。

PHP 教父 Rasmus Lerdorf





http://talks.php.net/show/ntu/0

2008年11月11日 星期二

Project : Lettory

probability : rand(1,n-n*H/24+1)~

關於我自己

Aspire freedom , Hope to do Soming make self complete ~