Who is Nerbles?A quirky actor from North Carolina afflicted with wanderlust and bad grammar. I also curse. A lot. And I am 22. Not 13. I love my Mac, driving fast, good music, high-heels, football, roller coasters, new journals, blue-ridge mountains, chips on my sandwiches, knee-high socks, astronomy, the arts (duh), Taco Bell, and spiced rum.
Feel free to drop me a line. I like comments.
Theme by nostrich.
Link reblogged from dan.o with 55 notes
Via jstn.
while (days > 365) {
if (IsLeapYear(year)) {
if (days > 366) {days -= 366;
year += 1;
}
} else {
days -= 365;
year += 1;
}
}Out of curiosity, why was this being rewritten by Freescale or Microsoft at all? This has been a solved problem for a very long time.
(Also, this is very ugly C style in many places. I expected better from Microsoft.)
I’m sure by now you’ve heard every 30GB Zune stopped working today. Well, one member of a forum for Zune users supposedly found the offending code, which runs an “if” loop without stop if the current year has 366 days and the current day is number three hundred sixty six, like, for instance, today, December 31th, 2008.
Ironic that Microsoft’s Zune was broken due to an infinite loop.
I am a geek for posting this, but it’s proof some of you should stop trusting ol’ Bill and buy Mac like grown-ups do. :P
I am a geek for posting this, but it’s proof some of you should stop trusting ol’ Bill and buy Mac like grown-ups do. :P
The code from where...originated is available here. The funny thing is that the same code...
Also, who hard-codes magic numbers like that? So many things wrong with this picture.
HOLY SHIT I actually understand all of this. Maybe I learned something from Dr Schwartz after all and therefore should...
I take it “days > 366” should be “days >= 366”.
I thought we were beyond these kind of coding errors. Anyways, here’s an explanation for people who don’t read code.
“I expect” is...diffrent story! Microsoft...like a hot...
Out of curiosity, why was this being rewritten by Freescale or Microsoft at all? This has been a solved problem for a...