ANACs to you

These are useful numbers to use if you are dealing with POTS:



It's been a while, but guess what?  It's time for more exciting notes on manipulating PDFs for preparation of scientific documents!

To crop a PDF to its bounding box, just try
pdfcrop input.pdf output.pdf
That's all!
This relies on having pdfcrop installed, but it seems to be there in my install of cygwin.


Urgent Threats

A frantic email sidles its way into my inbox:

I know this might come as a suprise to you,but I made a quick trip to Madrid in Spain and was attacked by thieves.My bag,valuables,credit cards and passport were stolen.The embassy has cooperated by issuing a temporary passport.I need funds to settle outstanding hotel bills,ticket and other expenses.

To be honest,i don't have money with me at the moment. I've made contact with my bank but the best they could do was to send me a new card by post which will take 2-4 working days to arrive here. I need you to lend me some Money to sort my self out of this predicament, i will pay back once i get this over with because i need to make a last minute flight.

Western Union or MoneyGram is the fastest option to wire funds to me. Let me know if you need my details(Full names/location) to effect a transfer. You can reach me via hotel's desk phone and the number is, +34 ...

Best regards,

Note to scam artists: try to make sure that your mark has actually heard of the person you are impersonating. In this case, I had to websearch them, and only then vaguely recognized their name as someone else distantly in the CS biz. I suppose you could argue that this is just a scattershot approach aiming to hit someone who will fall for it, but the problem is, like the traditional 419 scams, at some point even the dumbest user will start to twig that there must be something up when they received dozens of advanced fee fraud solicitations.

On the plus side, at least the country code matches the content of the message, and the from: address looks somewhat plausible.

On the minus side, one day someone is going to get robbed in a foreign country and need their friends to wire them some money, and no one will believe them.


More Misdirected Mail

Another erroneous email comes flooding into my inbox.

Hey gary and carol!!
I'm not sure if you got my texts, my phone is acting strange and not letting me call anyone! I'm in Bend and my dad says you are here too. I'm going to an artwalk in downtown bend tonight, if you are going to be around you should give me a call! My number is xxxxxxxxxx. If not, we should grab coffee or something tomorrow before I head back to school! Hope to talk to ya soon.
Sent from my Verizon Wireless BlackBerry
If you are in Bend, then I am sorry to hear it.


The Elders of Scion

Simon was an unremarkable boy, who grew up in an unremarkable town and went to an unremarkable school. One day a remarkable thing happened to him, the first remarkable thing that had ever happened to him, as he returned home from football practice.

A tall man strode confidently up to Simon and said, "The Elders of Scion have been watching you. We see great potential in you. From now on, everything you do will be guided by agents of the Elders of Scion. This will lead you to greatness". Then he turned around abruptly and stomped away into the twilght.

Simon thought a great deal about this encounter over the next few days. Surely this could not be real? He was, after all, quite unremarkable. Although, Simon had always believed that beneath a veneer of unremarkability, he did indeed have a great potential for greatness. Could there really be some kind of secret organization called the Elders of Scion that would help him achieve great things? It seemed unlikely, and there was no entry on the topic in the big encyclopedia in the school library.

However, now that he was watching out for signs, Simon started to notice strange events, out of place. When he played football, he seemed to get more passes to him. He scored highly on a test that he really hadn't prepared for. Then he tried asking out a girl in his class that he liked to see if the Elders of Scion could affect even that, and she said yes.

As time went on, Simon came to recognize the actions of the Elders of Scion everywhere in his daily life. Things seemed to just work out for him. Buses showed up just as he began to look for one. He got a job at a local hotel that paid well and didn't really require him to do anything. Life went well. Of course, to keep the actions of the Elders a secret from others, not everything went perfectly, but enough things went his way that he was sure that they were looking out for him.

After school, Simon got a job with the first company he applied to. It was a company that did something complicated with money that no one person who worked at the company fully understood. Filled with confidence, Simon knew he didn't really have to work too hard, and instead went to meetings, and told people exactly what he thought they should do. As a result, he quickly got recognized as a visionary and promoted.

