Wednesday, November 11, 2009

Fairy Tale

There was once a kingdom in a land far far away, ruled by a wise and noble king.
The king was blessed with two lovely children: A prince who was the most handsome man in the kingdom, and a princess who's beauty was unsurpassed. Under the king's just rule, the kingdom and it's people prospered.

Alas, all good things come to an end. A vicious dragon, accidently freed from the magic spell binding it, began to attack the people of the kingdom. Everyday it would devour an entire village. The terrified people beseeched their king to save them from this menace.

The king made an announcement: he promised the brave soul who slays the dragon the hand of his daugher in marriage. Hearing this, every knight in the kingdom donned his armor and set out towards the forest: for the man who married the princess would truly be the luckiest of men.

One after the other the knights tried to kill the dragon, but none succeeded. The dragon was too savage and strong.

With the death of each knight, the king grew more despondent. At last, when there were no more knights left, a man with an axe stepped forward. "I would like to try to my luck with the dragon, your majesty", he implored. "Are you a knight, my good man?" asked the king, to which he replied "No sire, I am a humble woodcutter". "Very well, you may try.", said the king, without much hope.

The woodcutter didnot recklessly confront the dragon as the knights did. He studied the habits of the dragon for many days. He noticed that the dragon always drank water from a pond, which gave him an idea. He made a special potion from the bark of some trees, which he mixed into the pond, which made the dragon go to sleep. He then cut the large trees around the dragon thus crushing it. The dragon was finally dead.

When he returned to the palace, he was greeted with great applause. The king came to meet him at the doorstep. "You have saved our kingdom, for which I am thankful. As promised, I give you my daughter's hand in marriage". The princess smiled shyly. The woodcutter hesistated for a moment, then whispered something into the king's ear. The king was lost in thought for a minute, then he replied "Very well, if that is what you want, so be it".

The woodcutter and the prince lived happily ever after.

Monday, October 19, 2009

Fairness

James and John were twins, but they were as different as two people could possibly be. John was a doctor who worked tirelessly serving poor people. Every year he gave thousands of dollars to charity. John was also a devout man who had not missed church in 30 years. James on the other hand was a gambler. He had been to jail many times for robbery, selling drugs and destroying property. He used drink every night and beat his wife. He was also an atheist who desecrated churches.

As it often happens with twins, James and John died the same day, James a few moments before John. To John's delight and to James' surprise, they found themselves in front of God, standing in a line. Behind God, there were two paths, one to Heaven, one to Hell.

James was first. He tried to open his mouth to speak, but he was unable to. For a few seconds, James stood meekly in front of the Creator. "Heaven" decided the Lord, and James was carried away by Angels along the heavenly path.

John was surprised by the decision, but he reasoned that God knew all; maybe there was a spark of goodness in his brother. John was happy for James.

Then came John's turn. John stood with his head bowed, humbled by the Almighty. Patiently he waited for his decision. "Hell" replied God, to John's great dismay. As demons came to take him away, he tried to think what wrong he had done to deserve eternal damnation.

As the demons were taking him away, he saw at last how God decided man's fate. God was fair. God was just. God was good.

God tossed a coin.

Monday, October 05, 2009

Infidelity

Who could have guessed that a letter from the department of revenue was what ruined Malini Srinivasan's marriage?

In retrospect, all the classic signs were already there. Srini had been coming home late for the past few weeks. Work, dinner with important clients, deadlines: he had made the usual excuses and she had believed him.

The letter changed everything.

The letter came when Malini was in the kitchen; she did not open it immediately. She was cooking Srini's favorite urundai kozhambu and wanted to get everything ready by 6:00pm. Srini had promised her that he would come home early. At 5:45, exhausted but satisfied with the afternoon's work, she sat down on the sofa and waited for her husband.

He came home at 11:30.

"Sorry dear, already saapaDaama .... Good night" was all he said before going to bed. The perfunctory apology was somehow worse than an insult.

Malini couldn't sleep. Looking for something to occupy her mind, she picked up the letter that had arrived earlier. It was from the Department of Revenue. It was addressed to her husband, but since Malini did all their taxes, she didn't hesitate to open it. As expected it was a property tax receipt.

She was about to file it away, when she saw something strange. The address on the receipt was not of their house. Strange, she thought, the receipt was posted to the correct address.

