July 7, 2009

The HTML 5 Layout Elements Rundown

TML 5 is an interesting beastie. The specification was not planned; The W3C was committed to HTML 4.1 as the last word in HTML. As such, most of the requests for HTML 5 came from the HTML user community itself, largely through the advent of the Web Hypertext Application Technology

Returning Zero-Length Arrays in Java

It’s best not to return null from a method that returns an array type. Always returning an array, even if the array has zero length, greatly improves the generality of algorithms. If you anticipate that your methods will return zero-length arrays frequently, you might be concerned about the performance implications

Find All User-Defined Functions in a SQL Server Database

This query returns a list of all the user-defined functions in a SQL Server database. In a T-SQL Window, write this query, substituting the appropriate database name for the db_name portion: Use select routine_name from information_schema.routines where routine_type=’function’ Run the query. This works in both MS SQL 2000 and MS

RegEx.Split vs. String.Split

The String.Split method has few limitations. For example, it does not support splits on duplicate delimiters such as double pipe (||) characters, double tildes (~~), or double colons (::). The easiest and most efficient workaround is to use the RegEx.Split method instead. Using RegEx you can escape the specific characters

Selecting Sort Order at Runtime

You can select which column to sort a SELECT statement by at runtime, using just one parameter. To do this, declare one parameter and use it with a CASE command. Then, include each column you might want to sort by as a CASE condition, for example: Declare @Parameter char(1)SELECT ID,

Error-Free Conversion for All CLR Primitive Types

Type conversions are more error-prone than most code, so it’s useful to have ways to convert types in ways you know will work. The CanConvert method in this tip checks data types in advance, and lets you know whether the conversion you’re interested in is possible. The method supports all