Tuesday, October 26, 2004

Long Weekend

I had fun this weekend writing an app to sync my phone from Linux. (Sound of people typing in "fun" at www.dictionary.com). LG doesn't provide syncing software for Linux and it doesn't publish the protocol used either. So I had to do a bit of reverse engineering to figure out how to do it. With a serial port sniffer, I found that the sync software wasn't doing any voodoo but simply using AT commands (though they weren't standard commands you'd find in the GSM AT specification). After that I learn a bit of serial programming from an good online guide and found a python module for serial programming. So far I've managed to extract the schedule from the phone. The next step is to create a good front end for it and maybe share it on the web. There is a project already for Nokia handsets called gnokii.
Other than that, after yet another failed attempt to rent out The Usual Suspects I ended up watching Toy Story and North by Northwest. And there was a trip to the perpetual mela called Forum with Danny. This week's amusement was watching the suckers who had queued up to get inside McDonalds. Danny has become interested in Krishnamurthi's books. Both of us bought The Ending of Time which contains conversations between Krishnamurthi and David Bohm. Yet to start reading it.
Anyone interested in a hike on the abandoned railway track from Donigal that Snu went on last weekend? Here's a friend's travelogue on this hike.

Monday, October 18, 2004

The SEP Field

The SEP field is an amazing technology introduced in Douglas Adam's Hitchhiker's Guide to the Galaxy "trilogy". It is a cheaper alternative to the invisibility field and serves the same purpose. So how does it work? Well, SEP stands for "Somebody Else's Problem". The SEP field relies on the human observer's tendency to subconsciously ignore the existence of things that look like somebody else's problem. Read on here for a funnier description.
If you're wondering why I posted this today: Mohan and I were going out for breakfast a while ago when the lift stopped at the third floor. When the door opened, there was this guy briskly sweeping a pile of dust into the lift. He probably was a bit late in seeing the lift occupied and then changed the direction of the sweep a bit. Neat idea though. If you can't sweep it under a carpet, just use the lift and make it somebody else's problem.
Coming back to Hitchhiker's, there are other articles in Wikipedia on The Total Perspective Vortex, Pan Galactic Gargle Blaster and Vogon Poetry. If this whets you appetite for the book, you could borrow the "trilogy" from me.

Sunday, October 17, 2004

Dreams...

I'm not going to write on the "I want to save the planet" or "I want to soar like and eagle" or "I want to give Schwarzenegger a wedgie" kind of dreams here. It's about the more interesting ones I wake up to on some days.
Just yesterday there was this guy from college (barely knew him) who suddenly turned psychotic and started chasing Kamath, Sito and me with a bazooka in hand. After a long chase we managed to give him the slip and end up in a lake bed. Just when it looked like a safe place to hide, we see pug marks. A little away we see granite sculptures of some animals. As we move closer, one of them roars. It turns out they are tigers covered in foam. I didn't know tigers also had foam parties. I tell others about a report and photo in The Times about foam formation in Bellandur lake due to effluents from textile units. Kamath helpfully adds, "Know what? We are in Bellandur." Satisfied with the explanation we let the tigers continue their party and move on. We soon find other victims hiding there and get into a meeting to figure out why the psycho is after us and where he got that frikkin bazooka from. Don't remember much after that.
I've spent most of my conscious hours today trying to figure out how the subconscious comes up with such interesting stuff. The foam from the lake can be attributed to the photo in The Times yesterday, but where the heck did those party animals come from? I haven't been watching any NGC, Discovery, Animal Planet or AXN this weekend. Also couldn't figure out why that sidey from college was after us either. Even if I'd inadvertently done some harm to him in college, why was he after Sito and Kamath? Anyone who does dream analysis out there? Dirty Freudians can stay out of this exercise!

Tuesday, October 12, 2004

Plan 9 From Outer Space

Did you know that Plan 9, the OS from Bell Labs is named after the movie Plan 9 From Outer Space? It's one of those movies that is so bad that it is actually a good watch. Here's a site on Plan 9 flubs. This reminded me of masochists in college who liked suffering first day first shows of Mithun Da's B grade movies. If you are a bad movie aficionado, here are some links that you can use to populate your TO DO lists -
Bad movie reviews (Turkey ratings)
Worst movie list on Wikipedia
The Golden Raspberry Awards
The IMDB bottom 100 list
There is also the IMDB top 250 list if you are looking for good films.

