Posts from October 2006.

Comments fixed again, I think

For all those of you who mailed me to say that comments were broken, thanks, and they should now be fixed. I think. Let me know if they screw up again!

Jackfield doesn’t work under Ubuntu Edgy 6.10

If you’re trying Jackfield and you’re running Ubuntu Edgy 6.10, you may have discovered that it doesn’t work. The D-Bus API has changed again. I’ll be updating Jackfield shortly; news will appear here when done!

Fonts and xchat

Couple of outstanding things:

Are you annoyed by how xchat-gnome in edgy hangs for ages when you connect to a server, because it’s popped up the channel list? Yeah, so am I. Set it to auto-join a channel (doesn’t matter which one, so make one up if you want) in Edit > Preferences > Networks > (network) > Edit > User and Channels and it’ll stop doing it. David Trowbridge and the xchat-gnome people are aware of how annoying this is and they’re doing something about it.

Are you also annoyed by having blurry anti-aliased TTF fonts* in gnome-terminal? The font I really like for terminal windows is ProFont, which looks really, really clear at tiny sizes like 7pt, because it’s a bitmapped font (also called a PCF). Normally, you make a font available to your apps by dropping it in the .fonts folder*, but bitmapped fonts aren’t enabled by default. From a terminal, run sudo dpkg-reconfigure fontconfig-config on edgy (that might be just sudo dpkg-reconfigure fontconfig on other distros or dapper), and go through the questions (choosing the default answers), but tell it that you want to enable bitmapped fonts when it asks. Then download the ProFont (bitmap font) for Linux/UNIX (new version) and put the .pcf files in your .fonts folder in your home directory (which you might have to create). You’ll have to restart any terminals you have open, but then ProFont will be available for you to use as a font (and in all your other apps too).

UK100 bloggers

Cor, look, a UK top 100 bloggers list, and I’m 23rd. Andy B and Simon W are ahead, of course. As is Boris Johnson, who I’ve met and is a bit mad.

Woo, Edgy

Woo, Edgy!

Looks pretty. Love the Firefox 2.0.

The upgrade fucked up half way through, though. That wasn’t good. More work to do there, Ubuntu people. Bug filed, anyway.

Memory scanner for Linux

I need to buy some memory for a desktop computer. Now, I hate buying memory because I never know what to buy. EDO, DDR, SD, PC133, PC100, it’s all completely meaningless. People say; buy the right RAM to go with your motherboard. And find out what your motherboard is by opening the case. Then download some PDF manual from a very slow site in Taiwan and read it. And I still never know what to buy.

Surely, I thought, it is possible to work out what my motherboard is from software, and cross-reference that with some Big List Of Allowed RAM somewhere on the web to have a small program that, when I run it, says “Go and buy PC133 SDRAM; you have two memory slots and each can take up to 512MB”. You could even sell advertising space on it to RAM manufacturers if you were of a mind to, so when someone runs it they get a discreet little thing which says, underneath the description of what to buy, “click here to buy this specific item from Stuart’s House Of RAM” or something.

It took me, ooh, thirty seconds of poking around the web to discover the Crucial System Scanner, a download from the memory company Crucial, which does precisely and absolutely that. It’s a great little program; download it (about 70K) and run it and it throws you at an appropriate page on their site listing details of your motherboard and which Crucial RAM sticks you can buy. The tragedy is that it’s Windows-only. I was running it on a Windows machine anyway, so that’s not too big a loss, but: why isn’t there a free software version of this? Is “which RAM sticks am I rated for, and what type?” workable-out from /proc? If making the tool requires you to put a huge database of all the motherboards in existence and their RAM types on a website somewhere, I can understand why it doesn’t exist…

LinuxWorld UK

I couldn’t make it down to LinuxWorld UK this year, but two cool things happened there.

First thing: there was a Jokosher stand in the .org village! People had lots of questions about what Jokosher is going to be able to do, and I’m inordinately proud that we had people there pushing the Good Word Of The J. You just wait. It’s gonna rock like nothing you’ve ever seen. The only bigger rock will be the Moon. There are pictures of the stand, including Dave Morley having to explain to a guy from Zend that yes, we give it away rather than sell it. Amazing.

The second thing: the Best Open Source Marketing Campaign trophy at the UK Linux & Open Source Awards 2006 went to… LugRadio Live 2006! We are better marketers than Ubuntu! Rock, again! Jono collected the trophy for us (Matt has more detail on why we didn’t go, but briefly because it was £120 per ticket!) since he was there anyway, what with being a judge. Nice one Bacon. Don’t think that this means that it lives on your mantlepiece, though :)

