ACCU World of Code

  • My Address Book 1.9.0 – rewritten from scratch

    Ordinarily, my motivations for doing open source work are clear: peer recognition and the satisfaction of knowing people are using my work. However, I’ve been distracted from that stuff recently because of my desire to scratch my own itch, by re-writin…

  • Switching workspace in GNOME via the command line

    I use rdesktop to connect to some Windows machines, and it works beautifully. I like to allow it to grab keyboard input so I can switch and close windows on my Windows desktop without fear of accidentally doing something to the rest of my Linux desktop…

  • Anatomy of an interpreter: the Evaluator

    Posts in this series: Lexer, Parser, Evaluator I’m still really enjoying writing my Scheme interpreter Subs, which can now succesfully run all the example code from SICP up to section 2.3.4. I’ve made the changes I mentioned I would in the Lexer articl…

  • How to ask technical questions in person

    In a healthy team performing a technical task, there will be a lot of questions. Those questions will sometimes be asked by those with less technical knowledge, but (in a healthy team) there will be plenty of questions going back the other way too. Que…

  • Anatomy of an interpreter: the Parser

    Posts in this series: Lexer, Parser, Evaluator Subs has reached version 1.3.4, which means that it can successfully run all the tests from chapter 1 of SICP. This is very exciting. Last time I explained a bit about the Lexer, which takes in a stream of…

  • Anatomy of an interpreter: the Lexer

    Posts in this series: Lexer, Parser, Evaluator I have been having a lot of fun recently writing my Scheme interpreter Subs. I have never implemented a full programming language before, so I am learning fast (mostly through mistakes) and wanted to write…

  • Subs Scheme Lisp Interpreter

    Why would you write a Lisp interpreter? I find that question difficult to answer, but the joy of open source is that I don’t have to answer it. Subs is a Scheme interpreter written in C++, and growing out of the excitement I have felt while reading Str…

  • Scalable Graph Coverage

    If you’re interested in dealing with large directed graphs of dependent objects and want some tips on how to process them in a way that scales in terms of memory usage, you may be interested in the article I wrote for Overload, which is a journal of th…

  • Ubuntu Lucid upgrade – a catalogue of disaster and pain

    I recently upgraded 3 machines to Lucid. I don’t recommend it. Broken after upgrade 2 out of 3 machines did not boot after upgrade to Lucid. One, an upgrade from Hardy, crashed hard during the upgrade (the screen was frozen with a prompt about lmsensor…

  • FreeGuide 0.10.11

    I’ve made a new release of FreeGuide today, which contains minor bug fixes. I changed the stability rating on sourceforge to “Production/Stable” (previously it was “Alpha”). Maybe I should bump the version number next time to 1.0. Certainly all this 0….

  • Don’t design for performance until it’s too late

    There is a piece of ancient wisdom which states: Premature optimisation is the root of all evil This ancient wisdom is, like all ancient wisdom, correct. However. It appears to have been reinterpreted as essentially meaning: Don’t design for perform…

  • Technorati appear to have broken openid delegation

    I have just changed to myopenid and can delegate to them from my own openid URL by following the instructions here: https://www.myopenid.com/help#own_domain. Google don’t appear to let you delegate to them (i.e. have your own url). I’m really glad I ch…

  • NNDB 0.1

    I’ve managed to get NNDB, my C++ data storage library which is almost, but not entirely unlike SQL, into a fit state for a release. You can create tables, set indices on columns, insert data, retrieve data using something like a SELECT, filter it using…

  • NNDB’s Not a Database

    My latest project is called NNDB. I’ve worked with databases for quite a long time now, and for a while I’ve been thinking about how they work under the hood. I know very little about it, but I thought I could learn a bit by trying to implement somethi…

  • Diffident 0.3

    My original plan for Diffident, the side-by-side diff viewer and editor that works in a terminal, was to implement basic editing capabilities before making another release. Of course, that turned out to be quite ambitious. It involves essentially imple…

  • CBeebies and other channels not working with mplayer

    It turns out the scan command from the linuxtv-dvb-apps package (on Ubuntu Hardy Heron, anyway) isn’t writing the correct channels.conf, and this makes some channels not work for me, including CBeebies, CBBC Channel and CITV. The fix is to do as this p…

  • Firefox keyword search for finding C++ keywords

    I often want to search the SGI C++ reference for a keyword. The best way I have found to jump straight to the page I want is to use Google’s “I’m Feeling Lucky” search limited to searching within sgi.com. You can create a Firefox keyword search to allo…

  • Flaws in the software patents system

    Note: I am in favour of patents on inventions. I believe the current software patents system has a number of flaws (in decreasing order of importance to me): They attempt to close off the use of knowledge rather than open it up. If we were not filing …

  • IGCC – a real-eval-print loop for C/C++

    When you first hear about the Read-Eval-Print Loop you might well think “So what?” as I did. What’s so great about being able to type commands interactively? But the thing is that it creeps up on you. Everyone already knows programming is an interactiv…

  • Diffident – command line side-by-side diff editor

    I really like Beyond Compare, which is a proprietary diff program with all those little touches that make it a joy to use*. The way I write code at work generally involves a bit of hacking in jEdit, checking the code myself, and then reviewing the code…

  • Random background in GNOME

    I’ve written a little script to show a different random background in GNOME every day, by looking inside your Photos directory. It will rotate them to be the right way up, if you have exiftran installed. Get it here: Random Background.

  • Analog literals

    I love this: C++ Multi-Dimensional Analog Literals. I quote: Have you ever felt that integer literals like “4” don’t convey the true size of the value they denote? If so, use an analog integer literal instead:unsigned int b = I———I; It goes on …

  • Separate regular expressions, or one more complex one?

    I have asked myself this question several times, so I thought it was about time I did a test and found an answer. If the user of your program can supply you with a list of regular expressions to match against some text, should you combine those express…

  • New Baby

    Finally the number of people in our family is prime again. Mum, baby, siblings etc. are all really well and enjoying ourselves.

  • Talk in code

    Last week we had an extended discussion at work about how we were going to implement a specific feature. This discussion hijacked our entire Scrum sprint planning meeting (yes, I know, we should have time-boxed it). It was painful, but the guy who was …

  • Fixing the vertical panel window list on Ubuntu Hardy

    For a long time now I’ve been bugged by GNOME Bug 86382. Recent versions of GNOME have featured a window list applet which behaves badly when situated on a vertical panel (which is where I like to have mine). Older versions were ok except the buttons w…

  • An actual difficult bug fixed

    Of course, I am bound to get a bug report immediately I have posted this telling me my fix breaks everything, but for the moment I am chuffed that I found, tested, and fixed a genuinely difficult bug. I am particularly proud because I wrote an automate…

  • FreeGuide 0.10.9

    So let’s quietly forget FreeGuide 0.10.8, which basically didn’t work. I fixed the problem (which was some nasty threading thing) by making the initial “Choose Channels for XMLTV” call from the first time wizard not do the clever stuff of displaying er…

  • Wii repaired free!

    A few weeks ago my Nintendo Wii started not accepting any Wii disks (but was still fine for GameCube ones… interesting). It made a clicking noise for a bit and then declared “Bad Disk” or something like that. I need my Wii. I watch all my TV through …

  • Another one

    Due in March. Very excited.

  • FreeGuide 0.10.8

    I am still working slowly on moving FreeGuide forward. Somehow it seems my itches for FreeGuide are all about making it less annoying for people who are trying it the first time. I guess this is motivated by my desire for world domination. Anyway, we a…

  • Debugging memory use and fragmentation on Windows using Address Space Monitor

    At work at the moment we are putting a lot of effort into making our program not crash. Sensible, eh? It’s crashing because a) it uses an enormous amount of memory and b) it tends to fragment your remaining memory. One of the characteristics of this pr…

  • C++ is an expert language

    Update: I should point out at the beginning that I love C++. Anything below which sounds bitter or critical is borne of a deep and growing love. C++ is a journey into worlds of beauty and strength. I assert that C++ is an expert language. What do I mea…

  • Templated test code?

    At work at the moment, as part of an initiative to get with the 21st century, we are waking up to testing our code. Thus, I am writing a lot of unit tests for old code, which can be soul-destroyingly repetitive and very pointless-feeling (even though r…

  • Public bzr branch of FreeGuide

    On the subject of distributed source code management, Dan Watkins has just informed me that the launchpad team have created a bazaar branch of FreeGuide’s code, so if you’re into that kind of thing, you can download the code from that instead of our ce…

  • Public git repo for GSSMP

    Git is supposed to work when you upload your repository to an http server, but in reality, no-one except me seems to use it, and it’s nothing like as useful as having a proper repository that people can commit to etc. So, here it is: http://repo.or.cz/…

  • Finally released last.fm support for GSSMP

    There was a weird bug in my last.fm support for GSSMP, where it would crash when run from the GNOME panel, but be fine when run from a terminal. After two bugs fixes from Charles Bailey, the problem seems to have gone away, so I’ve finally been able to…

  • lighttpd on Ubuntu – alias.url doesn’t work when included in a module config file

    I’ve decided to use lighttpd on my new machine (which was generously given to me and features a 700GB raid array). My main reason for choosing lighttpd was the FLV streaming plugin for it that will make my Wii TV viewing experience a lot better. (It wo…

  • FreeGuide updated to latest XMLTV, and bug fixes

    Check out a release candidate here: http://freeguide-tv.sourceforge.net/rc/ . So far I’ve only uploaded an RPM, but hopefully there’ll be a Windows exe and some other packages soon. Update: Windows installer now uploaded too. Test it! It’s got better c…

  • duckmaze 0.2

    I’ve finally released to the world the secret extra duckmaze levels. They’re contained in the 0.2 release, which is also faster, and doesn’t freeze time. (As far as I know.) It’s got 18 levels, and a level editor, which means you can make more. Do it….

  • Caution: numbers that feel prime may be divisible by 3

    Caution: numbers that feel prime may be divisible by 3. For example, 51 and 57. Conversely, numbers that feel divisible by 3 may be prime. For example, 61, 89 and 97. Nominations for least prime-feeling numbers that actually are prime: 89 and 101. Nomi…

  • Announcing Record TV

    Last night I uploaded the first public version of my latest project, Record TV. Record TV is a system for recording TV (on a Linux desktop computer) that is designed to allow lots of different user interfaces all to use the same back end. It is current…

  • FreeGuide 0.10.5

    After over a year, and several U-turns, the next version of FreeGuide is out. I was dead-set on getting recording functionality into it, and when some students turned up asking to help, I directed them towards doing that. They produced a reasonable fra…

  • FreeGuide SVN now useable

    Why not try the latest SVN version of FreeGuide, which contains lots of bug fixes over 0.10.4? There are detailed instructions on how to Build FreeGuide from SVN, and do ask on the developers’ list if you have problems. I’ve fixed the horrible bug that…

  • Heartfelt apologies for the feed URL change

    Sorry, sorry, sorry, sorry. I decided to change to wordpress’ pretty-URLs mode, and it changed the feed URL, which I was not expecting, and which I think is fundamentally borken.

  • FreeGuide – putting recording on hold

    FreeGuide has been stalled for about a year because the basic code for recording programmes has been sitting in SVN, but it contained far too many bugs to be useable, even by the developers. This kind of situation completely takes the wind out of devel…

  • New Baby arrived safely

    I won’t waste too much of your time, but here she is: She’s excellent, and mum is doing really well. Big brother appears to be a little bothered, but presumably that will pass.

  • (Badly wrong) usage statistics for FreeGuide

    A long time ago I added functionality to FreeGuide so people could opt to report their use of FreeGuide to under a username, or anonymously. This all happens as part of the latest version check, and you can turn it off, obviously. Quite a long time ago…

  • Procmail Maildir messages disappearing

    Google-friendly title, no? Executive summary: In your ~/.procmailrc MAILDIR=$HOME/Maildir – is BAD, whereas MAILDIR=$HOME/Maildir/ – is good. The slash at the end appears to tell procmail that this is a Maildir directory, rather than something else, el…

  • last.fm in GSSMP

    Obviously I should have gone to bed, but I’ve got last.fm support working in GSSMP. It’s in the git repo, and I should get a release out as soon as I’ve written a little bit of documentation.

  • lastfmsubmitd on Ubuntu Dapper

    So I had been thinking about putting last.fm support into GSSMP, and then I got an email to the mailing list suggesting it, and then I couldn’t sleep tonight, and, as ever, something that sounded easy has turned into a saga. I decided to use lastfmsubm…

  • Obviously, there was a bug

    So I’ve released GSSMP 1.1, which is guaranteed to contain one fewer bugs, and is relatively unlikely to contain any new ones. Also, thanks to João Pinto, it should build without warnings on AMD64 too! If anyone wants to make an AMD64 package, I’d be …

  • Watching TV: a simpler way

    MPlayer is a black art. GMPlayer, doubly so. It turns out this does the job much better than my previous hacks: #!/bin/bash gmplayer -cache 2048 -zoom “dvb://$1” It’s still not perfect for radio over digital TV, though – you get an empty window where t…

  • GSSMP 1.0

    Get it here: http://gssmp.sourceforge.net. This is the first time I’ve declared one of my projects stable, and given it a 1.0 version number. Prove me wrong by downloading it and breaking it. Enjoy. Now I must dash – I’ve just got to finish off my othe…

  • Choose channel dialog

    Following on from the last post about how I got my TV card working, here is a little script I wrote that allows me to choose a channel and start watching. It uses zenity for a rudimentary GUI: $ cat bin/tv_choose_channel #!/bin/bash awk -F ‘:’ ‘{print …

  • Digital TV on Dapper with my Hauppauge WinTV Nova-T card

    My card reports itself like this: $ lspci *snip* 0000:00:0a.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01) *snip Everything seemed to work out of the box: $ dmesg | grep DVB -A 0 -B 3 [17179585.872000] saa7146: register extension ‘bud…

  • Restoring a backup with Duplicity

    See the last post for how I back up my important files to a remote server. To restore them I do this: duplicity –file-to-restore path/to/file.txt scp://user@example.com//home/example/bkp/home/andy/Maildir file.txt and enter the passphrase when pro…

  • Remote encrypted backup with duplicity

    My father-in-law’s hard drive died the other day and I was just able to recover the data using Knoppix and my iRiver. Since I recently discovered a superb program that lets me create encrypted backups on a remote server over ssh, I thought I’d spread t…

  • GSSMP goes beta

    I’ve just released version 0.9 of GSSMP, and since I’ve fixed all the bugs I know about (except working around a gstreamer bug, which I will try to do before 1.0), I’ve marked this release as beta. This is the second project I’ve marked as beta, and I …

  • Recording in FreeGuide

    If you download the nightly builds of FreeGuide, you can try out the new recording functionality. There is quite a bit to do before this is ready for release. There are several bugs in the TODO list and you have to create your own scripts at the moment…

  • My daily backup

    I recently recovered my files from my daily backup, which had actually worked! (Pop quiz: this is how I deleted half my home dir – what is wrong with this Makefile? TMP_DIR=/tmp/gssmp blah: blah1 blah … blah7: … rm -rf $TMPDIR/ … …

  • Creating .deb and RPM packages

    Since I’ve managed to get it to work for GSSMP, I thought I might share how I am generating .deb and RPM packages using a Makefile. These make it much easier for Ubuntu and Fedora Linux users (respectively) to install the program. It should also be hel…

  • Moved to WordPress

    I’ve moved my blog to WordPress, which will allows you to comment on my posts. I guess it’s a sad day for DIYBlog, but hey, it was just a workaround until I got some web space that supported PHP. Happy interaction!

  • Two new babies

    I have 2 new babies to tell you about: Gnome Simple Stateful Music Player which is a music player that just stays out of your face, playing music off your hard drive without making a database or anything like that. It uses GNOME/GTK, GConf and gstream…

  • New games!

    I’ve been really enjoying the GP2X I got for our 5-year anniversary (!) and have got DVD ripping working, along with Quake playing at a decent speed, and lots of downloadable games, notably Spout, which is excellent, and (unlike many games which are re…

  • Linux Journal – Forgiveness

    Dear LJ, A few months ago I wrote to you saying we had to break up – you had become too chatty and opinion-filled for my taste. I have to admit that it turns out I was bluffing. I love you too much, and today I renewed my subscription. You did take a s…

  • Another FreeGuide release candidate

    I screwed up the RPM, so if you tried that, try the latest one from here: freeguide-tv.sf.net/rc

  • FreeGuide 0.10.4 release candidate

    Lots and lots of bug fixes, and some cool features sneaked in by people who obviously didn’t read my TODO list 😉 means that FreeGuide 0.10.4 is nearly ready. You can test it by downloading the relevant installer from freeguide-tv.sf.net/rc. I’ve put u…

  • A Quick and desperate introduction to data recovery

    No, I did not just develop a passing interest in data recovery as a leisure activity. Presumably like everyone else, I learnt about it because it was necessary. A year or two ago my friend’s computer was packing up, and he asked me to extract and store…

  • FreeGuide fan mail

    Really encouraged to receive this: Hello Mr Balaam, A quick email to thank you for giving the world the brilliant Freeguide. (I saw in your blog that you have a high volume of email – no reply needed). I tried Digiguide for a while, loved the principle…

  • Over-engineering gone mad

    Picture the scene: you are writing a Java application and you’re trying to do things right, so you use the java.util.logging code to do your logging. To create a logger you do this: Logger log = Logger.getLogger( “name” ); Everything goes fine until yo…

  • Keyboard layout change in Ubuntu

    I’ve had this problem a couple of times in my Ubuntu machine. I installed it with US keyboard layout, and then changed it to UK later (for my user). Even when I select the correct keyboard model (Generic 105-key (Intl) PC), and layout (United Kingdom I…

  • FreeGuide source layout (and SVN migration)

    Christian and others have pointed out lots of problems with the source code layout in FreeGuide. The biggest problem is that each plugin has its own source tree which makes it very difficult to set up in an IDE like Eclipse. I knew it needed doing, and…

  • Letter to Linux Journal

    Dear LJ, I’d like to start by saying thank you very much for the years of quality articles and features that your magazine has provided. I eagerly await the arrival of each month’s copy as it jets over the Atlantic to my doorstep. LJ has always provide…

  • Linux Journal slides

    jdub notes that Linux Journal is going to the dogs. If the only change were to the back page I could get over it and move on, but so far I am about half way through the latest issue (March 2006?) and I’ve read nothing but opinion pieces. I can get all …

  • Donation

    Forgot to mention: I got my first non-anonymous donation to the FreeGuide project – Steve Fuller sent in a donation along with a request (but with no implication of linkage ;). Thanks Steve! It never ceases to amaze me how Americans will donate to proj…

  • FreeGuide update

    I have very little time for FreeGuide at the moment. Part of the problem is that there are lots of boring bugs to fix instead of interesting new features, and it’s hard to motivate myself to get into it. I am really keen on making it Just Work every ti…

  • Faster Poker Analysis

    Forgot to mention that I also have one other optimisation up my sleeve: instead of fully analysing each hand I could only do that when I need it i.e. when the hand type is the same, so I could just return “flush” and only if your opponent also has a fl…

  • Poker Analysis

    I’ve just requested sourceforge space for my latest mini-project: Poker Analysis. I’ve been a big fan of poker for years, and am pleased to see everyone is catching up with me finally with the boom of Internet poker. I’ve started playing a little onlin…

  • Podcasts I listen to

    I use a modestly-modified BashPodder to download my podcasts (Internet radio shows) automatically every night, and sort them into different directories. If anyone is interested in my modifications, do ask and I can send them to you. I haven’t sent them…

  • Setting up my ideal email system 4

    Sending mail I used to do something clever with sendmail, but then spamcop blocked my computer because it apparently wasn’t set up properly, so now I use my ISP’s smtp server like everyone else. When I need to tunnel in I simply create a tunnel from lo…

  • I spawn

  • Setting up my ideal email system 3

    Fetchmail setup My ISP provides my email by POP3, so I use fetchmail to download it every 10 minutes. I created a file .fetchmailrc file in my home directory that looks like this: # Configuration created Wed Jul 27 06:43:07 2005 by fetchmailconf set po…

  • FreeGuide 0.10pre2

    So I’ve put out FreeGuide version 0.10pre2, and then a little bug-fix release because the Linux RPMs were broken. By calling this 0.10pre2-2 I managed to annoy my faithful Gentoo packager Christian, and myself, but at the time it seemed too much hassle…

  • Setting up my ideal email system 2

    Setting up Mozilla Thunderbird On the same machine that was running Dovecot, I set up Thunderbird to be able to access my email. I did this by creating a new email account (which I called “Andy IMAP”), choosing “localhost” as the server, and entering t…

  • Setting up my ideal email system

    Recently I have managed to get pretty much my ideal email system set up. This is the kind of thing that would simply be impossible on a Windows box, but (when you know how) is a quick job on Linux. I didn’t know how, but now I do (ish). I’m going to do…

  • Just a little bit longer…

    Now that my Christian youth holiday is over, I’ve got just one more major job to do before I can get back to working on FreeGuide: my thesis corrections. I don’t know how long it’s going to take, but it will certainly be painful. It might be best to av…

  • BashPodder

    I really must get BashPodder working, not only to download my two favourite Linux shows TLLTS and LugRadio but also because Radio 4 has started making Today and the best radio programme out there, From Our Own Correspondent available for podcast downlo…

  • Python objects in C++

    Sometime I find myself thinking in Python. Or, accurately, wistfully thinking of Python. Raw C++ is completely hamstrung when it comes to simple concepts like handling strings or dealing with lists (maybe BOOST is better?). Why can’t I just do this: re…

  • CD writing on Fedora Core 3

    I’m now thing of moving off Fedora Core 3 (probably to Ubuntu, or maybe FC4 for the Java stuff) and it turns out I’ve never written a CD from it, because when I tried it didn’t work: I kept getting the message “cdrecord: Success. Cannot open SCSI drive…

  • Prince of Persia – The Sands of Time

    arrived through the post from ebay yesterday. It is superb. Exactly my kind of game, and with loads of features from the old game (one of my favourites of all time), all updated and made even more beautiful. It is incredibly atmospheric, and so far the…

  • Personal stuff is boring

    …and I am not a big fan of pictures in blogs, but this is a special occasion: World domination is nigh. Soon we shall all be Balaams.

  • Sourceforge

    I have requested a Sourceforge project for DIYBlog, and it just struck me again how utterly fantastic Sourceforge is. What would the Free and Open Source Software world be like now without Sourceforge? A lot poorer, I reckon. I’m desperately trying to …

  • London

    London is a little quieter than normal this morning, but still pretty busy. It seems like most people are going to work, although some are having to walk. There are definitely fewer tourists on the streets.

  • London terrorist attacks

    As a largely unmilitarised country, Britain (like many other Western countries) is a soft target for terrorists. But that very softness makes attacking us in this way pointless: it’s like punching a sponge. We won’t change – we like our country how it …

  • The dangers of learning to code

    I was speaking to someone over the weekend who works in HR and has been enjoying making various Microsoft Access databases to do useful things for work. I warned her she might get the programming bug and then never be able to stop. Then I realised she …

  • Train gaming

    For my train journey, I ended up downloading a few emulators that didn’t work, and a few games that didn’t work, but what did work was the PC version of Prince of Persia, and the PC version of Cannon Fodder, both of which were very enjoyable. Especiall…

  • Constantly changing passwords

    I know it’s supposed to be best practice to force users to change their passwords regularly, but how are we supposed to remember them? I wonder whether anyone has done any research into passwords becoming lower quality as people are asked to change the…

  • Gaming on the move

    We’re taking a 4.5 hour train ride to Leeds at the weekend, and then even longer on the way home, so I am hoping to entertain myself using a Windows 2000 laptop with no CD drive. The options I’m thinking of are: Pingus Prince of Persia on WinUAE Conti…

  • ATV Palm export

    We’ve already had a bug report/feature request for the ATV Palm plugin Alex wrote, so it’s obviously going to be pretty popular. It’s really great that Alex is doing so much work on FreeGuide at the moment. We are having our disagreements here and ther…