MonthMarch 2007

If we were all like Cuba.. well, we’ll have probably have to be in a few decades

A fascinating letter in New Scientist of 10 March. Don’t think it’s online.

From Adrian Pollock, in Brisbane:

There are many C-words relating to the problem of climate change and its possible solutions: carbon trading, carbon sequestration, and now corn-based biofuels, according to George Bush (NS 3 February). The C-word missing from everyone’s lips is the one that matters: capitalism.

By its nature, capitalism needs continually to expand – to find new markets, new resources and new ways to accumulate to maintain profit for its investments. It cannot, therefore, offer a sustainable future.

The only country that has achieved a sustainable economy is Cuba (see the WWF’s Living Planet Report 2006, p19 – based on data Cuba supplies to the United Nations). Cuba would be perceived, at least in western nations, as having a relatively low standard of living; it is clear that an extraordinarily large change in our way o life is necessary to achieve a sustainable future.

Maybe that is why another C-word is missing: communism. Capitalism will have to be replaced with a system that does not depend on expansion but is based on the real needs of people and the planet. Call this what you will, but it is not capitalism or anything resembling it.

He’s absolutely right, I think. Oil runs out… can’t build nuclear power plants fast enough… can’t generate enough power.. can’t run cars and have to go on buses and trains..

It’s interesting, though: if it were to happen, do you think the US could keep up with Cuba’s low rate of child mortality? Assuming, that is, that we can trust the Cuban stats – which isn’t certain. (It’s quite hard to find any data from Cuba at Gapminder.)

Still, the music should be good. Buena Vista!

Actually, reading the letter reminded me of John Brunner’s The Sheep Look Up – his book about a polluted planet. Very like the forerunner of Children Of Men, seems to me; they could have read that and used it for the screenplay. God, I miss his writing.

Fire up the engine of serendipity: getting the database to mine the Long Tail of this blog automagically

When I worked for The Register, the only tedious task after you’d written a story – in what is one of the most friction-free environments I’ve ever worked in – was finding the “Related stories” to go at the end. (See this story for an example.) You had to plug in certain keywords, see what came up, and select them. Very good for getting people to click through (Long Tail and all that), but booooring to do. One’s obvious reaction: can’t machines do this sort of thing?

Turns out – yes. I think El Reg has moved on, and got the machines to do it, and now so have I. I’ve turned on a WordPress plugin called “related posts” (actually, nice-related-posts, which I’ve tweaked, which is itself based on related-posts).

“Related posts” works by getting the database that holds all of the content of your posts and telling MySQL to make an index of the full text. MySQL then has a function where you throw a couple of words at it and it will give you a “score” of other entries according to those words. Take the top-scoring entries, and you have a set of related posts.

However I’ve put that on steroids by using MySQL’s “WITH QUERY EXPANSION“. The reason is that the normal “score” system has a weakness: it only searches on the post title words. (Too hard to do the whole post.) But “WITH QUERY EXPANSION” throws up a list of posts and then finds words with related words, and runs a score on them all. Result: you get better matches.

Now, I have no idea how well this will work (though a brief glance suggests it’s quite good). I thought that it would get readers to discover stuff I’ve written that might have some relevance (there’s all the stuff about banks, and PKRSER.COM/Partygaming, and G4). And I also realised that I’ve written so much that I’ve forgottten a lot of it. “Related posts” might remind me of it.

Only thing – you’ll have to come to the site to see it. It isn’t in the feed (because it isn’t in the database.) It does mine both forwards and backwards from older posts, which I think is nifty.

And if you visit the site, you’ll also see a few other changes around here. You’ll find a smart picture in the right-hand column showing the Guardian’s front page today (whichever today you’re reading it in). There are also links to stories that have appeared in the paper, and stuff that I’ve blogged there. If I had literary stalkers, this would be a goldmine.

I haven’t decided how many is the best number of related posts to show. Five, as I’ve done at the Free Our Data blog, which I also run? Four? I thought most people would only bother with three. Tell me what you think – it’s not as if it’s a difficult change.

Roll over, Pixar – Shaun the sheep’s here to tickle your funny bone

Much as everyone seems to love Pixar and its totally computer-generated animations, one has to say that Nick Park – the man with Plasticine and an inexhaustible amount of patience – has provided the comic inspiration that leaves them standing.