My home backup system

After having spent the last five years feeling guilty, I now, finally, have my laptop backing up the data I care about to another machine on my network. Here’s how I did it. This is a relatively long and complicated process, but it means that it all happens automatically and by magic, and I don’t ever have to interact with it, which is what I want.

The first component I needed was some backup space: a machine on my network that I could send the backups to. I did look at online backup space (Amazon’s S3 and similar) like all the cool kids, but I just can’t get on with it, and I resent paying because I’m a cheapskate. So, it was to be a box on my network. Now, there are useful NAS machines around, which just get plugged in and automatically export their disc space (normally as a Windows share, with Samba), and I looked at those too (there’s the Terastation, etc, etc). However, I needed an always-on server for another purpose anyway, so I decided to go with a real machine. A machine cobbled together out of the Big Box Of Machine Bits, of course.

Setting up the server

It’s got two disc drives in it, and I divided the first disc into two partitions, one with 1GB and the other with all the rest. Install Ubuntu Linux 6.10 Edgy, server edition, on the 1GB partition. (I actually installed dapper and then upgraded it to edgy, for that bleeding edge greatness; at this writing, edgy is only at RC stage.) After that, we want to take all the remaining space on the machine (one big partition on disc 1, and all of disc 2) and make them one big block of disc space; this is what LVM, the Linux Volume Manager, is for. Note that all this stuff can be done with proper GUI tools, but I don’t have a GUI on this machine because it’s a server and I’m trying to converse disc space. This bit’s also from memory, so be very careful and don’t just slavishly follow it.

# First, make the partition available to LVM, by
# making it a "physical volume". This is LVM-speak for
# "a bit of a disk that I can use"
pvcreate /dev/hda3 # the big partition on the first disc
pvcreate /dev/hdb # and all of the second disc

# Now, create a "volume group". This is LVM-speak for
# "a big block of disc space all managed together"
vgcreate volumegroup /dev/hda3 /dev/hdb

# Next, create a "logical volume". LVM-speak: "something
# that looks like a disc drive, so you can mount it"
# First, find out how big it can be
vgdisplay | grep "Total PE"
  Total PE              11833
# now create the logical volume at that size
lvcreate -l 11833 volumegroup -n logical1

# You now have a device /dev/volumegroup/logical1
# which you can treat as if it were a disc
# Create a dir to put it in
mkdir /space
# and add it to /etc/fstab so it gets mounted. Add the line:
/dev/volumegroup/logical1 /space auto   defaults        0       0

After that complex little bit (again, if you aren’t tight like me, do it with the GUI, it’s easier), you will have a directory /space on the machine with loads of space in it. Install openssh-server and rsync, because we’ll need them later.

Rotating backups

The way I want my backups to work is as follows. Every night, each machine on my network should connect, and send everything that’s changed since yesterday. When I look on the backup server, there should be a folder for each machine, and there should be in there a folder per day. Each folder should look like a complete backup, but if a file hasn’t changed since yesterday it shouldn’t take up any more disc space. So, the folder structure should look, say, like this:

/space
  /stuart
    /2006-10-24
      /folder1
        /file1
        /file2
        /newfile1
      /folder2
        /file3
    /2006-10-23
      /folder1
        /file1
        /file2
      /folder2
        /file3

and the 2006-10-24 folder should have all the files in it but only take up as much space as newfile1. Complicated, but part of the reason I specified this is because I know it’s possible. (The main reason, of course, is that I’m tight and want to save disc space.) Making this happens involves two stages: making a hardlink tree, and using rsync.

The hardlink tree

If you can get over how much this sounds like something out of an Enid Blyton book, it’s a cool technique. I’m not going to explain hardlinks and inodes and things like that here, because there are many other descriptions elsewhere. Suffice to say that, if you have a folder, you can make a duplicate of that folder with cp -al folder newfolder, and that duplicate will look the same and be full of real files but not take up any disc space. My nightly backup therefore needs to do the following:

  1. Copy last night’s backup to a new folder, named for the current date
  2. Change the data in the new folder to look like my laptop, so it’s got all yesterday’s data but with any changes I’ve made today

The issue here is: how do you know what last night’s backup is called? I’ve solved this by making sure there’s a symbolic link called current which always points to the most recent backup. So, the above process actually becomes:

  1. Copy the current folder to a new folder, named for the current date
  2. Change the data in the new folder to look like my laptop, so it’s got all yesterday’s data but with any changes I’ve made today
  3. Change the current link so it points to the newly created most recent backup

