Archive for December, 2007

svn up is short for svn update

December 19, 2007

Did you know that “svn up” is short for “svn update”

I find I almost always misspell “update”. It’s a bit harder to misspell “up”…


Cropping PDF files… don’t do it!

December 19, 2007

Every now and again you hear stories of organisations embarrassed by pdf files containing supposedly redacted material. You know the sort of thing: somebody put a solid black bar over somebody’s name in a confidential document and published it on the interweb, but some other clever person found the document and looked at the pdf code to see what was under the name.

The problem is that the pdf contains (i) code to draw the name on the page and then (ii) code to draw a thick black bar over the name. So obviously if you inspect the code, you can in theory see all the redacted material. Oops.

There another interesting way this can happen. If you use a pdf tool to crop a pdf page, you could be leaking information.

Let’s say your payslip printing program prints three payslips per page. And you used to cut them up, or they’d print onto special perforated paper. Whatever.

Anyway, nowadays nobody wants paper payslips. Eugh. They want pdf. Easier to distribute, easier to manage, easier to store. So you print the payslips to pdf, then use a pdf cropping program to cut each page up into three.

If you do this, you’re probably going to be sorry some day. You see, pdf is a page description language. It laboriously emits all the commands for drawing a  page, then it “emits” the page, then it starts the next page. The point is that you can fairly safely split a pdf document up at page boundaries … as far as I know, I could be wrong … but you can’t safely split a pdf document up into little bits of a page.

All the cropping program does is render the whole page, but then change the viewport (or whatever) to some subset of the page. All the original page’s data is still there. If the recipients of the payslips only knew it, they could read the contents of two colleague’s payslips.

Isn’t pdf interesting? I love it, but like any technology, it has hidden gotchas.

Installing clisp on windows

December 18, 2007

I just followed the instructions at This post is a cut-n-paste of that, with commentary. I’m using this blog as a personal notepad; if that page ever disappears, I’ll have this one. You should follow the instructions on the original page.

First, you download minGW-4.1.1.exe. I’ve always disliked the name of this, probably because “ming” in Northern Ireland is an intransitive verb meaning “to reek apallingly, to be incredibly ugly, to be superlatively bad”, e.g. it mings, it’s mingin’, she’s a minger, etc. I parse “mingw” as “ming-double-ewe”. Yuck.

Anyway, then I install MSYS-1.0.10.exe (into c:\mingw\1.0 apparently, not the default c:\msys\1.0). Answer yes to most questions, but answer “c:/mingw” when it asks where your mingw is. I’d never met msys before. It looks a bit like cygwin, only … windows-ier. Yuck, I think.

Download clisp-2.38.tar.gz, clisp-2.38.patch and libsigsegv-2.2.tar.gz into c:/mingw/1.0/. Run mingw, build it all:

export PATH=.:/bin:/usr/bin:/mingw/bin
cd /
tar -xzf clisp-2.38.tar.gz
cd clisp-2.38
cat /clisp-2.38.patch | patch -p1
CC='gcc -mno-cygwin'; export CC
mkdir tools; cd tools; prefix=`pwd`/i686-pc-mingw32
tar xfz /libsigsegv-2.2.tar.gz
cd libsigsegv-2.2
./configure --prefix=${prefix}
make check
make install
cd ../..
./configure --with-mingw \
            --without-readline \
            --with-libsigsegv-prefix=${prefix} \
            --with-module=rawsock \
            --with-module=bindings/win32 \
            --build clisp-gui

Copy /clisp-2.8/clisp-gui/full/lisp.exe and /clisp-2.38/clisp-gui/full/lispinit.mem to my “application” directory. My what now?

Now I can apparently deliver applications. Niiiice, if true.

Hmmm, if you run the lisp.exe that results, it doesn’t do anything.

But if you follow the instructions, create a file message.lisp

(use-package "FFI")
(def-call-out messagebox
              (:name "MessageBoxA") (:library "user32.dll")
              (:arguments (hwnd int) (text c-string) (capt c-string) (type uint))
              (:return-type int)
              (:language :stdc))

