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$
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$
Alt key.+ (plus) key on the numeric keypad.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 Map to find the hexadecimal Unicode values for different characters.
Also, it’s worth noting that if you are using MS Word you can simply type in the Unicode hex value first and then press Alt+x. The hex number will be replaced by it’s equivalent Unicode character automagically.
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 having an overloaded method, one overload takes a parameter of type long, another of type int, now if you want to pass in the number ‘15′ for example, these suffixes will help you choose which overload to actually invoke by appending a letter (or two) to the numeric literal.
| Type | Suffix | Example |
|---|---|---|
| uint | U or u | 100U |
| long | L or l | 100L |
| ulong | UL or ul | 100UL |
| float | F or f | 123.45F |
| decimal | M or m | 123.45M |
Note that the suffixes are case-insensitive.
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 of course i didn’t have the correct format-specifier right off the top of my head so i had to hunt down the information on Microsoft’s slow-and-poorly-searchable msdn which is certainly something i try to avoid!
reference: Scott Gutherie’s blog
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..
Make sure you have the ClearType effect turned on (Control Panel->Display->Appearance->Effects)
I’m glad I found this font, and that’s why I’m sharing it, It’s way better than Courier New which used to be my favorite actually.
Subsonic is my favorite library for creating data access layers in asp.net.
If you are an asp.net developer you should give it a try, or at least check it out, it’ll be worth your while.