China, and the Great Wall

December 21st, 2007

great Wall

I have been continuing the ThoughtWorks tour, and have finally made it to the China office, in Beijing. The office has just moved here from Xi’an, and so the Monday that I arrived was a busy one, with old friends re-connecting, and the office rapidly filling up. In fact, we have very little room left, and may have to start find new space pretty soon. Once I have a few more photos, I’ll post a gallery of office photos. It is pretty much along the lines of other TW offices, a large open space with flat ‘dining tables’ and a very fun, collaborative feel.I was lucky enough to get here in time for the ThoughtWorks Away Day.

On the Sunday we went to the Great Wall near Beijing. The gallery is here (I haven’t put these on flickr yet, since it s blocked by the great firewall. Sigh.).

Biking to Ooty

November 27th, 2007

I guess there are always a few things that we don’t tell our parents until after the fact. No, get your minds out of the gutter, I don’t mean that. I mean the sort of thing that mother’s don’t need to know. They would only worry for no reason, so let’s spare them that and fill out the details later.

This was one of those. Recently the ThoughtWorks India office went to Ooty for an Away Day. The Away Day is a weekend technical and cultural fest (basically it involves geeking during the day and drinking and dancing at night) and in India we generally bus to somewhere within a few hours of Bangalore and spend the weekend there. This year was in Ooty, which is a hill station about 280km from Bangalore, past Mysore.

The route takes us to Mysore on one of the nicest South Indian roads (divided higway with 2 lanes each side), through Bandipur National Park (home of Project Tiger) and up a spectacular road to Ooty itself (36 hairpin bends).

A few of us felt that this was too good an opportunity to pass up, so with the help of Royal Enfield we got together some bikes, and the 14 of us took off at 7am to bike the 280km. For anyone who has not experienced the roads here, that may sound like a fairly quick jaunt. In fact, it took us about 12 hours each way. But the trip was awesome, and well worth it.

We were supposed to leave at 7am from the Bangalore office, but due to various issues, we were actually only able to leave by about 9:30. We drove for about an hour through Bangalore’s insane traffic, and ended up stopping for chai on the outskirts, near Bangalore University.

Rest stop before Mysore. Sagar picked up the sugar cane from a load that had been left on the road after a truck tipped over. This is fairly common here, as many trucks are overloaded and top-heavy We saw 2 just on the way to Mysore.

Rest stop after Mysore.

Lunch outside Gudalpet. We were waiting for Dheeraj, who was involved in a minor accident in a small town near Mysore.

Chai on the edge of Bandipur National Park.

Waiting for us at the petrol bunk.

At the bottom of the hill, we thought “Maybe we should fill up?” but it was getting late, and we felt that we were OK. famous last words of course. As a result we had to wait around while Keshav went off to find us some petrol. Luckily we were at the top of the hill, quite near Ooty, and there was an excellent chai stall.

The view from the hotel in Ooty.

Playing cards, Sunday night in Ooty.

Ooty — waiting for people to wake up

royal enfield enginerepairing the bike, OotyPlaying Uno, while waiting for the bike to be fixed

Ooty — Mechanics shop - playing cards again.

Coming back on the Monday, we hoped to leave at 10am, but we needed to get one of the bikes seen to first. It had lost the top gear. Unfortunately the mechanic took a long time to arrive, and when he did there was little he could do, so we had to ride it back to Mysore without a fix anyway. So we ended up leaving quite late, about 3pm.

Hairpin bend, Ooty

One of the 36 hairpin bends on the Ooty road. Near here, a car had gone over the side earlier in the day, falling down a sheer 100m drop. On the way up, we had done this road in the dark, and the rain. I’m kind of glad we couldn’t see the view, even though it was awesome coming down.

Bandipur national park.

This is the home of project Tiger, and one of our colleagues who drove back apparently saw one with cubs crossing the road, which is extremely rare, as they are quite shy. Deer and elephants are common though. We came upon a group as we rounded a corner, which was quite a shock at first, until we noticed that they were chained and domesticated. It is mating season right now, and wild male elephants (called ‘tuskers’ here in India) can be quite touchy.

Elephant with chain

Elephants in Bandipur

In Bandipur Keshav ‘distinguished’ himself by riding standing up and generally fooling around. It is relatively safe on the Thunderbirds since they are pretty stable at the low speeds we were doing, and there was not so much traffic in Bandipur.