The script that does this is stored in /space/begin-backup, made executable with chmod +x /space/begin-backup, and looks like this:

#!/bin/bash

PERSON=$1
BROOT=/space

if [ -z "$PERSON" ]; then
  echo You must pass the name of a backup dir
  exit 1
fi

PDIR=$BROOT/$PERSON/

# If person dir doesn't exist, create it
if [ ! -d $PDIR ]; then mkdir $PDIR; fi

# If there's no current dir, create an empty one and link it
if [ ! -d $PDIR/current ]; then
  mkdir $PDIR/first
  ln -s first $PDIR/current
fi

DT=$(date -Iseconds)

# Hardlink-tree the existing recent dir
cp -al "$(readlink -f $PDIR/current)" $PDIR/$DT
# and link current to the new hardlink tree
rm $PDIR/current
ln -s $DT $PDIR/current

We’ll come back to how you run this in a minute.

Rsync

The change the data in the new folder to look like my laptop bit is done with rsync, which is complex but brilliantly clever. In essence, rsync is like copy (or cp), except that it compares the source and the destination and only sends the changes over. On my laptop, I can do

rsync -avz --delete -e ssh \
    /some/folder/to/back/up \
    myserver:/space/stuart/current/

and that will copy /some/folder/to/back/up over to the server. Importantly, if that folder is already in the backup space, in the current folder (because we backed it up yesterday) then it’ll only copy the changes over. This is why we make sure that there’s a folder called current with the contents of last night’s backup!

Exactly how we run this rsync command we’ll come on to in a minute. Patience, Iago.

Choosing what gets backed up

I don’t want to back up everything. I don’t have the space, and to be frank I have a lot of crap lying around on my machine. So I need a very easy way of tagging something for backups. This is a perfect use of emblems; I can “tag” a file or a folder in the file manager with a special “backup” emblem, and that should indicate to my backup process that that file or folder wants to be included in the backup. Ubuntu doesn’t have a backup emblem included by default, but adding one is easy, and explained in the docs. Pick yourself an image (I use this little tape) and add it as an emblem, and then go through your machine and add it to every file or folder that needs backing up. (This will, if applied to a folder, back up everything inside it. If you need it to back up only some of the stuff inside it then you’ll have to not apply it to the folder. Yes, this is awkward, but I don’t need to do that.) Applying emblems is also in the documentation; a quick way if you’re doing this a lot is to pop up the Edit > Backgrounds and Emblems window and just repeatedly drag your new backup emblem to everything.

SSH with no password

One final preparation step: in order that the backup can run without me being around, I need to be able to make an ssh connection from my laptop to the server without entering a password. I’m not going to describe how to do this because there are plenty of guides out there on the web.

Make it so

Now, finally, after lots of setup, it’s time to actually make it all happen. To summarise, then, to do a backup, we need to:

  1. Run, on the server, the copy-last-night’s-backup script
  2. Get the list of all the files with the backup emblem
  3. Use rsync to copy all those files into the new backup folder on the server

To get the list, we can use my findemblem.py script (and you thought I just wrote it for fun!). The final script, dobackup.sh, which actually does the work, just does the above steps, and looks like this:

#!/bin/bash

# Do backups to the rsync server
# You must have already set up a passphraseless ssh key to the ssh server
# so that "ssh servername" just logs you in.

BK=$(dirname $0)
BKNAME=stuart

# First, tell it to clock over the backup
ssh servername /space/begin-backup $BKNAME

# Now, do the backup
python $BK/findemblem.py backup | while read fn; do
  rsync -avzq --delete -e ssh "$fn" \
    servername:/space/$BKNAME/current
done

All that remains now is to schedule this script to run every night, by editing your tasklist with crontab -e and adding the line

40  4  *   *   *     /full/path/to/dobackup.sh

And, lo and behold, you have overnight backups. All done and dusted. Phew.

AOL AIM in JavaScript

Steve Chipman and the gang begin to unveil JavaScript bindings for AOL Instant Messenger. This is going to be pretty cool; we’ll be able to tie AIM (and its two hundred trillion users) into websites with the greatest of ease. Bring it on.

Find files with an emblem in Gnome

With the desktop on Ubuntu Linux (indeed, with any Gnome desktop) it’s possible to add emblems to any file. An emblem is a little reminder, a small icon that appears on top of the file. Think of it as a tag, perhaps, in this Web 2.0 world.

The 'Sam presents' file has a 'money' emblem.

Anyway, I needed a way of establishing which files had a particular emblem from a script. So here’s such a script. Call as follows:

