Malevolent technology

I was woken by an brief but intrusive buzzing at two this morning. Before I could work out what it was, however, it stopped.

I fell back to sleep.

About a quarter of an hour later, it woke me again.

This time, I was disturbed enough to find the offending device. I spotted the glow of my Palm T3’s screen from behind its cover, and seized it. I had set it to silent mode, so, instead of the normal ‘bee-boo bee-boo bee-boo’ alert chimes, it was employing the vibration alarm, which rattled loudly against the hard surface. But why was it rousing me at this wee small hour?

It wanted to boast that it had correctly made the transition to summer time. Or, more accurately, the idiot-savant programmers at Palm had wanted it to.

Given that, as far as I know, the switch to daylight savings time happens in the middle of the night everywhere, the question is: what were Palm developers thinking when they decided that the event needed to be announced with an alert?!

Intel’s second most useless invention

It’s not quite as pointless as the WiFi surfboard, but not by much: the Intel Fender Web Guitar.

Guitar with a computer  in the back

According to Intel’s press release,

Incorporating the latest Intel® Centrino® Mobile technology, the supercharged TELE® also means players can:

  • Send a quick email in-between songs on stage
  • Scour the web for inspiration… or chords they’ve forgotten
  • Practice their guitar solo grimaces via a built in webcam
  • Check their royalties online

Say what? You’d look like an idiot checking your eBay auctions in the middle of a gig. It’s frivolous and humorous, not practical, and I’d be more impressed if they were honest about it: ‘Look! We managed to fit a computer into the back of a working guitar! Why? Why not!’

Chasing moving targets

At work, I’ve spent a reasonable chunk of the past two weeks implementing an hReview parser. To briefly explain, hReview, along with other microformats, is a way to mark up a standard web page invisibly in such a way that the contents can be read and aggregated by a computer.

It all began with a task to improve reevoo.com’s current parser so that it could accommodate multiple photos for a single review. However, since one of the ‘business value’ points on the task card was to develop a reference parser, I decided to go back a step and develop a generalised parser that could handle some of the other microformats.

Once I had something that could process the basic nested structure that many of the microformats adhere to, I could set out the structure and parse about 90% of the hReview and—because hReview relies on it—hCard specifications. Unfortunately, that left a hard core of fields that needed special consideration due to weird or lax parts the specification. (E.g. The telephone number goes inside a ‘value’ element. Or not. It depends.) Still, with a set of test documents, I worked my way through the edge cases until I could extract 100% of information from all the valid documents I could find.

hCard was particularly horrible, due in no small part to the unwillingness of the specification’s authors to actually, well, specify it.

Is there a list of all hCard properties which can be plural?

We have avoided duplicating (or providing a shortcut for) the “can this property occur multiple times or not” deliberately in order to avoid repeating a constraint from RFC 2426 vCard, and thus potentially getting it wrong. Here is the way to determine whether or not a particular property can occur multiple times (is a plural property / may have multiple instances or values).

  1. Check the hCard XMDP profile for the property definition.
  2. If the property definition references a plural form in RFC 2426 (e.g. honorific-suffix references honorific suffixes), then the property is a plural property.
  3. Else go check the referenced section in RFC 2426 which should state explicitly whether or not the property is plural or singular.
  4. Else (if RFC 2426 is not explicit) then the property is plural.

What a cop-out! RFC 2426 is, by the way, horrible to read. Surely discussing the specification in public would be better than expecting every implementor to follow that convoluted process and—magically—to come up with interoperable software. That (miserable excuse for a) specification is a guaranteed path to incompatible implementations. Incompatible implementations lead to anger. Anger leads to hate. The path to the Dark Side, that is. Or something.

Parsing hCards is particularly difficult: most of the few seen in the wild are broken in some way, and some of their information can’t be extracted automatically. Still, despite these difficulties, I succeeded, and could parse every well-formed hReview and hCard perfectly.

