Sunday, 21 December 2008

Recommended web 2.0 colour schemes

There is a flash colour scheme generator named ColorToy 2.0: http://www.defencemechanism.com/color/



Also there are 14 colour schemes from: http://zcool.com.cn/color/20070623/color_0623J52007.html

073340007334010733402073340307334040733405073340607334070733408073340907334010073340110733401207334013

Tuesday, 16 December 2008

Differences Between XHTML And HTML

First of all, when we are talking about XHTML it is actually XHTML 1.0. When using VS2008 to create HTML/ASP.NET page the default DOCTYPE details are:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The Most Important Differences between XHTML and HTML are:
  • XHTML elements must be properly nested.
  • XHTML elements must always be closed, for example "</p>". If tag is empty it should be self-closed, like this: "<br />".
  • XHTML elements must be in lowercase, including property names.
  • XHTML property value should always be quoted.
  • Use id instead of name to identify a XHTML element.
  • the script should be embraced by CDATA section.

Sunday, 14 December 2008

The most popular Web 2.0 color palette

Followed are two sets of web 2.0 color palette. Click the image will open the 1:1 size image.



Tuesday, 9 December 2008

C#: The best way to reverse a string

3 lines simple code here:
string ReverseString (string text)
{
    char[] _ch = text.ToCharArray();
    Array.Reverse(_ch);
    return new string(_ch);
}

Monday, 1 December 2008

C#: struct vs class

The differences between struct and class:
1, struct is value type, allocate space from stack. And class is reference type, allocate space from heap.
2, struct cannot inherit from the other struct or class, only can inherit interfaces. And struct can't be inherited because it is implicit sealed. But class can do them all. Also because the struct is sealed then all its members can't be protected.
3, struct can't have parameterless constructor, but class can
4, the default modifier of struct is public but for class it is private.
5, in struct there is no initializer, but class can. See code below.

public struct myStruct
{
    public myStruct(){}; //compile error
    public string s = "abc"; //compile error
}