The latest output from the Aardman studios, using the character created by Park (though none of the episodes, AFAICT, is written or even directed by him – he’s probably seen enough stop-motion characters for several lifetimes) of Shaun the Sheep.

You might be wondering why you haven’t noticed it. That’s because the 5-minute episodes have been playing on CBBC in the middle of the afternoon, when only those who aren’t working, or who have the blessed salvation of Sky+ (or similar PVR) can see it.

The humour is that classic Aardman style that leaves me laughing out loud; here’s a clip that shows it off perfectly.

And one has to admire how well they’ve caught the zeitgeist – the site offers the HTML for the embedable links to clips, which are in Flash. You’ll have to come to the site to see them, if your feed reader is as sniffy about Flash as mine is. Or just go and enjoy more Shaun clips.

(I suppose you’re going to say they’re all over YouTube now…)

A PHP/MySQL question – geeks only need apply: how to get a formatted date from an associative array

(He writes, noting all the comments piling up about PKRSER.COM.. hmm…)

I’ve got an intriguing PHP problem. Well, I hope it’s intriguing. I’m trying to format a date that comes out of MySQL. Presently I have to do it as
"SELECT ID, post_title, post_date,MATCH (post_name, post_content) AGAINST ('$terms') AS score.. "

That produces post_date which is in the MySQL datetime format – 2007-03-08 07:55:37.

But I want to put that in the form of “8 March 2007″. Yes, I know, you’re saying “Use MySQL’s date_format command!” Not so fast. The query produces an associative array called (surprise!) $results, where the results are then called one by one in a foreach loop (foreach $results as $result) thus:

$title = htmlspecialchars(stripslashes($result->post_title));
$permalink = get_permalink($result->ID);

See? You asked it for ID and post_title and it comes directly out of $result. Trouble is, post_date comes out in that boring “2007-03-08 07:55:37″ format.

Now, MySQL’s date_format could be used: SELECT ID, post_title, date_format(post_date, "%d %M %Y"),MATCH (post_name, post_content)...

And that would yield the post date nicely formatted. But how the hell do I call it?
$published = $result->date_format fails.
$published = $result[2] fails (which I found odd.)
How do I call the variable created by MySQL’s date formatting? Or am I doomed to use the rather boring substr on the boring date?

(I don’t really want to go off into parsing the months of the date, just to make the pages run quicker.)

You might be able to guess what this is for, though it requires some low-level tweaking too.

The original I’m working with is the tweaked Nice Related Posts plugin for WordPress, which I’m tweaking further. If you want, I can release the code, assuming I’m ever done.

(And you have to give its author kudos for the domain name. “Some fool with a .com”. Yeah.)

Update: solved – tip o’ the hat to Jason and L in the comments, who point out that one can use the SQL command SELECT date_format(post_date,"%e %M %Y") as publ_date… and then call $result->publ_date which will be formatted as 8 March 2007 (in that setting). Thank you, the lazyweb.

Wait, no, don’t stop reading this!

Interesting read over at problogger on 34 reasons why readers unsubscribe from your blog:

Thanks to everyone who has added their thoughts on why they unsubscribe from a blog’s RSS feed. There have been 109 comments left on that post so far and some interesting recurring themes have emerged.

…Obviously with 103 opinions (and most people giving multiple reasons all in their own words) I’ve had to make some judgement calls in classifying comments left. Some of the categories below have overlap but I think you’ll get a pretty good picture of what motivates people to unsubscribe from RSS feeds.

34 Reasons Why People Unsubscribe from RSS feeds:

  1. Too many posts (the post levels are too overwhelming) – 37
  2. Infrequent Posting (or the blog is effectively dead) – 29
  3. Partial Excerpts Feeds – 25
  4. Blog Changes Focus (too much off topic posting) – 23
  5. Too many posts that I see elsewhere (Redundant, Repeated or Recycled News) – 19
  6. Uninteresting Content – 16
  7. Irrelevant Content – 13
  8. The Blogger’s Ego – Too much self promotion – 11
  9. Low Quality Content – 11
  10. Too many posts that are too long – 10
  11. Negative blogging – 7
  12. Feed Errors – Especially when a Feed Reloads the latest 10-20 posts every time – 7
  13. Offensive Content/Personal attacks/Discrimination – 6
  14. ‘infomercials’ (too much selling) – 6
  15. Blog Titles that Don’t Tell what the post is about – 5
  16. No or Poor Formatting in posts – 5
  17. My own interests as a reader change – 5
  18. No Longer Useful or Valuable – 4
  19. Too many links in the text and not enough content – 4
  20. Advertising – 3
  21. Inconsistent writing (style and focus) – 2
  22. Too Many Grammatical Errors – 2

