Monday, 16 June 2008

Bash: printing the alphabet

(Sorry for the geeky topic, non-geeky readers)

Most have probably run across the "seq" command that will let you generate a list of numbers:
$ seq 1 4
1
2
3
4
But you can do similar with "echo" for a list of letters:

$ echo {a..d}
a b c d
$ echo {a..d}{a..d}
aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd

Wednesday, 11 June 2008

Think work sucks?

globeandmail.com: Think work sucks?
Actually, yes. Yes, I do.

Ok, let's be clear here: I like doing work but I don't really like the "traditional" work environment (an ironic term given the short length of time we've been working this way). Sarah forwarded me this article on ROWE (Results Only Work Environment) and all I can say is "Yes! Exactly! Has someone finally clued in?". Well, and also "Who came up with that name?". Maybe administrators love the name...

The idea is that you stop defining an employee's work in terms of hours in the office (or even hours worked, period) and start defining and measuring in terms of results. I've been lucky that most of my career so far has allowed me flexibility around the hours I work: a late morning here, a long day there, a banked day from working on the weekend, and so on. And I've always taken the attitude that, if I'm getting the job done, I don't need to feel too guilty if I spend a few minutes looking at a friend's photos while at work. But I've still always had to count hours because ultimately that's what I'm being paid for.

The difficulty with implementing a system like this, of course, is that it's easy to see if someone is sitting at their desk but much harder to determine whether they've achieved what you asked them to do. Plus you have to make sure your employees know what they're being asked to do. This may take more effort from managers to define tasks, set goals, and establish metrics. You might have to actually have those performance review sessions and dust off the 360 degree evaluation forms. But isn't this what managers are supposed to be doing anyway?

The end result is that there is just no excuse for not getting work done. As far as I can tell everyone wins, except possibly the guy in the back corner who hasn't done any actual work in 20 years. Maybe he gets motivated and actually finds himself happier? Maybe that's wishful thinking...

P.S. I don't think this ideas at the root of this are new or particularly insightful but if it's being adopted at all (and apparently Best Buy uses it) then that seems new.

P.P.S. What happens when employees start to feel like they're just being given a "harder" task than their co-workers?

Tuesday, 10 June 2008

Lipograms

Wandering through the bookstore at the airport in Kuala Lumpur, I came across this book. What caught my eye was not the title, but the claim on the front cover that the book was a lipogram and contains no E's. No E's?!! E is the most common letter of the alphabet. You can't even use "the" or "we" or "me" or "he" if you can't use E. How can you possibly write an entire novel without the letter E? At first I thought it was a joke but a quick skim certainly didn't turn up any occurences. Apparently the author wants to write one book for each letter of the alphabet... sheesh.


Tuesday, 27 May 2008

Two-way traffic

A few weeks ago we hired a driver and drove for two and a half hours (on the first day of a holiday weekend, no less) to one of the Great Wall sites. We thought we had negotiated a price that included road tolls so I was surprised to find us on small toll-free highways in so much traffic. I spent a good portion of the way there looking at sometimes-solid-sometimes-dotted expressway markings on the map that seemed to be running largely parallel to our route and telling myself that perhaps it just wasn't open yet. But the expressway isn't really the point of this story.

On several occasions, I've observed a certain traffic phenomenon here and this trip provided a good illustration. In China, you see, when someone or something on the road is in your way, you just... go around. Even if it means moving into an empty space in the oncoming lanes. Ignoring the danger of an accident, it seems reasonable enough at first glance: save yourself some time, keep the traffic flowing.

An hour or more into the trip we came along a particularly heavy patch of traffic and, as we inched along, I began to suspect what had happened: you see, this section of road had five lanes of traffic in total but there were four lanes going our way. Not a normal distribution. Sure enough as we moved along we came to a point where there were suddenly four lanes going the other way and ours all merged into one. Can you picture this? There was now one through-flowing lane in each direction and, in the middle, three lanes of traffic coming each way facing head-on into each other.

You can picture how this would happen: one direction slows up for some reason, someone darts around into a gap but doesn't make it back in because the traffic is moving slowly and there are no gaps. This blocks the traffic coming the other way and cars further back in that line, in frustration, dart around the stopped traffic ahead and find they can't get back in because the traffic has stopped. This is similar to the effect known as shockwave traffic, which produces traffic jams from something as simple as one car slowing too quickly in heavy traffic. Scientists in Japan recently managed to recreate this effect in a controlled environment. If you've never heard of this, check out the video mentioned in the above article or check out this computer simulation (click on "1: Ring-road" once it loads). Then you'll understand why that huge traffic jam you're stuck in often has no obvious cause when you get to the end of it. If you want to read more, check out here and here.

So, as the traffic keeps backing up, cars keep trying to go around and end up blocking more and more lanes. If the cars would only cooperate, they'd all get where they're going faster. Because everyone's trying to maximize their own forward progress, however, they end up in near gridlock. This kind of greedy algorithm reminds me of the Prisoner's Dilemma.

On our way home, we came upon the same patch of road and came to a complete stop for 15 minutes. Eventually, somebody opened a side street that had been blocked off and we were able to begin diverting around the stalled traffic into the countryside. As we moved our way forward, guess what I saw laid out in front of us?

Yup, 5 lines of traffic all pointing in the same direction...

Tuesday, 20 May 2008

Midnight Turf

It's midnight and I can't sleep. I'm lying listening to the rumble of trucks outside our window (open because it's getting to hot to sleep with it closed and we're still resisting A/C). "Turf?", I wonder?

Sure enough, a quick look out the window confirms the arrival of four large trucks carrying turf to be laid outside our apartment. The landscaping has been an ongoing project since we moved in nearly three months ago. Most of the time, the workers deliver their materials during the day using three-wheeled bicycle carts but some activities including including larger deliveries and a large loader shoveling bricks and other debris into dump trucks seem to occur in the middle of the night. Turf was laid on about half the area several weeks ago but much of was over-watered, died, and was finally pulled up again this week. Hence my hunch about the delivery.

Why the late hour? Apparently large trucks are prohibited within the 3rd or 4th ring road during the day without special permission; I hadn't noticed the nearly complete absence of trucks until someone mentioned it to me. Perhaps I should take a midnight walk one of these days and see what other trucks are driving around...

Monday, 19 May 2008

3 Minutes of Silence

At 2:28pm today, one week since the disastrous earthquake in Sichuan, people all over China maintained 3 minutes of silence for tens of thousands of victims who were killed. I stood watching from my apartment window as the office workers emerged from their buildings and the migrant workers planting flowers stood from their work. Everyone appeared to face southwest as car horns across the city began to blare continuously and in unison. What would normally be one of the most irritating noises imaginable, this time proved strangely moving...

Wednesday, 14 May 2008

The case for generalists

Seth Godin makes a case against being a generalist.

The problem is, I think the metaphor breaks down. Sure I want the best possible surgeon to fix my heart but I don't want to pay that surgeon to look at my sprained ankle or listen to my chest cough: there's a trade off there between specialization and cost. Also, I don't want a plumber, no matter how good he or she may be, to build my house for me. For that task I want a really good GENERAL contractor. Someone who knows just enough about all the parts of the house to make sure everything is done correctly and in the right order. A contractor who is good enough to know when to bring in other experts when necessary.

It seems to me there's a huge need for people who know enough about enough different things to communicate with and coordinate the specialists. Contractors, project managers, integrated health practitioners, and so on...

I've been thinking recently about companies hiring consultants. They bring in "specialized" consultants who throw buzzwords around and tell them what they Need To Do. The problem is that often nobody at the company knows enough to know what the consultants are talking about. What you almost need to do is hire another consultant (a generalist) for just long enough to talk to your other consultants and find out if what they're suggesting makes sense. I met a computer programmer type who did an internship (not specifically computer-related I think) with the airport authority in Beijing. In meetings, he was the only one with enough knowledge to really evaluate much of what the contractors were saying so they hired him on after his internship for quite a large sum of money to continue filling that role of "translator".

Now Seth also seems to suggest that the general contractor might even be considered a specialist role itself but then... what role isn't?