Monthly Archives: January 2009

‘Shocking’ Kebabs

This shouldn’t really be news to anyone, but a study has revealed that UK kebabs have ‘shocking’ amounts of salt, fat, and calories:

The worst doners inspectors came across contained 1,990 calories before salad and sauces – over 95% of a women’s recommended daily calories – 346% of a women’s saturated fat intake and 277 per cent of an adult’s daily salt intake.

Stanford iPhone Course Resources

Stanford University’s iPhone course has finished, and the resources for the course have been posted online. Included are the lecture slides as PDFs and code examples.

They’re probably not much use to experienced iPhone developers but might be a good starting point for anyone new to Cocoa and Objective-C.

Top Gear’s Stig Revealed!

The second Stig from Top Gear has been revealed to be former racing driver and professional stunt driver Ben Collins.

Passenger Stories from the Hudson Plane Crash

As the plane was on fire, some prayed, while others did what you were supposed to do: read the emergency instruction about how to open the door:

Some passengers screamed, others tucked their heads between their knees, and several prayed over and over: “Lord, forgive me for my sins.” But a man named Josh who was sitting in the exit row did exactly what everyone is supposed to do but few ever do: he pulled out the safety card and read the instructions on how to open the exit door.

Which do you think was more useful?

Many Civil Servants Deserve the Sack

From my own experience, I couldn’t agree more with Lord Digby Jones.

The ‘Misunderestimated’ President

The BBC have collected a Best of Bushisms list. My favourite is probably still:

There’s an old saying in Tennessee – I know it’s in Texas, probably in Tennessee – that says, fool me once, shame on… shame on you. Fool me – you can’t get fooled again.

You can watch him make this speech too on YouTube.

Cause of Zune Leap Year Bug

Someone on Zuneboards has found the actual snippet of code that’s causing the recent Zune crashes:

year = ORIGINYEAR; /* = 1980 */

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

The Zune stores the current date by keeping a track of the number of days since ‘ORIGINYEAR’. The loop works out the current year by subtracting 365 or 366 from the days counter and adding one to ORIGINYEAR.

The problem is with the conditional if (days > 366), which means if the current year is a leap year, the loop will never finish as days is always 366 and will never be subtracted. What it’s meant to do is if (days >= 366), although with the conditional above of if (IsLeapYear(year)) it’s not necessary at all.

This means that unless Microsoft fix this bug, it will recur at the last day of every leap year.

css.php