aquarius@giles:~$ python findemblem.py money
/home/aquarius/Sam presents
/home/aquarius/Work/quotation.xml

The actual script is:

import re, glob, sys, urllib, os
from xml.dom import minidom

def grep(pattern, files):
  search = re.compile(pattern).search
  matches = []
  for file in files:
    for index, line in enumerate(open(file)):
      if search(line):
        matches.append(file)
        break
  return matches

def findEmblemedFiles(emblem):
  metafilesWithKeyword = grep('<keyword ',
               glob.glob(os.path.expanduser('~/.nautilus/metafiles/*')))
  retfiles = []
  for dirxmlfile in metafilesWithKeyword:
    dom = minidom.parse(dirxmlfile)
    filenodes = [x.parentNode.getAttribute('name')
                 for x in dom.getElementsByTagName('keyword')
                 if x.getAttribute("name") == emblem]
    files = dict([(x,'') for x in filenodes]).keys()
    # turn /home/foo/.nautilus/metafiles/file:%2F%2F%2Fhome%2Ffoo%2FWork.xml
    # into /home/foo/Work/
    dirname = urllib.unquote(os.path.split(dirxmlfile)[1])[7:-4] + '/'
    retfiles += [os.path.join(dirname,urllib.unquote(f)) for f in files]
  return retfiles

if __name__ == "__main__":
  print '\n'.join(findEmblemedFiles(sys.argv[1]))

I hate Sharp

Grr! How is this help? Repeating the error message is not an “Explanation”.

Annoying Sharp "Help"

Firefox 3.0 suggestions

The Firefox people, just about to release version 2.0 of the browser, have put up a wiki page asking for feature requests and suggestions for future Firefoxes. Now, that to me sounds like a great idea.

And then I looked at the list.

There are already about four hundred suggestions on the list. As far as I can tell, damned nearly every one of them is useless. Let’s examine the reasons for uselessness.

Things that already exist
  • “I would like to see an option that would allow me to click on a link and it open in a new window or tab and not leave the page I’m on until the new window/tab has fully loaded.” That’s load-tabs-in-the-background, which I have turned on right now.
  • “When a numeric portion of the URL in the address bar is highlighted, allow it to be incremented/decremented using the mouse wheel.” If you want Pornzilla, you know where to find it.
  • “Or a variant that could be run from an usb stick, that you could use your personalised browser anywhere.” Portable Firefox.
  • “Make it possible to have firefox started as a new process with a switch (firefox.exe -np) to be able to have two instances running in case you are testing something that crashes the browser.” Just create a second profile and launch with it.
  • “Tab Exposé”. Foxpose.
Things that clearly belong in an extension
  • “These days, we seem to be only allowed to “save as” in HTML or text. This then means we have to use time-consuming external programs instead of it being a quick and easy drop-down selection. Please give us back our old “save as” options [ed: as PDF, etc]and also include a new ODF “save as” option.” This sort of thing is operating system level, not Firefox level. Install CutePDF on Windows; Macs can already print to PDF; everything can already print to PostScript. I can vaguely see the use of some of these, but “I want to save this as PostScript” is such a geek edge-case anyway that doing it through Print To File is hardly a barrier.
  • “I found a plug-in for Firefox that colored your tabs, but it was random. I would like to see user-picked colors for specific domains.” Interesting use-case (a synaesthete), and he says he’ll write it himself, so that’s good; it’s an extension, though. Not Firefox core.
Things that are basically impossible to do
  • “Sessions/Tabs Isolation: Make sure sessions from other tabs do not leak between tabs. This is a major security hazard.” What this means is that every tab is an independent browser. Firefox’s memory usage would go through the roof. This goes double for people who say “one tab crashing shouldn’t crash anything else”, which means that every tab is a separate process.
  • “Make the browser open faster; that is the number one reason that I have heard for people not using Firefox or switching from Firefox.” I love this. As if they could easily do this but have deliberately made it slow to annoy people.
  • “Use heuristics to try and avoid caching sensitive data for autocompletion. For example, if something looks like a credit card number or social security number, don’t cache it.” I assume that means “like a US Social Security number”, right? Or will you not mind if you enter what you think is a phone number and it refuses to cache it because it looks like a Russian SSN?
