July 2005 - Posts
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;
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!
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!
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 :-).