Wednesday, August 13, 2008
Monday, August 11, 2008
Ladies and Gentlemen, Please Stand for the National Anthem of India.
Congrats Abhinav Bindra, you rock!
Thursday, July 31, 2008
Cuil - Cool - Cold?

The wannabe Google killer Cuil (pronounced cool) failed to impress. Like many others on the net who did the same thing, I tried out ego-searching. What I found was that, it didn't even return 20% of the result what Google gives. Among the ones it returned, interestingly, it somehow associated one of my conference papers to a concentration camp memorial! (See the attached screenshot). Oh, please don't try to be too smart!!
However, as a bonus, when I did a similar search on google to compare, it unearthed a software that I had put on the web around 10 years ago, called Tcl-O-Scope, that I had totally forgotten. I still love you google :)
Oh btw, did I mention that I have advanced to the second round of google code jam 2008!
Cuil has a long way to go.. Unless it warms up and deliver results, it will become permafrost pretty soon!
Sunday, July 13, 2008
Gelatin Balls
Kevin was playing with these which my sister had bought yesterday night. Those tiny dull beads had turned into colorful globules after a few hours in water!
Friday, July 11, 2008
Thursday, July 10, 2008
Tuesday, June 24, 2008
String Comparison Gotcha in PHP!
Can you expect a mature language that has been around for 13 years, and powering many web sites to do basic string comparison properly? No, not really!!
Run the above code and see for yourself! It will match $toFind with $x[1]!! I got hit with this nasty surprise when calling the array_search() function for a programming contest problem. It appears like PHP is truncating these strings, which it thinks are numbers and comparing the first few characters. Can anyone give a logical explanation of what's going on? Am I doing something fundamentally wrong, or is PHP hosed?
Update: Jude pointed that using "strict" flag in array_search() uses "===", and hence gets rid of the problem. But the fundamental question still remains. Why would PHP do an automatic type cast to integer while comparing two strings?
Update 2: The fundamental issue can be traced to this single statement in PHP documentation - "If you compare two numerical strings, they are compared as integers." This was the root of all problems. I don't like that behavior, but hey this is PHP. I have a similar gripe with Tcl as well. Try this:
It will print 59, followed by an error 'expected integer but got "09" (looks like invalid octal number)' as Tcl treats any string starting with 0 as octal - a tradition it borrows from C, but unfortunately, it overloads the string type!
$x[0] = "10000000000000000000001";
$x[1] = "11011000000000000010101";
$x[2] = "10101010101010101010101";
$toFind = "11011000000000000010001";
$k = array_search($toFind, $x);
echo "match is $k";
$p = ($toFind == $x[1]);
echo "match is $p";
Run the above code and see for yourself! It will match $toFind with $x[1]!! I got hit with this nasty surprise when calling the array_search() function for a programming contest problem. It appears like PHP is truncating these strings, which it thinks are numbers and comparing the first few characters. Can anyone give a logical explanation of what's going on? Am I doing something fundamentally wrong, or is PHP hosed?
Update: Jude pointed that using "strict" flag in array_search() uses "===", and hence gets rid of the problem. But the fundamental question still remains. Why would PHP do an automatic type cast to integer while comparing two strings?
Update 2: The fundamental issue can be traced to this single statement in PHP documentation - "If you compare two numerical strings, they are compared as integers." This was the root of all problems. I don't like that behavior, but hey this is PHP. I have a similar gripe with Tcl as well. Try this:
set x "072"
puts [incr $x]
set y "09"
puts [incr y]
It will print 59, followed by an error 'expected integer but got "09" (looks like invalid octal number)' as Tcl treats any string starting with 0 as octal - a tradition it borrows from C, but unfortunately, it overloads the string type!
Monday, June 23, 2008
My kids on mugs!
Played around with POV-Ray, GIMP and the photo I took, over the weekend. Oh the joys of ray tracing! Credits to Ian Shumsky for the mug object!
P.S: If you like any of your photos to be on the virtual mug, send it to me and I'll generate a scene similar to this and send it to you.
P.S: If you like any of your photos to be on the virtual mug, send it to me and I'll generate a scene similar to this and send it to you.
Monday, May 26, 2008
AWS Meetup Chennai
We, the motley crew from Impiger (Ashok, Abi, Ram, Priya, Umaima and myself) just returned from AWS Chennai meetup. It was a great evening and we were able to hear what's new in AWS from Jinesh Varia, the evangelist from Amazon.
One of the highlights of the event was the demos. The coolest, imho was from nboomi. It has some cool 3D models of homes which you can customize. It is flash based and the demo was fascinating. It seems they store the models in S3. When I tried it out though, my Firefox memory usage shot through the roof and I had to kill it. I'm sure they will fix those kinks pretty soon. Also, our demo of Boxcloud was received well. I also got introduced to Hadoop and TimesMachine.
One problem with AWS is the barrier to entry for developers, as they are required to sign up with a credit card. I suggested that Amazon lower that barrier by providing sandbox APIs. They can control it by clearing out the data periodically and limiting the number of hits from an IP per day. Jinesh is going to look into that. I hope one day it will happen :)
One of the highlights of the event was the demos. The coolest, imho was from nboomi. It has some cool 3D models of homes which you can customize. It is flash based and the demo was fascinating. It seems they store the models in S3. When I tried it out though, my Firefox memory usage shot through the roof and I had to kill it. I'm sure they will fix those kinks pretty soon. Also, our demo of Boxcloud was received well. I also got introduced to Hadoop and TimesMachine.
One problem with AWS is the barrier to entry for developers, as they are required to sign up with a credit card. I suggested that Amazon lower that barrier by providing sandbox APIs. They can control it by clearing out the data periodically and limiting the number of hits from an IP per day. Jinesh is going to look into that. I hope one day it will happen :)
Saturday, May 24, 2008
Funny (but true) Quote!
Seen on the tagline of Slashdot user eldavojohn
"Can god code something so unusable even he can't use it? No, but I can and so can you: http://www.microsoft.com/careers"
*lol*
"Can god code something so unusable even he can't use it? No, but I can and so can you: http://www.microsoft.com/careers"
*lol*
Sunday, May 4, 2008
RoR Scalability
Volume Fade Out Sleep Timer
I usually take a nap Sunday afternoons, and I like to hear some streaming radio during that time. I wanted something that would fade the volume down to 0 after a certain period of time (say half hour). I decided to give it a shot myself. It's Tcl and Snack to the rescue! After twiddling with the Snack API for 5 mins, here is the code:
package require snack
set line [lindex [snack::mixer lines] 0]
snack::mixer volume $line v1 v2
set totalTime 1800; # half hour
set delay [expr $totalTime*10]
for {set v 100} {$v>=0} {incr v -1} {
set v1 $v
set v2 $v
puts "[clock format [clock seconds] -format "%T" ] - $v"
after $delay
}
It worked out well. And for the record, after I woke up, I googled to check if there is something out there that will do the same thing. There were many utilities, but the one stood out was this, based on something called AutoHotKey. I 've never heard of that before, but sounds very impressive.
Saturday, April 19, 2008
Monday, April 14, 2008
My First Speeding Ticket!
Today I got my first speeding ticket, after 10+ years of driving. I clocked a paltry 68kmph, when according to the traffic police, the limit is 50kmph. This was on the Rajiv Gandhi Salai (near Tidel Park), one of the best roads in Chennai, during a lazy mid-holiday-morning, when there was no other vehicle on the stretch except mine. The police officer was polite though, and I paid the fine of Rs. 300.
I love to drive fast, but I drive responsibly. I honor all traffic lights (it is a rarity in Chennai), be courteous to pedestrians and other drivers, keep the lane etc. There are people who drive rash. Mind you, rash driving is totally different from fast driving. Unfortunately, the police (CCTP) have no means or intentions to take away those rude mongrels off the street.
Drinking is not illegal. However, they urge you to "drink responsibly". I think speed limits should only be guidelines and drivers be let to "drive responsibly".
I love to drive fast, but I drive responsibly. I honor all traffic lights (it is a rarity in Chennai), be courteous to pedestrians and other drivers, keep the lane etc. There are people who drive rash. Mind you, rash driving is totally different from fast driving. Unfortunately, the police (CCTP) have no means or intentions to take away those rude mongrels off the street.
Drinking is not illegal. However, they urge you to "drink responsibly". I think speed limits should only be guidelines and drivers be let to "drive responsibly".
Wednesday, April 9, 2008
American Airlines - Bernard Jordan - False Prophets
I was checking out the news article about American canceling 850 flights, when this paragraph struck me: "Bishop Bernard Jordan, a Harlem minister, was in a first-class line trying to catch a flight to Atlanta, where he was scheduled to preach Wednesday night". Contrast this to what Jesus said to his disciples in Luke 9:3 -
And He said to them, "Take nothing for your journey, neither a staff, nor a bag, nor bread, nor money; and do not even have two tunics apiece." (NASB)
I have never heard of this man. Prodding further, I went to his site, the headline of which screams "FREE Prophecies are back!". Huh, when did prophecy come for a cost? It is so awful. Read about many of his antics here.
We should be very careful about such people. There are many youngsters, and particularly women, who are deceived by these people and fall in their trap. Remember what Jesus said in Matthew 7:15 -
"Beware of the false prophets, who come to you in sheep's clothing, but inwardly are ravenous wolves."
And He said to them, "Take nothing for your journey, neither a staff, nor a bag, nor bread, nor money; and do not even have two tunics apiece." (NASB)
I have never heard of this man. Prodding further, I went to his site, the headline of which screams "FREE Prophecies are back!". Huh, when did prophecy come for a cost? It is so awful. Read about many of his antics here.
We should be very careful about such people. There are many youngsters, and particularly women, who are deceived by these people and fall in their trap. Remember what Jesus said in Matthew 7:15 -
"Beware of the false prophets, who come to you in sheep's clothing, but inwardly are ravenous wolves."
Saturday, March 15, 2008
Not Practising What You Preach?
I have blogged about YSlow, a very nice tool from Yahoo, that gives performance indicators of your web page. Guess what? I ran it on their own page (http://developer.yahoo.com/yslow/) and found that they got 3 F's, 1 C and 1 B. Overall score was a D (62/100). A case of not practising what you preach?
Performance Grade: D (62) | |
| |
| |
| |
| |
Friday, March 14, 2008
Google Sky is up!

First google maps (earth) - http://maps.google.com, released February 8 2005,
Then google moon - http://www.google.com/moon/, released July 2005,
Then google mars - http://www.google.com/mars/, released March 12, 2006,
Now google sky!
http://www.google.com/sky/, released Today
Check it out!
Friday, March 7, 2008
Ext 2.0 Tips
Ever since I started dabbling with Ext a few months back, I'm addicted to it. Ext 2.0 has wonderful API documentation, but there are many hidden treasures that are not apparent. I will start capturing some of these starting from this post.
Toolbar Tips
Toolbar Tips
- To create a separator between items, use '-' between the items. Hmm.., "|" might have been a better choice, don't you think?
- To right align a set of items, use '->' as the separator.
Wednesday, March 5, 2008
I'm Learning to Play Keyboard!

Today was the first class. I used to play by hearing, but always wanted to be able to read notes and play in a formal way, especially to play the hymnals.
The 1 hour session was very interesting. The tutor was very knowledgeable and professional. She quickly understood where I stand and taught me the basics. I did some fingering practices for G and F clefs. Getting the keypress synchronized with the beat was tricky, but it came to me after several tries. Reading music and playing seems to be a mechanical activity. Atleast that is my initial observation. Let's see how it goes!
Friday, January 11, 2008
Some Interesting Quotes
that I came across recently:
"Success without honor is an unseasoned dish; it will satisfy your hunger, but it won't taste good." - Joe Paterno
"Don't make someone a priority in your life, if you are just an option in their life" - Heard on talk radio.
"Being bitter is drinking poison and hoping someone else will die" - Seen on the tagline of Slashdot user LarsWestergren
"Success without honor is an unseasoned dish; it will satisfy your hunger, but it won't taste good." - Joe Paterno
"Don't make someone a priority in your life, if you are just an option in their life" - Heard on talk radio.
"Being bitter is drinking poison and hoping someone else will die" - Seen on the tagline of Slashdot user LarsWestergren
Wednesday, January 9, 2008
Saturday, January 5, 2008
SOS
Conversation with my Son

Kevin: Daddy, do you want 25 or rhino?
Me: I want rhino.
Kevin: No no I want rhino. You pick something else!
Oh, and by the way, for those interested in numismatics, I found this excellent site when searching for the 25 paise image shown above.
Subscribe to:
Posts (Atom)