2009-07-23

Leaving Cert English selected answers

The themes in Macbeth are juicy and addictive like opal fruits with nicotine.

Some of the most appalling prose (and, rarely, some of the most appealing) is making the rounds in the form of the smuggled answers to Leaving Cert English papers from this year.

2009-01-07

Plug: a Browser Security Handbook

My employer has published a Browser Security Handbook advising authors of web applications about the various security risks involved, a subject that is ridiculously complex. Yay.

2008-12-05

POSIX time_t is not UTC

For years, I've been pretending that time_t is a better representation of time than any combination of year, month, day, etc. That's because it's a linear representation of time that can be subjected to arithmetic. In particular, it's monotonically increasing.

Well, that's not true on POSIX systems. On POSIX, time_t is said to be based on UTC, but it ignores leap seconds! Considering that UTC is defined as TAI minus accumulated leap seconds, that's one giant opt-out.

The official line (from SuS v3) on leap seconds is "applications which do care about leap seconds can determine how to handle them in whatever way those applications feel is best". OK, quick question: your application, which cares about leap seconds, calls time() and gets 915148800; what time is it? If you need to know, you're out of luck; compliant POSIX systems stepped their clocks back a second during the leap second. If you have a drug-delivery system that's based on POSIX, don't use it if a second's too much drug will harm the patient.

In fact, POSIX time_t is an encoding of a Gregorian calendar time (year, month, day, hour, minute, second). The POSIX committee considers it more important that time_t is consistent between machines, than that it should be correct. Consequently, the description in the man pages and standards of time_t as "seconds since the Epoch" is a lie.

It violates POSIX to set your system clock to return the actual number of seconds since 1970-01-01T00:00:00Z! Right now (2008-12-05) it should be the number of seconds since 1970-01-01T00:00:23Z; from the start of 2009 it should be the number of seconds since 1970-01-01T00:00:24Z. If you try to use difftime to compare a time from 2008 with a time from 2009, you'll get the right answer minus one.

This is clearly crazy. If you want to ignore leap-seconds, use TAI and accept the drift. If you want to ignore leap-seconds but stay close to UTC, stick to year/month/day/hour/minute/second (i.e. struct tm). If you want accurate intervals and not necessarily accurate calendar times, use a monotonically-increasing count of seconds since some definite time in the past. Unix made its choice clearly and precisely; POSIX is wrong to change it, and STUPID BAD WRONG to change it while pretending it's the same.

[Edited: I had the wrong offsets in the fifth paragraph.]

