LugRadio Live USA videos

May 8th, 2008

For those of you who missed the greatness that was LugRadio Live USA, or those lucky lucky people who were there and couldn’t see all the talks, we’re now starting to make videos of the talks available for download! Tony Whitmore, our hyper-competent video guy, is busily processing the videos, and as they’re made available we’re adding them to the LugRadio Live USA schedule. Currently there’s video of the LugRadio live show recording, Ted Haeger talking about “Freedom and the Cloud”, and Emma Jane Hogbin talking about women in open source. More will be appearing over the next few weeks! Keep an eye on that page to find video that you can stream or download in a load of formats.

(Those of you who are hyper-keen can actually get the videos quicker by watching the official video thread in the LugRadio forums, too.)

Auditions

April 26th, 2008

Lots of posts stacked up over Heathrow at the moment, like one about LugRadio Live USA, but for now I just have one bit of news. This morning, Niamh, my daughter, went to an audition to join the Stagecoach Talent Agency, and she was hugely successful. So successful, in fact, that they’re already putting her forward for an audition for a part on CBeebies, the children’s TV channel in the UK.

It is possible that I may burst with pride.

Fifteen years from now when she wins the Best Actress Oscar, I can look back and say “this is where it started”. CeCe Bloom, eat your heart out.

So proud. They said she was excellent.

Coming to America

April 5th, 2008

I’ve been noodling about in Inkscape, and reading The Order Of The Stick, a webcomic. It’s got a unique visual style, which always makes me laugh, and I thought (despite my lack of artistic ability): I wonder if I could do that?

LugRadio Coming to America

(there’s the SVG too to look at, which is a better size, although it’s 1MB because of the embedded images)

I’m not brilliantly happy with Chris or Adam, but I think Jono and I came out OK :)

Maybe I should do a LugRadio webcomic.

Inkscape’s a really good tool, by the way. The people who do it should feel very proud. I am distinctly short of artistic ability, and I’ve barely used Inkscape before, and I managed to put that together in relatively short order. Good work, Inkscape team.

Oh, yes, and LugRadio Live USA is this Saturday. We’re coming to America. Get ready.

gDay

April 1st, 2008

Q: Wait a second. I live in the US. Does this mean I’m now 2 days behind Australia?
A: Yes. Yes it does.

the gDay MATE future-search-engine announcement

I don’t normally like April Fools’ stuff on the web, but I’ll make an exception for this one :)

Editing a PDF (sorta) on Ubuntu

March 31st, 2008

I have more than once had to fill in a paper form for people in America. Obviously, doing such things is a huge pain, because actual paper mail — with stamps — isn’t just so last century, it’s the century before that. You know, the one with robber barons and Lord Kelvin and workhouses. Put a stop to it. Email. Email, I tell you. It’s gonna catch on, just you wait.

Anyway, a fair few American corporations (and, wouldjabelieveit, the American government too) provide PDF versions of their forms so you can download them and print them out at your leisure. They’re still designed to be printed and written on, though — they’re not officially PDF “forms” in the sense that the PDF reader can give you textboxes and an FDF file to fill them in, they’re just PDF documents. Nonetheless, I find myself wanting to be able to open them up in OpenOffice.org and edit them.

Now, you can’t do that. (Well, you might be able to, but it’s hard.) All I actually need to do is overtype them. So what I do is:

  1. Convert the PDF to an EPS file with pdftops: pdftops -eps AmericanGovernmentForm.pdf (the pdftops program is in the poppler-utils package)
  2. Create a new empty document in OpenOffice.org and drag the new .eps file onto it, which will embed it as an image
  3. Use Insert | Frame to draw a text frame on top of the new image (set it to have no border; set the background colour to anything other than No Fill and transparency to 100%)
  4. Overtype onto the form in the text frame
  5. Export as PDF to get a PDF version with your text in
  6. Email it to the government

No stamps. Their evil must be stopped.

Hackergotchi

March 31st, 2008

Would someone better with the Gimp than me like to do me a hackergotchi for Planet Gnome? I’ve been meaning to do it for ages and not got around to it. This snap at Flickr seems like a good candidate, but go wild if you can think of a better one (CC-derivs-licenced Flickr pics of me as a starting point :))

Overriding a single field in the Django admin, using newforms-admin

March 28th, 2008

Django has been gradually changing the way their automatically-created admin system works to use the newforms-admin code, which makes lots of cool new things possible. However, because newforms-admin is rather new (ha!), it’s not brilliantly documented. One of the things I wanted to do today was to make one field use a custom field-editing widget that I’d created, rather than Django’s default textbox, in the Django admin system. You do that like this.

In newforms-admin, you specify admin options for a model by creating an extra ModelAdmin class for it:

class Vehicle(models.Model):
  colour = models.CharField()
  name = models.CharField()

class VehicleAdmin(admin.ModelAdmin):
  search_fields = ["name", "colour"]

admin.site.register(Vehicle, VehicleAdmin)

Imagine that we wanted to build a custom widget to allow people to choose a colour by clicking on a colour swatch. To do this, you need to actually create your custom widget. So, in a file custom_widgets.py, you create your widget. The easiest way to do this is to subclass one of the existing widgets (TextInput is a good one here, because that’s a normal textbox, which is what gets used by default for CharFields) and then change its render method:

import django.newforms as forms
from string import Template
from django.utils.safestring import mark_safe

class ColourChooserWidget(forms.TextInput):
  def render(self, name, value, attrs=None):
    tpl = Template(u"""<h1>There would be a colour widget here, for value $colour</h1>""")
    return mark_safe(tpl.substitute(colour=value))

There are a few interesting wrinkles in there.

First, overriding render() changes the HTML that your widget prints when asked to display itself by the admin system. (I haven’t actually implemented the widget there; left as an exercise for the reader, that bit.)

Second, you need to call mark_safe() on the HTML you return, otherwise the admin will escape it.