And there our story would end. Except … a day later, they released the revised version 0.3 specification! This is admittedly a predictable problem when working with draft specifications. My parser could handle reviews written according to version 0.3, with one small omission: the actual rating of the review itself. From our point of view, this is one of the most important parts. Still, it was easy to fix.

However, the latest draft of the specification blithely throws in a couple of hand grenades: in addition to rel-tag and hCard, a comprehensive hReview parser now needs to understand hCalendar, rel-license, and include-pattern . Adding those is a bit more work.

Whilst I understand the microformats.org crowd’s love for their own product, I do have to wonder whether they aren’t raising the barrier to implementation a bit too high by making all the microformats interdependent. Now, in order to handle one specification you’re interested in, you must first implement five that are not directly relevant to the current task. That’s not a microformat any longer.

We’re going to release the hReview parser for public use in the next few days (update: it’s here), I hope, by which time I should have added the latest changes. Partly, it’s good publicity, but I think there’s also a big advantage in being among the first to implement it: we get to say what’s valid and what isn’t!

Webalizer hates Googlebot Mobile

For reasons that are pretty much historical, I use Webalizer for analysing my web site access logs. (I’m in the market for something better: any suggestions would be welcome.) Since earlier this month, however, my statistics have been broken: Webalizer died with a SEGFAULT every time it tried to parse the access log. The culprit wasn’t too difficult to find, but it was an interesting exercise that probably benefits from being passed on.

In order to try to work out what was happening, I employed the services of strace, a handy debugging tool that monitors the system calls made by an application.

strace -o strace.log webalizer (normal command-line options)

After a few minutes of parsing, Webalizer died as before. I checked the last few lines of strace.log.

