18 August 2007

I'm Jim

You scored as Jim Halpert, Congratulations, you're Jim! How'd you get to be so awesome?

Jim Halpert

78%

Dwight Schrute

75%

Andy Bernard

73%

Michael Scott

70%

Kelly Kapoor

68%

Jan Levinson

68%

Creed Bratton

68%

Pam Beesly

65%

Karen Fillipelli

60%

Kevin Malone

60%

Toby Flenderson

60%

Ryan Howard

50%

Meredith Palmer

45%

Angela Martin

38%

Dunder Mifflin Personality Quiz
created with QuizFarm.com

17 August 2007

Date Validation

When looking for a date validator you are likely to find many Regex solutions that will check for mm/dd/yyyy format's etc but almost none of them will check for 2/30/2006, i.e. non-leap year problems.

Don't bother writing a custom validator or looking online for that quick JavaScript or prewritten control fix. In comes stupid hack:

<asp:RangeValidator
id="vldt"
runat="server"
Type="Date"
ControlToValidate="DateControl"
MinimumValue="1/1/1900"
MaximumValue="12/31/3999"
Display="Dynamic"
ErrorMessage="Invalid Date Entered"
/>

Since an invalid date is not in the range of a lot of years, it is invalid and the message is displayed. Hurrah! (Note: The code above will not function after the year 4000)

(Time wasted/spent figuring this out: 2hrs)

Adopt a kitten

A stray in our neighborhood had a litter of kittens and we are left with these three all which need a good home. They are healthy and playful and we would hate to take them to a shelter, mostly because after 30 days they are put down and all the shelters are full up with cats. We can't keep them because I have an allergy to cats. So if you have the room and are in the Chicago area… (Look at the picture)