Quote of the week: Tau at dinner last Friday - "Whenever I have a difficult choice to make in life, I always consult my dad. I know for sure I have to make the opposite choice."

Friday, October 01, 2004

Narasimha Parvatha

I was down with viral fever for the last four days. The stud that I am, it is unlikely that this had anything to do with last weekend's trek to Narasimha Parvatha. The 7 km trek up to the top was fun. This was the popular trail and not difficult at all. Rains and fog spoiled some of the fun of camping at the top. The next day, for the trek back, some of the more adventurous members suggested we take an 18 km trail that would take us through dense forests. Reasoning was that since it was downhill, it shouldn't be difficult. Well, it did turn out to be downhill from there on (figuratively not literally).
For one, the trail went steeply downhill and then it was mostly uphill. The next problem lay in the jungles. The guy who thought of the phrase "jungle mein mangal" probably wasn't in his right mind (or in his left one for that matter). The only things that seemed to be doing any "mangal" there were the gazillion leeches that had come out in the previous night's rain. Getz you here, getz you there could well be the theme song for our trek through the jungle. It's hard to describe leeches satisfactorily without resorting to profanity. Suffice to say that you would be happier letting Dracula coochie-coo with you than having one of these slimy blood suckers in your shoes. The trek back started at 7 am and ended at 3 in the afternoon with two stops in between for "de-leeching". One of the stops was at Barkhana falls where I discovered that these slimy @#&*er$ don't drown. At the next stop I learnt that stomping hard on these slimy @#&*er$ only damages your knees.
I've posted selected photos from my camera here. There are more photos by Manjula and Prabhu here.

Wednesday, September 15, 2004

Google Code Jam

Warning: Geeky Content.
I participated in the Google Code Jam challenge phase today. You are given two problems to solve in one hour. On problem is for 1000 points and another easier one is for 400 points. The solution can be submitted in C/C++, C#, Java or VB.NET (Python not allowed :( ).
I worked on the 400 pointer first. You are given a list of strings like {"...Y...T..",".......T..",..} where Y denotes your position and T denotes an enemy. You are to return distances to each enemy. Pretty straightforward (piddlu in IIT lingo). I guess the only factor here is how fast you can code up the solution. Passed the test cases in the first attempt. That left me about 45 minutes for the 1000 pointer.
For the 1000 pointer you are given the weight, coordinates and time of a rock falling into a pool. With each passing second, a ripple moves around the rock with the initial amplitude equal to the rock's weight. The amplitude falls with time as the ripple moves out. The ripple is square shaped. Ripples from different rocks add up. You are given a list of strings of the form "weight time x y". The function should return the highest amplitude at any point of time in the pool. Took about 40 minutes to code it up slow and steady. There were two errors which I couldn't fix in the 5 minutes that remained for testing. The sad thing was that one of the errors was was a stupid optimization that I shouldn't have added before testing (premature optimization - BAD). The other was my old nemesis - a boundary problem (< instead of <=) that resulted in one edge of the ripple not containing all points. I submitted the code anyway. In another 10 minutes after the deadline I was able to fix the errors with a couple of debug prints of the pool matrix. I wish I'd added the debug prints initially. I guess I should have attempted the 1000 pointer first (I have solid 20/20 hindsight) but the 1000 pointer in the practice rounds had given me the heebie-jeebies.
The 1000 pointer in the practice round had a graph where all nodes are connected to each other. A pseudo random generator gave the weights of the edges initially (note initially). You are given two nodes and the shortest path between them has to be determined. Looks like a simple application of Dijkstra's algorithm so far. But, the weights of the edges change while you are traversing the graph. If you travel along an edge of length 3, you need to recompute the weights three times (the new weights are pseudo-random). You have the option of looping at the same node. A self-loop has a weight of one. Solutions to most problems involve looping at a node multiple times till the weights are favourable. I coded up a brute force algo that worked for two of the three test cases they'd given. I didn't know Dijkstra's algo then. The program couldn't complete within the 8 second limit for the larger graph. I found another guy's solution later. It took me four hours just to figure out how that worked. That scared me off the 1000 pointer problems.
If you're interested in the problem statements and the solutions, drop me a mail (binu#removehashes#k#s at gmail com).
All in all a good experience (I now believe firmly that participating is much more important than qualifying :) ). There are other contests on TopCoder which is hosting the Google contest. Some nice links I found during all this:
Graph algorithms on Wikipedia
An online book on algorithms
A quick STL tutorial