(defun main()
  (messagebox 0 "Hello World!" "Message" 0)

…and also build an application (from a cmd prompt)…

lisp -M lispinit.mem -x "(load \"message.lisp\")(ext:saveinitmem \"message\" :init-function #'main :executable t :norc t)"

…you do actually get an application “message.exe”. Which is nice.

I’ve put my lisp.exe and lispinit.mem in a c:\clisp\ directory.

Evolution and non-competes

December 13, 2007

You sometimes hear people talking about the evolution of businesses. This irritates me a little. Evolution happens through reproduction. Slowwwwly.  Entities don’t “evolve”. Species evolve. If anything business-ish can be likened to evolution, it’s when new businesses are born out of old ones.

I’ve read some discussions recently on the merits of non-competes. Seems to me that if a non-compete means that a business can’t easily “reproduce”, then it’s going to mean a given business will have fewer descendants.

You might or might not regard this as a good thing. If you’re an owner of the business, you might look upon descendant businesses as the owner of an apple tree would regard other trees growing very close to his apple tree: with horror, disgust, and an axe.

If you regard companies as being mechanisms for human beings to work together for the betterment of humanity – by doing something somebody wants them to do – then you might regard business offspring as a good thing.

Empirically, it does seem that countries with high “churn” of businesses do better – in terms of doing things that people want – than countries with low churn. This would lend credence to the second point, that churn is good for (a) society. But these countries tend be the richer countries. This would tend to suggest that churn is good for business owners.

How exciting. Business evolution is good. Therefore non-competes are bad, not just for society, but for investors too!

Commuting into Belfast (via Lisburn train station)

December 12, 2007

I “commute” from Dromara to Belfast. Well, commute is too grand a word for it. The way I see it, I just drive into work. I usually go very early in the morning, so it would take between forty and sixty minutes, door to door. And that’s with me parking near Botanic and walking into town.

Recently though I’ve found myself not wanting to get up in time to leave before seven. And I’m finding that leaving sometime after eight (but before nine) means that my trip in really does deserve the name “commute”. Darn. As well as that, it’s hard to find somewhere “good” to park.

So I’m thinking of taking the train for a bit of the journey. Maybe drive to Lisburn, park somewhere, then get the train. I’ve got a timetable. I’ve googled for pricing. And I’m ready to give it a go. Maybe I’ll write about my experiences. Hmmmm.

Lisburn train station – a minor rant

December 12, 2007

…In which I rant a teeny little bit about Translink.

When you get off the train in Lisburn, there’s a double door to take you out of the station. But they keep one half of these doors closed, and a guy checks everybody’s ticket. Y’know, to make sure you haven’t *gasp* fare-dodged.

Anyway, the most annoying bit is that they do this even when there’s a massive queue to get out of the station, even when there are loads of members of staff hanging around. How annoying.

And it gets worse: if there are people coming through to get onto the train, they come through the same single door, and the same person insists on checking their tickets. But they have priority, seemingly, so the huge queue of people waiting to get the hell out of the train station have to wait. And wait.

Normally my rants about Translink – Ulsterbus and especially Citybus – usually end with me raising my voice a couple of octaves, going a dangerous shade of red, foaming at the mouth and having to lie down for a while. But NIR, the railway bit, is actually not all that bad. It’s a bit like being in England. (Only not as good.) At least on the Lisburn-Belfast bit; the other bits aren’t as good. The bit to Larne, for example, is a bit like going back in time. And not to the part of history when trains were good.

Fairtrade: you have to be kind to be cruel

December 11, 2007

I find the idea of fairtrade a little discomfiting. It seems like a nascent giant bureaucracy that wants to control and bless all trade with “third world” farmers.

The soundbite I’ve come up with to describe my unease is “Fairtrade: because you have to be kind to be cruel.”

I like think that if I wanted to really grind “africa” under the boot of tyranny, and I mean even more than now, I think I’d invent something like fairtrade.

This said, I try incredibly hard to be alert to evidence that might make me change my mind. Thus, I’m open to the idea that fairtrade could be a good thing. I’m skeptical though. Evidence welcome.

Don’t get me wrong: I’m totally in favour of free trade. That is, trade between two parties without anybody holding a gun to anybody’s head, or bribing one of the parties (e.g. the Common Agricultural Policy of the EU).

At best, fairtrade slightly levels the playing field between the farmers of europe (who get to snort at the EU CAP trough) and some farmers in the third world (who get to snort at the fairtrade trough. But it completely fucks farmers who aren’t blessed by the fairtrade bureaucracy. C’est la vie.

How can trade be bad?

December 11, 2007

I heard Bob Geldof (may he live long!) on the radio the other day, and he was moaning about free trade agreements between europe and africa. I think he was saying that africa needs aid, not trade. That opening up “africa” to free trade with europe would just mean that we (the europeans) would flood africa with our goods and that this would somehow hurt africa and africans.

If anybody else said this I’d just laugh and forget about it. But this was Bob Geldof. Bob Geldof. So I listened. Maybe he’s got a point.

I try not to be a fundamentalist about anything. Instead I try to believe things with varying degrees of intensity, but try really, really, really hard to stay alert to anything that might contradict what I currently believe.

Anyway, if I believe anything with a lot of conviction, I believe that free, unencumbered trade is a Good Thing. It’s easy: any unforced trade between two people leaves them both better off. Otherwise they wouldn’t do it.

Therefore, how can trade ever be bad?

OK, so a key word here is “unforced”. Anything that involves somebody spending somebody else’s money is likely not a good trade. (This probably covers most, it not all, government spending!)

My mind is open to the possibility that free trade between “europe” and “africa” could somehow be a bad thing. But I doubt it. Suggestions welcome. Evidence particularly welcome.

Quick booting of virtual machines

December 11, 2007

If the hypervisor is the new OS, then we’re going to need faster booting OSes. That is, if an “application” is going to be a virtual appliance sitting on its own little linux or freebsd, then we’re going to have to quickly, quickly come to a world where these little virtual machines have a “bios” that loads in milliseconds, and we’re going to want linux or freebsd to also boot in milliseconds. And I’m not even sure if milliseconds will be fast enough!

Goods *are* services

December 11, 2007

Every time you pay for something, you’re paying somebody. There’s no such thing as paying for goods, per se. Goods are merely services you can touch. Your payment accrues to somebody for doing something. Whether it be for having it in stock on the offchance that you buy it, for delivering it, for assembling it, for digging or sucking it out of the ground, or for agreeing not to hurt or kill the person who stores it, delivers it, assembles it, or sucks it out of the ground. (We call these payments bribes or taxes.)

People fret that modern, western countries don’t make anything any more. That we just “take in each others’ laundry”. Well, you know what? They’re right. But you know what else? It just doesn’t matter.

If goods are just a particular, tangible form of somebody doing something for somebody else, who cares if many services don’t take the form of goods?

On my more optimistic days, I get excited about how the future for humanity is so incredibly bright. We’ll all be doing things for other people, more and more efficiently, and more and more people will be doing things for us. What a wonderful, virtuous circle. God bless trade. God bless the internet.