Hilton Giesenow's Jumbled Mind

the madness that is...

News

This is my little spot in cyberspace where you will find a collection of random (but mostly software-related) thoughts and ideas that are frightening in their shining brilliance (or something like that ;->).
 
Please enjoy your stay and feel free to Contact Me.
 
Microsoft MVP

.Net Links

BlogRoll

Misc. Links

Syndication

July 2005 - Posts

Calculating an Age in C# From a Date of Birth

Just a quickie - if you've got a date of birth, you can get and age using the following formula. It's based on the code at http://www.developerfusion.co.uk/show/4671/, but I've simplified it a bit:

// get the difference in years

int years = DateTime.Now.Year - dateOfBirthDate.Year;

// subtract another year if we're before the

// birth day in the current year

dateOfBirthDate = dateOfBirthDate.AddYears(years);

if (DateTime.Now.CompareTo(dateOfBirthDate) < 0) { years--; }

return years;

Posted: Jul 25 2005, 12:22 PM by hiltong | with 5 comment(s)
Filed under:
Somebody at Microsoft Does Not Care!
Yes, that is right. Somebody at Microsoft, when writing part of the Graphics library, did not in fact care. Not sure what I mean? Then check out the System.Drawing.Imaging namespace, and have a look at the PixelFormat enumeration. It has a bunch of options, (such as 32 bit RGB, etc.) and also includes an Undefined option, but one of the values is “DontCare”. Brilliant!
Posted: Jul 13 2005, 12:11 PM by hiltong | with 1 comment(s)
Filed under:
A Big Welcome to my New Coworker
Those of you who hang out regularly on SA Dev / SA Arch will know Doobiwan, but you probably won't know that he just started working with us from Friday. I wanted to extend my welcome to the web, and say I'm looking forward to working on some awesome stuff with ya!
A Slow Week

Ok, last week was the maddest I can remember in a looong time. With two major deadlines, my machine went totally south on me, bluecreening almost constantly on Mon / Tues. Any machine I put my harddrive into, no matter what config, would bluescreen and reboot. I finally managed to get a dual-boot 98 machine to access it via NTFS drivers from sysinternals, which let me backup important docs, and then ran another neat sysinternals tool - NTFSCheckhttp://www.sysinternals.com/Utilities/NtfsChk.html.

Whew, so that finally had me booting. I was still bluescreening every now and then, thinking it was my harddrive, when the last few reboots showing I had lost 500 mb ram! So, I got hold of Microsoft Memory Diagnostic (part of the free Windows 2003 Resource Kit). It ran 6 different types of tests and found .... Nothing. But, the system seems to be (reasonably) stable. I was almost pulling my hair out, and not the nicest co-worker this week, so apologies to every one at the office :-).

Posted: Jul 03 2005, 07:37 PM by hiltong | with no comments
Filed under: