Archive

Archive for January, 2009

Hiding UniqueIds in css class names

January 27th, 2009 No comments

I always have a unique id in my databases for each row. When passing this to objects for javascript to manipulate I add it to the class string as ‘id_1′ so I can easily retrieve it later. The GetIds function below returns an array with the id pulled out. It also handles multiple ids in the format of ‘id_name_1′ so we can do something like ‘block id_1 id_Page_1′

Read more…

Categories: Javascript Tags:

Cross Browser Support for inline-block

January 27th, 2009 No comments

From http://foohack.com/

I learned a new CSS trick from one of the best insane inventor webdevs I know. The pieces have been out there for some time, it seems, but I hadn’t ever seen this spelled out as simply and elegantly as he did it. Read more…

Categories: css Tags:

The most common fonts

January 27th, 2009 No comments

The table below is a periodically updated listing of font survey results for all platforms, the cumulative total of all valid font survey submissions since January 2004.

These figures are calculated per platform and do not show how common the fonts are on other systems. Think of it this way: More Mac systems have the Monaco font than Windows systems have Trebuchet MS.

Read more…

Categories: css Tags:

Flagged Enums

January 27th, 2009 No comments

Read more…

Categories: .net, c# Tags:

Type.GetType and referred assemblies

January 27th, 2009 No comments

There is a DLL called CommonAssembly. This contains a namespace called CommonNamespace. This namespace contains a class called CommonClass.

Another project adds a reference to CommonAssembly and wants to get the type of CommonClass using the method Type.GetType.

Read more…

Categories: .net, c# Tags:

Determining whether a class implements certain interface

January 27th, 2009 No comments
typeof(IFoo).IsAssignableFrom(bar.GetType());
typeof(IFoo).IsAssignableFrom(typeof(BarClass));

The Type.IsAssignableFrom() method check whether a type can be assigned from another. It takes a System.Type object as argument, so if you are given a class or an instance of a class, you can use the typeof operator or the Object.GetType() method to get the corresponding System.Type object respectively. The MSDN has a clear definition of the returned value of the IsAssignableFrom() method:

Read more…

Categories: .net, c# Tags: