Monday, February 15, 2010

No need to say it out loud

13th February, and minutes away from the V-Day.

It is at this moment my reader that we choose to visit a boy who is preparing to send his first Valentines message - very much like several love struck teenagers at this time around the world I'm sure -well, atleast those who are in the same time zone as the boy in question...

But it is this boy we are watching now as he sits on his bed by the window in almost complete darkness. It is nearly new moon and the only light from the skies is what the stars in the heaven can provide (which is quite naturally, very little, if you've observed the sky on such a day my reader) The streets are empty and dark owing to the local power stations devious plan that seems to be that it's town's local lovers may be deterred by such darkness into keeping away from each other. Alas, they do not know that true love cannot be stopped by such menial things..

Let us approach the boy my reader, and hush... Make not any noise. Here we currently see that though it is completely dark, there is a little glow coming from his room. What is this source of light that has lit up his face thus? Ah, it is his mobile phone. Come now let us peep over his shoulder and see what the boy is upto...

He seems to be going through the Drafts section in Messaging option of his phone. Here we see several messages: shayari, wonderful poems, mushy rhymes he has collected all through the year. And they all bear the name of only one sender.. That is right my reader. The name in the sender field is that of the girl whom this boy loves deeply!! He seems to ponder over each message. One of these will end up in her inbox tonight he thinks, and we see/hear all this quite clearly...

You may wonder, my reader, why doesn't the boy call the girl up - for isn't that the best way to make his feelings known? Well the truth is that he is so sure if he tires to talk he will make a fool of himself and fail very badly. And neither me nor you can convince him otherwise, so lets leave it at that.

But even as I speak, we see/hear he has decided he cannot send any of those canned messages. They all seem to fake and unreal. Yes, he thinks, a true message must be from ones heart to another. So he starts composing a new message:

My dear ... Happy Valentines Day. I really love you a lot and

Hmm, he does not have much imagination at this sort of a thing, so my readers, we have to accept that this is what he starts with. Atleast this is some beginning...
But wait. He is shaking his head; Oh!! And now he is erasing the message

Happy

He cannot do it. He will not do it. Oh my, I think he is giving up. We can see/hear it in his head...

Happy Chinese New Year!

He writes instead. Poor boy...

May the year of the Tiger bring to you great prosperity !!

He concludes the message somewhat lamely and presses the Send button.Bitterly dissapointed he lies down to sleep. A few seconds pass by and he knows he isn't going to get any sleep tonight...

Somewhere nearby the town-halls huge clock begins its 12 chimes to indicate the arrival of midnight.

Dong.. Dong.. Dong..

Just then his phone beeps!!

Dong.. Dong..

1 new message

Dong.. Dong.. Dong.. Dong..

He opens his inbox. It is from her!!! His heart starts beating wildly. He opens the message:

Hey! Happy Valentines Day!                                                                                   Dong..
You don't need to say it out loud silly. I love you too.                                 Dong..
How about we meet someplace and spend our Valentine together?    Dong..


Come now dear readers, let us not press upon his privacy any more. Just as we leave his room we see him typing 'Y' and 'e' and ...





Wednesday, February 3, 2010

In which the author is plagiarised

Not so long ago, I wrote a stupid, silly post about how to tweet from java. And then as the Gunslinger said "the world moved on" I found better things to do (and also to do things in a better way), and wisely judging that if I ever wrote a Twitter app as mentioned in that post and made it public (which was something I wanted to for some time now) I may be sent to the gallows for such stupidity. Really, because it was a simple application that transmits your Twitter id & password in plain text, for all to sniff and snoop. For those of you who are interested you can use OAuth to keep your Twitter data safe. I'll perhaps write about that some other time..

So why am I returning to all that now? Well.. I stumbled upon this today. If you look carefully (or casually - for Christ's sake - it doesn't matter) you may notice similarities to the earlier post of mine. Some dude has flicked bits of my code for some project (called ESME) undergoing incubation at Apache Software Foundation!! Check out this part:

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..


Come on dude. It's okay if you're inspired by someone else's code. Feel free to contact that person if you want to use it. But copying it with comments and all ? Too obvious. How can you ripoff someone else's posts and pass it off as your own, huh? I'm not really interested in taking a legal recourse. But come on, isn't there something called ethics?

So now I make a hue and cry about not being credited and all that ? That my mother cried after seeing all this? What next, I participate in Aman ki Asha with my Pakistani counterpart (if I have one), block people on Twitter and write novels whose titles include only numbers I can count with my right hand?

My case may not be has high profile one as this. But hell, I now understand how people who get plagiarised by the likes of Pritam and all feel. I think I'm more than just a little peeved at this. I feel this urge to do something to make me feel better about this.

Allrighty.. What you see next is a product of one pissed off mind. You have been warned, so beware.

** Ironically the producers of a certain movie claimed that using this video is kind-of plagiarism, so this has been taken down **

In your face plagiarist. In your face..


Aah.. Feels much better now.

Saturday, January 9, 2010

The uncertain case of Jeevan Das

(Disclaimer: The following work is purely fictional. I do not mean to offend anyone by writing this. This could have happened in any court in any country. Perhaps it is only the names that are Indianised. I leave it all to your imagination. No more preambles. No meandering narratives. On with the story then.... )

Judge: This court has been called to decide upon the case of Jeevan Das vs State of *** with directives that it deliver a speedy judgement as it involves parties who have very high holdings in our society. The public prosecutor Mr.Roy will argue on states behalf.
(turning to the accused)
You have been accused of the theft of a bicycle of Bobby, pampered son of our village Panchayat head. How do you plead, guilty or not guilty ?

Jeevan Das: Not guilty mi lord.

Audience: (Gasp!!)

Judge: Very well. Who will represent you in the legal proceedings?

Jeevan Das: No one mi lord. I will argue on behalf of myself. And yes the public prosecutor will assist me.

Public prosecutor: What the f**k !!!
(judge glares at him) Ahem. Sorry your honour. I apologize for using cuss words in the esteemed court. But as a public prosecutor, I am not legally bound to assist the accused. I request your lordship to instruct the accused to refrain from making such statements.

Judge: Mr. JeevanDas, you are not to make such statements. Do you not know how the judiciary works ? The public prosecutor cannot be of any assistance to you. If you want to proceed without a lawyer, you may do so. But I hereby prohibit you from making such absurd claims.

Jeevan Das:  Apologies mi lord. I will make no more such claims, though I still stick to what I claimed earlier.

Judge: Alright, alright. Let the public prosecutor begin his thing. Whatever it is that his thing is.

Public prosecutor: I'm sure you mean that I begin my prosecution your honour.
(coming to Jeevan Das - who has in the meanwhile been sworn on Gita or some other similar tome)
Will you please state your name and occupation to the court ?

Jeevan Das: Well I'm Jeevan Das, and I'm the president of Kleptomaniacs Anonymous.

Public prosecutor: Mr.Jeeven Das, when I say occupation I mean what do you do for living ? His lordship probably knows that the presidency of Kleptomaniacs Anonymous is not an office of profit, considering that lordship himself has held the post previously.

(judge appears to be looking towards the ceiling, whistling lowly)

Jeevan Das: Well then, by daylight I am a swindler ; and a thief by night.

Public prosecutor: Aha!! Your honour, I think this statement itself should be suffient to convict the accused for the crime, don't you think ?

Jeevan Das: Mi lord, I said I am a thief, not a successful thief. If my knowledge of law is correct, I cannot be convicted if it isn't proven that I've ever successfully stolen something, right ? Besides, the aforementioned robbery took place in broad daylight.

Public prosecutor: Well allright. I have a witness who has, as you may have guessed, witnessed you stealing the cycle. I request your lordship to allow me to present the witness to the court.

Judge: Summon the witness.

Public prosecutor: I call upon Bobby, the grievant.

(Bobby enters)

Public prosecutor: Bobby, do you identify the person standing as the accused?

Bobby: You mean the guy in the silly wig? Why he's my dad's friend and drinking mate. Namastey Uncleji !!

Public prosecutor: Hush!! That's the honourable judge.. And here he's no one's friend. I meant that one (points to Jeevan Das)

Bobby: Oh.. Hey, I'd identify that guy anywhere. He's the rascal who stole my bicycle. Arrest him!! Why's he standing.. (prosecutor whispers) Oh, sorry.

Public prosecutor: So Bobby, please narrate to the court what happened on that fateful day.

Bobby: Well I took out my cycle for a ride to the market. That turned out to the last time I rode it.. Well actually I rode it once more on my way back...
And then I parked it in my compound and went inside the house to have lunch.I came out and saw that the cycle had dissapeared. Just outside the gate, I saw this man Jeevan Das escaping with my cycle.

Public prosecutor: Thank you Bobby. That evidence should convince his lordship about the accused.

Judge: Hmmm.. Jeevan Das, do you have anything to add?

Jeevan Das: I have one question to ask the witness mi lord.

Judge: Ask away then.

Jeevan Das: (turning to Bobby) You say that you saw me escaping on you cycle. Can you tell me the exact speed with which I escaped ?

Bobby: Well I could say the approximate speed was around 25Km/h

Jeevan Das: Approximate.. See mi lord, he does not even know the speed with which I sped away after allegedly stealing his bike. I say that his entire story is fabricated.

(meanwhile Public prosecutor nudges Bobby so hard in his ribs that he yelps)

Bobby: No.. No.. I can tell you the exact speed.. Mi lord, he escaped with my bike at an exact speed of 24.6 Km/h

Jeevan Das: How sure are you of that?

Bobby: I completely certain.. I swear on it..

Jeevan Das: In terms of percentage??

Public prosecutor: Objection Your honour, this is highly irrelevant question...

Jeevan Das: Very relevant mi lord as I shall shortly explain.. Please Mr.Bobby how certain are you?

B: (now vehemantly) 100%.. I'm 100% sure of the fact that you escaped at 24.6 Km/h..

Jeevan Das: Ah! Thank you Bobby and thank you public prosecutor.. That is all I need to prove my innocence..

Judge, Public prosecutor and Bobby: (all together) What the f**k @#$@ ?!?

Jeevan Das: Yes.. I'm sure you must have heard of Heisenbergs uncertainty principle.. Well it states that: the position and velocity of an object cannot be measured exactly at the same time!! This means if Bobby is 100% sure of my speed/velocity he must be totally unsure of my position at that time. Thus you cannot take his evidence that I was there at that time. That is all mi lord..

(Almost everyone who was capable of speech in that court gave out a loud groan. One lady screamed and fainted. Donkey brayed somewhere. Or it was the other way round. Govinda slapped someone..

And ofcourse - Jeevan Das walked free)

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!!