Saturday, December 31, 2005

Accurate-but-unintentionally-funny definition of the day

Tax'i·der'mist n. Someone who mounts animals

The Lord of the Rings

After watching Parts 1 and 3 of LOTR, I finally got around to reading the book. While I do concede that it is good (I am about 350 pages or so into the book, so this opinion is subject to change -- for better or worse), I am yet to see any justification for the cult status that the book and its author enjoy. One positively irritating thing is Tolkien's presumptuousness (if that is the right word): the way he goes on and on about how the chronology of the entire thing was recorded for posterity by various people, the elaborate family trees, indices, appendices and so on. It's almost as if he knew beforehand that the book would become a bestseller, and he decided to milk it for all its worth. People who are just interested in a compelling, well-told story simply do not care about these details (they care even less when one of the innumerable characters bursts into long-winded, crappy poetry -- some of it not even in English, but in some made-up language the author came up with when he was probably stoned).

So does that mean I have what it takes?

Since I got right three of the four questions that Joel posed here? I don't know JavaScript and hence didn't attempt Question 2, so I guess I should feel even more snotty :-)

To be fair, the two C questions are trivial to anyone who has done anything worthwhile in C. The Scheme question was a bit trickier for me, since Scheme syntax is slightly different from Common Lisp, but again, nothing an average Lisper would find too challenging.

On a related note, it's getting quite predictable:
  1. Joel writes something controversial

  2. His acolytes jump in and express their concurrence enthusiastically

  3. A few nay-sayers pipe in with their objections and

  4. A legion of geeks go to bed that night, satisfied that they have done their bit to uphold their geek cred

Sunday, December 25, 2005

How to touch Reader's Digest for Rs 150

  1. Start with a common saying or idiom, say, "quitting when ahead".

  2. Modify this slightly so that it is still grammatically correct, but has an altogether different meaning. Example: "quitting when a head".

  3. Think up a contrived, patently unfunny story that has the above phrase as the punch line:
    Finally, after six girls, Luke's wife had a boy. But he had only a head - nothing else. Luke didn't care, though. He was just happy to have a boy.

    On the kid's 21st birthday, Luke took him to a bar. "A shot of your best Scotch," he ordered.

    The boy drank it, and - POOF - he grew a neck. Amazed, Luke then ordered another and - POP - a torso sprouted. "Keep 'em coming!" Luke shouted. Eventually, the boy had a whole body. Everyone cheered.

    Tipsy, the boy stood on his new legs and stumbled to the left ... to the right ... out by the front door and into the path of a truck.

    The bar fell silent.

    "He should've stopped drinking," the bartender said, "while he was a head."

  4. Submit this story as a contribution to Laughter the Best Medicine

  5. Wait patiently for the Rs 150 cheque

Saturday, December 24, 2005

Book Review: Mystic River

Imagine that you somehow get talked into going to a B-grade action movie. You sit through the entire movie, fidgeting, and finally get to the climax, in which the villain and his minions have the hero at their mercy, with the hero's sweetheart writhing helplessly in the hands of two leering henchmen. The villain starts his standard heh-heh-I-got-you-what-are-you-gonna-do-about-it spiel, and though you know it's a cheesy flick, you start to look forward to the hero escaping from his bonds and start kicking some serious ass.

What happens instead is that the villain finishes his speech in his own sweet time, asks the hero to say his prayers, and after waiting for the customary ten seconds, pulls the trigger and the hero drops dead.

Cut to the villain riding off into the sunset with the hero's girl by his side (who has quickly adjusted to the turn of events and is in fact wondering what she ever saw in such a good-for-nothing bloke who can't even best a B-grade villain, who, by the way, doesn't seem that bad, if you think about it).

Now what has all this got to do with Mystic River, you ask. Nothing, except that I felt the same way after finishing the book as you would feel walking out of the theatre after seeing said imaginary movie.