Make Firefox into Internet Explorer
  • “Allow an option run a downloaded setup file (in the place of “open”) instead of saving it, like in Internet Explorer.” There is a reason it doesn’t do this. It should not be easy to click a web exe and have it run!
  • “Add fallback mode to support non-standards based rendering when “IE only” features are present in a web page so that the page will render correctly.” This means: completely implement total compatibility with IE. As if it were made easy by saying it. Let alone that Firefox policy is generally, when faced with a choice, to do it right rather than to emulate IE.
  • “I know it might be heretical, but it would make life easier for some of us Ajaxy types if Firefox bit the bullet and supported IE style drag and drop.” I’m sure it would.
  • There are quite a few “turn Firefox into Opera” requests, too. Why not just use Opera if that’s what you want?
Things that are moronic
  • “Allow us to specify which order each plugin will sit in.” Why? WHy is this even remotely useful?
  • “Send Theme name and version currently in use in the HTTP headers.”
  • “dual screened tabs. two tabs showing in the same window pane, almost like frames. with ability to drag and resize viewing area between the two tabs.” Just open a second window!
  • “Make proprietary Anchor mode: Make possible custom anchors like this:url#custom(0,555), this would make firefox scroll 0pixel to left and 555pixel down.” Why is it a good idea to make only Firefox understand these? Did we learn nothing at all from the mid-nineties?
  • “Show the MD5 Checksum of each download after its finishied.” Why? What’s the point? If you even understand the word MD5 you’re quite capable of running md5sum, and if the website doesn’t publish md5s then it’s useless information anyway!
  • “Move all MPL code to GPL.” Yes! Make that suggestion to Microsoft for IE as well!
  • “Rather than pop up annoying dialogs when a site has a bad security certificate, simply perform the encryption without showing the lock icon.” What do you think certificates are for? Yes, it’s a pain to see the window, and yes, the window’s not brilliantly designed, but the answer isn’t just to turn it off!
  • “I think the possibility to setup and use a socket connection for client-server communications would be a great improvement for Firefox to use it in Web2.0 / intranet-webapplications.
    I know it’s already possible, but it requires ’signed/secure javascript’ through a plugin to deploy the possibilities, but it would (and should) be a lot easier if a could just setup a javascript object.” You want JavaScript to be unrestrictedly allowed to open socket connections? Ahahaha. No.

If you strip out all of those, then you’re left with barely anything. More importantly, there’s nothing actually good left in the list; it’s all little incremental improvements. Is Firefox really so good that no-one can think of anything it might do differently? It’s the perfect execution of the web browser concept? It surely isn’t. I intend to lay out a few thoughts on what I’d like to see happen in a future post, but for now I’ll just say: can’t we do better than this?

To be honest, I’m being unfair. There are some good suggestions in the list. What disappoints me is the lack of decent solutions, the lack of vision. Most of the ones that are in my “it already exists” category above (and there are many that I didn’t highlight; the above is just a selection) are things where I happen to know that it exists but I can understand that users do not. I need to go through the Firefox list and update it with some of these complaints or pointers to existing implementation, so that people can know. The moronic suggestions, by contrast, tend to be things that fall foul of Raymond Chen’s “what would happen if it actually did this?” thought experiment.

Fusion confusion

Leaving university, moving from being a loafing and lazy student to being a paid-up besuited member of the rat race, means a pretty significant change to life. You stop being funded by the government for a start, unless you decide to throw away your soul (what the hell, you weren’t using it anyway) and go and work for the civil service. (Nurses and doctors and so on are excluded here; NHS consultants are not.) You start getting up at seven and going to bed at eleven, rather than getting up at eleven and going to sleep when the cigarettes run out, or possibly slumped against a wall in a nightclub. You stop caring about politics, until you start caring about it again. The amount you actually contribute to society starts an upward turn, just as your beer consumption and the amount you want to contribute to society and the amount you give a shit about contributing to society start their horrific screaming nosedive toward ground zero. And you have to buy your own shower gel for the first time in twenty-one years.

None of this, though, has as much of an effect as the most important paradigm shift between the two states. You stop eating takeaways.

When I was at university, we ate pizza all the time. Babylon Pizza (that’s 0191 386 4004 for those of you following along in Durham, assuming the number hasn’t changed in the last decade, which I’m gratified to see that it hasn’t, although it has changed its name to Pizza King (beware: large jpg! also crimes against typography!)) got so many orders from us that all I had to do was dial the number and say “Hello” to get a 10″ olives-mushroom-sweetcorn and a 12″ chicken-ham-pepperoni delivered to our house. (This is really true.) I’m beaten in this only by my aunt Caroline, who once got a letter from BT saying that she could save money by picking the listed ten numbers as her Friends and Family (a scheme from British Telecom, the UK phone company, designed to offer a discount on the numbers you ring most often); number four on the list was the Chinese takeaway. Caroline, a grown-up, had reached that pitch of adult life when you get to eat food that you didn’t cook (and microwaving counts here) on a semi-regular basis. It took us a while to get there, but we’re there now; in fact, because we’re so rich and so posh and so uncaring, we’ve blown right through the wall of takeaways and into actually going out for dinners.

