S Anand

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.

ImportHtml doesn’t auto-refresh

A cool thing about Google Spreadsheets is that you can scrape websites using external data functions like importHtml. It’s really easy to use. The formula:

=importHtml("http://www.imdb.com/chart/top", "table", 1)

imports the Internet Movie Database top 250 table on to Google Spreadsheets.

Since you can publish these as RSS feeds, it ought to, in theory, be a great way of generating RSS feeds out of arbitrary content.

There’s just one problem: it doesn’t auto update.

There are claims that it does every hour. Maybe it does when the sheet is open. I don’t know. But it definitely does not when the sheet is closed. I wrote a simple script that logs the time at which the script was accessed, and prints the log every time it is accessed.

#!/usr/bin/env python
 
import datetime, os.path
 
print 'Content-Type: text/plain; charset=utf-8'
print ''
 
logfile = 'timenow.log'
try:    timelog = open(logfile).readlines()
except: timelog = []
timelog.append(str(datetime.datetime.now()) + '\n')
open(logfile, 'w').writelines(timelog)
print ''.join(timelog)

Then I importHtml’ed it into Google spreadsheets, and left it on for the night. Result: absolutely no hits when the document is closed.

Pity. Guess YQL is still the best option.

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.