­

#349916 – Pastie

Zune Source Code FAIL

via #349916 – Pastie.

The offending function from the source code of Zune’s that caused the huge, epic Zune failure.

For those of you that don’t know how it managed to fail (myself included), see this Digg explanation for more:

Ouch.

For anyone who is wondering or just doesn’t want to figure it out, Dec. 31 qualified as being greater than day 365 (obviously, because it was day 366) but it got caught where the program says to look at (days > 365). The problem is that there was no code for what to do if the day *equals* 366, only if days is *greater* than 366. So, there was no way to break out of the (days > 365) loop until today (day 367) when the program would reset days to 1, thereby breaking the loop.

Whoops. It’s amazing what one bad “if” statement can do.

Heh. Amateur mistake, I know…

Did This Man Just Rewrite Science?

Take a sheet of graph paper that has been divided into grids. Color a square in the middle of the top row black. Drop down to the next row. Now invent a rule that will decide if a square should be black or white, based on the square above it and that square’s neighbors — for example, that a square should be the same color as the one above it unless that square has a black neighbor. Go across the second row filling in squares accordingly, then repeat the process, following the same rule, for the third row, the fourth row, and so on.

There are 256 rules you can concoct to play this simple game. Most will create a boring or repetitive pattern. But at least one rule will cause the page to explode into complex, ever-shifting patterns. You will have created a so-called universal computer, equal in its computational sophistication to Apple’s jazziest laptop. Given the right starting pattern, and the right rule, according to Dr. Stephen Wolfram, a former teenage particle physicist and software entrepreneur who has been doing this at home for the last 10 years, those lines and shapes cascading downward can be made to pick out the prime numbers, compute pi, calculate your income tax, or model the evolution of a star — anything a real computer can do.

via Did This Man Just Rewrite Science? – New York Times.

Yet another thing to try in these holidays…