A seed of doubt was planted; and it grew. Malini started going through his credit card statements: not even one entry was a restaurant. So much for the dinner-with-clients lie. As she went through more statements, she began to understand the extent of her husband's betrayal.

Nobody knew how Malini got a gun, but she did. Two days after the letter, Malini waited for her husband; she would give him one last chance at coming out clean. But he didn't come.

At 7:00pm Malini hailed an auto to the address on the receipt. It was a nondescript house in a shady part of town. Without making a sound, she tried the door; it was unlocked.

The smell! The smell hit her just as she entered the house. It hardened her resolve; she knew what she was about to do was right.

There wasn't much furniture in the hall, just a table and a chair. A recipe book was lying opened on the table. Malini could hear her husband humming from the kitchen. She took out her gun and made her way towards him.

Srini was shocked to see his gentle, loving wife standing there with a gun in her hand. Nervously he glanced towards the vessel on the stove and back at her. "Is that what I think it is?" Malini asked him. He didn't have to answer, the look on his face said it all.

She closed her eyes and shot him.

She made the headlines in the newspaper the next day: "Tamil Brahmin Wife kills husband for eating non-veg food".

Saturday, October 03, 2009

How to escape an Indian wedding

Has this ever happened to you?: You're sitting there, shirtless, with a mangaLasutra in your hand and you suddenly get cold feet. You think of all the western men who leave their brides standing at the altar. But you can't do that because (a) the bride isn't standing (b) there is no easy path from the altar to the door.

It's clear you need a better plan.

Don't underestimate the Indian wedding ceremony: thousands of years have refined it to be almost impossible for a groom to escape. But with the right planning and technology, it can be defeated. And I will teach you how. So pay attention.

Here's a list of things you will need:
  • one half sleeve shirt
  • one pair of jeans
  • Rs 7.50 in exact change
  • 200 grams of Cycle brand saambraNi*
  • two M47 submachine guns
  • two Smith and Wesson .50 handguns
  • thirty hand grenades
  • one auto rickshaw


First, you need to make a map of the wedding hall. A typical wedding hall looks like this:



Here is what you do on the wedding day. Remember, even the smallest mistake can ruin your plan, so learn this by heart.

a) Pretend your leg is itching, reach into your panche and take out the packet of saambraaNi. Put it into the agnikunD. This will cause a lot of smoke, which will hide you taking out the guns.

b) Take one handgun in each hand. With the left gun, shoot the bride, with the other, shoot the poojari. Aim for the head. Show no mercy, they are the enemy. Drop the guns, their work is done.

c) With the machine gun, start shooting people on the dias. There is no need to be accurate. Make your way towards the stairs, but keep shooting.

d) Now you have two choices. I have illustrated both with diagrams. Choose one of them.

Plan A: Turn sharply left. With the left hand shoot at the people on the bride's side. Lob grenades to the groom's side. After you reach the midpoint, switch hands and start lobbing grenades on the bride's side. When you reach the corner, turn sharply right and run to the door. Once you reach the door, lob all the grenades and jump out of the door.


Plan B: Keep walking on the centre aisle, and keep shooting people with both hands. Once you reach the midpoint, turn around, throw the guns and start throwing grenades as you run back. Once you reach the door, lob the last grenade at the musicians.


e) Hurray! you're out. But your work is not yet done. If you get caught now, they'll make you marry the bride's sister.

f) Run towards the auto. You should have parked it facing the road. Rev it up and off you go.

g) Chord Road to Majestic is normally 30 minutes; you need to do it in 10. Avoid Anand Rao Circle, it's congested at this time. While you're driving put on the jeans and shirt.

h) Go to platform 4, catch the 86. If you can't, get into a 265. Avoid the puskpaks, you only have Rs 7.50.

i) Get down at dasarahaLLi. Congratulations, you are home! You've done it!

Note: The same plan, with a few minor modifications, will work for the bride as well. I would suggest a Flame Thrower instead of a machine gun.

* saambraaNi is the resin of the Commiphora wightii tree, which when put on hot coal, produces lots of smoke.

Tuesday, September 22, 2009

Classification of detective stories

Almost all whodunnit stories fall into one of the following story-o-types:

Setup: V is a victim who dies. D is the detective. X, Y, Z ... are the suspects. The killer K must satisfy K ϵ {X, Y , Z ...} U {D, φ, V}.

