Archive

Archive for January, 2009

Snow time like the present

January 21, 2009 1 comment

Monday of this week was MLK day: no school. That night, some prayers were answered and 4-5 inches of snow got dumped on NC State, canceling classes.

So I took my camera and went out to document the snowfall for a friend in Georgia who didn’t get to enjoy the fun. The results of my picture-taking are over at flickr. A few samples:

Buildings 3

Bikes

There was also some graffiti and I finally examined something I’d seen a hundred times before.

Categories: Uncategorized

Hindsight has 100% test coverage

January 7, 2009 Leave a comment

Browsing the blog that published the earlier Zune 30 bug analysis, I found another post, most philosophical about the media coverage of the bug. (Emphasis mine.)

What happened? Every Apple-loyal iPhone, iPod, and Mac owner threw a fit even though none of them actually owned a Zune 30 (You can’t run a Zune 30… or any Zune, for that matter, on a Mac). Thanks in part to the additional sensationalism promoted by gadget bloggers and, subsequently, news outlets the world over, a problem with a Zune model sold only in North America suddenly became a “Worldwide Zune Outage.”

But it gets better. How about all the haters at Slashdot fueling the fires with an article claiming that the Zunes were “committing suicide”? The word “bricked” also got thrown around way too much for what turned out to be an outage. Dickwads.

But, let’s get back to that “outage” thing. That reminds me of Blackberries, those ball-and-chain devices that are veritably equivalent to being enslaved by your company.

RIM reports “critical” BlackBerry outage
Mon Feb 11, 2008

Research In Motion’s ubiquitous BlackBerry experienced a “critical severity outage” on Monday afternoon that left users stranded without wireless e-mail access, its maker said.

Last April, a massive outage crashed BlackBerry service across North America, leaving thousands of users without access to wireless e-mail.

Well, shit. The Zune isn’t even an enterprise device that some companies rely on: it’s just a way to get the Rage in to your Machine. But somehow this problem gets Microsoft torn to shreds where with RIM it’s just business as usual.

I don’t know about anyone else, but I own a Zune 30. When I found that it had been rendered inoperable on 31 December 2008, I put it back down, went out of my house, and played D&D for twelve hours. And on the way there, I listened to the radio. I guess that’s why I still own a Zune, too. Apple refuses to put radios, an excellent way to get free, dynamic programming, in their iPods.

Fools.

Categories: Uncategorized

The fundamental problem

January 5, 2009 2 comments

I was browsing an analysis of the Zune 30’s 31 December 2008 bug, and I found myself wondering where it was going. See, it’s a thorough treatment of the subject that goes in to exactly what code failed and why, and then begins to re-write the C code.

The problem (well, my problem) is that the re-writer is a C programmer. Great for writing C code, but not for writing blog posts. Because the C programmer proceeds to write a version of the code that fixes the bug and is rather long, a bit verbose, and rather easy to read.

while (days > 365)
    {
        if (IsLeapYear(year))
        {
            if (days > 366)
            {
                days -= 366;
                year += 1;
            }
            else
            {
                break;
            }
        }
        else
        {
            days -= 365;
            year += 1;
        }
    }

And then the C programmer does what C programmers like to do, and starts compressing. Trinary operators are involved.

int daysThisYear = (IsLeapYear(year) ? 366 : 365);
    //The number of days in the current year is now calculated instead. 
    while (days > daysThisYear)
    {
        days -= daysThisYear;
        year += 1;
        daysThisYear = (IsLeapYear(year) ? 366 : 365);
    }

Much more compact in lines of code, but also much more difficult to read, in my humble, Python-loving, Java-using mind.

And as the author/programmer began to trim the code down, I wanted to just say “Stop! This is unnecessary!” but it was too late. It had already been done. But, it seems to me, that code like the more terse example is more error prone, or at the very least, harder to troubleshoot. And I just don’t think that way.

Maybe that’s my problem with C. Just as I would never think that distilling the code the way that that blog post did would be a good idea, I never think that other “features” of C are good ideas to use. Maybe I just don’t get it.

Categories: Uncategorized