This is as days pass by, by Stuart Langridge

Showing source in Firefox

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

"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

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

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

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

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

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 LugRadio forums.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.