read(3, ".1" 200 5981 "http://po-ru.com/p"..., 4096) = 4096
read(3, "ul/small/IMG_2233.JPG HTTP/1.1" "..., 4096) = 4096
read(3, "ot-Mobile/2.1; +http://www.googl"..., 4096) = 4096
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

From this, I could see that the last section parsed contained the text ‘ot-Mobile’. That was sufficiently unusual as a user agent to pique my interest. Running grep on the logs revealed something worth following up: a user agent I’d never seen before.

"Nokia6820/2.0 (4.83) Profile/MIDP-1.0 Configuration/CLDC-1.0 
(compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)"

From there, I did something very simple: I just removed the four lines containing ‘Googlebot-Mobile’ from the access log before feeding it to Webalizer.

It worked.

This warrants further investigation, but for now, I’m happy to have fixed the problem and to have got my logs back.

Gotmail: Hotmail how you want it

I haven’t used Hotmail for email since about 1999, but, inexplicably, people still send emails to my hotmail.com address. I occasionally check the account, usually to find that they have expired it due to inactivity. It’s hard to remember to check it, just to wade through the poker and dating spam that Hotmail’s weak spam filter lets through. Besides, the interface is dreadful and confusing. I’d like to get the useful emails in a timely fashion, but I’d rather not have to go near Hotmail to do it.

I’ve found a solution. The gotmail script downloads emails from a Hotmail account, and forwards them on to another email account. I’m using Gmail to help sort the wheat from the chaff.

It’s pretty easy to use gotmail, although it has to be updated from time to time to cope with changes to Hotmail’s interface. The version currently available via apt-get on my Debian server is outdated and broken, but the latest version is working fine at the moment.

I’m using this as a .gmailrc and running gotmail via cron once an hour.
It’s a bit more complicated if your computer doesn’t have a local SMTP server, but still possible.

username=XXXXXXXX
domain=hotmail.com
password=XXXXXXXX
forward=XXXXXXXX@gmail.com
mark-read
only-new

The above settings cause gotmail to forward only unread messages, and to mark messages as read after forwarding them.

Gotmail is a good tool to help wean people off Hotmail accounts.

Big in China?

One of my friends found my name mentioned in an article in Forbes China about in-train internet access. Unfortunately, my Chinese reading ability is very limited, but I’m told that it’s a well-written article.

The first paragraph:

到中国旅游的英国小伙子巴特利(Paul Battley)告别北京的故宫,踏上了前往上海的高速列车。他在餐车里边享用夜宵,边用笔记本电脑欣赏自己刚刚采集下来的数码照片。“请问您的笔记本电脑内置了无线网卡了吗?”餐车里的一位陌生乘客用英语问巴特利,“是的。”巴特利回答说。“愿意尝试在这里用自己的笔记本连接互联网吗?”陌生乘客接着问巴特利。巴特利瞪大了眼睛,兴奋地接受了这个让他耳目一新的邀请。

Here’s an approximate translation (suggestions for improvement gladly accepted!)

Paul Battley, a young British man travelling from Beijing to Shanghai on the high-speed train, is enjoying a midnight snack in the dining carriage and looking at digital photos on his notebook computer. A stranger asks in English, ‘Do you have a wireless card in that?’ ‘Yes,’ responds Mr Battley. ‘Would you like to try connecting to the internet with your own notebook?’ enquires the stranger. Mr Battley excitedly accepts the invitation.

Thanks to Xiangdian for alerting me.

Review: The Bug digital radio

The Bug digital radio

In order to test out the new review aggregation facilities of Reevoo, I’ve decided to write my own review. It’s also going to test the parser a bit: it’s long, and I've modified the markup a little.

0.2 product

I was given a Bug DAB digital radio for Christmas, and I can honestly say that it’s one of the best presents I’ve ever received. The looks are—to put it politely—unconventional, but the functionality is superb.

I’m an avid radio listener, and really appreciate the extra channels available on DAB. The sound quality is definitely better than AM, especially in the evening when AM is particularly susceptible to interference. Whether DAB sounds better than FM is somewhat subjective: the artifacts of the MP2 compression used by DAB are sometimes audible, but the reception is far more robust. Those are features of the format itself, though, and not specific to this product.

The killer feature of the Bug is timed recording. Just like on a VCR, you can set up the station, time, and duration, and the device records it for you. This requires the additional purchase of an SD card, but I’m glad that they don’t include one with the product: the speed at which capacities increase and prices decrease is so fast that it’s a much better deal to pick one up separately. The timed recording can handle things like weekdays, weekends, one-off, and weekly repeats, and covers almost every permutation I’ve needed. There are six timers; I haven’t found that to be a limitation so far.

Recordings are saved in the DAB-native MP2 format, and can easily be transferred from the SD card to a computer with a card reader (there’s a USB port on the Bug itself that exposes the card as a Mass Storage Device, but that only provides USB 1 speeds). It’s easy to play MP2s in iTunes, which can also convert them to MP3 files for my iPod.

There are some thoughtful features such as the ability to set the channel and volume for radio alarms in the morning; in my case, that’s something loud to wake me up. There are quick-access buttons for tuning to favourite stations. You can pause and rewind through live radio.

It’s not perfect, though. What could be improved? Well, for a start, an off button would be nice. The Bug has a four-way clicker to handle most of its functions, and turning the radio off requires a long-duration press on the clicker. In practice, it’s tricky to do without rocking it one way or another. Curiously, there’s a dedicated button for automatic rescanning of available stations, an operation that is rarely needed in a radio that’s tethered to one location by its power supply.

The screen is slightly old technology; something with a higher resolution and refresh rate would make it easier to read the station text data and to navigate through stored tracks.

Compared to the rich options for timed recording, the alarm facility is limited. There are only two alarms; it would however be nice to be able to set different times for Saturday and Sunday.

The firmware can—and indeed should—be upgraded to provide some important bug fixes and functionality improvements. However, the firmware upload utility is only available for Windows (ugh). It’s also annoying that the device comes with firmware that’s more than a year old out of the box.

The sound quality when listening via the headphone socket is noisy and poor. The sound quality through the speakers is fine, though, so this seems to be a shortcoming of the headphone output circuitry alone.

The Bug stands alone among DAB radios, as far as I know, in providing comprehensive recording facilities. It sets a high standard in features and functionality, but has a few annoying wrinkles. It’s also a bit bulky and peculiar-looking. It’s nonetheless an excellent product: if you want a recording DAB radio, buy it.

Rating

9/10 by Paul Battley on Feb 07, 2006

Blue-eyed foreigners

I can’t help but be amused by the odd outbursts of some Japanese politicians regarding the possiblity of allowing women to accede to the throne (which seems increasingly necessary in the continuing absence of any male heirs).

Former Trade Minister Takeo Hiranuma told supporters that the move could dilute the imperial line if Princess Aiko married and had children with ‘a blue-eyed foreigner’.

Interestingly, however, the Imperial line is not purely Japanese, at least according to the Emperor himself:

‘I, on my part, feel a certain kinship with Korea, given the fact that it is recorded in the Chronicles of Japan that the mother of Emperor Kammu was of the line of King Muryong of Paekche,’ he told reporters.

Still, I don’t think that they need to worry about big-nosed foreign devils upsetting the racial line yet: Princess Aiko is only four years old. A blue-eyed Japanese Emperor seems about as likely as a black King of England at the present time.

The elephant grass in the living room

In US President Bush’s State of the Union Address this week, he identified the US’s dependency on oil—especially the kind imported from badly-governed parts of the world—as a problem.

I couldn’t disagree with him there. And his plan to replace petroleum as an automotive fuel with plant-derived ethanol seems sound, at least initially.

I used to think it was a good idea, too, until I read a particular article about using elephant grass as a biomass fuel in Europe. One sentence in particular caught my eye:

If we grew Miscanthus on 10% of suitable land in [the 15-member] Europe, then we could generate 9% of the gross electricity production.

A little mathematics, however, leads to the alarming realisation that if we grew Miscanthus on 100% of suitable land, it would only cover 90% of electricity production. That still leaves out the significant fuel requirements of non-electric vehicular transport. Plus, there’s a small problem of where to grow food when all the land has been devoted to fuel crops! (To be fair, it’s not clear whether ‘suitable’ land includes or excludes land currently used for food production.)

In fact, it gets worse. Jeffrey Dukes calculated1 that the human race uses more than 400 years’ worth of organic matter each year. (This is of course due to the fact that oil contains a lot of dead organisms.) Fairly obviously, we aren’t going to be able to get that much out of the biosphere. It’s also naïve to imagine that mass farming of fuel crops will be without its own ecological consequences.

In fact, however, I still think that plant-derived ethanol is good idea to a certain extent. Some use of biofuel will certainly help to reduce oil dependence—not to mention free up oil for some of its other, arguably better, non-fuel uses. Increasing efficiency will also help; sadly, mention of that is completely absent from the State of the Union Address itself. Perhaps asking Americans to buy smaller cars is a political step too far.

I’m sure that other people have realised the same thing. Even if we ignore the pollution aspect, diminishing oil reserves will draw ever-higher monetary and political prices. Until we invent zero-point energy or desktop cold fusion, nuclear power really does seem to be the only feasible alternative. Nuclear power has its own noxious output, but it is at least more easily sequestered than the prehistoric carbon vented into the atmosphere by burning fossil fuels.

There is one more solution, of course: drastically reduce the number of human beings on the planet. That’s something of an ethical conundrum, though.

1 Statistic cited in George Monbiot’s essay on biodiesel.

Watch where you’re driving! Are you blind or something?

I love Barry of Portsmouth’s review of a TomTom navigation device. Scroll down a bit to Go directly to Barry’s review, in which he says:

I have found Tom Tom very useful. I have restricted sight and it is excellent not having to search for sign posts especially in towns.

Whoa, hold on a minute! This is a satellite navigation device for cars!

Am I the only person who’s a little scared that Barry is driving around unable to see the actual street signs?