Sunday, September 05, 2004

The Free Taxi

I pulled off a nice surprise on Rupa (classmate at IIT-B) who came over
from Bombay this weekend. Rups had given me the flight details but he
wasn't expecting me to pick him up from the airport. As I saw him coming
into the arrival lounge, I hid behind a pillar.
A taxi driver swoops down on Rupa: "Sir, Taxi?"
Rupa (busy punching some number on his mobile): "Nahi"
I move in from behind: "Sir, Taxi chahiye kya?"
Rupa (again without looking up): "Nahi. Katao."
Me (expecting Rupa to look up this time): "Sir free taxi hai."
Rupa (yet again doesn't look to see who is offering a free ride): "Nahi
chahiye."
Me (sure he'll look this time): "Sir apko Binu se milna jana hai na?"
Rupa (finally looks up bewildered): "Abbe!?"

Wednesday, September 01, 2004

The Life, the Universe and Everything

Try this query on google:
answer to life, the universe and everything

Tuesday, August 31, 2004

Vacation Snaps

Snaps from my recent trip to Wayanad and Cochin. This time I took the more scenic route through Mysore, Gundulpet, Kalpetta (Wayanad) and Kozhikode to Cochin. It takes much longer to get to Cochin this way compared to the Salem, Coimbatore route but the terrain is far more interesting. Spent a day in Wayanad to see Edakkal caves and Pookode lake. There's lot's more to see if you are willing to trek and camp. The best time to go is between Jan and March. It was a 6 hour drive from Bangalore. Got to try the route through Nagarhole and Mananthavady next time.
I also found a secluded unspoilt stretch on Cherai beach to laze around. The more developed stretch has gained too much publicity of late and gets jam packed in the holiday season.


Monday, August 09, 2004

The Onion

Sometimes, people just don't get satire. It can get very comical at times, like when a Chinese daily printed a translation of an article from The Onion assuming it to be a credible news source. Another instance (though not exactly satire this time) was when the information on a website on di-hydrogen-monoxide was used by a city council to almost ban the use of this chemical in producing styrofoam cups.

The Personal Space Concept

Remember the MTV lift-man - the guy with the bald pate and missing teeth who would rant about the new generation and the stuff shown on MTV? A series of close encounters with the young college going crowd has made him my hero. Pity I couldn't find the guy's pic on the net.
My pet peeve so far had been about dull conversations being shoutcasted to all unwilling listeners at restaurants. But my experience at a dance fest yesterday makes this chitter chatter tolerable.
It happened at a dance fest called Prayog at the Chowdiah Memorial Hall yesterday. I had taken a seat right next to the aisle. There isn't much of a gap between rows of seats at this hall. This young thing comes in to take a seat somewhere in the middle of my row and I withdraw as much as possible to make way. Then she spots a friend in the the aisle. A long exchange of pleasantries begins. The nubile thing stands facing me. If I had a navel fetish I wouldn't be complaining (but I'm a pretty normal guy you see). For a minute or so I tried to act cool about it, fixing my gaze on random things on either side. When the giggle fest didn't show any signs of ending I decided to reclaim my rightful personal space. I finally looked up and asked her politely to either move in or out. The encroacher moved out with a sheepish grin.
Note to Kamath: The girl didn't say "Excuse me uncle" at any time during this incident - I was genuinely aggrieved. And I eagerly await your blog's launch.

Thursday, August 05, 2004

Urban Legends

Can Coke dissolve nails? Should mobile phones be switched off near petrol pumps? Check out urban legends at snopes.com.

Monday, August 02, 2004

Smashing the Stack

A classic article on how to get a shell from an application with a buffer overrun: http://www.insecure.org/stf/smashstack.txt
Read the jargon file if you are interested in hacker slang, writing style and culture. Hacking need not anything to do with computers. The MIT Hack Gallery contains some interesting hacks.

Wednesday, July 28, 2004

Kibology

Hilarious! The Kibology FAQ. If you really want to know about Kibology check out the Wikipedia entry.

Tuesday, July 27, 2004

Reflections on Trusting Trust

An article by Ken Thompson on the cutest program he ever wrote: http://www.acm.org/classics/sep95/.