Tuesday, March 30, 2010

Interactive story

Scene opens with a long shot. Location: Top secret Nuclear Missile Command. People are milling around. Suddenly the door opens and a harried looking man rushes inside. He is the NATIONAL SECURITY ADVISER. He is on the verge of panic.

NSA: Who's the lead programmer here? Where is he?

An intern points towards a lonely guy sitting in a cubicle on the far end. The guy JOE is fat, almost bald. He's wearing a faded t-shirt and drinking coffee from a paper cup. The NSA runs over to the cubicle.

NSA: Quick! We have no time to lose. We have to override the launch command!

JOE: Hey! calm down, man! What happened?

NSA: A janitor accidentally pressed the deploy button on our ICBM control! The missiles are pointed directly towards us! If you don't override the launch we'll all die! HURRY!


JOE is a programmer.

Monday, March 22, 2010

Unicode variable names in Java

Total I learned that you can have Unicode characters in your class/variable names.

public class Lang
{
 public static final int प्रियानंद  = 42;
 public static final int ಪ್ರಿಯಾನನ್ದ = 33;

 public static int ನನ್ನ(int x)
 {
  return x + 1;
 }
 public static int ಹೆಸರು(int x)
 {
  return x - 1;
 }
 public static void main(String [] args)
 {
  ನನ್ನ(ಹೆಸರು(ಪ್ರಿಯಾನನ್ದ));
 }
}

Note: You might have to specify -encoding Unicode when compiling.