February 2008


As I went down to Hoboken PATH station this morning, someone was broadcasting “move through the turnstiles! PATH is free today!” I thought either the system was broken, or there’s some problem in NJ Transit trains so PATH is taking train riders, as it had happened quite a few times before.

Turns out it’s PATH Centennial.

PATH is by no means a “nice” system, but 100 years is very impressive indeed. It only post-dated NYC subway by less than 4 years, and it sure runs a lot better than the subway–granted, it’s hugely less complicated. Once I was leaving work to catch a train and my subway-dwelling boss was surprised that PATH even has a time table: “I guess it’s not a 100-year-old system”. Now I can throw the line back to him :)

The Wikipedia piece on PATH is surprisingly long and informational. A few interesting things:

  • PATH stands for Port Authority Trans-Hudson.
  • The Port Authority only agreed to purchase and maintain the tubes from the bankrupt Hudson & Manhattan Railroad company in return for the rights to build the World Trade Center on the land occupied by H&M’s Hudson Terminal.
  • PATH has 333 cars in its fleet.
  • The cool moving-slide-show ad on the tube wall between WTC and Exchange Place is called Zoetrope. They should do this for every tube wall to literally light up people’s commute.

PATH started using the RFID SmartLink card last year, and it’s clearly the future as it’s a whole lot more convenient, fast, and sustainable than the paper QuickCard. The most frustrating thing about the paper card is that sometimes some turnstiles refuse to read it, so I have to try several times and/or at different turnstiles, which could mean angry people waiting behind me and missing trains. But I can’t use paper TransitChek to refill SmartLink card because there’s no human-stationed booth for SmartLink, and my company doesn’t want to switch to credit-card based commuter card because it costs more. I really hate it when I can’t use superior technology that’s readily available.

I’m getting close to AAA rating.

Lately I’ve forgotten to pack wipes into diaper bag three consecutive times.

And within about a month I’ve forgotten to turn off the head light and had to have the car jump started for… THREE times.

And it had never happened before.

10 years: 0. 1 month: 3. That’s the power of AAA.

First time was at Ikea. Their office keeps a jump start kit, so it may be common for Ikea customers to have single A.

Second time was at the pediatrician’s. There’s a AAA (how appropriately named) office a few steps away, but they don’t have a jump start kit, and every employee was too busy sitting in their chairs staring at the ceiling to help me jump start with their own car. Another car happened to come into the parking lot and helped us out so we didn’t have to wait for at least 1 hour for AAA service. Double A.

Third time was at a friend’s house. J had explicitly reminded me to turn off the light. Isn’t third time the charm?

An old man is sitting on a park bench crying. A young man is walking by and asks him why he’s crying. The old man says, “I’m retired and I have lots of money, a huge luxury apartment, a beautiful 25 year old wife who loves me and has sex with me twice a day…”

The young man says, “Well then why the hell are you crying!?”

The old man replies, “I can’t remember where I live!”

I bought a Roomba Red in September 2006 when it’s on sale at Amazon. It worked fantastically well for about a year, but then the battery started to die out. As soon as I unplug it from a full charge the light turns amber, and it would only run for less than 30 minutes.

So I bought a li-ion battery from glo69 on roombareview.com, and it worked extremely well, due to both more power and much lighter weight than the original NiMH battery. However Roomba soon started acting weird. It’s not exactly the notorious Circle of Death, but close: it would make very frequent turns and could not go straight for more than a foot, so it mostly stayed in one spot and often got stuck, also partly because it’s running faster from the better battery.

Now I think the problem was just the edge detectors were covered by dust, so Roomba always thought it’s over stairs and turned back. But I’d wanted to clean its interior for a long time, so finally I made up my mind to do it.

The wonderful Fix Circle of Dance site made it really fool-proof. The most important thing is I printed the screw location picture on a full page, and punch each screw through the paper as I took them down so that they wouldn’t get mixed up.

The inside of Roomba can be a prop for a horror movie. I first used pliers to pick out the large dust chunks–yes, chunks of dust, and there’re plenty of them! Then I used a wipe, and finally a dust blower. The result?

roombadirty.jpg

roombaclean.jpg

And now Roomba can run a couple of happy hours again.

cover

(This post, like many others, was started long ago.)

I haven’t read much “modern” literature. Heck, I haven’t read much classical literature, but it feels like I’m more familiar with classical authors and titles, at least superficially.

