How I do things

The Calvin and Hobbes search Takedown

Eight years ago, I started typing out each of the Calvin and Hobbes strips by hand. Four years ago, I set up a site that let people search for strips. Early this month, I was asked to take it down.

This is the story.


I can’t quite remember when I started reading Calvin & Hobbes. The earliest reference I can find in my blogs is in July 1999. I remember it didn’t take me long to become a fan. I’d read every strip on the newspaper; hunt them out at bookshops; and spend a fair bit of time searching for archives online.

At some point, I discovered a few archives of the complete Calvin & Hobbes images. These aren’t hard to find, and they’re still around in plenty. So that gave me a few more months of delight.

The trouble, though, was that I never could quite find a strip when I wanted to. A friend would refuse to accept something, and I’d want to pull out that strip where Calvin declares to reside in the state of “Denial”. Or if they said something fancy, I’d want to pull out the one where Hobbes says “I notice your oeuvre is monochromatic”. Or those strips where Calvin’s Dad explains how things work (“They build bigger and bigger trucks over the bridge until it breaks.”)

There were a few Calvin and Hobbes search engines around. None quite did what I wanted them to – which was to search the text, and show me the strip, with a nice scrollable interface.

So I set out to build one. I can’t remember when, exactly, but it was before Sep 11, 2002.

It took me many years. I’d spend several train rides and evenings typing this stuff out. My friends, employers and family were a bit puzzled, but just added it to my list of eccentricities and carried on. I was halfway there in 2005, pushed further in 2006, and with some help, I managed to finally complete it.

I was able to do a lot of cool stuff with this, like statistically improbable phrases and some amusing posts as well.

It also increased traffic to my site, which was a bit disconcerting. I didn’t want to attract attention. In 2007, I removed the page from Google’s indexes, which cut the number of hits a fair bit. Since then, the site was only visited by a few people that knew of it, and the occasional stumblers.

A month ago, I got reddit-ed and MetaFiltered.

It didn’t take me long to figure that a takedown notice would be on its way. It turned out to be quite a friendly mail, actually – scary only in parts. (A bit of a carrot-and-stick approach, perhaps.) Anyway, it took me all of 2 minutes to remove all of the pages and links.

Of course, the reason I went to all of this effort was because the original Calvin & Hobbes site does not have the search feature. I’ve reached out to United Media, offering my transcripts and code. Let’s see what happens.

Make backgrounds transparent

This is the simplest way that I’ve found to make the background colour of an image transparent.

  1. Download GIMP
  2. Open your image. I’ll pick this one:
  3. Optional: Select Image – Mode – RGB if it’s not RGB.
  4. Select Colors – Colors to Alpha…
  5. Click on the white button next to “From” and select the eye-dropper.
  6. Pick the green colour on the image, and click OK

The anti-aliasing is preserved as well.

Dear Tesco, your books are expensive

Dear Tesco,

I do like you. Really. Your products are invariably cheaper than I can find at most other places. I am a methodical, crazy gadget freak, and I find your gadget pricing impressive. I don’t always find what I want, but you often have the items I finally pick as the best value for money, and at very low prices.

But.

Your books are expensive.

Of Amazon’s bestsellers, just 2 out of the 100 books are cheaper on your site. And this is apart from the fact that I’d get free delivery from Amazon on 37 of those books (over £5), while you’d give me free delivery on 5 (over £15).

On average, that book list costs £5.66 on Amazon. With you, it’s £7.20. I don’t fancy paying 27% more. (36% if I include delivery.)

I’m not making this up. You can check: the books in red are cheaper at Amazon.
(as of 6pm on a cold, rainy Tuesday the end of March.)