Those of you in London (or, I imagine, New York or Boston or Sydney or probably Moscow for all I know) will now be sneering into your mochacockachocochinos before instructing your secretaries to book your usual lunch table at Wagamamas like Patrick Bateman, I know. However, out here in the provinces, eating out is still an interesting and vibrant experience rather than just what you do in between 12.30 and 3pm. So we went out for dinner, as we do quite often these days.

Eating out is problematic if you have a youngish child; my daughter, Niamh, is six. Now, she’s approximately the best behaved child in the universe, so just going out to a normal restaurant, sitting, eating, and talking, isn’t a problem. She won’t get restless, she won’t cause a scene. She will, however, get bored, and I think it’s pretty important that everyone enjoys going out. So we normally end up going to a pub with a children’s play area, so Sam and I can eat dinner while Niamh jumps and runs about on some insane enormous room-filling contraption made out of Meccano and covered with foam and occasionally runs out to gulp down some spaghetti bolognaise. Last night was a change: we were going for a Chinese meal. Now, I like Chinese. Sam’s more a curry person, so we argue a lot about that on takeaway days and normally settle on pizzas, but last night was for Chinese.

You may have noticed the increasing trend in the UK (if you’re in the UK) for Chinese restaurants to move over to “buffet-style” dining, where they cook a mountain of different sorts of food and you can eat as much of whatever you want for a fixed price. I, personally, think that this is a good idea on a par with fire, indoor plumbing, and uncapped internet connections, because when I have Chinese I only ever eat sweet-and-sour chicken with egg fried rice. Not for me Beef with Green Peppers in Black Bean Sauce! You can keep your King Prawns with Ginger and Spring Onions Szechuan style! Sweet and sour chicken, that’s where it’s at. Lemon chicken on a good day. Unadventurous, true, but if you want to eat interesting new things go to someone else’s house. Anyway, the buffet concept allows me to eat two or three plates of that and then stagger home barely able to breathe, which is clearly the point of going out for dinner. The restaurant in town is a buffet-style place, so we had it earmarked; we’ve been meaning to go there for five years, so this was a momentous occasion. And when we got there it was closed for refurbishment. That’s poor customer service, that. Admittedly we’ve only been talking about going to the place for half a decade rather than actually venturing across the threshold and proffering money in exchange for food, but that’s not the point! Where’s our dinner?

So we headed onward. Sam had had recommendations for somewhere called Shanghai Fusion, on Salop Street in Dudley. Out to Dudley headed the three brave explorers. Now, we didn’t know where Salop Street was, but we intended to try the time-honoured “drive around until you find it” location technique, what with Dudley not being all that big. Turns out it’s big enough to defeat us, though, and after my griping about how my car has sat-nav (we were in Sam’s) reached enough of a pitch, my lovely wife pointed out that I constantly boast about (and consequently have to pay for) my phone having a net connection; couldn’t I just go and get a map? Well, I have the Mobile GMaps Java app on my phone for just such an eventuality, so I fired it up. I’d looked at it before, at which point I was a bit over-effusive about the wonderfulness of being able to see a map on your phone (”the Google Maps viewer is the coolest thing in the whole fucking world. I am not kidding. It does UK maps as well. Wow. Just, wow. I will never, ever be lost again”). That falls dramatically into the category of “Famous Last Words”. Actually trying to use it taught me two things:

  1. It’s really, really, really slow. Phones are such a crappy platform for accessing the net. Perhaps 3G is fast enough, but as far as I can tell you can’t tell your phone “use a 3G connection to just connect to the net”. You can use it for pointless video calls or downloading trailers to movies you don’t want to watch, but you can’t make the Java apps on your phone like Mobile GMaps or Opera Mini use a 3G connection instead of a GPRS one. The slowness was agonising. “OK, I can now see Dudley on the map; I’ll zoom in. Drive around the block again a couple of times while the three map tiles load.” That, however, was enormously exacerbated by
  2. It forgets map tiles and sets them back to blank and then reloads them. While you’re looking at them. What you really want when you’re trying to navigate through town with directions like “Well, keep going up this street; I can’t tell you which side-street to take because the map isn’t zoomed enough for that because I don’t want to wait another ten minutes” is for the bloody map you’re looking at to bloody disappear and then reappear again three minutes later when it reloads. Why in the name of Jesus on a one-wheeled bicycle would that ever, ever, ever be a good idea? Don’t do that. Just…don’t.

