There are five generic font families, each including some fonts:

serif:   have finishing strokes, flared or tapering ends, or have actual serifed endings (including slab serifs);  are typically proportionately-spaced;  often display a greater variation between thick and thin strokes than fonts from the ’sans-serif’ generic font family. Examples of fonts that fit this description include:

  • Garamond
  • Georgia
  • New York
  • Times
  • Times New Roman
font installed(%)
win mac unix
Georgia 97.76 94.20 57.70
Times New Roman 97.51 91.71 60.98
Lucida Bright 30.01 59.77 73.97

sans serif:  have stroke endings that are plain — without any flaring, cross stroke, or other ornamentation;  are typically proportionately-spaced;   often have little variation between thick and thin strokes, compared to fonts from the ’serif’ family. Examples of fonts that fit this description include:

  • Arial
  • Geneva
  • Helvetica
  • Lucida Sans
  • Trebuchet
  • Verdana
font installed(%)
win mac unix
Verdana 99.13 95.58 59.67
Tahoma 98.98 74.86 —-
Arial 98.73 96.41 65.90
Lucida Sans 41.17 59.77 73.97

monospace: have the same fixed width so it is similar to a manual typewriter. Examples of fonts that fit this description include:

  • Courier New
  • Courier
  • monospac
font installed(%)
win mac unix
Courier New 98.73 90.88 64.59
Monaco 2.77 98.34 4.11

cursive and fantasy are not suggested to be used in the body text.

Some common rules:

  1. Sans serif for online, serif for print.
  2. Monospace for typewriter and code.
  3. Cursive and fantasy for accents.

The following combinations are fairly safe when it comes to universal application across operating systems and browser platforms:

  • Arial, Helvetica, sans-serif
  • Verdana, Arial, Helvetica, sans-serif
  • Georgia, Times New Roman, Times, serif
  • Times New Roman, Times, serif
  • Courier New, Courier, monospace

[references]

http://www.codestyle.org

http://webdesign.about.com/od/fonts/a/aa080204.htm

http://www.w3.org/TR/CSS2/fonts.html#generic-font-families

“Prof ASP.NET 2.0 Design _ CSS, Themes, and Master Pages”, Wrox, 2007

We can do it with DataBinding a combobox with DataSet or DataTable object. And we can also do it with customer objects. There are two ways to do this.

Here is the customer object:

public class cbxItem
{
private string _Text;
private long _Value;
public string Text{get{return _Text;}}
public long Value{get{return _Value;}}
public cbxItem(string theText, long theValue)
{
_Text = theText;
_Value = theValue;
}
}

Way 1: using DataBinding with customer objects as DataSet

……
ArrayList cbxObjects= new ArrayList();
while(theDataReader.Read())
{
cbxObjects.Add (new cbxItem (theDataReader.GetString(1),theDataReader.GetInt32 (0)));
}
this.ComboBox1.DataSource = Authors;
this.ComboBox1.DisplayMember =”Text”;
this.ComboBox1.ValueMember = “Value”;
……

Way 2: directly using ComboBox.items.Add(obj) with customer objects:

……
while(theDataReader.Read())
{
ComboBox1.Items.Add (new cbxItem (theDataReader.GetString(1),theDataReader.GetInt32 (0)));
}
……

combine multiple rows in one

September 3, 2009

I have a table as:

itemID tagID
100                111
200                222
200                223
300                333
300                334
300                335

I want to have a select statement to group records by itemID and one itemID will have only one row, multiple tagIDs will be combined in one field.

Step1: create a scalar-valued function (UDF)

ALTER FUNCTION sUDF_itemTagIds(@aItemId int)
RETURNS varchar(MAX)
AS
BEGIN
DECLARE @tagids varchar(max)
SELECT @tagids = COALESCE(@tagids + ‘,’,”) + convert(varchar(20),tagID)
FROM myTable
WHERE itemID = @aItemId
RETURN @tagids
END
GO

Step2: call the UDF from the SQL script:

SELECT itemID,dbo.sUDF_itemTagIds(itemID) as tagIDs
FROM myTable
GROUP BY itemID

Here is the result:

itemID tagIDs
100                111
200                222,223
300                333,334,335

Intro to User Defined Functions

The ability to create a user-defined function (UDF) is a new feature added to SQL Server 2000.

A user-defined function is a database object that encapsulates one or more Transact-SQL statements for reuse. This definition is similar to the one for stored procedures, but there are many important differences between user-defined functions and stored procedures—the most pronounced being what types of data they can return.

Scalar Functions

A scalar function returns a single value of the data type referenced in the RETURNS clause of the CREATE FUNCTION statement. The returned data can be of any type except text, ntext, image, cursor, or timestamp.

Inline Table-Valued Functions

An inline table-valued function returns a variable of data type table whose value is derived from a single SELECT statement.

Multi-Statement Table-Valued Functions

The multi-statement table-valued function is slightly more complicated than the other two types of functions because it uses multiple statements to build the table that is returned to the calling statement. Unlike the inline table-valued function, a table variable must be explicitly declared and defined.

COALESCE

Returns the first nonnull expression among its arguments.

Syntax

COALESCE ( expression [ ,...n ] )