(Alright, I admit that this doesn't exactly qualify as a book review)

Damn he looks young

Boys and girls, now you have the pleasure of having a face to go with all the witty, incisive and informative commentary that's been inflicted on you for the past 18 months or so: I have graciously decided not to withhold said pleasure any longer and have added a mug shot to my Blogger profile. Incidentally, the picture is from a recent trip to the Hogenakkal Falls.

White to play (and win?)

After mucking around with Knights a bit, my passion for chess was sort of rekindled, and I dusted off my trusted old Radio Shack 2250XL and fired up a game. I usually consider myself lucky if I manage to stay 20 moves in the game without committing some egregious mistake like losing a piece through oversight or tying myself hopelessly in knots, but this time I surprisingly found myself in an interesting position: I breached the black king's defences with some pretty bold moves and won a rook and a pawn in exchange for a bishop and a knight.

I stopped the game at this point and went to bed, with hopes of finding a winning combination over the weekend. But it turns out that I underestimated the computer's resilience, for, on resumption, the bastard managed to neutralise my initiative within a couple of moves and I found myself back on equal terms.

Not willing to let such a potentially winning opportunity turn into a loss, I magnanimously offered a draw, which the machine gratefully accepted (translation: I pressed the Reset/Clear button).

Coming soon: "Chess: Tips, Techniques and Strategies" by Rajesh Jayaprakash (ELO rating 1650)

Thursday, December 22, 2005

Wasn't he servile enough for you?

With the UN's reputation pretty much in tatters vis-a-vis the oil-for-food scandal, James Bone has every right to ask questions about Kofi Annan's son. Mr Annan should either answer the question, offer a 'no comment', or, if he is so indignant, sue the reporter. The one thing he should not do is call the reporter an overgrown schoolboy.

BTW, looking at how the sons of politicians invariably turn out to have reached their station in life via pater's influence, Plato's model, while a bit extreme, seems more attractive than ever:
The guardians (i.e. the rulers) will have no wives. Their communism is to be of women as well as of goods. They are to be freed not only from the egoism of self, but from the egoism of family; they are not to be narrowed to the anxious acquisitiveness of the prodded husband; they are to be devoted not to a woman but to the community. Even their children shall not be specifically or distinguishably theirs; all children of guardians shall be taken from their mothers at birth and brought up in common; their particular parentage will be lost in the scuffle.

In the market for a notebook

I sent the following email to Dell, Acer and Toshiba:
Hi,

I am looking for a notebook with the following specifications and
would appreciate it if you could provide me with a quote:

AMD processor (32 bit)
80 GB hard disk
512 MB RAM
DVD/CD-RW drive
No operating system, no other system software
Linux-compatible

Thanks and regards,

Rajesh Jayaprakash
The folks at Dell and Acer have responded. Toshiba (more precisely, their resellers in India, HCL) have not condescended to send a reply. However, even in the case of Dell and Acer, the responses were more along the lines of 'let us know your contact details and we'll get in touch with you'. Looks like they do not want to send quotes to an email address. I then sent them my address and phone number, but haven't heard from them yet.

There's an ad today in The Hindu for a Thinkpad that costs about Rs 34,000 and pretty much meets my specs. I am not very satisfied with my earlier IBM purchase (the ThinkCentre I am typing this from), and with IBM selling its PC business to Lenovo, I am hesitant to turn to Big Blue again.

Wednesday, December 21, 2005

Smalltalk Sudoku Solver

Seeing the huge demand for a Smalltalk Sudoku Solver, as evidenced by the number of Google searches that hit my blog (well, it was actually one stray hit yesterday), I have put up my solver here. It was developed on VisualWorks 7.2, but the non-GUI part should be 100% portable to other Smalltalks.

Friday, December 16, 2005

How to think like a conspiracy theorist

Facts:
  1. The Congress Party have egg on their faces owing to the Volcker report

  2. The questions-for-money scam arrives at the right time, affording them a way out and putting BJP on the defensive instead.
Naive Conspiracy Theorist: "The questions-for-money scam was engineered to bail out the Congress Party."

Realist: "The sting operation was more than six months in the making, so there is no conspiracy."

Seasoned Conspiracy Theorist: "The Congress Party engineered the whole thing as a sort of insurance policy, to be used in case some scandal breaks out, so there."

Realist: *shakes head and mutters something incomprehensible under his breath*

My Air Deccan Experience

  1. The Travel Department send me an e-Ticket, which is nothing more than a web page print-out. The e-Ticket contains a lot of intimidating stuff like how I should check in two hours before the departure time, flights are subject to cancellation with no obligation on their part other than a refund and so on. Alarm-O-Meter reading: Slight Concern.

  2. I call Air Deccan at 1 PM to confirm my flight and am informed that the departure time is 9:15 PM, which is 15 minutes later than the scheduled time. Alarm-O-Meter reading: Heightened Concern.

  3. I receive an SMS message at 4 PM advising me that the flight has been rescheduled to 8:40 PM. Alarm-O-Meter reading: transitions to Faint Alarm.

  4. I reach the airport. The lady at the counter has just finished having a spat with her colleague and doesn't seem very eager to see me. In addition, she says that my rather small suitcase cannot be considered as cabin baggage as it weighs 12 kg and will have to be checked in. Alarm-O-Meter reading: Since I have managed to successfully obtain my boarding pass, drops to Mild Concern.

  5. As I wait to enter the security check-in, I receive another SMS stating that due to operational reasons, the flight has been cancelled, and can I please contact the given number? Alarm-O-Meter reading: May Day!

  6. I approach an airline personnel, who quickly asks me to ignore the SMS message and assures me that the flight is on schedule. Alarm-O-Meter reading: climbs down to Mere Panic.

  7. Just as I am about to board the plane, I am asked to hold on for a second. A young kid scurries out of the plane with the trash. Alarm-O-Meter reading: Shakes Head (Why do you even bother)?

  8. There is only one stewardess, a pretty, innocent-looking, sweet young thing. AOM reading: Enters positive territory for the first time

  9. The stewardess further endears herself to me, with her broken and lispy English. AOM reading: Nods Head Approvingly.

  10. The pilot is a very cheerful bloke and seems quite talkative, giving a pretty thorough update of how high we are flying, the weather conditions, etc. More importantly, he makes an immaculate landing, much better than most of the landings I have experienced with the bigger airlines. AOM reading: Give Air Deccan another chance. They do get the important stuff right.

Sunday, December 11, 2005

Off to Hyderabad

...for four days, followed by another three-day trip. No blogging for the next week or so (like anyone really cares).

Saturday, December 10, 2005

Lisp and Elegance

Disclaimer: I am new to Lisp, and the idioms and syntax are still somewhat alien to me, so there.

I am in Chapter 9 of Practical Common Lisp, in which Peter Seibel develops a unit testing framework to build on the concept of macros. By the end of the chapter, we end up with just 26 lines of code that is quite powerful (albeit slightly arcane) and elegant (apologies for the horrendous formatting):

(defvar *test-name* nil)

(defmacro deftest (name parameters &body body)
  "Define a test function. Within a test function we can call
   other test functions or use 'check' to run individual test
   cases."
  `(defun ,name ,parameters
    (let ((*test-name* (append *test-name* (list ',name))))
      ,@body)))

(defmacro check (&body forms)
  "Run each expression in 'forms' as a test case."
  `(combine-results
    ,@(loop for f in forms collect `(report-result ,f ',f))))

(defmacro combine-results (&body forms)
  "Combine the results (as booleans) of evaluating 'forms' in order."
  (with-gensyms (result)
    `(let ((,result t))
      ,@(loop for f in forms collect `(unless ,f (setf ,result nil)))
      ,result)))

(defun report-result (result form)
  "Report the results of a single test case. Called by 'check'."
  (format t "~:[FAIL~;pass~] ... ~a: ~a~%" result *test-name* form)
  result)

All well and good, and I appreciate the way in which we ended up with this code, starting from a simple definition of the problem, recognising repeated patterns and refactoring them via macros, but my grouse is this: from a maintainability perspective, the final code, while very powerful, and well-commented to boot, still contains none of the thought processes that led to it. May be it's alright if the same person who wrote the code is also doing the maintaining, but IMHO, unless they are documented somewhere, another person will definitely have trouble grokking things.

This has always bugged me

How can Eriksson be coach of the England team and lead it against his native country, Sweden, without any questions of conflict of interest? Which comes first, patriotism or profession? Remember the stick Wasim Akram got when he did nothing more than pass on some informal bowling tips to Irfan Pathan?

Slashdot = Tabloid?

Slashdot content has become very predictable of late: most of the stories look to be either designed to start flame wars or to report sensationalist news items. They seem to fall in one of these categories:
  1. Is XYZ all that is cracked out to be (replace XYZ with the flavour of the day - AJAX, Google, OSS, Evolution)?

  2. Beating a dead horse, something that is universally reviled by the Slashdot regulars -- like Microsoft, DRM, SCO, patents, et al

  3. The latest shiny object unveiled by Google or Firefox
The articles that don't belong to these categories are either boring (Jupiter's 14th moon is discovered to contain traces of methane? Really? How could I possibly have made it through life without knowing this?) or plain sensationalist.

The reason for my rant is one of today's /. items: a Japanese bank loses a lot of money because of a typo. Nothing wrong with reporting this, but, never being one to let facts stand in the way of a good story, they hype it up so:
  1. The amount of money lost due to the typo is not $3 billion, as the story's headline misleadingly indicates

  2. No shares were sold at the price of one Yen
What's more, in the age of RSS, when one subscribes to the blog feeds of people like James Robertson, Bruce Schneier and Joel Spolsky, in addition to providing interesting insights, they also serve as an unintended filter on stories reported by Slashdot: if they blog about it, it's definitely worth knowing about (notwithstanding the argument regarding gatekeepers and all that). I might as well unsubscribe from Slashdot's feed and still not miss anything really relevant.

One thing Slashdot really excels at, though, is the quality of the comments. Provided you browse them at 3+, you get to read some very Informative/Insightful/Interesting/Funny stuff.

Tuesday, December 06, 2005

A koan for modern times

This is from one of David McGowan's older newsletters:
Imagine that you are Jacobo Arbenz in the 1950s, or Fidel Castro in the 1960s, or Joseph Stalin in the 1920s and 1930s, or, skipping ahead, Hugo Chavez in the present day. You're trying to get a fledgling administration off the ground and you've got a big problem: the institutions of your country are littered with assets controlled by Western intelligence agencies.

The CIA, for instance, has moved into town and set up shop under various assumed names to operate an 'opposition' press, which daily agitates against the sitting government with heavy doses of manufactured 'black' propaganda. If you take any action against these operations, you will be vilified via the entire Western media establishment for brutally censoring the opposition press and crushing free speech. If you do nothing, the problem will continue to fester and grow. What do you do?
Now consider this:
Kyogen said, "Zen is like a man up a tall tree hanging from a branch by his teeth. His hands can't grasp a bough, nor his feet reach one. Under the tree a man asks him the meaning of Bodhidharma's coming from the West. If he doesn't answer he fails the questioner. If he does answer he will lose his life. What should he do?"
The similarities are pretty striking, aren't they?

Sunday, December 04, 2005

I had a dream last night

... that I wake up late on a Sunday morning, finish reading The Hindu, turn my attention to Deccan Chronicle for some comic relief, and in the course of flipping through its pages, land up at Indira Bhangar's column, where somebody writes in that they had a dream that Sania Mirza had married Irfan Pathan and would Ms Bhangar please interpret this dream for them, and I fall off the bed, rolling with laughter, and injure myself.

Oh wait, that wasn't a dream.

Saturday, December 03, 2005

The world is flat

Watch the Hazard music video on VH1, realise you would like to get the MP3 version, fire up LimeWire^H^H^H^H Apple iTunes, and two minutes later, you have the song streaming out of your computer speakers.

Yup, it's a flat world, alright.

Obscene political cartoon of the day

:-))