Almost before he realized it, Simon found himself the youngest chairman of the whole company. He had everything he could ever want. He had a beautiful wife, and a beautiful home, and two beautiful daughters, and most beautiful of all, a very large amount of company stock.

But something nagged at Simon's mind. Yes, clearly he had benefited from the help of the Elders of Scion in reaching this position. But was there more to it? How many others were in his position? What else could the Elders do for him? What more did they have planned?

He decided that he would have to find the Elders of Scion, and learn all their secrets. But this was difficult. No one he mentioned the name to, casually, would admit to having heard of the organization. Not even those he most suspected being agents of the elders gave any indication that they knew what he was talking about. There was only one thing for it. He would have to find the man who had first told him about his destiny.

The number of people you would have to interview to find one man who talked to an unremarkable boy almost twenty years ago would be huge. But fortunately Simon could afford to pay private detectives a high hourly rate to do that for him. And, after several months of dead ends, at last came the news that they had found the man. What's more, they said that they were certain that he had a strong connection to the Elders of Scion.

Simon knew that he had to talk to this man in person. So he found himself at the door of an unremarkable semi in an unremarkable village near where he grew up. The man was confused to see him, but let him in anyway.

"The Elders of Scion? I was in them long time ago." he admitted to Simon. "Bit of a waste of time, if you ask me. I remember I saved about a grand to get 500 CDs made up, but we only shifted about twelve of them. Got the rest in a box in the attic, I think. How come you've heard of us?"

Simon, a little confused, told the story of how the man had changed his life, and how everything since then had been influenced by the Elders of Scion.

The man looked confused for a while. Then a short laugh erupted out of him like a belch.

"Oh, that! I'd forgotten completely till you reminded me. I was pissed. I'd been rehearsing with the rest of the band, and had a couple of beers while we were at it. On the way to the offie to get some more, I saw some scrawny little kid, and decided to scare him with some made up story. Are you telling me you really believed that?"

There was an awkward silence, and Simon soon left.

Things didn't go so well for Simon after that. A change in the market wiped out a lot of the company's investments, and a boardroom coup that he didn't see coming ejected him from the company. His wife quietly started sleeping in the guest bedroom, and his daughters were angry at him because he wouldn't buy them ponys.

He started taking long walks in the countryside, kicking his way through autumn leaves. He thought about how ridiculous his life had been, based on a silly superstition about a non-existent conspiracy centered around him.

But, over time, things started to improve. He got headhunted to a consultancy firm that didn't really need him to do anything. His daughters started talking to him again when he bought them the latest must-have toy, a robotic cat that would hiss and scratch you if you ignored it. And he began an affair with one of the secretaries at the consultancy, something he'd been meaning to do for a while but never had the time for before.

Simon still drives off into the countryside and goes for long walks. Every now and then he sees a child running or playing alone. And when he does, he tells them that the Elders of Scion have been watching them, and they see great potential. From now on, their actions will be helped by agents of the Elders, and great things await them.

Mostly, the children look back blankly, not understanding the words. Some of them accuse him of being a child molester, and tell him to piss off. But for one or two, a light goes on in their eyes. Of course they have always had potential, and now they can realize that potential, thanks to the Elders of Scion.


As I was going to Manchester...

...I met:
  • A 40-year old black man in Plymouth
  • The ward sister in a paediatric hospital in Cardiff
  • A woman in Crosby who had been burgled
  • My father who ran a youth club
  • A young man in London whose flat has been burgled five times
  • My mother, a magistrate in Newbury for 30 years
  • A man in my constituency called Clive Stone who had kidney cancer
What a busy evening!


epstopdf rotating issue

Another post more for my own benefit and future reference.

epstopdf often rotates figures that you'd prefer it didn't. That's ghostscript getting a bit eager. The following kludge will fix it:

export GS_OPTIONS=-dAutoRotatePages=/None

before running epstopdf as usual.


export GS_OPTIONS="-dPDFSETTINGS=/prepress -dAutoRotatePages=/None"
to embed fonts as well...