Book Amazon Tesco
The Girl Who Kicked the Hornets’ Nest 3.86 3.86
The Girl with the Dragon Tattoo 3.48 3.86
The Girl Who Played with Fire 3.79 3.86
Wolf Hall 3.86 3.86
61 Hours 9.49 9.49
Solar 8.90 13.00
One Day 3.79 3.86
Mums Know Best: The Hairy Bikers’ Family Cookbook 8.98 13.00
The Lovely Bones 2.98 2.98
Breaking Dawn (Twilight Saga) 7.49 14.99
Eclipse (Twilight Saga) 3.99 6.99
New Atkins for a New You: The Ultimate Diet for Shedding Weight and Feeling Great 3.99 5.99
The Return: Nightfall (The Vampire Diaries) 3.49 6.99
New Moon (Twilight Saga) 2.98 6.99
Twilight (Twilight Saga) 3.44 6.99
The Struggle: Bks. 1 & 2 (The Vampire Diaries) 3.48 6.99
Brooklyn 3.86 3.86
Vampire Diaries: Bks. 3 & 4 (The Vampire Diaries) 3.49 5.99
Hamlyn All Colour 200 Slow Cooker Recipes (Hamlyn All Colour Cookbooks) 2.48 2.48
Shutter Island 3.98 3.59
101 One-pot Dishes: Tried-and-tested Recipes (Good Food 101) 1.97 1.97
The Secret Ingredient: Delicious, Easy Recipes Which Might Just Save Your Life 5.97 5.98
Percy Jackson and the Sea of Monsters 3.48 6.99
Percy Jackson and the Last Olympian 3.99 6.99
The Guernsey Literary and Potato Peel Pie Society 3.49 3.49
The Double Comfort Safari Club (No 1 Ladies Detective Agency) 7.99 12.00
The Hummingbird Bakery Cookbook 8.49 8.49
The Gruffalo 2.96 5.99
Percy Jackson and the Titan’s Curse 3.99  
Percy Jackson and the Battle of the Labyrinth 3.48  
The Big Short: Inside the Doomsday Machine 12.50 17.50
The Secret 4.55 4.55
The Time Traveler’s Wife 3.82 3.86
Miss Dahl’s Voluptuous Delights 11.50 13.00
Ching’s Chinese Food in Minutes 9.98 9.98
The Little Stranger 3.86 3.86
ReWork: Change the Way You Work Forever 5.50 7.69
Percy Jackson and the Lightning Thief 3.48 6.99
The Girl Who Kicked the Hornets’ Nest 9.49 9.49
Dead and Gone: A True Blood Novel (Sookie Stackhouse Vampire 9) 5.20 5.20
The Forgotten Highlander: My Incredible Story of Survival During the War in the Far East 9.48 9.48
Room on the Broom 2.98 5.99
Lord Sunday (The Keys to the Kingdom) 3.49 3.49
The Official Highway Code 1.65 1.65
The Gruffalo’s Child 2.94 5.99
The Return: Shadow Souls (The Vampire Diaries) 3.50 5.24
Three Cups of Tea 4.98 4.98
The End of the Party 12.50 12.50
The Very Hungry Caterpillar [Board Book] 2.97 5.99
Annabel Karmel’s New Complete Baby and Toddler Meal Planner 8.69 8.69
Bad Science 3.57 3.57
The Snail and the Whale 2.96 5.99
True Blood Boxed Set (Sookie Stackhouse Vampire) 19.95 19.95
Gone Tomorrow 3.86 3.86
The Italian Diet 6.98 6.98
The Snowman 6.48 9.09
Wedlock: How Georgian Britain’s Worst Husband Met His Match 3.86 3.86
Little Darlings 4.89 8.00
Eat, Pray, Love: One Woman’s Search for Everything 3.98 3.98
101 Meals for Two: Tried-and-tested Recipes (Good Food 101) 1.97 1.97
The Immortals: Blue Moon 3.48 6.99
The Host 3.82 3.82
The Catcher in the Rye 4.48 4.48
The Final Fantasy XIII Complete Official Guide 11.24 14.24
The Book Thief 3.95 3.95
Mexican Food Made Simple 9.99 9.99
Tea Time for the Traditionally Built: The No.1 Ladies’ Detective Agency: The No.1 Ladies’ Detective Agency, Book 10 (No 1 Ladies Detective Agency10) 3.86 3.86
The Oxford Companion to Food (Oxford Companions) 20.00 28.00
Sacred Hearts 3.86 3.86
A Squash and a Squeeze 3.00 5.99
Pokemon HeartGold/ SoulSilver Official Guide 9.74
Cutting for Stone 3.86 3.86
Trespass 8.98 8.98
Wheels on the Bus (Pre School Songs) 2.44 4.76
Alone in Berlin (Penguin Modern Classics) 4.98 4.98
The Good Man Jesus and the Scoundrel Christ (Myths) 7.50 10.00
Twenties Girl 3.85 3.86
The Last Straw (Diary of a Wimpy Kid) 3.48 6.99
Rodrick Rules: Diary of a Wimpy Kid (Book 2) 3.48 6.99
The Natural Navigator 7.48 10.49
The White Queen 3.99 6.39
The Shack 3.95 3.95
Good Food, 101 Cakes and Bakes 1.97 3.45
Faces (Baby’s Very First Book) 2.48 4.99
Lustrum 6.38 6.38
Blacklands 3.86 3.86
The Lost Symbol 8.78 9.00
A Touch of Dead (Sookie Stackhouse Vampire Myst) 5.20 9.09
The Spirit Level: Why More Equal Societies Almost Always Do Better 4.96 4.96
Jamie’s Ministry of Food: Anyone Can Learn to Cook in 24 Hours 15.00 15.00
Ottolenghi: The Cookbook 12.50 16.25
The Ice Cream Girls 5.89 9.00
The Best of Times 3.79 3.86
Whoops!: Why Everyone Owes Everyone and No One Can Pay 11.50 11.50
The Children’s Book 3.86 3.86
Twilight: v. 1: The Graphic Novel (Twilight the Graphic Novel 1) 6.49 12.99
Too Big to Fail: Inside the Battle to Save Wall Street 7.48 7.49
Dark Days (Skulduggery Pleasant – book 4) 5.84 12.99
It’s Only a Movie: Reel Life Adventures of a Film Obsessive 6.00 5.98
The Smartest Giant in Town 3.00 5.99