Eventually, eventually, we got there. After some more fun and games parking, we entered the restaurant. And actually, it wasn’t too bad. The reason it’s called Shanghai Fusion is because it’s not only a Chinese buffet restaurant; it’s an Indian buffet restaurant as well. So you can have chicken tikka with egg fried rice. Beef with cashew nuts and mango chutney. Lamb balti with sweet-and-sour sauce on and a poppadom. Personally, I thought that was weird, and eating it didn’t change my opinion, but I can’t complain about the quality of the cooking. My approach rapidly became “pretend you’ve just come out for a Chinese and ignore all the Indian stuff”, because the culture clash did my head in, but all around me people were eating beansprouts with mint yoghurt dressing with evidence of genuine enjoyment. I have to say the place is recommended, even if they apparently don’t take credit cards and I had to take a break between plates of sweet-and-sour to go out and get some money from a nearby garage.

On the way out, Niamh said “I know why it’s called Fusion. It must be called Fusion because it’s confusing to get there.”

All this leads me, as ever, to two conclusions. Firstly, you should eat out more. It gives you the chance to enjoy great food and not have to wash up afterwards, and it’s really not that expensive. Shanghai Fusion was a tenner a head, which is not bad considering you can eat a hundredweight of chicken tikka and there was carrot cake and gateau and ice cream for dessert and you could smoke too.

And secondly, when you do decide to go out, take a map.

INSERT_MAP
INSERT_ADDRESS

Posting with locations

A test of the GeoPress plugin. This post should have a little map in it, and it should have the location in the RSS feed.

INSERT_MAP
INSERT_COORDS

Google Reader is not good

I’m starting to get really hacked off with Google Reader. I’ve mentioned this already, but I thought I might fill in a few more reasons. You might be thinking: why haven’t these been submitted as bugs to the Reader team? Well, most of them aren’t really susceptible to that. I’ll come back to this point later.

The old version kept dying all the time: it popped up a “loading” screen and it never went away. Forced refresh sometimes brought it back, and sometimes didn’t. When the all-new exciting version came out I thought that this problem might be fixed: in fact, it’s actually got worse. I find Reader hangs probably once every three or four times I use it.

There’s no point in doing Ajax things if you have to wait 20 seconds for it to load. I’ve already ranted about this, though.

As far as I can tell, you can no longer skip to the next item by pressing space. Maybe this works for everyone else, because it ties into…

If you have All Items shown, and some new items have arrived since you clicked it, I can’t find a way to refresh the list of All Items. I have to switch to Home and then switch back to All Items again, with two long waits with a loading screen. Apparently “r” is meant to refresh, but that doesn’t do anything. I’ve tried “r” and alt+r and neither seem to help.

It gets confused about whether articles have unread items or not. See here:

The left hand pane shows Python News with a (1) for one unread item, the header shows

I could not get Reader to show me this mysterious unread item, or to acknowledge that it wasn’t there. I tried a full refresh (just loading Reader again), I tried switching to Home, back to All Items, I tried showing the feed individually (which is what the screenshot shows). This also happened with other feeds; the only way I could get the supposed new items alert (the “1 new items” and the (1) in the left pane) to go away was to “View all items” (all of which appeared to be read) and then say “Mark all read”. Now, though, I’m left with the lingering suspicion that there really was an unread item and now I won’t ever get to read it.

(Plus: 1 new items? Hm.)

In terms of filing bugs: what should I do about that last one? I have no idea how to replicate it, I can’t give instructions. I could say “look at my Reader page and you’ll see it”, but then I basically can’t use Reader until I get an acknowledgement that the Reader team have diagnosed the problem, which I don’t want to do.

Anyway, as soon as I’ve got my customisations done to Rawdog, I’m switching. Sorry, Google team. I have to say that Gmail is increasingly getting confused and having to be full-refreshed or just hanging on the “Sending…” bit when trying to send a mail (it’s still an Ajax loading screen, even if it’s just in the top right hand corner). Makes me sad. If Google can’t make this stuff work, who can? Maybe I should look harder at the Yahoo stuff instead? They seem to be coming on strong recently.

Jackfield on OSNews

Blimey, Jackfield got linked from OSNews. I need to stress at this point that it’s still very preliminary! If you’re reading this and wondering why it isn’t a drop-in replacement for Dashboard just yet (and when support for Microsoft Gadgets and Yahoo Widgets and Opera Widgets is coming) then, well, I’m working on it, but we’re still at a pretty preliminary stage.