Indian road near Mysore

Riding to Mysore In Mysore we stopped while the bike was seen to. It turned out to be a long job, so we ended up leaving the bike there. The dark green bike here is a very rare diesel model produced by Royal Enfield in the 70s. Yes, you did read that right, it is a diesel motorbike.

On the way back, in the early evening, I dropped the bike near a speed-breaker (aka speed bump, sleeping policeman). These are very common on Indian roads near cross roads and the entrance to towns, even on what you might consider a ‘highway’. Sometimes, as in this case, they can be very poorly marked. None of us saw it in time, and the vehicles in front of us also braked very late. My front wheel locked, and as any motorcyclist would tell you, once that happens you are not going to stay upright. Fortunately I was going slowly, and suffered only bent pride and some scrapes on elbow and knee.

Sripad was shaken up a bit by seeing the accident, and he himself came of the bike a few 100m later, as a result of hitting a pig. These are the hazards of Indian roads. Both he and the pig were fine.

Recovering at Coffee Day, half an hour after dropping the bike.

Murphy’s law hit later on I guess, when about 2 hours later the bike started acting very strangely - and handling like a sofa. I thought it was my imagination at first, then it was getting much worse. Naturally I assumed it was the after-effects of the accident. I swapped with another rider and when he rode off I noticed that the back tyre was going flat. This was at 10:30 at night on a Sunday, and when we stopped at a (closed) petrol bunk, I was pretty sure that it was a forlorn hope to find someone to fix it.

'Puncher' shop'Puncher' shop

Repairing punctures

Fortunately in India there is always hope. It turned out that there was a puncture shop a couple of kms back in the last town, and miracle of miracles, they were still sitting around drinking chai. A hundred rupees and we were back on our way. For me there were no more problems, although Keshav managed to have some fun when his muffler fell off. He carried it back to Bangalore, and eventually, after an event filled ride, we all made it back safely.

All in all it was an eventful, painful, wet and wonderful ride. It was a great way to travel, and hopefully it won’t be the last time I ride a bike across India. I’ll still wait till afterwards to tell my mother though.

Wix bug fix for importing InstallShield project with Dark

November 22nd, 2007

I have been spiking migrating our project’s InstallShield scripts to Wix. There are several good reasons to do this, which I will get to in another post.

But when trying to decompile the InstallShield msi using Dark I get the following error:

dark.exe : error DARK0001 : Cannot set column 'KeyColumn' with value 0 because it is less than the minimum allowed value for this column, 1.

Exception Type: System.InvalidOperationException

Stack Trace:
   at Microsoft.Tools.WindowsInstallerXml.ColumnDefinition.ValidateValue(Object value)
   at Microsoft.Tools.WindowsInstallerXml.Unbinder.UnbindDatabase(String databaseFile, Database database, OutputType outputType, String exportBasePath)
   at Microsoft.Tools.WindowsInstallerXml.Unbinder.UnbindDatabase(String databaseFile, OutputType outputType, String exportBasePath)
   at Microsoft.Tools.WindowsInstallerXml.Unbinder.Unbind(String file, OutputType outputType, String exportBasePath)

It turns out that InstallShield doesn’t put the right values in the _Validation table (whatever that is). Some hints are in this bug. It is next to impossible to fix it from the InstallShield side, so I did it by fixing the Wix side.

Note: You need to check out the CVS version of Wix to build it - the source downloads from the website do not work. No documentation on this anywhere of course. Sigh.

When you have the code compiling, the hack is simple - modify the columnDefinition for KeyColumn in the file src/wix/Data/tables.xml to allow 0’s in that column. Note that this is a hack not a solution. This may cause other problems and probably the Wix guys will need to fix this for real, maybe by supplying a default value. But it did allow me to export the MSI successfully.

Patch against the latest cvs:

Index: src/wix/Data/tables.xml
===================================================================
RCS file: /cvsroot/wix/wix/src/wix/Data/tables.xml,v
retrieving revision 1.49
diff -u -r1.49 tables.xml
--- src/wix/Data/tables.xml	21 Sep 2007 07:58:40 -0000	1.49
+++ src/wix/Data/tables.xml	21 Nov 2007 14:32:05 -0000
@@ -1482,7 +1482,7 @@
         <columnDefinition name="KeyTable" type="string" length="255" nullable="yes"
                 category="identifier" description="For foreign key, Name of table to which data must link"/>
         <columnDefinition name="KeyColumn" type="number" length="2" nullable="yes"