I do like you. Really. (Despite trying to stop me scraping via user agent detection.) I don’t mind that you don’t have every book. I trust you to pick what I’d most likely want. You’re good at that.

Please make your books less expensive?

Shopping with Cooliris

John Lewis jackets scrolling on CoolIris plugin

Zoom-in view of a jacket at John Lewis

I just put together this little demo that scrapes John Lewis’ site and creates a MediaRSS file out of it.

CoolIris has got to be the best way to shop. Apart from being really pretty, it’s quite useful when you know what something looks like, but don’t quite know how to search for it. For example, I was trying to look for a headphone-microphone (you know, the ones that connect into an iPhone or a Blackberry). I didn’t have a clue what it’s called. (TRRS, if you’re interested. I found out later.) The only way I could get it was to browse the wall…

Amazon search for ear microphones on CoolIris

For the curious, here’s the 50-line source code.

Recruiting smart people

Recently, I have ended up giving bits of advice to people recruiting at start-ups, and a few patterns have emerged that are worth sharing.

Before I go ahead, I should warn you that I have no qualifications whatsoever. (All consulting advice should come with this caveat, perhaps!) You might be better off reading Joel Spolsky’s Smart and Get Things Done (read). I haven’t read it myself, but from what little I see of it, the thoughts seem similar.

The key is to realise that smart people are probably 10 times as productive. OK, that may be wrong. It probably originated with Fred Brooks, and has been debated to death. But it seems fairly well accepted that the best people contribute more than they are better paid. (The best guy is probably paid twice the average, but is worth more than twice the average guy.)

This isn’t because they do more work. It’s because they solve harder problems. You can get two people to do two people’s work. You can’t solve a problem twice as hard even with twenty people.

For a startup, the problem is acute. You don’t have the luxury of being able to manage a large number of people.

Since smart people typically work for a lot less than they’re probably worth, it’s a bargain to hire smart people. You pay them twice as much, and they’ll solve problems twenty others couldn’t solve.

The problem boils down to finding smart people and getting them on board.

Finding smart people

You need to go after the smart people. They won’t come to you. Many reasons. You’re not big enough. There aren’t that many of them. They’re not in the market that much (no one lets go of them anyway).

So that just demolishes the traditional recruitment model straight away. You don’t advertise for people and filter their resumes. You find the people you want and go after them.

The good thing is, smart people cluster. They tend to know other smart people, meet up with other smart people, read the same things as other smart people, etc. That gives some useful starting points.