For no one's real interest, but because I've done this for the past couple of years, here are all the films that I watched on NetFlix in 2009. Fans of privacy invasion might try to use this to break the anonymity of any future releases of netflix user data, but since I'm disclosing pretty much everything that would be announced, I fail to see what it might get you.

Previously I have added some commentary on each film, but I'm not sure that I can be bothered to this time. They mostly speak for themselves, or at least for the combination of my odd selection of tastes and my habit of randomly ordering my queue so I never know what is coming next.

Mr. Magorium's Wonder Emporium
Forgetting Sarah Marshall
The Evil Dead
Naked Lunch
Titan A.E.
Watchmen: Tales of the Black Freighter
Vicky Cristina Barcelona
Pan's Labyrinth
Guerrilla: The Taking of Patty Hearst
Ocean's Thirteen
Afro Samurai: Season 1
A Clockwork Orange
But I'm a Cheerleader
The Girl in the Cafe
Grey Gardens
The King of Kong
Tenacious D in: The Pick of Destiny
Run Lola Run
Being There
Ghost Rider
Murder by Death
Collected Shorts of Jan Svankmajer: Vol. 2
No Country for Old Men
The Last King of Scotland
The Weather Underground
The Monster Squad
Logan's Run
Princess Mononoke
The Kid Stays in the Picture
Harry Potter and the Order of the Phoenix
Chronicles of Narnia: Prince Caspian
National Treasure: Book of Secrets
A/k/a Tommy Chong
Superman Returns
District B13
Kevin Smith 2: Evening Harder: Disc 2
Man on Wire