Third, all input to mark_safe() must be Unicode, hence the u""" at the beginning of the string. The parameter value already is Unicode, but any strings you provide must also be explicitly Unicode strings; otherwise, mark_safe() fails silently — the string will be escaped.

Fourth, you don’t have to use string.Template, but it’s pretty convenient.

Once you’ve created your custom widget, you have to hook it up to your model. In our example, we need to change VehicleAdmin:

from custom_widgets import ColourChooserWidget

...

class VehicleAdmin(admin.ModelAdmin):
  search_fields = ["name", "colour"]
  def formfield_for_dbfield(self, db_field, **kwargs):
    if db_field.name == ‘colour’:
      kwargs['widget'] = ColourChooserWidget
    return super(ArticleOptions,self).formfield_for_dbfield(db_field,**kwargs)

The formfield_for_dbfield() function gets called for each of the fields in your model; for the one we care about (colour in this example), override widget in the kwargs and then carry on with the rest of the function, and that hooks it up.

That should be it; now, in the Django admin system, your colour field will use your ColourChooserWidget for editing.

Aaron Bockover’s Gong-a-Thong Lightbulb Talk Extravaganza

March 28th, 2008

The one, the only, Aaron Bockover points out how great LugRadio Live USA will be when it happens in just over two weeks. Modestly, though, he refrains from mentioning possibly the greatest part of it.

Yes, this year, Aaron himself will be taking the prestigious role of orchestrating the Gong-a-Thong, a blizzard of incredibly short four-minute talks. Last year at LRL UK this went down really well — it’s a perfect opportunity for people who don’t normally get the chance to speak to stand up and talk for a few minutes about what they’ve been doing. (Incidentally, if you’re coming to LRL USA and you want to spend a few minutes wowing people with stuff, or mentioning your latest project, or ranting and waving your fists in the air about software patents or the bash shell or something, we want you to come and do it — contact us and let us know.

Those of you who were at LRL UK, or have seen pictures, will now be grinning at the thought. You see, it’s called the Gong-a-Thong for a reason, and the reason is that the signal for the end of your talk is someone banging a big gong when time is up. And the person doing it, much like the guy at the beginning of the old Rank films, is all oiled up with a thong on. Jono’s got a bit more history on how he and I thought up the gong-a-thong, and he’s right about the sense of pride we felt last year. This year, Aaron has stepped forward to be the man with the beater and the shiny gold underwear. It’s gonna rock like Alcatraz.

Bockonegger

LugRadio Live USA schedule now available

March 6th, 2008

And now we have the schedule for LugRadio Live USA. Go and see and plan which talks you intend to watch!

LugRadio Live USA 2008 schedule

Internet Explorer 8 standards-compliant by default

March 4th, 2008

Dean Hachamovitch on the IEBlog:

We’ve decided that IE8 will, by default, interpret web content in the most standards compliant way it can. This decision is a change from what we’ve posted previously.

This is really good news. The previous decision that IE8 would be IE7 unless you specifically told it to be IE8 was one that I was really quite unhappy with; it ignited discussion all over the web developer world. The reason that this is really good news isn’t because IE8 will be IE8 by default (although that’s exactly what was wanted): it’s really good news because this is an example (the first example?) of Microsoft being prepared to break backwards compatibility in order to do it right. It’s an example of trying to take people who are doing things wrong and help them to move into a world of doing it right, rather than bending over backwards to help those doing it wrong and punishing those doing it right. That’s been Microsoft policy up to now, and I’ve always felt it to be penny-wise and pound-foolish; it keeps everyone working, but inhibits progress. This is a fundamental change in policy, based on the new Microsoft interoperability promise. And that’s a brave move by Microsoft.

The IE team are to be congratulated, because making IE8 default to being as standards-compliant as possible is going to make the web better; it’ll be easier to build web sites and web applications that work across browsers, and those applications will be able to do more things. That’s bad for lock-in, but it’s good for the web as a whole, and that’s important.

Dean Hachamovitch again:

Shorter term, leading up not just to IE8’s release but broader IE8 adoption, this choice creates a clear call to action to site developers to make sure their web content works well in IE.

What we need to do that is beta releases of IE8 that can be installed alongside previous IE releases. Nobody who’s an IE user wants to replace their system browser with a beta, because betas break — that’s the point of betas — but we do all want to test with them. Allow IE8 to be installed in some form of “standalone” mode in an official, supported, way. The IE team have said in the past that the existing standalone mode is not supported, but if we could have a supported standalone mode then testing is much more likely to happen, and testing is what we need here. (Note: “create a whole new Windows installation in a virtual machine and test IE8 there” is not really what I’m talking about here.) Working with the WINE team to allow IE8 to run under Wine would be pretty helpful, too, especially given that this change in IE’s direction is being driven by a promise of interoperability.

This bodes well for IE passing the newly-released Acid 3 test, too. Hixie describes how the WebKit team are flying ahead on Acid3 support, just as they did with Acid 2; since Opera are pretty good at supporting recent standards, and the IE team are not only prepared to make serious standards-based decisions but have already committed to passing Acid 3, the Mozilla team might end up being last to pass, which would be a headline they don’t want.

In short: well done IE team. Now let’s see IE8 kick some arse.

NetworkManager and phones and data plans

March 2nd, 2008

Dan Williams:

NetworkManager mobile broadband support…can most likely use your GSM mobile phone…if you add the appropriate stuff to the HAL .fdi file.

Blimey, that’s excellent. What would be required to get .fdi files for loads of phones into HAL by default, so it Just Works out of the box? For a given mobile phone model, will the serial port always have the same settings, or does it depend on who your phone company is and so on as well? It’d be brilliant to have this all working with no configuration required.

(PS. Dan, I couldn’t use OpenID to log in to leave this as a comment on your site; it didn’t recognise http://www.kryogenix.org/ as an OpenID for some reason.)

Better than Lego?

March 2nd, 2008

When I was a kid I played with Lego: specifically, Technic Lego, which is the one with the rods and cogs and whatnot. It occurred to me that it’d be pretty cool to have the Lego people be at LugRadio Live USA with a huge table covered in bits that people could go up and play with and use and look at. They can’t make it, though (it’s a long way from Scandinavia to San Francisco!). So, what are the cool kids using for building things now other than Lego itself? There was Fischer Technik when I was at school, but I’ve got no idea whether anyone still uses it; if this was LugRadio Live 1978 rather than 2008 then Meccano would have been good; what else is there? Nominate your favourite building stuff…

Four more beers

February 26th, 2008

Four years ago, four guys got together in a room in Wolverhampton and recorded the first episode of LugRadio. Since then, we’ve started running a yearly “rock conference” event in the UK, LugRadio Live, we’ve taken LugRadio Live international with the first US event, we’ve won an award for marketing, we’ve changed two of the presenters and then changed one of the replacements, we’ve gone to Guadec and PyCon and Guadec again, we’ve done nearly a hundred episodes, we were crowned “best open source podcast” by Linux Format, and we’ve built up a really cool community.

Four years, eh? I’m pretty proud of what we’ve done with the show. Thanks, all of you who listen and send in emails and come to LugRadio Live and post on the forums and hang around in #lugradio and make your own podcast about us and help us out with sysadmin stuff and run a mirror and talk about the show and enter competitions and laugh at the show on the bus. Here’s to four more.

Creative Commons coming to LRL

February 24th, 2008

Cool. Mike Linksvayer of Creative Commons writes about how he’s speaking at LugRadio Live USA and as a free bonus of making me feel proud, links to my writeup of the process of relicensing LugRadio episodes. Cheers, Mike! Naturally, if you want to see Mike and 40 other people speak, go and buy a LugRadio Live ticket now!

LugRadio Live USA registration is now open

February 21st, 2008

If you’re coming to LugRadio Live in the USA this year, you can now go and buy your LRL ticket! I can’t imagine that there are people reading this who don’t already know what LugRadio Live is, but you can read all about LRL to find out that we’ve got the cream of the open source community talking about their projects and their work and their thoughts for two days in San Francisco, on the 12th and 13th of April. If you pre-register there are, like, extra bonuses and prizes and stuff, and you can be sure of getting in (we’re a bit worried that we might hit the fire limit on the venue, so you want to buy a ticket!). Tickets for two days of glory are a practically-free $10 for the whole thing, too. Go thou and buy a ticket and buy a ticket for your friends. Do that now.

The other thing we’re concentrating on right now is exhibitors. We have a full schedule of speakers (and I’ll be publishing the schedule in due course so you can plan who you’re going to watch!), but we do still have space in the exhibition area. If you want to show off your project, or demonstrate the stuff your company makes, or just let people know about your cool technology, contact us and let us know what you want to do and how much space you’ll need.

Manchester free software group talk, Feb 19th 2008

February 18th, 2008

Tomorrow evening I’m speaking at the Manchester Free Software Group meeting: see their event page for details. I shall wave my hands a bit and chat about various things, including LugRadio and what I think about the way the free software community is, and start a discussion or two. See you there.

DRM-free downloads in the UK, redux: hooray for Play.com

February 17th, 2008

My ceaseless quest for DRM-free mp3 download files in the UK appears to be over!

A while back I tested Amazon’s mp3 store, which was fine except that you have to be in America. Fail. However, Play.com have just opened a similar store in the UK. As usual, my canonical test song for these things is Feelin’ Good by Nina Simone, and…I’ve just bought it from Play. As before, I have a list of requirements for these services:

  • I can download one track, instead of a whole album; I don’t want ten Nina Simone songs, I just want the one I’m looking for - PASS
  • No DRM. None. I don’t mind what the format is, if there’s no DRM, as long as it can be played on Linux (which is pretty much everything). Bonus points for oggs. Half a bonus point for just plain mp3. - PASS
  • A track costs a pound or less. I’m not paying more than a quid for one song. - PASS (99c is about 50p)
  • I feel comfortable putting my credit card number into the site. This means, in practice, that if it’s called something like mp3downloads.haxx0r.ru, I am not interested. - PASS
  • I can just buy a song by putting my credit card number in and getting it for download. I don’t need to sign up for an account, give them all my details, none of that. - FAIL
  • My music tastes aren’t very eclectic, so I’d expect the service to carry most of what I’d want to listen to. This means that a service for one label alone isn’t really what I want. I don’t want to discover new music with this; I want to get the stuff I already know about and want to listen to. - PASS
  • I’ll get, probably, about five songs a year. So a subscription service is out, especially since with most of them your music stops working when you unsubscribe. - PASS

As with Amazon, Play fail on the “don’t need an account” idea. However, there are two extra thoughts concerning that:

  1. They let you re-download the track later (an indeterminate number of times, depending on the record company) if you lose it or delete it. This is a good feature, and I can’t think of a decent way of doing it without some sort of authorisation process.
  2. I have mailed them with a suggestion. If someone’s just buying downloads, why not have a “buy this without signing up” button, which just asks you for all the information that’s required on the “buy it” screen? (You can’t just enter a CC number; they need billing address and so on for the credit card companies, more’s the pity.) Then, quietly sign them up for an account under the covers, and when you send the “you have bought a download, go here to download it” email, say “oh, and we signed you up for an account, with password GF78F$0.Fsf;” and they can use it or not care. No idea whether the Play people will take this suggestion or not, though.

Anyway, it works. I can get songs and listen to them. Well done, Play. That will do nicely.

Fix embedded YouTube videos for Gnash users

February 15th, 2008

I use Gnash instead of Adobe Flash, because it’s open source, and because I largely don’t miss Flash. The one thing I would miss, though, is YouTube. However, Gnash (in Ubuntu gutsy), while it works fine at displaying videos on YouTube itself, doesn’t work on embedded videos (where someone puts the YouTube video on their own site). GreaseMonkey to the rescue; this very short GreaseMonkey user script simply replaces embedded YouTube videos with a big link to the appropriate YouTube page, so I can click through and watch the video. Only useful for people who are as lunatic as me about freedom but still like YouTube, which might be an audience of one.

Clicking it should allow you to install it, if you’ve got GreaseMonkey installed already in Firefox; Epiphany users with GM enabled should right-click the link and say Install User Script.

youtubepopout.user.js

generated-toc: Generate a Table of Contents with the DOM

February 12th, 2008

More excitement from the Stuart House Of JavaScript Stuff: generated-toc: Generate a Table of Contents with the DOM. A very easy way to get a table of contents onto your documents: generate a table of contents using JavaScript.

A big thanks goes out to the organisation who funded this work, who I can’t name. Getting stuff like this out into the world is a good thing, and them allowing me to open-source it is better still. Good work.

Video thumbnails for MythTV

February 11th, 2008

My MythTV box has lots of TV episodes on it, as well as films. The MythTV people have got films all sorted nicely; there’s a thing which looks up the film on IMDB, grabs the plot and the cover art, and makes your list of films look all pretty. However, you can’t do that for episodes of TV shows, or random bits of video; they don’t have DVD cover art, unsurprisingly. Lots of people have come up with the idea of using a thumbnail taken from the video as artwork, which is fine, but most people using MythTV are using mplayer to do the thumbnailing (and play videos). Mplayer doesn’t work on my MythTV box (it crashes X), so I use VLC. VLC can theoretically create thumbnails, but I can’t get it to work properly, so I’ve written a script which does it with totem-video-thumbnailer.

(myth-thumbnailer.py — download)

#!/usr/bin/python
import MySQLdb, os, re

if not os.path.exists("/usr/bin/totem-video-thumbnailer"):
  raise "This script requires totem-video-thumbnailer"

# read DB connection parameters
fp = open("/etc/mythtv/mysql.txt")
DB = {}
for line in fp:
  if line.find("=") != -1:
    k,v = line.strip().split("=",1)
    DB[k] = v

required_keys = ["DBHostName", "DBUserName", "DBName", "DBPassword"]
for k in required_keys:
  if not DB.has_key(k):
    raise “Missing MySQL connection detail: %s” % k

# connect to database
con = MySQLdb.connect(DB["DBHostName"], DB["DBUserName"], DB["DBPassword"], DB["DBName"])
crs = con.cursor()

# get location where thumbnails are stored
sql = “select data from settings where value = ‘VideoArtworkDir’;”
crs.execute(sql)
VIDEO_DIR = crs.fetchone()[0]
# get all files without covers
cmd = ‘totem-video-thumbnailer -j -s 600 “%s” “%s” >/dev/null 2>&1′
sql = “select intid, filename from videometadata where coverfile = ‘No Cover’;”
crs.execute(sql)
VIDEOS = []
while 1:
  data = crs.fetchone()
  if not data: break
  intid, filename = data
  parts = filename.split(os.sep)
  output = re.sub(”[^a-z0-9_]“,”_”,”_”.join(parts[-2:]).lower()) + “.jpg”
  full_output = os.path.join(VIDEO_DIR, output)
  if os.path.exists(full_output):
    pass
  else:
    cmd_exec = cmd % (filename, full_output)
    print “Thumbnailing”, os.path.split(filename)[1]
    os.system(cmd_exec)
    VIDEOS.append((intid,full_output))

sql = “update videometadata set coverfile = %s where intid = %s limit 1;”
for intid, thumbnail in VIDEOS:
  crs.execute(sql, (thumbnail, intid))
  print “Added %s to database” % thumbnail

Touchscreen on both sides

February 8th, 2008

Someone should make a mobile phone which has a touchscreen on both sides (front and back), with one being the phone stuff and web browsing and the other side being music. If you get a move on you’ll be able to have it out by August when I need a new phone. Touchscreens make sense as an interface to me, despite what Nokia say and despite lack of tactile feedback. I don’t like my Nokia E50; it keeps running out of memory when I try and do things like play music and browse the web at the same time. Six months of research ahead, hooray; don’t want an OpenMoko Neo because the device itself is clumsy, don’t want an iPhone because I don’t like the restrictions, don’t want the LG Viewty because the OS is horrific, don’t want the Samsung Armani because I can’t read books on it or browse the web properly, blah blah blah. If I wasn’t so picky about this stuff then I’d be a lot better off. Android is coming, though, and the OpenMoko OS is coming too; might be possible to have an open source phone by August, if I’m lucky. Something to look forward to, there.

There can be no FUD

February 8th, 2008

Ben Darlow accuses Bruce Schneier of spreading FUD about the iPhone.

This isn’t lock-in, it’s called choosing a product that meets your needs. If you don’t want to be tied to a particular phone network, don’t buy an iPhone. If installing third-party applications (between now and the end of February, when officially-sanctioned ones will start to appear) is critically important to you, don’t buy an iPhone. It’s one thing to grumble about an otherwise tempting device not supporting some feature you would find useful; it’s another entirely to imply that this represents anti-libertarian lock-in. The fact remains, you are free to buy one of the many other devices on the market that existed before there ever was an iPhone.

Ben, I’m not sure how it’s possible for “lock-in” to exist, if that’s your necessary condition for it. That’s got nothing to do with iPhones. Don’t like how Microsoft lock you in with Exchange and Outlook? You should have chosen different mail programs. Don’t like how you’ve been locked into the iTunes Music Store because you’ve got an iPod? You should have bought a different music player. Don’t like how you’ve been locked in to anything? Shoulda bought something else, dude. Lock-in doesn’t exist. We are never forced to do anything. We have always been at war with Eurasia.

Your iPhone comes with a complicated list of rules about what you can and can’t do with it. (Schneier)

Now I’ve been looking through the exquisitely arranged packaging that mine came in and I’m still struggling to find that list! Perhaps it’s written in black smallprint on the underside of the lid? You know, the lid that’s black?

Nope, it’s better than that. It comes with a complicated list of rules about what you can and can’t do with it and you’re not allowed to see the list. For one example: you can use your Bluetooth headset to make calls but not listen to music. That’s a rule: I’d actually prefer it if it said that on the box, but it doesn’t. You get to buy it and then find out that it doesn’t work, or you get to research all the things you might want to do online first. Don’t get me wrong, the iPhone’s a lovely device; it’s pleasurable to hold and enjoyable to use, which is not something you can say about very many bits of electronic equipment at all. For 90% of the people who want it and don’t want anything more, it’s perfect; it’ll read their email, browse the web, and make phone calls. The complaints that people who complain about it have pretty much boil down to how arbitrary-seeming the restrictions are. What was all that crap about how iPhone-native apps might overwhelm the cell network, eh? Since the iPod touch also needs jailbreaking, that was clearly bullshit. Still, apps are coming, so perhaps that’ll make it all better. There are plenty of people who hate the iPhone, and Apple, way more than they deserve, but there are equally plenty of people who flat-out refuse to hear a word against the device or anything else that comes out of Cupertino. If you’re somewhere in the middle ground on this, like most people are, and you’re prepared to put up with the restrictions that Apple put on you to get the good experience they provide, you go for it. If you get fucked, then that’s the way it is, but hey: sometimes being fucked is nice. That’s why the human race still exists, after all.

Five things you don’t know about me

February 7th, 2008

That git Steve pokes me with the latest trendy meme (which is not actually latest as I think it got started some time in the Middle Ages), and I do believe I got similarly poked by Matt Revell on the same subject a while back. So, five things you don’t know about me. I ought to note that I don’t think that there are five things that no-one knows about me, so you may know some or all of these.

  1. I have ankylosing spondylitis, a “chronic, painful, degenerative inflammatory arthritis primarily affecting spine and sacroiliac joints, causing eventual fusion of the spine”. The painful bit is certainly right; the medical stuff I take on trust. So, y’know, thanks a lot for that, Dad. It’s an autoimmune disease, which is a term you never hear except on House where they say it all the time, although on that programme they all have some kind of horrible serious thing that’s going to kill them in two hours.
  2. I’m moving jobs. In mid-March I leave Mills & Reeve, the law firm where I’ve worked for eight years, and I go to GCap Media, who own loads and loads of commercial radio stations. I’m pretty excited about this.
  3. I was interviewed on BBC Radio Norfolk once, along with Kam, Natalie, and Urgit, about alt.fan.eddings.
  4. I can roll my tongue. Apparently it’s genetic; only some percentage of the population can do it. No idea why this is a useful genetic talent, although Richard Dawkins probably has a theory that it’s all to do with making me more sexually attractive to women to increase my chances of passing on my genes or something.
  5. I haven’t seen any of the first three Star Wars films (that is, the last three in creation date but the first three of the nine, if you see what I mean). Just never got around to it. People keep telling me that I should do, and I just can’t be arsed with it.

Is anyone else tempted to just make shit up in these things? “I am really Harlan Ellison.” “I can suspend myself from a ledge by one finger.” “I have a third eye in the back of my head.” “I can haz cheezburger.” It’s pretty tempting.

I’m supposed to tag other people. Don’t break the chain, etc, etc. To be honest I think this stuff gets made up by demons who are determined to make the human race endure the psychic pain of trying to think of things which are simultaneously (a) interesting (b) secret (c) not too secret. I mean, if I was really a Russian spy or had a third bollock or something, am I likely to talk about this on the internet? Nonetheless, it is now my solemn duty to make five people suffer as I have suffered. I think we’ll have Aquarion, Christian Heilmann, Mr Ben, Sam Rowe to see if he’s still alive, and Davyd Madeley.

LugRadio Live UK dates announced

February 7th, 2008

What with all the excitement over here in LugRadio Towers about the upcoming LugRadio Live USA (April 12th-13th in San Francisco! Cool speakers! An exhibition of greatness! You can’t afford to miss it!), some people might be thinking: have we forgotten about the UK? And the answer is, hell no. LugRadio may be going international this year for the first time, but we’re still here in the UK as well. I am pleased to be able to say that

LugRadio Live 2008 UK will be happening on the 19th and 20th July, in the Wolverhampton University Student Union, Wolverhampton, UK!

We’re pretty heads-down sorting out the US event at the moment, but if you’re interested in speaking or exhibiting at LRL UK this year, let us know — the big push for this will start when we get back from America. European and UK people: Get ready.

Another year passes

January 30th, 2008

I get up each morning, dust off my wits,
Pick up my paper, and read the “Obits,”
If my name is missing, I know I’m not dead.
So I eat a good breakfast, and go back to bedgo to work, depressingly enough.

Actually, I am not that old. I am today, however, another year older! Traditionally you all get to guess my age, and this year is no exception. In the past I’ve been complained at for always making the quizzes mathematical (Well, duh. You are guessing a number. What were you expecting?) and so this year we have two separate tests. Also, there are points. I have a high opinion of my readers* and thus I feel confident that you’ll do well here.

As of today, and for the next 365 of your Earth days, my age is, in decreasing order of difficulty to work out:

Quiz for maths people, people who wear glasses, or people who consider themselves clever*

  • the Saros number of the solar eclipse series which began on September 24, 1957 BC and ended on March 10, 460 BC
  • the smallest number n with exactly 7 solutions to the equation φ(x) = n
  • the atomic number of germanium
  • 273.15K in Farenheit
  • the fifth power of two
  • my age in 2004 plus four

Quiz for thick people, liberal arts majors from the US, people who work in MacDonalds, and Jono

  • the number of variations in Bach’s Goldberg variations
  • my age in 2006 plus two
  • 32

If you got down to the bottom of the quiz most appropriate to you and still don’t know the answer, try the other quiz. If you’ve done both and still don’t know the answer, then your shipment of fail has arrived in style and you should give your computer back since I’m surprised you’re able to operate it. I’ll take it off your hands tomorrow; today I’m too busy enjoying my birthday. It started rather well, but now I’m at work. Still, we all have our crosses to bear, especially those who still don’t know how old I am.

Same age as Christ was when he was crucified, allegedly, although I thought that was next year. If the stigmata* show up I’ll be sure and report it.

Firefox usage at 28%

January 29th, 2008

Blimey. According to Wired’s report on a “well-regarded as being accurate” XiTi survey, IE usage in Europe is at 66%, with Firefox second at 28%. Safari and Opera are both under a twentieth of the browsing population. Interesting stats, although all browser statistics are unreliable. I occasionally forget to stick my head out of the overheated greenhouse that is the web hacker community; looks like in the real world, Firefox is doing pretty well! Good work the FF team.

LugRadio Live USA: call for papers

January 28th, 2008

We are now 74 days away from LugRadio Live USA at the Metreon in San Francisco, and the Call For Papers is open! We’ve already confirmed some great speakers — Jeremy Allison, Aza Raskin, Val Henson, Ben Collins, Ian Murdock, John “Magnatune” Buckman, Robert Love, Dan Kegel — but we want more. If you want to speak at LugRadio Live, and you can be in California on the 12th-13th April this year, we want to hear from you. Drop us a line before Friday 15th February and tell us what you want to talk about!

We’re collecting names of exhibitors, too. This year we’re really keen to get some cool stuff into the exhibition. If you’re part of a project and want to demonstrate it, or you’ve got some cool technology you want to show off, or you think people would love to see what your company does, get hold of us and let us know. Exhibition space is free, too!

To find out more about LugRadio Live, take a look at the website and what is LRL?.

Media players and the TV

January 26th, 2008

I’ve spent a while trying to get Elisa to work on the computer attached to my TV (a PPC Mac Mini running Ubuntu). Video was slow and jerky, and there was a strange white bar graphical glitch. Anyway, after fighting all day with it, compiling the latest version of Elisa and so forth, I eventually gave up and installed MythTV. And it works perfectly.

I don’t really want MythTV. I prefer GStreamer-based applications, because I think GStreamer is the way forward, and Myth does a mountain of stuff that I don’t want, like watching live television; all I want to do, for the moment, is watch recorded video files. I like Elisa’s interface more than Myth’s. I’m more able to write Elisa plugins than I am for Myth.

Still, Myth (using VLC as the playback program) works fine, and Elisa doesn’t, and I don’t think Elisa will get better; it seems that the problem might be the open source ATI drivers, which aren’t (apparently) as good as the closed source ones. I can’t run the closed source drivers, though, because they don’t exist for powerpc, which is what the Mac Mini is (even ignoring that I don’t want to run them because they’re closed source). So MythTV it is. There is probably a lesson here.

Making the arrow keys work in VLC

January 26th, 2008

One of my big flaws with the VLC media player is that you can’t use the arrow keys to skip backwards and forwards in a video. It turns out that this is because the left and right arrow keys are already configured to mean “navigate around a DVD menu” and you can’t configure a key twice. So, if you need to use VLC for something, and you want the arrow keys to work, go into the settings and set the DVD navigate options to something other than Left and Right. Then configure “jump forwards” and “jump backwards” to Right and Left, and then it’ll work. God knows why it has to be this way, but at least if you do that it works.

DVD slideshows under Linux

January 16th, 2008

Philip Newborough notes that in the last LugRadio episode I said that I planned to release more odd bits of software. (He also illustrated this with a snippet of audio from the show; since we’re trying to relax our licence to allow this sort of thing, it’s great that people are taking advantage of that!) The problem I outlined on the show itself is that I write lots of little bits of software for me, but I don’t release them. They’re not generally applicable or easy to install: they’re not designed to be polished, public-friendly software in any way. Now, I’m a huge opponent of this. There’s a pervasive myth among non-Linux users that all the software on the free desktop is complicated and thorny and command-line driven, and it requires you to edit configuration files and compile it yourself. It’s not like that, not at all, if you don’t want it to be. However, these little bits of software I write purely for myself are like that; they’re not for general distribution. So, I don’t release them, because I don’t want to add more fuel to the fire for the sneering hordes who say that Linux is hard to use. Over pizza earlier this year, it was brought home to me that that might not be the best idea; even though these little hacks aren’t useful to the general population, they might be useful to someone. So, my resolution, if I have one for this year, is to get more of this stuff out there.

Update: Greg Grossmeier is doing the same thing after I talked about releasing scripts on LugRadio. That’s really cool; it’s lovely to hear when people go with a suggestion!

The first one is a thing to create DVD slideshows under Linux. My dad said to me over Christmas that a friend of his would, on return from holiday, give out DVDs with all the photos from the holiday on in a nice little slideshow that you could watch in your DVD player. Was it possible, he asked, for him to do the same thing on his (Ubuntu) desktop? Of course, said I, and then started looking into how to do it.

The base way that everyone does this on Linux is with the dvd-slideshow shell script, which uses tools like mplayer and so forth to do the work. There are GUI clients for it but they’re all really complicated; what you want ideally is something where you just drag photos into it, select transitions if you want to, and click the “go” button. There’s also an extension for F-Spot, but it’s not actually distributed with F-Spot yet and my dad doesn’t use F-Spot anyway. (There isn’t an extension that does this in a sane way for digikam, as far as I can tell.) I at first sat down to my keyboard thinking that I’d write a nice PyGTK + GStreamer application that would do this right, before discovering that you can’t really take a load of photos and make a nice slideshow out of them with GStreamer. (You sort of can, with multifilesrc, but not really; you can’t feed it arbitrary files, it doesn’t do transitions, etc.) Then I thought: I’ll do a nice application that wraps dvd-slideshow, and then I couldn’t be arsed.

So instead, I wrote a script for my dad: make-dvd-slideshow.

The way this script works is that you hardcode the name of a folder into it. It looks in that folder, makes all the images in that folder into a slideshow, adds an mp3 as a soundtrack if it finds one in the folder, and then drops the resulting .iso file onto your desktop ready for burning. You’ll need to change at least FOL="/home/aquarius/Desktop/Olivia Party 2" to be the location of the magic folder (I put one on my dad’s desktop, called “DVD Slideshow”, and hardcoded it into the script) and then run the script (I put a launcher on his desktop, in that folder, which launches the script in an xterm). Enjoy this: if you think it sucks then I’d love to see someone write something better, and tell me about it when you do; if you want to write something better but aren’t sure how to do it then I’ll happily write you a spec of how I think it should work :-)

Odds and sods again

January 16th, 2008

A random collection of things that I don’t have enough time to properly write about but which ought to be noted for future reference:

  • All sorts of news in the world of Humanized. Enso is now free to download, although disappointingly not Free Software. However, Jono di Carlo has left a comment suggesting that that might happen; my fingers are crossed. I’d love to see Humanized and the free desktop in partnership, because I think their work is excellent, and we have a dearth of good usability engineers. Another potentially great move in this direction is that Mozilla Labs have hired some of the Humanized engineers.
  • We’ve announced dates for LugRadio Live USA: come to the greatest show on earth on April 12th and 13th 2008 in the Metreon, San Francisco. I’ll shortly be allowing people to register for the event; at the moment I’m trying to decide precisely how to do it. Paypal’s a pain (because they hassle you to create an account if you don’t have one), Google Checkout requires you to have a Google account as far as I can tell: any other suggestions for how to do online registration are welcomed.
  • Adam Jackson writes that the phrase “Linux is about choice” is holding everything back: “It strangles the mind and ensures you can never change anything ever because someone somewhere has OCD’d their environment exactly how they like it and how dare you change it on them you’re so mean and next time I have friends over for Buffy night you’re not invited mom he’s sitting on my side
    again.” I couldn’t agree more, I really couldn’t. Well said, that man.
  • Stuart Colville (currently fourth in a a Google search for “stuart”, one place behind me, ahaha, take that, Colville!) writes about the new Macbook Air and compares it unfavourably to the Eee PC. I’m a big fan of the Eee, because Asus have the right idea; there are lots of similar sub-notebooks coming out which all have the idea “we need to make a small notebook” but don’t have the idea “and we need to not charge a thousand pounds for it”. I know lots of people who have bought an Eee, precisely because it’s two hundred pounds, and it’s actually a really nice machine. We were keen on it on LugRadio, too (and don’t forget that we’re giving an Eee away; go enter the competition. Good work Asus, I say.

Is it my fault?

January 9th, 2008

Jeremy Keith writes about where the fault lies:

If I’m on the tube listening to my iPod—because, y’know, that’s exactly the kind of situation for which the iPod was invented—and somebody steals said iPod, which is illegal, is that my fault? If I publish my email address online—because, y’know, I actually want people to be able to get in touch with me quickly and conveniently—and it gets harvested by scum-sucking spammers who send unsolicted commercial email, which is illegal, is that my fault? If I utter my date of birth or my mother’s maiden name—because, y’know, I don’t believe that information should be a state secret—and somebody uses that information to “steal my identity”, which is illegal, is that my fault?

Nope. None of those things are your fault. In a similar way, another Jeremy, Top Gear presenter Jeremy Clarkson, published his bank details in a newspaper in an attempt to prove that the furore over the UK government losing the personal data of 25 million people was a storm in a teacup. Of course, someone used those details to set up a £500 direct debit to a diabetes charity, so he’s now a monkey out of pocket. That act is basically theft; theft is illegal. Was that Clarkson’s fault? No, not really. He wasn’t at fault. What he was was imprudent, deeply so. (And deservedly so, I feel. Clarkson is one of my favourite presenters, and I have boundless respect for his knowledge of cars and engineering and his personal style; he knows a round brown fuck-all about technology, though.)

Look, it works like this. If you believe that the world should be open (which I do), then you can’t insist that if someone takes advantage of that openness, it’s Someone Else’s Problem. It’s your problem if they take advantage of your data. If you want to be open, to publish, to break down barriers that stop us properly communicating, then that’s a great idea… but each person then becomes individually responsible for their own security. On the other hand, if you want someone else to make the hard decisions for you, to accept liability and take responsibility for problems, to protect you so you can go about your life unscathed, then that someone else gets to make the decisions about what you do with your data, and you don’t.

If you ask your bank “should I publish all my bank details online?”, they’ll say: no, don’t do that. If you ask the police “should I leave my iPod visible on the tube?”, they’ll say: no, don’t do that (and that’s what the “byepod” posters are all about). If it’s the police’s responsibility to keep your iPod safe (by tracking down criminals who steal it) then they get to have some measure of control over what you do with it.

If you demand the ability to do what you like with your stuff, then you have to take on some of the responsibility for protecting it. It can’t work both ways; you can’t have all the benefits of openness (I can publish my email address where I like!) and none of the deficits (someone else must solve my spam problem!). With great power comes great responsibility, as Uncle Ben tells us. It’s not about blame, it’s about prudence. It’s not about taking decisions out of fear, it’s about taking responsibility for life. We’re all grown-ups now. No more hiding under the bedclothes and letting Daddy protect you from the big bad world.

Epiphany download icon

January 8th, 2008

Did you know that Epiphany puts a little icon in the notification area while it’s downloading stuff?

epiphany download icon

Well, you might have mentioned it to me, because I didn’t know. Anyway, that’s really cool. A couple of minor issues with it; firstly, the icon has a right-click menu with only one option, “Show downloads”. Since left-clicking the icon shows and hides the download window, I can’t think what the point of the right-click context menu is; surely right-click should just do the same thing as left-click? (Bug #508151 submitted.)

Secondly, and not really an Epiphany problem; I’d love to see the “downloads” window go away, to be replaced by a “Downloads” folder which has Special Nautilus Magic when displayed. The folder could show partial downloads in progress, with how long there is to go, a clickable link to the page it was being downloaded from, etc, etc. This requires some heavy co-operation between Epiphany and Nautilus (although it might be doable as a Nautilus extension; having said this, I can’t find a way to add a top bar (like Deleted Items has or the CD burner has) to a Nautilus folder from an extension), and I’m certainly not the first person to suggest it, but I think it’d be deeply cool.

Technology I would like that isn’t here yet

January 4th, 2008
  • A head-up display on my glasses (not something like the Lumus Optical ones that make you look like a tool)
  • A data projector for my mobile that I can actually buy (everyone currently doing these is (a) still in pre-production and (b) not selling them to consumers (because they want to sell a million of them to Motorola, not one of them to me)
  • Memory diamond
  • My cigarette-pack laptop

Are we not in the future yet? Where’s my jet pack? What should I be hoping for?

Drowning in the backscatter

December 19th, 2007

Every now and again, some shit-eyes of a spammer decides to send a million spams and forge my address as the sender. So I come back to my email and find four hundred messages, all of which say something along the lines of “your message was rejected because it was spam”, or “the user arsefish@example.org does not exist”, or “I’m on holiday until Dec. 31st”.

This is pretty annoying.

What I want to know is: how can I not drown under the weight of this backscatter? I can’t go round to each mail server admin that does it and forcibly administer a fatal beating, much as I’d like to. I read my mail with Gmail, so I can’t use procmail to filter it all first (not to mention the fact that trying to use procmail has a very similar pain/productiveness ratio to trying to insert the Empire State Building down my urethra). I’m frightened to actually mark these backscattered bounces as spam in Gmail, because if I myself actually mail someone and get a message back saying “I’m on holiday for two weeks” then I don’t want that marked as spam — I want to see it. Part of the problem here is that everything at kryogenix.org goes to me, so when spam is forged from non-existent addresses at kryogenix.org, I get the bounces. I could avoid this by blackholing all addresses that aren’t specific ones that I use, but I really like the convenience of being able to subscribe to mailing lists with the address “name-of-your-mailing-list at kryogenix.org”, so i can tell if people sell their subscription list to spammers.

Suggestions welcomed. I tried creating a Gmail filter that looked for mail that (a) wasn’t addressed to one of my main addresses (b) wasn’t a mailing list mail (c) contained words like “bounce”, “account”, “spam”, etc and then adding the label “probably-spam-bounce” to it, so that I could see if this technique would work. It doesn’t; on an average “get 400 bounces” day, it catches about 60% of them, which isn’t much good, and worse it occasionally matches real actual email I get, like Amazon “you have just purchased this item” emails. If anyone has suggestions for a better Gmail filter, or can confirm that I’m OK to tell Gmail to classify these messages as spam without much risk of many false positives, speak up. If your suggestion is “don’t use gmail” or “fetch all your email with POP and run it through procmail”, then I don’t want to do that; I understand that those methods might be better, and if deleting five hundred bounces every week is the price I pay, then I’ll pay that price.

Reigniting the browser wars

December 17th, 2007

Alex Russell calls for a return to the browser wars, citing (among other things) the stagnancy of the W3C as a part of the problem, with the argument that browser makers are the ones who can innovate and they’re being prevented from doing so by a slavish insistence on “standards”. Meanwhile, Andy Clarke calls for the current W3C CSS Working Group to be immediately disbanded, Opera file an antitrust complaint against Microsoft, the HTML5 spec removes a recommendation for non-patent-encumbered video formats after pressure from Nokia and Apple, and all the old fights start up again. Fire and brimstone coming down from the skies. Rivers and seas boiling. Forty years of darkness. Earthquakes, volcanoes. The dead rising from the grave. Human sacrifice, dogs and cats living together. Mass hysteria.

Alex has a point. There is nothing but truth in the old saw that a camel is a horse designed by committee. Evolutionary theory tells us that actual forward progress happens faster in small communities, not in big ones. Browser manufacturer innovation is exemplified by Microsoft creating XMLHttpRequest, which ushered in the shiny world of Ajax; standards committee “innovation” is exemplified by XHTML 2.0, about which no-one gives a shit. Forward the innovation. Let the browser builders off the leash of blind and feverish compliance with “standards” made up by committee.

However. Let us not forget that the problem with the browser wars wasn’t that it fragmented the world in lots of different directions. The problem with the browser wars was that it fragmented the world in lots of different directions that weren’t possible to eventually implement everywhere. Don’t think of the output of this “innovation” as XMLHttpRequest. Think of it as the IE filter property, which is, as described on that page, “not available on the Macintosh platform”. For those of you innocent of such things, this allows you, in Internet Explorer, to apply a visual effect to a bit of an HTML page, where that visual effect is actually implemented by DirectX, Microsoft’s graphics library. Good luck porting that to Safari if it takes off. Oh no, hang on, it’s “not available on the Macintosh platform”, even in Mac IE, is it? Not that Mac IE exists any more.

The point here is very much the same as the point behind objections to DRM technologies on music. When browser manufacturers are told “go ahead and innovate — we want to see progress”, it’s jolly difficult for them to not think “hey, I know, why don’t we take this opportunity to provide something that we can do and other browsers can’t? Then, when people start using it, we’ve locked all their users into our browser!” There are corporate executives the world over furiously masturbating themselves into unconsciousness at the very thought of that technique being open to them again. Perhaps you’ve bought a few products from their corporations in the past.

Standards bodies aren’t really there to think up ideas, although that’s what they seem to have evolved into. They’re there to say, now, hang on a second, if you do that then what about all the people with no working eyes / some other operating system / touchscreens / no money for patent licences. They’re there to make sure that the web, which is meant to be there for everyone, isn’t separated into the haves and the have-nots, where the have-nots is everyone who won’t or can’t jump on the latest bandwagon. This is precisely why Silverlight is trying to supplant the web: to divide us into haves and have-nots. It’s why Flash is trying to supplant the web: to divide us into haves and have-nots. It’s why XUL as an application-development language for web apps was doomed.

It’s possible that the people Alex is calling on to do “innovation” in the browser will put the best interests of the web first, and the best interests of their companies and their browsers second. It’s also possible that a duck will fly in the window right now, juggle some lemon pies, and then deliver IE8, but I don’t think that that’s very likely either. The current mess over the proposed <video> element is a perfect case in point here: Nokia and Apple have refused to contemplate using the suggested Ogg Theora video codec as a baseline format, because they fear submarine patents despite the Theora project’s assurances. OK, they may have a point. However, the HTML5 people have stated, after this pressure from Nokia and Apple, that “we need a codec that is known to not require per-unit or per-distributor licensing, that is compatible with the open source development model, that is of sufficient quality as to be usable, and that is not an additional submarine patent risk for large companies”. It is just not possible for such a codec to exist. So, what we, the ordinary web developers of the world, are left with is precisely the same cluster-fuck that we currently have when publishing video: it is still not possible for me to make a video and put it on the web with some assurance that everyone can actually see the fucking thing. How is browser vendors’ “innovation” going to help with this? If they were truly “innovative” then we’d see them trying to co-operate on issues like this, because how can it be bad for ordinary web users and web developers to make it easier to publish and watch video?

Standards organisations aren’t there to dictate what Microsoft and Apple and Mozilla and Opera are “allowed” to implement. They’re there to provide a voice for people who will otherwise be merrily buttfucked and then thrown over the side in the pursuit of “innovation”. Think Web Standards Project rather than W3C. Of course, the WaSP seems to have lost its way and its voice a bit recently; are they coming back? It’s easy to just say “no, no, no” to new ideas, but it’s equally easy to say, well, I’m alright, Jack, if you’re not coming along with us then you’ll just get left behind, regardless of whether you’re not coming along because you’re unable to. If you think that Apple were right to resist video formats, ask yourself if you’d have been happy if the HTML5 spec had suggested Windows Media format as the default. If you think that browser vendors should innovate, ask yourself how happy you’d be implementing DirectX on a Macintosh. Fix things, yeah. Put some innovation back in, yeah. Let’s, though, try to not throw out the baby along with the bathwater.

On the radio

December 14th, 2007

Blimey, tonight I’m on the radio.

Specifically, the Wolverhampton Politics show on WCR FM. I’m talking about digital rights and DRM and that sort of thing. It’s available as a stream — I should be on somewhere around 7.15pm this evening — and it’s also downloadable (episode should be available on Sunday or thereabouts). And if you’re in Wolverhampton itself you can listen to it on the actual radio. Cool.

Negative numbers in the Google Chart API

December 8th, 2007

Google’s new Chart API is a useful little thing that returns a PNG of a chart based on the URL you feed it, so you can create graphs like this:

a simple example line graph

by just specifying the <img> src attribute as http://chart.apis.google.com/chart?cht=lc&chs=200×125&chd=s:helloWorld&chxt=x,y&chxl=0:|0|10|20

However, as Marty Alchin rightfully complains about, it doesn’t handle negative numbers at all. Obviously Google, being the internet success story that it is, never has any numbers for anything that dip below zero, but not everyone’s so lucky. However, there are ways to handle negative numbers in the Google Chart API.

Sort of, anyway. This is a bodge. Hold your nose and dive in. I’m sure Google will forcibly inject clue into their charting engine at some point, but until then you can sorta-kinda get around the problem like this.

a simple line graph with negative numbers

For line graphs with negative numbers, you need to do two things. First, lie about the values on the y axis (so you display on the graph that the y axis goes between -10 and 10, in the above example, even though it actually goes between 0 and 20). You’ll obviously need to transform your numbers appropriately, so a data series [-10, -5, 0, 5, 10] should be fed to the graphing engine as [0, 5, 10, 15, 20]. The second thing to do is to draw a horizontal line at 0 on the y axis; if we had real negative number support then that’s where the x axis should be, and so the extra drawn line “stands in” for it. That’s easy enough to do, using the grid lines chg parameter; just make the grid only exist horizontally, and have the grid divide the graph into two 50% parts, with chg=0,50,1,0. The four parameters 0, 50, 1, 0 mean “don’t draw vertical grid lines (0)”, “draw a horizontal grid line every 50% of the y axis (50)”, and “make the line solid with no gaps (1,0)”.

It’s also possible for bar graphs, although it requires a small amount more ingenuity.

a bar graph with negative numbers

This graph has negatives, right? Well, how it’s done might be clearer if you see this graph:

a bar graph without negative numbers, with the parts 'below the line' coloured in

Yep, you just stack up the bars, and make the bottom bit of the stack be transparent (note that in the first graph we have chco=00000000,ff0000,0000ff, which specifies colours for each data series; the first item in there is 00000000, which is in format RRGGBBAA, meaning 0% red, 0% green, 0% blue, and 0% visible. Actually, it could have been ffffff00, or deaded00, or anything; all colours are the same when they have 0 opacity! The second graph is exactly the same, except now the transparent bars are shown in green so you can see how it’s done.

You’ll note that all these graphs still have the “real” x axis (the line at the bottom of the graph) still visible. This is because there’s no way to turn it off, which is unfortunate both for this fake-the-negatives approach and because you can’t do decent sparkline graphs if you have to display the axes.

Both of the tricks above are horrible fudges which only need to exist until the Google Chart people rediscover the minus sign on their keyboards, which I’m sure is already in their bugtracker somewhere. If it’s not, then here, Google, take some of these: - - - - - - - - - - - - - - - - - - - -. Hope you find them useful.

Epiphany

December 5th, 2007

A little while ago I decided to try out Epiphany instead of Firefox as my main browser.

It’s excellent. It’s a proper Gnome application, which Firefox isn’t — it just fits in to my desktop because it has a proper Gnome interface, and I really like that. It starts up and runs way faster than Firefox does; it doesn’t crash like Firefox does; it does everything. Huge applause for the Epiphany team, I say. Install the epiphany-browser package on Ubuntu to get it. It uses the same rendering engine as Firefox, so the whole web still works perfectly.

I’ve heard a fair few people bitch about not having access to Firefox extensions, but, frankly, it turns out that I don’t actually need any of them. Epiphany actually comes with a load of extensions (install epiphany-extensions on Ubuntu to get them) and there are third-party extensions too if you like. I’ve changed my opinion on this; I did think that it was bad that extensions need to be written in C or Python rather than XUL/JavaScript, but hey.

Of course, the one big missing thing for me, when I have my web hacker hat on, is Firebug, which is the greatest web development tool that’s ever existed. Wish that existed.

Epiphany is also the default browser in the next release of Gobuntu, which is what I run, so I’d have been migrating to it anyway — it’s jolly pleasing to note that it’s actually better, too.

Capturing Caps Lock

December 4th, 2007

Another JavaScript usability tweak from Stuart’s House Of JavaScript Weirdness: alert users if they’ve got Caps Lock turned on when they’re entering passwords into your web applications.

Capturing Caps Lock

Just install the script and go!

The other nice thing about this is that it’s part of 24 ways, the thing Drew McLellan runs every Advent showcasing 24 cool web things. I’m pretty pleased to have been invited. Drew is pretty pleased that this year I didn’t promise him something and then renege :)

Showing source in Firefox

November 28th, 2007

Annoyed that Firefox pops up the source of a page in a separate window when you View Source? Annoyed that Epiphany shows the source of a page in Gedit? Help is at hand! Simply drag the following link to your bookmarklet bar:

Toggle source

Clicking it will replace the page you’re viewing with that page’s source, nicely syntax-highlighted, in the same browser tab. Clicking it again will go back to the page. That should keep Sean Middleditch happy and stop complaints about Epiphany using Gedit as an HTML viewer.

(Warning: I don’t know what happens if you do this on a page where you’ve just posted some data, like if you’ve just placed an Amazon order or something. Don’t do that.)

A limited number of boots

November 25th, 2007

“We are kicking arse, but there is a lot of arse to kick and only a limited number of boots.”
Jono on the free software world

Wordpress through Subversion

November 23rd, 2007

I have to say, I’m liking Wordpress’s install-with-subversion documentation. This will make it a lot easier to upgrade…

(update, 11.05: well, theoretically…)

(update, 11.12: you have to remember to upgrade the database once you’ve installed)

In short, making your Wordpress installation be a Subversion checkout seems like a great idea to me. It works easily (the WP people have instructions on how to convert your existing WP installation into a checkout of Subversion), they’re careful about tagging each new release (so you can upgrade just when releases happen; you don’t have to track the unstable bleeding-edge of Wordpress), and when a new release happens, upgrading is as easy as svn switch http://svn.automattic.com/wordpress/tags/NEW_VERSION/ followed by visiting http://server/wordpress/wp-admin/upgrade.php, and upgrades don’t come much easier than that, if you’re a techie like me. Good work, Wordpress team.

@media Ajax 2007

November 22nd, 2007

Finally returned from @media Ajax 2007, and I had a great time. I was a presenter, talking about How To Destroy The Web, which I thoroughly enjoyed doing. My slides are here:

(in-line presentation made with a bodged version of John Resig’s easy PDF sharing, but using libpoppler’s pdf2ppm because libpoppler can read my PDF and GhostScript can’t, for whatever reason. You can also get the presentation as a PDF or see it on SlideShare if you’re a freedom-hating Flash person.)

It was a great conference. Particular highlights for me were Derek Featherstone talking about accessibility (since I don’t know anything about it and I should do), being asked to be on the panel at the end (with Alex Russell (!) and Douglas Crockford (!!) and Brendan “inventor of JavaScript” Eich (!!!)), the coolness incarnate that is Firefox 3 and whizzy SVG stuff, having Chris Heilmann spend two days trying to convince me how nice London was even though it did nothing but piss rain solidly the whole time I was there, finally meeting John “Kelly Osbourne” Resig, and having a rather pregnant lady (who may have been this lady) tell me that my talk was so funny that she nearly gave birth during it. That’s not a compliment you hear every day, that one; I was pretty chuffed with that, I have to say. Thankyou!

The usual suspects have photos on Flickr (tag seems to be “atmediaajax”); the wifi didn’t work (but it never does, at any conference); we’re discussing what (if anything) to do with the WaSP’s DOM Scripting Task Force (set up after @media 2005: the question is, do we still need a “task force”? Hasn’t DOM scripting now become part of the toolkit? It does still need to be used properly, in moderation, and not be critical for it to be present, but the concept doesn’t need evangelising any more, I don’t think); I shall be back for @media 2008. Great work Patrick and your orange-shirted helpers. Cheers to a cool bunch of people: it was great to catch up with Jeremy again, and having a beer with Drew and Rachel and Chris and ppk and Bruce and Harry and Alex and oh, just everyone is a good way to spend an evening. Maybe even more than one evening.

A “presenter view” for OpenOffice presentations on Linux

November 22nd, 2007

Earlier this week I was at @media Ajax, and it was great — more in an upcoming post. First, though, a quick bit of scripting I did. You see, it’s become apparent to me that I need a “presenter view” when I’m presenting; I have my laptop running dualscreen, so that the view I get on the laptop screen is not the view that appears on the projector. I need this, because I’m not Derek Featherstone; I can’t just see the slides and remember everything that I need to say. My slides are often just a single word, or a picture, and I can’t remember the thread of what I’m aiming at without notes.* So, I used to have notes on a bit of paper. The way I create presentations is:

  1. Write out, longhand, everything I intend to say, word-for-word, like it’s an essay or a playscript
  2. Go through my longhand script and identify all the slides I want to put in to bolster the points
  3. Spend some time with Flickr’s Creative Commons image search finding the images that I want for slides
  4. Put together a presentation
  5. Make notes for each slide expressing the bullet points of what I want to say, with notes to myself to remind me of any particular phrases I want to specifically remember
  6. Throw away the longhand script

The final step, after that lot, used to be “write out all of the notes in big writing on bits of A4 paper”. Then it occurred to me: why not use the presenter view to put my notes on? I used S5, Eric Meyer’s in-browser HTML/CSS/JavaScript based presentation system, for a long time to make my talks, and it has a presenter view. However, I got increasingly hacked off with it being slow and annoying, and so I resolved to use OpenOffice for presentations; it’s just easier. OpenOffice, though, doesn’t have a presenter view (there’s a spec for it, but it doesn’t yet exist). After a bit of casting about, I discovered that (a) OpenOffice will export presentations to PDF, and (b) Evince, the Gnome document viewer, has a presentation mode. So, thought I, I could use that instead. OpenOffice allows you to export the notes pages too into your PDF: if you’ve got three slides in your presentation*, each with notes, and you elect to include notes pages in the PDF export, then you get six pages in the resultant PDF — the first three are just the slides, and the second three are the slides at the top of the page with the notes below.
So the idea appeared in my head: why not open the PDF twice, put PDF-1 on page 1 and display it on the projector, and PDF-2 on page 4 (the first notes page) and display it on my screen? Then just get them to advance in lockstep — when I advance the projector PDF by one page, it advances the notes view on my laptop screen by one page as well — and lo, I have a presenter view.
Those of you with (a) modern versions of PowerPoint or (b) whatever the Mac presentation thing is called are doubtless laughing your heads off right now, and rightfully so. I can’t wait for the OpenOffice people to make this happen properly.

Anyway, to do the advancing, you need a little script. This little script uses dogtail to provide the presenter view, and I used it on Monday and it worked perfectly. Be warned: this is not a proper solution. It’s a crappy hack, and if it de-bones your cat and deletes everything on your hard drive, don’t come crying to me. Almost certainly requires Linux, requires dogtail (and accessibility mode turned on in Gnome (NFI whether KDE has the same features, but it probably does; if you use something other than Gnome or KDE then you’re on your own, you freak)), requires Python and PyGtk, requires Evince (which should be called “Document Viewer”), requires a PDF (that has been exported from OpenOffice.org Impress with notes page included) on the command line, requires a laptop that can do dualhead (mine seems to set up the two screens as One Big Screen, so I don’t know what happens if you have something that actually does it properly), probably requires the phase of the moon to be right as well. Enjoy.

Evince presenter view

import gtk, sys, random, shutil, os, time
from dogtail.tree import root

pdf = sys.argv[1]
# copy pdf to /tmp
pdfcopyname = “pdf.%s.pdf” % random.random()
pdfcopy = “/tmp/” + pdfcopyname
shutil.copy(pdf, pdfcopy)

# start two evinces
os.system(”evince –presentation –page-label=1 %s &” % pdf)
os.system(”evince %s &” % pdfcopy)

# find them with dogtail
time.sleep(2)
from dogtail.tree import root
evince = root.application(”evince”)
pdfw = evince.window(os.path.split(pdf)[1])
pdfcopyw = evince.window(pdfcopyname)
halfpages = int(pdfw.child(roleName=”tool bar”).child(roleName=”label”).text.split()[1]) / 2
pdfpageel = pdfw.child(roleName=”tool bar”).child(roleName=”text”)
pdfcopypageel = pdfcopyw.child(roleName=”tool bar”).child(roleName=”text”)

def ping():
  global pdfw, pdfcopyw, halfpages, pdfpageel, pdfcopypageel
  try:
    pdfpage = int(pdfpageel.text)
    pdfcopypage = int(pdfcopypageel.text)
  except ValueError:
    # pdf window has been destroyed, probably
    raise “die”
  if (pdfpage + halfpages) != pdfcopypage:
    pdfcopypage = pdfpage + halfpages
    pdfcopypageel.text = str(pdfcopypage)
    pdfcopypageel.doAction(”activate”)

  return True

pingobj = gtk.timeout_add(500, ping)
try:
  gtk.main()
except:
  os.unlink(pdfcopy)

Cruciforum v1.24

November 11th, 2007

Some upgrades to Cruciforum, which fix things like character encoding (it now actually gives a damn about utf-8, which is better than it was before) and individual-post linkability. I’ve also fixed almost all the HTML validity problems, but not quite all of them, so the HTML’s still invalid. It’s still on the bug list to fix, that, although next might be OpenID. I’ve also clarified that it’s GPL.

LugRadio tests the latest distros

November 5th, 2007

In the latest episode of LugRadio, “One From Four”, we test four Linux distributions — Mandriva 2008, Ubuntu 7.10 Gutsy Gibbon, OpenSuSE 10.3, and Fedora 8 beta — in a series of real and ordinary tasks. Printing, connecting via Bluetooth, playing Ogg Vorbis and MP3, watching Youtube, using wireless. Is Linux really ready for ordinary people on the desktop? Well, we had fun finding out. Four identical machines, four non-identical presenters, four Linux distributions. The results were pretty entertaining to discover. (I ought to note that it was a little unfair on Fedora, since we were using a beta, but Fedora 8 isn’t out yet; certainly it did not embarrass itself!)

Also in this episode, the odd world of Machinima (making animated films using 3D game engines), the odder world of the Otherkin (what the fuck is that all about?), and a chap from Mandriva gets repeatedly beaten about the Mandrake Club. Plus all the usual fun and games. Go listen and tell us what you thought by email or phone or on the