-                minValue="1" maxValue="32" description="Column to which foreign key connects"/>
+                minValue="0" maxValue="32" description="Column to which foreign key connects"/>
         <columnDefinition name="Category" type="string" length="32" nullable="yes"
                 set="Text;Formatted;Template;Condition;Guid;Path;Version;Language;Identifier;Binary;UpperCase;LowerCase;Filename;Paths;AnyPath;WildCardFilename;RegPath;KeyFormatted;CustomSource;Property;Cabinet;Shortcut;URL" description="String category"/>
         <columnDefinition name="Set" type="string" length="255" nullable="yes"

Pune - Singhad and Panshet Dam

October 3rd, 2007

I am in Pune for a couple of weeks giving the ThoughtWorks Object Bootcamp training. It was a public holiday yesterday for Mahatma Gandhi’s birthday, and some of us went out to Singhad and Panshet Dam for a mini trek.

Erlang: How to send a message to a registered process on another node

September 29th, 2007

It took me ages to find out how to do this — it is such a simple thing that no-one ever seems to mention it. Assuming that you have a process registered to foo:

register(foo, Pid).

you send it a message from the current node by doing:

foo ! "hello".

and you send it a message from another node by doing:

{ foo, node_name@othernode } ! "hello".

18 months in India

August 27th, 2007

I am about to head back to India for work. Before coming to Canada I had worked in ThoughtWorks’ Bangalore office for 18 months. Anyone who knows me has probably heard me rant at length about how much I enjoyed being there. This video is a (small) attempt to capture some of the highlights of my time there.

This was created with the new iMovie 2008 - which is one of the most beautifully designed pieces of software I have ever used. The whole thing took me about 2 hours, and it is a testament to the power and ease of the software that it made me stop procrastinating and make this video. It is highly recommended. It is also one of many reasons that I love my Mac.

Ultimate Frisbee — Crash and Burn

August 16th, 2007

I added some photos of our Ultimate frisbee team to flickr. It’s been a fun season — even if the team name has proven to be somewhat apt at times. One of the nice things about Ultimate has been the spirit of the game — you call your own fouls, you call yourself out or in, there is no referee, and it makes for a fun game with little of the aggressive attitude found in similar sports.

Ant unit test forking behaviour

August 15th, 2007

There is a long-standing issue with the way that ant’s JUnit task runs tests. The default behaviour is to fork off a new JVM for each test - which is *very* slow, particularly if you are doing something like GWT Unit Tests.

In this case, the whole GWT environment bootstrap (about 20 seconds on our cruise box) happens once per test. Ouch.Fortunately there is a solution, in ant 1.6.2 and above - use the forkMode attribute :

<junit fork="true" forkMode="once" ...

See the junit tag documentation for more details :

http://ant.apache.org/manual/OptionalTasks/junit.html

Google Maps StreetView Privacy Issues

June 1st, 2007

This link illustrates some of the potential concerns with Google Maps new StreetView.

Personally I like the approach of this guy — maybe it is true that in a world where we have ubiquitous information, anonymity comes with overflowing the buffers of the observers.

This is something that we have been coming to terms with for a while. Records such as court records that were once theoretically available freely were in practice quite hard to come by. You had to go to the court in question and apply for the paper copies. Now as they become available freely and electronically, there are new considerations.

For example, over on Groklaw the addresses and phone numbers of court staff and lawyers are available in the court records which are now available for easy download. This could be a serious issue in a controversial case.

I’m not sure what the long term prospect is. I suspect that we will just become used to the fact that a lot of what we do is visible. The blogsphere proves that many of us are comfortable sharing extraordinary amounts of personal information with the world as a whole.

Interesting times.

Learning Hindi from Bollywood movies

May 30th, 2007

I was looking for learning Hindi links, and came across this one House Full - Learn Hindi from Bollywood Movies Podcast. I haven’t learned much Hindi from it — but I have been laughing a lot even after the first few episodes.

I think you get more from it if you understand the movies — I can’t wait to tell my colleagues “Main bhi tere khoon ki kasam khake kehta hoon — Ek ek ko chun chunke maroonga, chun chunke maroonga”