1. The least obvious suspect did it: This trick is used so often that it has become almost a cliche. Y is meek, good and helpful. Y seems the least likely to have carried out the murder. In the end though, Y is revealed to be the killer.

2. The most obvious suspect did it: As people read more and more novels which use trick #1, they start suspecting such unlikely characters. A clever writer reverses this by making the most obvious suspect the killer. The problem with this is if the reader hasn't come across trick #1 very often, the ending will fall rather flat.

3. The victim did it: No one suspects the victim, by virtue of the victim being dead. The ending reveals that the victim intentionally killed themselves, thus confounding everyone.Cards on the table is a good example of this trick.

4. Everyone did it: People instinctively expect only one of the suspects to be the killer. If more than one suspect were in collusion, the reader is much less likely to deduce the culprits. The most famous example of this is of course Murder on the Orient Express, where every suspect turns out to be the killer.

5. No one did it: There never was a murder: it was all an accident. Like trick #3, the reader feels a bit cheated since the perpetrator isn't brought to justice.

6. The victim is the victim: V is supposed to die, but W dies instead. The ending reveals that W was the intended victim after all. The ABC murders is a perfect example of it.

7. The fake victim did it: This takes trick #6 to one more level; not only is W the intended victim, the fake victim V is the killer. The Mirror crack'd from side to side is a good example of this.

8. The detective did it: This obviously doesn't work if the detective is famous. Also, for this to have a satifying ending, there has to be a second detective who reveals the killer. Bonus points if the story is being narrated from the detective's point-of-view in first person.

9. The butler did it: I just had to put that one there :D

10. Unexpected Motive: Given that the choice for 'who' is pretty limited, the motive is the factor writers get to play most with. Again, The Mirror crack'd from side to side is a brilliant example of a motive for which enough clues exist in the story, yet is very surprising in the end.

11. Unexpected Method: 'How' is the thing writers let their imagination run free over. The most interesting ones are the "impossible murders": murder which happened in a room which was locked from the inside etc.

Monday, September 14, 2009

Handling memory leaks

I found this gem in some code I wrote in 2003. This, ladies and gentlemen, is the proper way to avoid memory errors.

//////////////////////////////////////////////////////////////////////
/// Extremely Dangerous to do this , but the app keeps crashing
//////////////////////////////////////////////////////////////////////
void SigSegVHandler(int __SigNumber){
return;// I am ignoring all Segmentation faults
}
int main(){
signal(SIGSEGV, SigSegVHandler);
}

Tuesday, September 08, 2009

Guess the plot: B-grade horror movie edition

In this age of internet porn and big budget 3D horror movies, the subtle art of the B-Grade Movie is indeed lost. They were the true pioneers of their time, pushing the boundaries of the U-rating by showing almost-but-not-quite-naked women in close-to-but-not-really-scary situations, with the silliest names anyone could ever imagine.
I found some posters of some such gems recently, without any other info about their plot. So here is my take on the movies based just on the poster.

Bhaago Bhoot Aaya

Usain Bolt produces and stars in this classic tale of murder, revenge and running. When Shaitan captures Bolt's girlfriend, he challenges him to the ultimate race. Now Bolt must run like he has never run before: being chased by ghosts and while wearing formals.


Kabrastan

To the east of Kazakhstan and to the north of Uzbekistan lies a small forgotten country called Kabrastan. For some reason everyone there is dead. After Borat succeeded in introducing the fine culture of Kazakhstan to everyone, some Kabrastani director decided to make this movie. The protagonist of this surreal movie is a hand which talks. Some believe that hand is a metaphor for the Congress party which is why Sonia Gandhi banned this movie in India.

Pyasa Shaitan

Thie movie is notorious for it's product placement: the people in this movie keep drinking Coca-cola products throughout the movie. The Shaitan doesn't actually kill anyone because he's too busy drinking Coke Zero. There is a token girl-who-dies in the movie, but thats because she drinks Pepsi accidentally.

Khatarnak

A heartwarming musical adaptation of Michael Jackson's Dangerous. A touching story of a one-eyed cyclops' struggle against the bigotry of the carnatic music world. The protagonist is a monster who's ambition is to sing Dangerous in yamuna kalyaaNi raaga, but is thwarted by jealous and petty humans. In the stirring climax, our hero butchers an entire kacheri full of people while maintaining taaLa.