Monthly Archives: July 2007

Persisting SessionID Across Multiple Requests

Today we had a problem while working on Darden‘s project. We were using the SessionID as a unique key to store some information about the behavior of the user surfing the site. The SessionID was getting changed with every page request. The trivial solution was adding a global.asax file to the project.

Regex for U.S and Canadian Zip Codes

for my future references, below is a regular expression for validating U.S and Canadian zip codes. ^\d{5}(?:-\d{4})?$|^[a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d$ more details on the format of Canadian zip codes

How to type a unicode character under MS Windows

Press and hold down the Alt key. Press the + (plus) key on the numeric keypad. Type the hexadecimal Unicode value. Release the Alt key. Note that this method will only work if you have the following registry key set to the correct value.. under HKEY_Current_User/Control Panel/Input Method, set EnableHexNumpad to 1 Use the Character [...]

C# Numeric Literals Suffixes

The suffixes in the table below are useful because they tell the compiler what type a numeric literal is and how it should be treated. The default type of a numeric literal is integer (int) of course, but if you want to specify decimal or long, how would you do that? (please don’t cast it, it’s ugly) Consider [...]

DateTime & Number Format String Cheat Sheet

I don’t know why I haven’t spent the time to create something handy like this! If you are a .net developer (specially an asp.net one) you certainly will see the benefit of this DateTime formatting cheat-sheet. Personally I have wasted my time before trying to format an integer to print in a certain way and [...]

Consolas – A font for programmers!

I stumbled upon this font called Consolas which is recommended and created by Microsoft to use with Visual Studio 2005 (I’m not sure why just 2005), It’s a very good font for writing scripts, code, HTML, etc.. It’s monospaced (i.e. fixed width) The characters ’0′ and ‘o’ are very distinguishable (which helps avoid a common [...]