A few good friends of mine recently started an email list mostly talking about books we’ve read, and my complete ignorance of modern writers was put to shame by an elite friend (he eats Roman history for breakfast) who hates elitism. So I wanted to make up a bit, and when I heard about this year’s Nobel price, I got this book from the library immediately. (I had only read half of it when I had to return it. Bought one but only finished it in late 2007.)

I definitely don’t know how to analyze a novel and critique its style and organization. But before I go on read some serious review and analysis, let me first record my instinctive and naive feelings.

The narrative structure is pretty interesting–I don’t know if it’s the first novel that only uses the first-person accounts from many people and things (dog, tree, counterfeit coin, the color red, etc.) to tell the story. It’s pretty interesting at the beginning, starting with a corpse talking to the readers from the bottom of a well, but it gets tiresome after a while due to jumping perspectives.

And what bothers me the most is that everyone (and thing) speaks almost the same tone, especially the miniaturists. Granted, the author doesn’t want the reader to find out who’s the murderer simply by the way he talks, but it’s a self-inflicted deficiency. Could it be something lost in translation?

The superficial story line is about two murders and a love story, but I feel those are just means to sell the book. The story is really about the inevitable loss of history and culture at the advance of a new dominance. Turkey has been (and still is) going through that painful phase for a few hundred years, and alas China a hundred times more traumatic.

That’s why the longest chapters are those of Master Osman (supposedly based on the real Nakkaş Osman) and Black spent in the royal treasury, perusing through endless hidden volumes of books with miniature masterpiece over the centuries. Master Osman use the excuse of finding the murderer to spend his last days of light with the greatest arts in history, just like the book uses the excuse of finding the murderer to take readers into the world of lost Islamic arts and idiosyncrasy.

I wish I had seen this page while reading the book. Although it only shows 6 miniatures, they really make the story alive, especially the picture of Hüsrev and Shirin (meaning “sweet”, and the heroine’s name Shekure is cognate with “sugar”), which is brought up so many times at nausea in the book.

P.S. One of the best sections is the horse drawing contest. Can you tell which miniaturist is the murderer from what they say after each draws a horse?

Olive says: When I draw a magnificent horse, I become that magnificent horse.

Butterfly says: When I draw a magnificent horse, I become a great master of old drawing that horse.

Stork says: When I draw a magnificent horse, I am who I am, nothing more.

Stevey “Long Long” Yegge strikes again.

And this time it cuts twice: first it wasted a lot of my time as usual, then it showed why I suck at being a developer: I can’t get over the n00b mentality and capacity.

OK it’s not that bad. I’ll never be able to write a compiler or understand LISP, but I don’t think my code has that much of a chance to be honored on the Daily WTF, either.

This is the paragraph that makes me sweat (bold by me):

A programmer with a high tolerance for compression is actually hindered by a screenful of storytelling (referring to long comments). Why? Because in order to understand a code base you need to be able to pack as much of it as possible into your head. If it’s a complicated algorithm, a veteran programmer wants to see the whole thing on the screen, which means reducing the number of blank lines and inline comments – especially comments that simply reiterate what the code is doing. This is exactly the opposite of what a n00b programmer wants. n00bs want to focus on one statement or expression at a time, moving all the code around it out of view so they can concentrate, fer cryin’ out loud.

I would always cringe at the LISP code segment he quoted, not just because it’s LISP, but mostly because it’s too terse and dense, exactly as he wants it. My current team lead writes code just like that, and now I can understand his smirk whenever I ask him for more comments.

Stevey’s take home messages are clear, balanced, and easy to follow, though. The essence is the same as the original Agile Manifesto, which is working code (including test code) is the one and only true goal of development. Not any kind of artifact (Stevey calls it metadata) like process, model, and documentation.

When in doubt, don’t model it. Just get the code written, make forward progress. Don’t let yourself get bogged down with the details of modeling a helper class that you’re creating for documentation purposes.

If it’s a public-facing API, take a lesson from doc-comments (which should be present even in seasoned code), and do model it. Just don’t go overboard with it. Your users don’t want to see page after page of diagrams just to make a call to your service.

Lastly, if you’re revisiting your code down the road and you find a spot that’s always confusing you, or isn’t performing well, consider adding some extra static types to clarify it (for you and for your compiler). Just keep in mind that it’s a trade-off: you’re introducing clarifying metadata at the cost of maintenance, upkeep, flexibility, testability and extensibility. Don’t go too wild with it.

Next Page »