Matt Biddulph talks about Algorithmic recruitment with Github. The premise is that smart programmers are at the centre of the social networks in their respective areas. Just go after them. I advised a friend similarly: to look for the network (or at least the smart people) that hang out on Stack Overflow for a given topic. Last year, when I was looking for a Django developer, I scoured the Infosys internal blogs for similar networks. (Found only a few, but it sure introduced me to a lot of really smart people that I didn’t know existed!)

Conferences are another place to look for them. I tend to periodically check out Upcoming and Meetup to see who’s taking part in what, go over, meet them, and see what they do. I find it a great way of figuring out who’re the experts in a field. (I once met one of the guys who wrote TiddlyWiki, and it was immediately obvious that he was in a different league from the others that day at the Javascript Meetup.)

You can go a step further. Since smart people cluster, they form networks, and control of that network is power. So why not organise those conferences? A lot of these smart people just need a place to hang out and learn from each other. I know the Javascript Meetup was struggling to find a place to meet. Pubs don’t give you the quiet atmosphere needed to learn from each other, and it’s certainly impossible to have a talk there. The folks at Hackspace have done this really well, renting a place and equipment for people to tinker with electronics.

That’s what smart people want, mostly: a nice quiet place, good company, and perhaps pizza. Skills Matter does this beautifully. They organise free workshops every now and then. The list of people that attend these is invaluable.

Getting them on board

Once you’ve spotted a smart person, what do you offer them?

Remember – they’re probably 10 times as productive. Money is quite likely to be worth offering. If that works, great. But if you’re a startup, you probably don’t have the money. You probably could offer a stake in the firm. That might work too.

But, to quote Dan Pink: “One of the most robust findings of social science is that incentives dull the mind and hamper creativity. Yet, businesses ignore it.” Some people aren’t motivated by money. You might get better results if you didn’t pay money than if you did. (Read this story on motivation by Peter Bregman.)

Suppose you said, “I have this problem… I’ve no idea how to solve it. Would you be able to help me?” Most smart people would probably help you. For free. The feel good feeling is worth more than the transaction cost of extracting payment from you.

Or you might be championing a worthy cause – anywhere from world hunger, rural poverty or cure for cancer down to organising a scout camp. The thing about this is they are intrinsically attractive. You probably just need to open up and say “This is what I’m doing, can you help?”

The flip side of it is loss of control. Jonty told me about how Hackspace London was run: “it’s as loosely organised as possible without falling apart”. You don’t manage these people like traditional organisations. You manage them like a community of volunteers. Like parents at a school day function. Like family at a wedding. You don’t pay them. You don’t order them around either.

Part of that is the flexibility of being a startup. You can afford that loss of control. Yes, you don’t have the money. No, not everyone’s working for money. (The planet as a whole is fairly well off. Smart people particularly so.) But you might offer something interesting. Just as long as you’re willing to let go of some control in your mind…

SSH Tunneling via Rackspacecloud

I wrote about SSH Tunneling through web filters using Amazon’s EC2 at 8 cents/hr. With Rackspacecloud, you can get that down to 1.5 cents/hr. This turns out to be a lot simpler than EC2 as well!

Ingredients

  1. Rackspacecloud account (sign up for free – you won’t be charged until you use it)
  2. Putty (which may be available on your Intranet, if you’re lucky)

