Wednesday, December 9, 2009

Your country needs you - and how




I got this very important 'msg' today evening. You'll thank me for not forwarding this to you. It ran like this:

hi guys.
Ths msg s vry vry imp Pls frwd2al. (OMG!! Last time I got an important 'msg' was in the heydays of Swine flu - what is it now? Equestrian measles ??)
V hav 2stp d chinese products whch v r buyin. (who told you I brought Chinese products? The mallu shpokeeper who sold me that secret chinese stuff swore discreteness... Dang, he must have snitched under pressure)
So tat v can mak china economic down. (Ah! So this is how we make economic down. I bet not even Amartya Sen knew this)
U al knw tat china goi2start war wit india (WTF?!? I didn't know that I knew this - *scratches head*)
within 2or3 mnths (Whoa.. 2 or 3 months? Do our intelligence agenicies know this??)
Pls guys stp buyin chines prdcts. (Swear I will... really - we'll burn em like swadeshi movement)
Stdnts hav 2shw our powr by sending ths sms 2whole india. (Yeah! Go students.. But when you say whole India do you mean to include the remote village of Tarlekuntanhalli too??)
Atleaz do this for our india. (You break my heart sir. 'Atleaz' ?? Meaning I have not done anything for my country yet ?!? Waaah :`-( )

I suspect a Chinese hand in this forward.. Their plan is to cause panic in minds of Indian students (who make up a sizable chunk of our sizable population) Who do they think they're fooling? For one, it's definitely not me ;)

Tweet from Java

Here's how you can use Twitter API to Tweet from java:


import java.io.*;
import java.net.*;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;


public class Tweet {
static String twitterUrl="http://twitter.com/statuses/update.xml";


public static void main(String[] args) throws Exception {
//Hate args checking.. Won't do it; Not even usage shall be displayed - figure it out
OutputStreamWriter ostreamwriter;
String statusmsg="";
int i=2;

URL url = new URL(twitterUrl);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setRequestProperty("Authorization", "Basic " + Base64.encode((args[0]+":"+args[1]).getBytes()));
while(i < args.length-1){
statusmsg = statusmsg+ args[i++]+" ";
}
statusmsg = statusmsg+ args[i];
String encStatus = "status="+URLEncoder.encode(statusmsg, "UTF-8");
ostreamwriter = new OutputStreamWriter(conn.getOutputStream());
ostreamwriter.write(encStatus); //--> Magic Magic :)
ostreamwriter.flush();                              //I forgot this at first..

//If interested you can check the response after this, though
}
//Won't bother with exceptions either. 
//A programmer should be intelligent enough to discover errors without any display mechanisms...
}
}


And voilà:













(or you could also use this )

Tuesday, December 1, 2009

Short story #6

[...They say it's bad luck if a black cat crosses your way...]

It was getting late for work and he had missed his cab. Weather did not help in any way, gloomy as it was. He decided to take the shortcut to the nearest bus stop, instead of standing at his doorstep, cursing his luck. Thunder rumbled in distant sky. He prayed he did not get wet so early in the morning. Sitting with wet clothes, in that awfully cold place called office was not something he looked forward to. Neither was the presentation he was supposed to be giving today.

Brows furrowed, hands deep in his pockets and his head low, he hurried past the butchers shop of that gully, that would for today, serve as his shortcut. He did not even shudder, as he did always, when he went past that particular landmark. So lost was he in his thoughts that he nearly jumped onto the road when he heard that sound.


MIAOW!

A cat as black as the deepest darkness, with bright jewel like green eyes looked up at him, midway through tackling a mouse. He scowled at it (although for what reason he did not know) He was not superstitious, but
[...They say it's bad luck if a black cat crosses your way...]
still he did not like the way it stared at him.

Curse you, curse you; Dirty human, who walks upon the plate we eat
Damn you, damn you; Wicked man, for no reason which us you beat

Shit. He did not care if the cat actually was cursing him now. He had no time for such stupidity. He mimed kicking, aiming his feet at the cat, which deftly picked up the mouse between its teeth and ran away, it's net displacement resulting in
[...They say it's bad luck if a black cat crosses your way...]
it crossing his path.

His momentum carried him forward a few steps before he thought about his action (all the while not really sure, whether some consideration would have resulted in a different outcome) and just as he went past the crossing point of their paths, a cold drop of water hit his forehead hard, dripping down to his eyes. Before he crossed the next 20 yards, that landed him at his bus stop, heavens opened up and drenched him completely.

He reached his office full 16 and a half minutes late, wet. Nancy, his colleague whispered as soon as he reached his cubicle, "Boss man is in a bad mood today. He's looking for you, I think"..
"Thanks", he said. "I'll drop by his chamber right away" and he started towards his boss' chamber.

He knocked on the door and entered the chamber. Boss was peering over a long piece of what appeared to be fax paper. He looked up.

"Ah, here you are. I was looking for you. You're late you know", the boss said and then continued without missing a beat, "This just in. There are some changes in the figures you'll be presenting today. You'll have to start working on this immediately and if you are lucky enough
[...They say it's bad luck if a black cat crosses your way...]
you may just finish this, and then we can have our presentation as planned. You know how much this means to the team, right?"

He could hardly protest as boss man dumped the sheets of the latest reports into his (still wet) hands. Taking it as a sign that he was dismissed for now and also for the fact that he wanted to show that he was going to start working on it immediately, he started looking at the numbers on that report even as he started from the chamber towards his cubicle. Shit, he thought, as he felt the numbers made no sense. He sat heavily in his chair, took out a pencil and started marking those parts that made some sense to him, dimly aware that some parts of the fax were slightly smudged by his wet hands.

Two hours went by, he was not even half way through. His stomach grumbled, but he stayed at his place. No lunch today, he thought. Dumb luck. And his mind wandered to the black cat who
[...They say it's bad luck if a black cat crosses your way...]
had crossed his path that morning. Hmmmph. He had to push such thoughts away. That would get him nowhere. And he was pretty confident, he'd be done in a couple of more hours, if he concentrated hard. Imagining his colleagues nodding appreciatively at his presentation, he started working away furiously.

Shit. He had smudged more that he had thought he had. He extrapolated whatever figures he had, cursing his stupid luck, his mind going back to his lab exams (where he had performed similar feats of adjustment), going back to the black cat (more than once) and returning with the faithfulness of a well trained dog, to the task at hand.

Hours passed...

He was almost done now and he looked up at the clock. Shit again, it was 4:30. He had only an hour before the presentation. His thoughts turned to despair, (and also to the cat which crossed his path that morn) and by the time he finished, it was exactly 3 minutes to 5:30. He snatched his laptop up and ran 12 flight of steps to the meeting room. As his luck would have it
[...They say it's bad luck if a black cat crosses your way...]
lifts were not working today, of all days.

Entering the meeting room, he tried to throw a casual smile at those present and was treated to a couple of grimacing (ghastly even) looking smiles. Or perhaps it was just his imagination (which again wandered briefly over to the black cat who, you know, crossed his path that morning) Turning on the projector, he started his presentation, although without his usual confidence.

For the next one and half hours he battled his way through the presentation, fielding all sorts of questions thrown at him. Were a couple of questions asked just to rile him? Anything was possible today he thought and as the presentation concluded, he did not quite think he had pulled it off. Infact he had no hopes of it at all. As boss man took the guests away for the evening entertainment, he just slunk away from the office, too tired and too dazed, now for sure believing that - it's bad luck if a black cat crosses your way.. There was no other reason that could explain such a bad day.

Now once you believe in the problem, you have to believe in the solution as well..
So, determined to set this all right, he decided he should retrace his steps of the morning, uncrossing the darned path where this all began. An undo, a ctrl+z of sorts.

As he neared the spot where the (darned) creature crossed his way, he saw that there, at the exact spot, was a boy of about 8. The boy stood there all alone, crying. "Ah, another victim of badluck", he thought pitying the boy and decided that perhaps he should enquire and offer him his solution (ctrl+z and all that)

"What's wrong kid?", he asked, "Why're you crying?"

Sobbing the kid replied "Cat" (his heart leaped)

"What happened, kid? What of the cat?", he asked, now feeling suddenly very light headed.

"My cat", the kid sobbed again, "Someone ran over her today morning. I have her no more" and he started wailing..

They say it's bad luck if a black cat crosses your way, but they did not say it is for whom...

Monday, November 23, 2009

Language biff-bash

Lighter side of language bashing. Nothing Thackerayesque here ;)

Bashing:
English vs Kannada (ah, the controversial topic) came up recently, when we were at a wedding over the weekend (me and 2 other friends-I'll call them Quiz master a.k.a Pyaaz Kaatke and the C dude - no points for guessing who they are) and the conversation drifted to the aforementioned topic.

Quiz master: Accha, C dude, fiancé ka spelling batha..
C dude: f i a n c e
Quiz master: Woh 'e' nahin, 'é' hain. 'e' ke upar ek tilak
C dude: Kya baat kar raha hain? (He fished out his iPhone with a flourish, opened the dictionary and searched for the word) Arrey you are right man (pause) But there are two words here: fiancé and fiancéé
Me: Haan. For different genders. One is pronounced fiancey and the other fiancei
C dude: Nahin. Pronounciation is same for both. See..
Me: (trying to recover) Ah.. It's a word derived from French. In French, if you add le before a word it's masculine; if you add la it's feminine. But English has no such distinction, hence they have extra é (a.k.a e with tilak)
C dude: What a stupid language. Indian languages are much better..
Quiz master: English is like that because it's not rule based, it's practise based. Let's take another word - spell Django
C dude: I give up
Quiz master: It's d j a n g o
C dude at this point made a statement that was almost a copy of Dharmendra's go = ಗು  dialog of Chupke Chupke. I remembered that he had once told me his name should actually be pronounced as rhyming with cream. I shuddered..
Quiz master: ?!?
C dude: That is why I call it a stupid language. We have no such problems in Kannada
Quiz master: Ok.. Let's go and wish the couples
Me: phew

Basher bashed:
Long long ago, I had a friend who's favourite topic was(guess, guess) English vs Kannada. He is rumoured to have asked an English teacher a question that stumped the lady completely, and  made sure she reserved the lowest marks in her subject for this guy. He also asked that question to a lot of other people mercilessly. My turn came one day.. He asked me: ನೆಹರು ಭಾರತದ ಎಷ್ಟನೆಯ ಪ್ರಧಾನ ಮಂತ್ರಿ? Translate this to English.. Heh he!!

Gears turned in my brain and out this came: If one were to prepare a list of Prime Ministers of India, sorted on the order in which they swore in, what position would Nehru occupy on that list?

Bash that!!

Sunday, November 8, 2009

Koda and the Zen of stomach ache and other maladies

Scenario:
You are a bigwig in the society (perhaps political), who has hundreds of people working under you. You have wielded power for a long time. You are thinking all this is going to last for ever, and you'll live to a ripe old age to enjoy the fruits of your (poor taxpayers ??) labour, when one day, all of a sudden, like a bolt out of the blue, you find that Income tax department has raided your palatial home, found that you have been involved in illegal transactions ammounting to several crores, and you are now facing detainment and possible arrest. So what do you do?

Solution:
You fake it ofcourse.

Hmm.. This may not make much sense to all the readers out there, the humble voters/taxpayers. So let me elaborate. What you fake is some sort of illness. And what choices have you got? Well you could go for faking chest pain (do not go all the way one "patient" in Munnabhai MBBS does when Munna's dad visits his "hospital" - that won't work I suppose.. But then again, I'm not really sure of that) Or you could try the good old uneasiness and blood pressure thingy (you wont have to go to great lengths to fake uneasiness - just picture your imminent arrest - that should do the trick) There are several such illness you can always fake, but just make sure no other bigwig has used that reason in recent times. Not that it'll be easy for the sleuths to spot the fake. You see, my sir, people deserve something original..

If you have observed, I've never mentioned the humble stomach ache here. Yes, the world famous refuge of school-going children worldwide has now been used by Mr. Madhu Koda. So Sonu, if you want your mother to be convinced that you are indeed sick enough to skip school today, you'll have to use a different excuse. Sorry kid.. You see, it's all politics :( What really bugs me is, how is it that the IT department and ED (you pervert, it's Enforcement Directorate) bought this story, when, not once in all my school going years did my mother fall for this trick.. Koda ke performance mein kya hain jo mere mein nahin?!?

Madhu Koda, whose surname was carefully chosen by his grandfather, a Star Wars fanatic, now joins the great list of Movers and Fakers. Some of the more notable names on this list include Abdul-stamppaperismymiddlename-Telgi, Ramalinga Raju amongst others. A visibly heartbroken Koda granddad, told the press today that he had never expected his grandson would land in such trouble one day. "I had christened him Koda, along the lines of Yoda, hoping one day he would reach to great levels as the Jedi master. Actually I would have named him Madhu Yoda, if it weren't for the insistence of the village astrologer, who said it was numerologically advisable to have a surname starting with 'K'. This same piece of advice from the same astrologer worked wonders for Ekta Kapoor. I don't understand what went wrong", he said revealing the K connection

So finally what happened was that Koda was discharged from the Apollo hospital today. The doctor who treated him, told on the condition of anonymity that Koda's stomach ache was due to high levels of acidity, caused by indulging in all the spicy festival food his mother-in-law had made for him. "We have intravenously administered Gelusil to Mr.Koda. Joh karna tha humne kiye hain.. Ab toh bus unko dua ki zaroorat hain", he added in a quite filmi fashion. Now the nation awaits with a bated breath (reserved for such cases), as to what happens next...

One word of advise to dear readers. The above techniques though tried and tested over the years by several bigwigs, may not really work for you. So if you are in a similar situation, please do not try this, for the above stunts are performed by trained professionals. For the harder you try, the harder you fail. Do not 'try' to fake it, for it fakes all by itself.  Better yet, do not get into a similar situation at all. How do you do this? Pay all your taxes on time, do not bribe or get bribed and please for God's sake do go out and vote.. To make sure such people do not get elected ever again. I know, the next guy may be not be better than this one( he could be a lot worse), but let us by a process of elimination get rid of all these babus one by one.

Jaago re!! (and drink your tea too)

Wednesday, October 28, 2009

Caution: Chicken crossing

I'd broken a plastic comb this morning,
Followed by a plastic jar of glue;
Thank heavens her heart wasn’t made of plastic,
Or I'd have ended up breaking that too...
(A song not written by the Beatles)

Swaminathan, the village idiot of a remote village in South India caused quite a furore in the philosophical world yesterday when he claimed that he had solved the question that had puzzled philosophers, theologists, theosonists, arsonists(??) and Marxists for several centuries (and in that order). The question in question here is the famed "Why did the chicken cross the road?" or "Kukkutaha maargam tarati kim?" as was known to ancient Indian philosophers.

To the uninitiated, let me begin with the historic importance of this famous question. Any philosopher worth his salt will agree that this question is to philosophy what Einstein's Theory of Relativity is to Physics. The exact origin of this question is still in dispute amongst the historians. Some experts say that this happened during the late Selandian era when the chickens evolved enough to distinguish between the road and the pavement, and the Darwinian force called the "survival instinct", made it cross the road to the other side, where it perceived an abundance of bird seed. However this group of experts is small indeed, for there are several other groups who have put forth arguments that have cast some aspersions on the validity of this theory. Rival groups have long argued that there were no chickens in the late Selandian era and the rest of the theory is hogwash. However a recently unearthed signboard of KFC has been found to be of the late Selandian era (in fact in the last 3 years of that era - carbon dating has accurately established) and this seems to lend a little credibility to the former group (Let's call them Selandian experts) Another group of radicals however argue that there may have been chickens, but certainly no roads in that particular era. Selandian experts have dismissed this saying that the KFC signboard was that of a KFC “Drive in”, and “Drive in” must imply the existence of roads. QED..

The opponents look silenced for now, but there is a general air of calm before the storm, and rumours have it that these opponents have an ace up their sleeve that will demolish the Selandian experts once and for all (All this became "like lighting divine fire underwater" or "neeralli madida homa" as Swaminathan, effectively put an end to this topic yesterday. More on this later..)

The origins of this question is not the only thing disputed with regard to the question. As one can see here, there are arguments that chicken did not have the rationality that road was indeed a road. For that matter, it wouldn't discomfort the road-crossing-chicken the slightest bit, if one called road a toad. This seems to suggest that the chicken was well versed in the Shakespearean philosophy of "What's in a name?" which suggest the it was indeed a rational thinker (assuming that anyone who reads Shakespeare is a rational being) Thus a mere suggestion that the chicken is not a rational being leads to 'it' being proved to be a rational being! However such suggestions not withstanding, the author of the above essay has brilliantly dismissed the idea that the "question of chicken crossing the road is meaningless and invalid".Thus there is no need for the rationality or intentionality on the poor chickens part here. It has also been bought to light in the recent LHC experiment that this question is indeed a valid one. Scientists recently claimed that the same force that causes a bunch of scientists to study atoms by colliding them against each other and breaking them apart is responsible for such actions of the chicken. Philosophers smirked at this news, saying this is what they had claimed all along. They even named that unknown force as "Curiosity"

It is to be noted here that this mysterious force has long been associated with felines. This same force has caused several members of the feline fraternity to pay dearly with their lives. This discovery of "curiosity" as the force behind the chicken-road-crossing, some philosophers go on to claim, has heightened the importance of the great question. They say that since there has been no historical evidence of any chicken having to pay with its life, even under the effect of this force, chickens are allegedly immune to the force of curiosity. Their claim is that solving this question will make even humans immune to the curiosity force, thereby prolonging their lives.

In related news, Chicken rights activists recently held protest near the author’s office stating that it was dangerous for the chickens to cross the Indian roads. They wanted the traffic police to help any chicken crossing the road. Later they distributed pamphlets, which enumerated the safety precautions that chickens had to follow while crossing roads. Unfortunately the 30 chickens who were bribed into attending this protest were nowhere to be seen after about 30 minutes after the start of the protest..

Coming back to how this question came to be solved, let us first see the previous solutions. Over the years there have been several attempts to solve this conundrum. However none of them seem to have satisfactorily answered the question. Given below are some of the more important theories:
  • "To get to the other side" (A very popular and old solution) Reason of dismissal: But why? Answered again by: "Perhaps there was grain on the other side" Reason of dismissal: "Perhaps... Indeed *smirk*"
  • "The chicken discovered that the side of the road on which it was standing on had a KFC outlet" Reason for dismissal - Chickens cannot distinguish between KFC and "McShmucks Home for homeless chicken"
  • "The sidewalk on which chicken stood was dug up to lay the Optic fiber cables. It had no space to stand, hence it crossed" (A popular Indian theory by the second-cousin forty-seven-times removed of the Nobel prize winning Chandrasekhar) Reason for dismissal - When there is a dispute over the existence of the road itself, there can be no question of admitting the existence of optic fiber (Indians have protested that it was racism that caused the dismissal of this theory)
Thus for years there were not satisfactory explanations for this philosophical question. That is until yesterday. And then,

World sat stunned in silence as Swaminathan announced: "The chicken never did cross the road... Road just happened to move under chickens feet (a la Relativity)"

Thus it came to be that a philosophical question that was compared in likeness to Relativity came to be solved by the same. Nobel committee has decided to open a new category in philosophy this year. And guess who the prize goes to?

Monday, October 26, 2009

An untold short story

(Disclaimer: The following work is purely fictional. I do not mean to offend anyone by writing this. Anyone who knows me personally will vouch for this. And please do not sue me for this either, for I’m mortally afraid of lawyers. Further more please imagine this plot unfolds in a universe parallel to ours – just to be safe – and do not make any assumptions about the religions, for they may not actually be what you are thinking them to be)

As the clock struck one, Rishab Ali Khan entered his private chambers, closing the door discreetly behind him. But not before he had warned his new secretary that he did not want anyone disturbing him when he performed his daily prayers.

This private room adjacent to his office was adorned with all sorts of trophies and treasures. Head of a bison he had once slain, medals of honour that were relics from his days of action in the army, expensive gifts a.k.a bribes from so many distinguished businessmen of all over the country as well as beyond. Rishab loved all the comforts of this private chamber. The plush leather chairs by the fireplace, a cabinet full of expensive wines, a shelf full of records of some of the best classical music in the world, an antique gramophone to play these, were some of the comforts he had come to love very much.

And as he crossed over to the center of the room, where a very expensive Turkish prayer mat lay, his eyes fell on an object that he loved the most above all - the framed photograph of a girl standing in front of the Paleozoic monument - sitting on the exquisite mantlepiece (He loved the girl, not the photo frame) His daughter Aaliyah was a spitting image of her mother, when she was the same age. Oh, how he had loved his wife (former actually)

The marriage of Rishab Ali to Hameeda Begum was a grand union of two most powerful families in the country. Hameeda being the eldest daughter of a wealthy merchant and Rishab being the only son of a political party president, this alliance made sure that in that era itself Rishab became one of the most wealthy and powerful men in the country.

At the time of marriage Rishab was only a member of his father’s political party, fresh from his army stint. His new found wealth and power made sure he rose in the political circle, eliminating opponents and obstacles, both from within his party and outside. He was soon at the head of the party after his father’s death. But this rise proved costly as he started neglecting his beloved wife. And then started the strenuous nights of arguments, shouting matches and name calling, till they separated after 8 years of marriage.

This was fourteen years ago. Hameeda was since then, rumoured to have been remarried (to a rich sheikh). Rishab had given up hopes of her, even though he loved her deeply (No, he was not angry with her for seeking separation. Mostly he was angry with himself) However since separation Aaliyah had been bought up by Rishab. He had made sure he did not neglect his daughter. And it thus happened that much against his wishes Aaliyah decided to study at one of those new universities in Avalonia. Rishab reluctantly agreed. He had never said no to his daughter for he did not want to risk losing her too.

Two weeks ago, she had called him and told him, she had found a boy who loved her. Rishab was shocked to hear the boy was not of their religion. As a matter of fact, he was not of their country either. But Aaliyah sounded so happy, that once again he did not find it in him to say no. She had sent a photo of her taken at Rodinia (where she was currently holidaying and where she had met the love of her life), which now lay at the center of the mantelpiece.

He went past the mantlepiece, to his prayer mat. He sat on his knees in a prayer position and started his daily prayer. But his thoughts were now turned elsewhere. These were turbulent times for the world. And when it came to the matters of his religion versus someone else’s, he readily took sides with his fellow men. In the very room adjacent to the current one, he plotted with cunning skill of a wily old fox, such designs, that nearly bought his enemies to their knees. One such plot was underway today, and this would be a great strike. He had ordered and supported this major attack on what he had called an enemy of his religion. A giant step towards proving to the world the cost of being on the wrong side of his God.

From the table nearby a telephone rang. Rishab furrowed his brow angrily. Stupid secretary. Didn’t he specifically order him that he did not want to be disturbed? He did not expect news from his Commander-in-chief Rehmat this soon and that too over the phone. The phone kept ringing. Unable to continue his prayer and eager to give a piece of his mind to the secretary, he picked up the handset and barked, “What is this? Didn’t I warn you I do not like to be disturbed when I’m doing my daily prayers? I will…”

“Sir, I’m really sorry. But this sounds urgent. Commander wants to speak to you immediately”, replied the secretary almost hysterically.

“Hmmph”, grunted Rishab, “Put him on line”, wondering at the same time what could have been so important that Rehmat had contacted him so soon in the day.

*Click*

Rehmat spoke in his quivery voice (everyone’s voice quivered before his) “Sir, I’m really sorry to disturb you. But this is.. this is..”

“Well what? Out with it”, said Rishab.

“This is concerning your daughter, sir. We have just received the news that she was in Didlydale with a Pangaean boy. We fear she may have been at the airport when our mission was carried out there. There have been no survivors so far. I’m sorry sir, we had no idea she was in Pangaea. We are still looking for her and...”

Rishab heard no more. He collapsed to his knees for the second time on to the cold hard floor, and this time he earnestly prayed...

Note: Avalonia, Pangaea and Rodinia are fictious countries I have invented/borrowed for the purposes of this story. And Didlydale is a major airport in Pangaea