[Update: Someone pointed me at an old message titled History of IEEE P1003.1 POSIX time which explains a lot.

2007-06-17

Now it's lolbots

This meme just keeps spreading. One day I'll look back and cringe. But right now I'm laughing my head off.

2007-06-12

Search your lolcats

I Can Has Cheezburger has a search feature. Why? The spelling-correction isn't good enough to mangle English into Kitteh well enough to find anything. I only found the noo it are my birthday cat by searching for no "it are my" birthday.

2007-05-13

E61 force-flashing links

Here are some links to help me force-flash my new Vodafone-branded Nokia E61 to the latest (uncrippled) firmware version:

  • Hisham's blog entry
  • averageadmins blog entry
  • Nemesis tools (download links: NSS103810.zip, History.txt, pdg4fbus.zip).
  • Quick Nemesis instructions:
    • On Hardware Selection, pick Virtual USB Device
    • Backup the phone using the vendor tool
    • Open Nemesis again
    • Scan for new device ⇒ Phone info ⇒ Scan
    • Enter product code (0523307 for UK layout), check the enable box, and Write.
    • Use the vendor tool to update the firmware — new version should be 3.0633.09.04 or later.
  • The official updater can be downloaded via this link.

2007-04-15

Kasparov arrested for political action

Expect many chess-related puns from sub-editors around the world. More seriously, Russia is rapidly becoming the world's greatest threat again. Putin has presided over a degradation of civil rights which is as shocking as it is sudden. Journalists are murdered, votes are rigged, power is centralized. I don't know which is scarier: that Putin has a grand plan for which he will need all this power; or that Putin wants power for its own sake, and will leave a Stalinesque legacy when he's finally removed. Who could have thought Yeltsin's successor would actually make things worse? I can only wish luck and popularity to the opposition in Russia.

2007-04-10

The IPv6 Experiment

It's so crazy and yet so plausible. It might just work. (Of course, it could be an April Fool, and that would be cool too.)

2007-03-21

Directive 2003/58/EC

The EU, in a genuine act of stupidity (not to be confused with the imaginary acts of stupidity usually recorded in the British press), has directed that all email messages emanating from a limited company contain the same information required on the company's letterhead (directors, registered office, etc.). Articles 5 and 6 do the damage.

2007-01-29

Myths about physical seals

LLNL have a great information resource on physical seals. I wish it had been around during the electronic voting debate in Ireland. So many journalists and politicians believed the myth that physical seals are tamperproof. It was an uphill struggle until the Commission on Electronic Voting took a look at them.

2006-11-15

That Monaghan car crash in... empty

On Saturday 2006-10-21, two cars were crashed into one another in Co. Monaghan. Five people died as a direct result. This unusually-bad fatal crash provoked much comment about Irish driving standards, and the peculiar reticence of reporting of car crashes in the Irish media.

Sarah Carey wrote about it. I don't know what she wrote, because she gave in to comments (reported by fatmammycat and irisheyes) that she interpreted as personal threats.

The reporting of motor vehicle crime by Irish media is uniquely euphemistic. Drivers do not swerve off the road — instead, cars leave the road. Drivers do not crash their cars — the cars themselves become involved in a collision. In particular, drivers do not kill or cause serious injury — instead, the victims are reported to have lost their lives following an accident.

When the driver in question survives, this coyness in reporting could be put down to fear of litigation from a driver who escapes conviction. It's more baffling when the driver has killed himself or herself, and isn't around to sue. We then hear nothing but expressions of sympathy for the families (heartfelt but irrelevant to the road-safety issue) and some frustrating generalizations about young drivers, speeding, and drink-driving.

If reporting of aviation disasters was as circumspect as reporting of motoring disasters, aviation would be as dangerous as Irish roads. Aviation safety is hugely improved by the policy of openness in investigation of accidents. Conversely, road safety is damaged by the policy of reporting car crimes as if they were tragic accidents, and not crimes.

Sadly, there is no possibility that the traffic law will be enforced, because there's an election coming, and too many people want to commit car crimes in this country. They have convinced themselves through a process of cognitive dissonance that the traffic laws they break are unjust, and that their crimes are not actually wrong. In fact, they have simply become used to doing what other drivers have bullied them into doing — driving faster and everywhere. This is a battle that political parties dare not fight, when there are so many people who view driving home from the pub as a basic civil right, and Ministers of the Government are happy to drink and drive, and to drive (or be driven) at illegal speeds.

If we can't even talk about the personal, criminal responsibility of drivers who kill, how can we possibly hope to reduce dangerous driving in our country?

Sampler's Culchie Control Platform

I don't like linking to YouTube because they have a poor copyright-policing record, but this looks OK. And it's hilarious and should be seen.

Hallowe'en Horror

Foxtrot has a good and scary Hallowe'en story (well, scary if you live in the US).

2006-09-18

Talk Like A Pirate Day

September 19 is Talk Like A Pirate Day. For help with this important language option, consult the How To Talk Pirate video.

2006-09-09

Tom Limoncelli's Time Management for System Administrators

I saw the talk and bought the books, but it's handy to have this link available. More useful links (to the book etc.) are on the right-hand-side of the Google Video page.

2006-09-05

Just Try Voting Here: 11 of America's Worst Places to Cast a Ballot (or Try)

A wonderfully shocking summary of the biggest things wrong with the USA's electoral system, which is right up there with Zimbabwe's. The problems are, briefly:

  1. Citizens can't vote without a special token issued by the state (normal ID is not enough)
  2. Electronic voting machines screw up all the time with huge effects on count results
  3. Citizens in poorer neighbourhoods wait hours in line to vote
  4. No training for poll workers means no voting until afternoon
  5. Good old dirty tricks are used to mislead voters and disrupt campaigning
  6. Gerrymandering is now a widespread craft
  7. Citizens convicted of felonies are not told if or when their voting rights are restored
  8. The careful selection of pessimal electoral schemes is used as a creative means of minimizing representation for minority groups.
  9. Citizens away at university are simply denied the right to vote
  10. Voter registration forms are selectively "lost"
  11. It has become acceptable for election supervisors to abuse their power to favour their party

Failure recovery

I've been categorizing distributed system designs into four groups, according to how they recover from the loss of a single critical ele...