…and so on. It gets a bit trivial after that.

I find it interesting that “partial RSS feeds” is the No.3 (after the rather difficult to reconcile “too much” and “too little”). It’s certainly what frustrates me the most; there aren’t that many feeds that I stay subscribed to which only give a partial content. (I still don’t get why Martin Stabe doesn’t do a full feed, for instance. Are there adverts I’ve not noticed, Martin? And none of the RSS 0.92, RSS 2.0 or Atom 0.3 feeds offers a full feed.)

So anyway, I shall endeavour not to post too much, nor too little. And the feed remains full.

Cambridge Ten Pin bowling: like war, only louder, and with less negotiation

The Manic Street Preachers once did a gig in Cuba. Before it started, Fidel Castro came backstage to see them. They felt they should warn him that considerable volume is now involved in yer rock concert: “it might be a bit loud tonight,” they warned him.

“As loud as war?” replied Castro, which put them down neatly enough.

However if Fidel had accompanied us this morning to help us look after six young boys and a two-year-old and a couple of more rational older girls, he would have had a different comeback. “Is it as loud as the Cambridge Ten Pin Bowling?” he could have enquired, knowing that war comes a poor second to that one. Honestly: I recommend against ever going there if you want to have fun, or even a conversation. If you’re a parent thinking of giving a kid a birthday party at one, first go and check out the volume level at the time you’re thinking of. Because a DJ will likely be there, and ruin your great idea, as one did ours.

Yes, seriously. We thought that we were giving middle child a fun time with some of his equally under-12 friends by taking them bowling (his idea). You know, a lot of rolling balls down lanes, talking to each other, chasing after them, bit of cutting cake, that sort of thing.

Uh-uh. We got there and ur, OK, as we walked through the door it seemed kinda noisy for 1030 in the morning. But not people noisy. Pumped music noisy. Oh no, hang on, it’s DJ noisy. Maybe that was his moniker. The noise of some of the past five years’ top 30 hits played for about two minutes each before being rotated onto something else was simply CRUSHING. By the time we got down to the lanes themselves, it was just ASSAULT.

We couldn’t hear each other at all. We had nine children, with three adults (we’d borrowed a parent) trying to corral them. But they couldn’t hear us, we couldn’t hear them, and it’s pretty hard to explain what “you’re next lane up” means to someone who’s not gone bowling before if they can’t hear you and you have to put your mouth next to their ear if what you say is going to come out as anything but “MOO MUB DOR BOR”. Which, looking around, probably applied to pretty much every other lane there. Children having parties. Well, it was 1030 on a Saturday morning.

Not for the DJ, though. For him it was around 2am at the wedding reception of someone who’d asked him to turn the volume up because nobody should sleep through this bit and everyone ought to dance.

Eventually the constant BARRAGE started driving me mad. So I went over to ask if he could turn it down. “We can’t hear our children, they can’t hear us. We’re trying to have a nice time and we can’t,” I said.

“Sorry, mate, but it’s what the parents want,” he replied. The deputy manager, who was there chatting away to him (for they were neatly far back from the sonic onslaught, where you could converse easily in a light bellow), gave me a frosty look too, along the lines of ‘trouble?’. I wondered where precisely it had said on the party setups that as well as party bags and two hours of play that we’d get the hair cells of our cochlea selectively destroyed too.

“Ohhhh,” I said. “So it’s not about us the customers, it’s about you the DJ.” There were conspicuosly zero parents coming along to ask him to turn the volume up.

He said he’d turn it down. If he did, it must have been from 12 to 11. It was still deafening. As we chased children and bellowed food orders and lane changes and imprecations not to run down the lanes and that it was your go now, we became tired, grouchy, irritable even more than is to be expected from trying to look after nine children including a two-year-old intent on escape. This simply wasn’t right. What is wrong, tell me, with simply having a place where you get together and you can hear each other? Bowling balls and skittles make a fair amount of noise. But nothing to compare with the WWII artillery barrage coming out of the speakers there. We had hoped for a tiny bit of enjoyment. None of us got it. All the children found it really loud. None liked it that loud.

