Microsoft Zune

The code that caused certain Zunes to freeze is here. And the offending logic:

BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)
int dayofweek, month, year;
UINT8 *month_tab;

//Calculate current day of the week
dayofweek = GetDayOfWeek(days);


while (days > 365)
if (IsLeapYear(year))
if (days > 366)
days -= 366;
year += 1;
days -= 365;
year += 1;

So what happened to all of those poor Zunes? The code looks at the number of days that has elapsed since a predefined ORIGINYEAR of January 1, 1980. Then it keeps on subtracting 365 days (or 366, in the case of a leap year) from the total number of days, adding one to the year value, until it can no longer do so. What should result is the correct year.

However, if you push December 31 through on a leap year then there are 366 days. Which is greater than 365 days but not greater than 366 days.

The code goes something like this. Are the number of days greater than 366? Yes. Is it a leap year? Yes. Are the days greater than 366? No. And so nothing happens. The code loops back and continues to repeat FOREVER.

Result? Frozen Zune.

Obama is a Great Leader

There were concerns raised about Obama’s leadership yesterday. A blogger claimed that he saw Obama using a Zune. Many people have never heard of Zune. A Zune is Microsoft’s copy of the iPod. Apparently you can find them at stores somewhere in Canada now.

And the folks at Microsoft were delighted at the news. Obama seen using a Zune! Time to get the PR machine moving. Examples are here and here. Pretty much everywhere on the blogosphere.

It has been confirmed that Obama is not a user of Microsoft’s Zune music player. An Obama spokesperson put the rumor to rest, saying “Not true, the President-elect uses an iPod.”

Obama, being a great leader, is an Apple guy. MacUser was talking about what Obama had on his iPod back in June and also highlighted that Obama and the rest of his family are Mac users.

Philadelphia City Paper blogger Neal Santos, who started the uproar after seeing Obama at a local gym, stands by his assertion that he saw Obama using a Zune.

Glad that all got settled.