Why I (don't) blog

It seems to be quite a few months since I wrote anything. Laziness, is the main reason. Also, Facebook. Now that facebook makes it easy to post an idle comment about anything that's on my mind, it makes the need to write here seem less urgent.

However, Facebook isn't everything. It also encourages more short form comments, so there's less scope to witter on at length about trivia. And, since it's done under my own name, and visible to everyone who's ever met me, there's a lot more incentive to self-censor and tone down. So I should probably make more effort to be more longwinded, obnoxious and tedious in this forum. Let's see if I can manage more of that in 2010.


More more misdirected mail

More exciting mail plops into my inbox evidently intended for someone else. First, a text from a Florida (813) blurts out "Hi missing u". Which is all very well and good, but what am I supposed to do about that?

And then a receipt from a site offering white water rafting excursions in Canada:
Online payment Submitted on 2009-06-23

ARRIVAL DATE (yyyy-mm-dd): 2009-06-24
CITY: Newmarket
CC TYPE: vis
CC NUMBER: xxxxxxxxxxxx9908
COMMENTS: Fxxx you Holly

Not quite sure what the obscenity (uncensored in the original email) in the COMMENTS field is all about -- who's Holly?


Travel Arrangements

A usually haphazard journey. Plane arrives half an hour late into LHR. Sitting near the front, I manage to get out quickly with all my luggage from the overheads, and pace quickly so that I'm second to passport control. Waltz in with no trouble at all, and with only a minor diversion around the back of a baggage carousel to avoid a troublemaker being pinned down by two police, am cleared through customs with the usual indifference into the UK proper in less than 15 minutes from deplaning. Check that, American border security.

Zoom to Heathrow express (or HEX to its friends), pick up a ticket, and get on the last train that fits my schedule with a minute to spare. End up at Lon Pad, collect my 10 quid single for Brstl Tmpl Mds, and even have time to pick up a sandwich from Boots, though chagrined that my selection does not somehow qualify for the meal deal. Relax, and try to ignore the pitiful whines of the old biddy who does not realize she is on the wrong train until the ticket collector informs her that this is the 12.00 to Bristol, not the 12.06 to Penzance. Wonder how someone can not only ignore all the platform signs, but also the repeated announcements over the intercom. Observe that she isn't even carrying the phone number of the person she is supposed to be meeting there, and decide that she clearly can't travel much if she was expecting no delays or reroutings.

Arrive BTM only 5 minutes late, see that the weather is more pleasant than I remember, and so decide to take bus instead of taxi. Debus about three stops sooner than I ought, but walk the rest of the way anyway. Arrive at hotel to discover that there was a bus stop right out front. Get to room, find it to be possibly the smallest hotel room I have ever stayed in, though am expectant that tomorrow's will beat it further. Slump, sleep. It's surprisingly good to be in England in June.


Wget this

I think I've mentioned before my netflix obsession: I want to be able to receive a disk from my selected set of movies without knowing what's on it till I start to watch it.

Well, this system works fine, but occasionally I do at least want to know how long this weeks movie is, and maybe even what genre it's in. This is trick, because there's no easy way to do this on the netflix site without learning the identity of the movie. So I decided to hack together a system to do this.

I could have tried to figure out how to use the netflix API to do this, but all that authentication stuff seems complicated. So instead, I decided to hack together something via feedflix: this is a third part site that shows you statistics about your usage. After logging in, it shows you a link to your current movie. So if I could just get a bot to simulate logging in and clicking on the movie, then I could scrape out the relevant details. Well, of course, it was much more complicated than I had thought. As well as dealing with cookies and session keys and the like, there was one particularly nasty bit: the site would return an authentication code which you had to post back with the log in form. Mostly this form is randomly chosen letters and numbers. But sometimes it would return a string with other characters like + in, which seemed to cause a problem when I would post them back. So I had to borrow someone else's trick, and run perl on the string to URL encode it. As a result, I think that this is quite possibly the nastiest little shell script that I have ever concocted. I'll paste it in, mainly to offend people who have any clue that it means:

EMAIL={my email address}
PWD={my feedflix password}
WOPTS="--cookies=on --load-cookies cookies.txt --keep-session-cookies --save-cookies cookies.txt -olog"

rm cookies.txt
AUTH1=$(grep authenticity $TMPFILE | cut -d\" -f12)
AUTH=$(perl -MURI::Escape -e "print uri_escape('$AUTH1');")
echo $AUTH
wget $BASEURL$LOGIN $WOPTS --post-data=authenticity_token=$AUTH\&email=$EMAIL\&password=$PWD\&commit=Login -O$TMPFILE
MOVIE=$(grep "href=/movie" $TMPFILE | head -n1 | cut '-d=' -f2 | cut '-d>' -f1 )
grep Duration movie -A 1 | tail -n1
grep Genre movie -A 1 | grep -v div

Vile, huh? And it'll probably break on the next movie that comes through, so I'll have to figure a way to patch it up then.


Chip Chop

Getting back to my office with some sesame chicken and rice, I noticed that the pair of chopsticks I had picked up was deficient to the tune of one. I didn't really feel like going back to the canteen to get another one, so scouted around my desk for an alternative. I found a plastic knife, which I used with my one chopstick to make an ad hoc pair of chopsticks. Result? It's actually easier to eat rice with one chopstick and a plastic knife than it is with a pair of chopsticks. Good to know.


Stamp Duty

I thought that I had already posted a lengthy and tedious whinge about the cost of stamps which I could link to, but it looks like I didn't so I'll have to recreate it on the fly.

A while ago, I found a letter that I had sent returned to me with a little "returned for postage" sticker placed on it. "Returned for postage"? What on earth does that mean? It had a first class stamp on it, which had been franked. I shrugged, put the letter in a new envelope with a fresh stamp, and stuck it back in the mail.

Of course, exactly the same thing happened. And so I went to my local post office, and asked them to explain what this meant. The clerk helpfully explained that the price of a first class stamp had gone up from 41c to 42c. "So what?" I asked "This stamp just says "First class", so it should be good for a first class letter. Apparently not. The stamp I had, which looked like:

is apparently only worth 41c, though there's nothing on it to indicate this.

I then paid the extra 1c of postage, which apparently was enough (and got a receipt for it), and my letter was taken away to be delivered. But now I had a big roll of what I thought were first class stamps but which turned out to be merely 41c stamps in a 42c world. So I bought 100 1c stamps, and proceeded to stick them on every letter that I send (the clerk eyed me when I asked for 100 1c stamps, as if to say "are you sure?" -- well, it's only a dollar for me).

This was just a few months back, but on the news today I heard some earthshattering news... the price of a first class stamp has now gone up to 44c. Oh, great. Now I need to stick 1 41c stamp and THREE 1c stamps to get my letters delivered. Damn you, USPS! Damn you! I was fooled into believing that you had sold me some mystical "forever" stamps, but it turns out you got me good and proper. Well, the jokes on you, since these 1c stamps must cost way more than 1c each to produce and process.

Puzzled by all this confusing stamp price palava? Then maybe this website is for you.



Another day, another 8000 airmiles and 14 hours in the sky. Putting aside the toll that this places on the sky, I tend to focus more closely on the personal toll that it takes, what with 12 hour time differences and the resultant crippling jetlag. So as usual, I distract myself with the provided in flight entertainment. This time is was Continental's AVOD system again. In the configuration I saw, it finally had a decent selection--about 300 movies and 150 short titles--compared to the 20 odd movies last time I encountered a version. It might even be getting more stable -- it only had to be rebooted once on the way out, and not at all on the way back. (That said, I had a row of 3 seats to myself on the way back; one screen was locked up through the whole trip, and a second hung after I had been prodding it for an hour or so. Fortunately, the middle screen survived to the end). The selections are still a bit idiosyncratic, especially on the "short program" front: most titles (TV shows) have only a couple of seemingly randomly chosen episodes with no apparent logic. Although, if you are a fan of the CSI franchises you can see just about every episode ever. UI is still flaky: only one fastforward/rewind speed, and rather unresponsive/laggy, so when you see something on screen and tap to resume, it's usually a couple of minutes away from where you want to be. And still no fast way to jump back to where you got to before the last crash/reboot.

The music side of the AVOD system still needs more attention. It had a rather clunky user interface, where you navigate by genre, then by CD. When you play a track from a CD, the track plays out, and then nothing happens. That is, there's no way to select an album and just listen to the whole thing through. A new feature is the "jukebox", which lets you add up to 50 tracks, and will do a track advance at the end of each song. So you can find an album you want to hear, click on each track in turn to add it to the jukebox, and then listen to the album. An "add all" feature would help here, although the whole metaphor is pretty broken, and is probably anathema to the iPod generation. I also miss the "radio channels" from the pre-On Demand days, which would have a 2.5 hour selection of music, which could be good to just stick on and not bother about choosing what to listen to: sometimes, you don't really want to be so Demanding.

The system as a whole is coming along, and it helps to pass the 14 hours (although not as much as simply stretching out and entering an altered state of semi-consciousness). I wonder what the policy is for rotating off the larger library of TV shows and movies: a few more flights, and I could exhaust the things I actually want to see.


Send in the clowns

It's at times like this that I'm reminded of the story about the depressed man who went to see a psychiatrist. Times were hard, with many people out of work and hungry. The man told the doctor of how miserable, depressed, alienated and lonely he felt. The doctor listened patiently, and at the end he said "I know just the cure for you. Tonight, the great clown Pagliacci is in town. Go, see his show and you will be filled once again with the joys of life."

At this, the man slumped further in his chair, and said, "But doctor... what the hell kind of prescription is that? I've just told you that I'm on the verge of suicide, and your advice is to go and watch some stupid clown show? How will that solve my problems? What crackpot medical school did you go to so that you come up with pointless fatuous suggestions like that? At least offer me prozac or something, you worthless piece of crap."


Nasty Search Queries

It's been a while since I posted any search queries that have brought people here, but it's long overdue. Most egregious from the recent batch was a query for "yes minister appleby/hacker slash", although I have to shoulder some responsibility for that since I briefly mentioned the topic back in 2003. Worryingly, after inventing the concept as a ridiculous dummy five years ago, it seems to have genuinely come to pass, at least judging from the search results. I'm not about to actually click on any of them.