Update: got dugg as well. The server went rather wobbly.

Looking at rawdog

Well, I’ve finally got hacked off with Google Reader (not least because I am sick of Ajax loading screens), and started looking around for my own feed reader. (I did this before, but now I’m going to do it properly.) I don’t like gregarius, after trying it, and I remembered that rawdog popped up in a search I did once because it has a plugin that uses templates from my old weblogging system, Vellum. So, I thought I’d give it a shot. It looks good so far; fulfils the few requirements I have for this sort of thing, which are:

  1. Heavily customisable
  2. Written in Python, so I can actually do the customisation
  3. Doesn’t require a database server

I intend to try and document what I do to Rawdog to get it to be the aggregator that I really want.

First job, though, is to get all my feeds imported into it. I’ve been chatting to Adam Sampson, the rawdog author, about it and a few things that it can do, and something that’s missing is an OPML import. If you’ve got an OPML file, you can import it into rawdog with a (fairly complex) Python and bash one-liner as follows, where feeds.opml is the OPML you’ve exported from your existing aggregator:

for f in $(python -c "from xml.dom import minidom; dom=minidom.parse('feeds.opml'); print ' '.join([x.getAttribute('xmlUrl') for x in dom.getElementsByTagName('outline')])"); do rawdog -v -a $f; done

Review of Run Your Own Webserver using Linux and Apache

There’s a nice complimentary review of my second book, Run Your Own Web Server Using Linux & Apache, in issue 69 of Linux Magazine. The review itself (warning: PDF) says

Then it occurred to me that this book is not intended as a book for a seasoned Apache administrator. The book is written for people who, probably for the first time, have decided to take advantage of the power of both Linux and Apache and set up a web server on their own… [W]hen viewing this book in the light of its true target audience, I consider it a great piece of work. If you are just starting out with building an Apache web server on Linux, this is the book for you.

That’s exactly what we were aiming for. The review author, James Mohr, has hit the nail precisely on the head. The audience for the book, the typical use case, was someone who knows something about computers, maybe does a bit of admin on a couple of Windows boxes in their organisation, and wants to set up a Linux server on a piece of kit they’ve found in the basement to try it out, to see what all the fuss is about, and to see if it’ll help their organisation. The idea is that someone like that hears about Linux, wants to give it a shot to see if it’ll do what they want without having to go and buy an expensive server and another Windows licence, and wanders into a bookshop to grab a book explaining it. When they do that and see a book called “Run Your Own Web Server Using Linux & Apache”, they’ll (hopefully) think “aha! that’s what I want to do!” and find the book useful. Looks like we got the pitch about right.

Ajax loading screens

Right, here’s the thing.

Using Ajax technologies is pretty cool. They can help your web application really feel smooth and whippy and quick. Like a desktop application. However:

There is no point in using Ajax if you have to pop up a “Loading” screen and wait ten seconds when a link is clicked.

Read that again. There’s no point. There is no difference in the UI between “click a link, see a ‘loading’ image pop up, wait ten seconds, the page is rebuilt with the DOM” and “click a link, wait ten seconds, see a new page load from the server”. None. Please, please, stop doing this. If it’s going to take ten seconds to load a page, just load it from the server. That way, the browser takes care of the work, your pages are more likely to be bookmarkable, and it very rarely dies half way through. Picking on Google Reader for a moment, about 10% of the time I click the “All items” link and get the loading div pop up, that loading div never goes away and I have to refresh the whole page using the browser Refresh button. This user experience is no better than using an “old-fashioned” no-JavaScript web app. It really isn’t. Browser manufacturers have spent ten years thinking about what to do when a page load fails, and perhaps how to do some recovery, and users have spent ten years learning how to cope with a ropy and abortive internet. Please, just stop doing this.

Men With Bigger Romans

Last weekend the Gentlemen’s Philosophical Society of Elvet travelled to York for the Men With Bigger Romans tour, this year’s installment of the Men With Big (Stones | Thrones | Moans) holiday fact-finding field trip extravaganza series. It was glorious. I have discovered that York Brewery make excellent beer, that Sp. Manlius Fronto (or Tim to his friends) is better at Smuggle (caveat PDF) than I am, even if you steal half his money while he’s in the toilet, and that the Romans left a lot of stuff lying around the lovely city of Eboracum before they ran off to become the Byzantine Empire. Gn. Quinctilius Praetextatus took some pictures of the GPSoE in his official role as secretary of the Society, so good work fella. We’re doing this again next year.