My particular gripe with this being that it would be fine to have music at that volume at 6pm, 9pm, 2am. Sure, go ahead. Ain’t my style, but you know, let people screw themselves up. However, at 1030 – in fact up till midday, which is when you’re going to find kids having parties – it seems calculated to give people a serious headache.

And those people include the employees. They have to work in those conditions too, and some of them, we found, don’t greatly like it. Do they get the option to ask the DJ to turn it down? Do they hell.

In fact, I think it would be interesting for an enterprising Cambridge Evening News journalist (say) to take along an Environmental Health Officer with a noise level meter to measure precisely how loud it is in there. Should the staff be issued with ear protectors? Equally interesting, if you went along and asked each lane’s users whether they’d like the music (a) a lot louder (b) a bit louder (c) just as it is (d) quieter (e) off, what sort of results would you get? [I’d point to a specific journalist who’s written noise stories, but the CEN doesn’t give bylines on its website. Great way to build the brand.. it could be done by robots..]

We didn’t get asked on the way out whether we’d enjoyed our visit. We’d have filled in little satisfaction forms and ringed “no no no no” repeatedly. We’ll not go back; we’ll not recommend it to the many people we know with children who might otherwise take them there. Oh, Cambridge Ten Pin, you screwed it up. Now, hang the DJ.

Afterthought: next year if he wants to do bowling again, then we’ll hire a projector and hook it up to the Wii. The Wii sports bowling is just as good and it’ll be a damn sight cheaper – and quieter. Here, have a look for yourself (though this doesn’t show the fact you have to move your arm about like you’re bowling; click through and try some of the other Wii bowling vids to see that).

Who I feel sorry for in the Wikipedia mess: the journalist

While lots of people have been weighing in on the pros and cons (mostly con – actually I’m not sure there are any pros at all to it) of the Ryan Jordan (aka Essjay) affair, where someone pretended to be a tenured professor of theology so he could big up his credentials on Wikipedia, and then got quoted in the New Yorker, nobody seems to be wondering what it’s like for Stacy Schiff, the writer who got bamboozled.

Since she’s a Pulitzer Prize-winner (that is, received the highest award in American factual journalism) one might have expected Schiff to have nosed out someone’s deceit over a total of six hours of interviewing. But no; and the same for the fact-checker who spent two hours on the phone checking, well, facts. (Of course at the moment we only have Jordan’s word on the six and two hours, so it might have been minutes; or even imaginary. Or on email, which is a less precise medium.)

The reality is though that if someone is intent on deceiving you and adept enough at making up their story, they will fool even an excellent journalist. (And, ahem, the less good ones too.)

You just know how it will be. She’ll come into the offfice feeling crap, and people will be going “Hi Stacy!” and she’ll smile back and then when she’s gone past they’ll raise their eyebrows at each other and blow their cheeks out and shake their heads, and she’ll be walking past and out of sight muttering under her breath and furious as hell with that little git who thought it would be fun to take the piss.

It’s really not fun when you’re taken for a ride. In journalism, it tends to be more visible than in other professions, I think. And especially now with the web, it tends to persist more too – in Google’s cache even if things are tweaked invisibly. (The Guardian doesn’t allow “invisible mending”; if we make a mistake, the changes on the website are left visible.)

So, hey, think of Stacy. Actually, it’s still a really good article. You just have to discount the stuff involving Essjay, or whatever.

What is codecasting? Dave Winer’s new name for Fraser Speirs’s appcasting idea

Dave Winer asks “What is codecasting? and answers “It’s got enclosures, like a podcasting feed, but instead of linking to MP3 files, it links to bits of code.

Seems like a rational next step.”

Yup – so rational that Fraser Speirs came up with the precise same idea back in February 2005 and dubbed it with the rather more accessible name of “appcasting”. I got around to noticing it in May of that year.

It’s something like the system used by the Sparkle framework which gets apps to update themselves when you start them up (which is very neat if you’re not worried they’re going to incorporate a bug.. actually, Sparkle really should incorporate some sort of public key swap to make sure it can’t be hacked – ah, it does: Supports DSA signatures for ultra-secure updates (or MD5 for verified updates)).

Let’s hope Dave’s listening for this and will realise appcasting is a much nicer name. Hey, let’s start a petition!