Friday, April 29, 2005

 

Sin-"bad" Adventures!

This happened last month (March). March 25th was a holiday (Good Friday), so I bought a KSRTC ticket to Chennai, for Thursday night (March 24th), or at least that was what I thought I did! I actually had bought a ticket for Friday night (March 25) and I did not even notice that mistake until I went there to the bus stand!

Thursday evening, I left office by 7pm, went home, packed lotsa clothes (to wash in Chennai), stuffed my camera + other valuables along with my laptop in to a shoulder bag, started merrily to Majestic bus stand! As the next day was Good Friday, KSRTC expected lotsa passengers and had arranged for many special trips to Chennai. So, my 10.15pm bus actually came in only by 11.45pm!! Feeling relieved that I had not missed the bus, I boarded it and was shocked to see another person sitting in my seat, #14.

I told him, "Hey, I have this seat booked".

"Really?! I also have this. See...here is my ticket"

I compared all the fields, could not find any difference! I was really irritated by then. Who wouldn't be! I took both the tickets to the driver and told him the problem. He had one look at both the things and said I had got a ticket for the next day!! Only then I noticed it. I sheepishly apologized to that #14 middle-aged man, got off the bus as quickly as possible! I could hear the driver telling me it was possible to transfer the tickets. I didn't even turn to thank him. Since, it was already nearing 12am, the ticket controller said it was impossible to transfer the tickets. So, I was standing there, with a ticket for the next day's night, wondering whether to go back to my house in Airport road, or to buy a ticket in some bus and reach Chennai somehow! Unfortunately, I decided on the latter.

I went outside and got a ticket in National Travels for Rs.450! The bus seemed spacious, a 2+1 seating arrangement. I was happy that at least I would have some personal seat space. The bus left Majestic by 12.15am. By that time, I was feeling very sleepy, very uncharacteristic of me as I usually go to sleep only by 1.30am or 2am after all those Miike Takashis and other East-Asian "classics"! When they reached Madiwala, the bus stopped near a petrol bunk. I learnt from my next seat person that some one, sitting next to the driver, puked and they have stopped to clean it. I went down and saw the driver instructing a cleaner what to do. I told the driver that I was going for some water and would be back in a minute.

The petrol bunk had a shop; it had lotsa items on display. I was going through all those and finally, bought a water bottle and some snacks. When I came back to the main road, I could not find the bus! The bus had apparently left with out me!

“Did you see when the bus left?” I ran back and asked the person at the cash counter.

“Illa pa, Enakku theriyathu (No, I don’t know)”

I ran back to the road, hoping to catch at least a glimpse of the bus’s wake at a distance. I could not see anything past 200 meters. I realized, only then, how silent and dark the night was. My entire luggage had gone with the bus. LAPTOP! Oh, God, my beautiful T41p was also there. With all its accessories, it costs around Rs. 1.4L. If I ever lose it or break it, I need to pay back that amount to my company. More than that, all my emails, personal and project related documents + all confidential documents were there, very much unprotected. Apart from these, my personal valuable things were there also.

For a second, it was a big void, I could not think of anything other than how to catch that bus. Looking around, I saw a call taxi waiting for someone. I ran to it, I quickly told him my problem, asked him if he would help me catch the bus. He was going home, after dropping his last customer. He agreed to come with me, of course, with the Taximeter on. Thus began the chase.

For 20 or so minutes, we did not see a single bus. The driver had already started talking about turning back if we could not find anything in 10 minutes. I was thinking more along the lines of catching the bus at any cost, but I could understand his concerns.

“What to do now? May be, I should get down, try to get in to a bus to Chennai, start searching for National travels there.” I was thinking.

“Look, a bus over there. Is this the one you were talking about?” Driver shouted.

I snapped off my trance-like state and looked up. YES, it was the same bus. Hoorah! We over took and signaled the bus driver to stop the bus. I jumped down, ran to the driver, and started shouting. I felt very mad, but inside I also felt kinda warm and relieved, a mixture of emotions. I did not even mind paying Rs.190 for the taxi, as I knew if I had not caught the bus I would have lost close to Rs. 1.7L. I got it in to the bus, patted my laptop bag, and slumped in to my seat.

I did not sleep that night !


Wednesday, April 27, 2005

 

Dumb Code - 1

Recently, I was helping a friend debug an application debugger. In one of the report/UI modules, he had to log the date execution started + more process meta info. For date conversion, instead of using one of the inbuilt CRT functions, with the true spirit of a good (!?) programmer, he decided to implement it himself. When I saw the code, I couldn't help asking him "How many years have you been programming?"!! Check out this so called production-quality (??) code...

---- [ Code segment ] -------------------------------------------------------

#define MONTHS_SIZE 12

typedef struct __monthNoPair
{
char *strNoMonth;
char *strMonthName;
} monthNoPair;

static monthNoPair months[] = {
("1", "January"),
("2", "February"),
("3", "March"),
("4", "April"),
("5", "May"),
("6", "June"),
("7", "July"),
("8", "August"),
("9", "September"),
("10", "October"),
("11", "November"),
("12", "December")

};

char *getMonthFromData(int noMonth)
{
int i;

for (i=0; i < MONTHS_SIZE; i++)
{
if (atoi(months[i].strNoMonth) == noMonth)
return strdup(months[i].strMonthName);
}
return NULL;
}
---- [ /Code segment ] -------------------------------------------------------
Indian Bloggers Ring
[ Join | Hub | ? | << | >> ]