Directions

  1. On the Rackspacecloud console, click on wordpress website hosting– Cloud Servers – Add Server and select Ubuntu 9.10 (Karmic Koala). Actually, you can pick any other instance. I’m going to talk through this using Ubuntu 9.10 as the example.
    ssh-1
  2. Type any server name, pick a 256MB RAM instance, and click on Create Server.
    ssh-2
  3. Once the server has started, you’ll get the screen below. Click on the Console to open a session.
    ssh-3
  4. Your password would have been e-mailed to the account you registered with. Log in as root with that password. Now type the following:
    sed –i "s/^Port 22/Port 443/" /etc/ssh/sshd_config
    /etc/init.d/ssh restart

    ssh-4

  5. Run Putty. Type in root@<server-IP-address> as the host name, and 443 as the port
    putty1_thumb4
  6. Under Connection > Proxy, set HTTP as the proxy type. Type in the Proxy hostname and Port you normally use to access the Internet. Select Yes for Do DNS name lookup at proxy end. Type in your Windows login ID and password.
    putty2_thumb2
  7. Under Connection > SSH, select Enable Compression.
    putty5_thumb3
  8. Under Connection > SSH > Tunnels, type 9090 as the Source port, Dynamic as the Destination, and click Add.
    putty4_thumb2
  9. Now click Open. You should get a terminal into your Rackspacecloud instance. Log in with the same password as before.
  10. Open your Browser, and set the SOCKS server to localhost:9090. For Internet Explorer, go to Tools – Options – Connections – LAN Settings, select Use a proxy …, click on Advanced, and type localhost:9090 as the Socks server. Leave all other fields blank.
    ieconfig_thumb2
  11. For Firefox, go to Tools – Options – Advanced – Network – Settings and select Manual proxy configuration. Set the Socks Host to localhost:9090 and leave all other fields blank.
    ffconfig_thumb2
  12. Also, go to URL about:config, and make sure that network.proxy.socks_remote_dns is set to true.

Laptop power usage

I just got a digital wattmeter. Had no idea about these until Google PowerMeter, but now, they’re all the rage. Mine’s a pretty simple model and all  I plan to do with it is play around with a few household gadgets.

n67hh-small

My first target, obviously, was my Dell Latitude E5400. The statistics are interesting:

Power … when…
0.3W Laptop is switched off. The adapter must be consuming the power
1.3W Laptop is on standby.
12W The lid is closed, and no applications are running.
18.5W The laptop is on, the lid is open, and no applications are running
25W The laptop is writing to the hard disk
34W One CPU is fully utilised
41W Both CPUs are fully utilised

Looks like the display and hard disk each consume about 6.5 watts each, while the CPU consumes a whopping 15 + 7 = 22 watts.

One interesting observation is that the colour of the display doesn’t make much of a difference. From my CRT monitor days, I’d remembered that a black screen consumes less power, and is less likely to wear the screen off. So my desktop background has always been black, and most of my applications use a black theme. But it turns out that on LCDs, it makes absolutely no difference. A full white screen uses the same power as a full black screen. So I’ve really been wasting my time the last 9 years. (There is a good reason to have a black screen, sometimes – it’s much easier on the eyes when reading without lights.)

Another lesson was that turning off the wireless had no effect whatsoever. (It worked quite well for my Blackberry, though. Increased the battery life quite a bit. I thought the same might apply for laptops, but looks like it doesn’t.)

I’ll do an audit of some of my home appliances and post it out here. Wonder if there’s a repository of power usage for appliances…

Command line alarm

When I’m in front of my laptop, I usually forget the world around. Sadly, the world around has important things that need to get done on time. Like eating medicines, turning off the washing machine or the hob, etc.

The one thing I’ve been lacking on my machine was a simple alarm system. I’d like to set an alarm to remind me to do something in 5 minutes, for example. And it should be dead simple to set up.

After hunting around a fair for freeware to do this, I’ve finally settled on writing this tiny piece of Visual Basic code.

Set WshShell = CreateObject("WScript.Shell")
If WScript.Arguments.length &lt; 2 Then
  WScript.Echo "Usage: alarm <time-in-minutes> <message>"
Else
  WScript.Sleep WScript.Arguments.Item(0) * 60 * 1000
  msg = ""
  For i = 1 to WScript.Arguments.Count - 1
      msg = msg + WScript.Arguments.Item(i) + " "
  Next
  WshShell.Popup msg, -1, "Alarm", 64
End If

I’ve saved this as “alarm.vbs” somewhere in my path. When I need to set an alarm, I just type

alarm 5 Turn off the hob

This pops up a window in 5 minutes with the alarm:

An informational popup window saying Turn off the hob

This turned out to be a life-saver yesterday. I had to catch a flight at the Bangalore airport, and traffic is notoriously bad. To be on the safe side, I set up the following:

alarm 25 Catch the flight
alarm 30 You really need to go now
alarm 35 You've missed the flight

Turned out to be a wise thing. I ignored the first alarm. On the second, I said “OK, OK, just 1 minute…” and it really took the third alarm to get me going. Just barely made it to the flight.