Home | Techie Talk | Story Time | About | Contact

Friday, May 25, 2007

Ooooh... laah... laah.. laaaaah!!!

Around 3 years ago, one among the top software service companies in India had a recruitment program for freshers. Being a fresher then, I had applied for that - cleared the written test and got through the technical interview and the final stage was a HR interview.

I think I did well in that round too - for the same formal HR interview questions - and was sure I would be placed. But they didn't pick me. It would have been better if they had told me what mistakes I did. Then days rolled, later I joined my current organization.

Its almost 3 years here now.Yesterday, my colleague Dhinesh told me that today morning @ 10.00 AM there is a training for our product and I ll have to give that throught a telephone call to hyderabad. I said OK.

This is one of the coolest parts of working in small teams. You write the code, you find bugs in that code, fix your own bugs, launch the product, give presentations, support customers and blah.. blah.. blah.. To put it simple in Tanglish - You will be an All In All AzhaguRaja [:-)]

Now back to that training part, this morning when I opened that mail to note down the contact information - I saw that I am suppose to train the folks working for that service company I had mentioned earlier. They have purchased our product.

I really dont know why I had a smile on seeing that. If I had been selected then, I would have coded for them and now they are gonna use a product I am working for. Anyways feeling gud for this.

might sound silly for few - I dont wanna care. I m enjoying this [:-)]


Thursday, May 24, 2007

Life without a mobile phone!!!!

I have lost my mobile phone.

I had joined a swimming class for this summer and the day before yesterday (i,e. Monday) was my first day there. It was my mere stupidity to keep my mobile inside the bag and leave it in the dressing room. I should have kept it safely at the locker - first of all, I really cant understand why did I need a mobile at that early hours

It is a Toshiba 902T model (for Vodafone) which my brother had bought from Japan. I had to crack its software for the Indian GSM cards. Except this one, the phone had plenty of cool features - the 1.9 mega px Camera (I liked this the most) , a nice voice recorder , a big display and lot more...

Moreover I had all my friends' contact details stored in that.

I know the person who had stolen it, might not be able to use it further. This phone needs a peculiar pin for recharging and also it requires 110V current. I think he ll have to search a lot for such charger in the city - and for this one reason I m praying, he should replace the mobile in bag again [;-)]

Anyways, I had lost it. No point in worrying over that again and again.

Now, I dont have a mobile - really feel like one of my arms is broken. I really miss some sweet things that I had in my mobile.. but still there are plenty of good things happening too..

No SMS, when I m busy at the rest room...
No Calls from Home, asking to come home, while haning out with friends..
No status calls , when I m driving home...
and moreover... No worrying about if I might lose a mobile again [;-)]

So what Next?????

Time to joyfully sing Thalaivar's song:

"Ae.. Balle la ka... Balle la ka...
Koovum Cell phonein nacharipai anaithu
Konjam cell vandin ucharipai ketpom
Balle la ka... Balle la ka... "


Thursday, May 17, 2007

A simple mistake can take your whole day, away!!!

Today I had to implement a small task related to Windows Active Directory in our product. The base for this had already been implemented in C language, few months ago. Just a wrapper code was to be written in Java, today.

The input for this would be 1. Domain Name, 2. login Name 3. Password.

Everything worked fine if all these parameters were passed as individual texts - i,e. login name without the domain prefix

Its normal for few Windows users to enter the login name with the domain prefix i,e. something like "DomainName\LoginName"

So to handle such cases, I wanted to
1. check if the character '\' is present in the login name,
2. If present, split the string and take the login name alone

This is what I used from Java for step (2)

//*** Assume oldLoginName = domainName\loginName
int i = oldLoginName.indexof('\');
//*** this should be '\\'. Using '\' for better understanding

int l = oldLoginName.length();
String newLoginName = oldLoginName.substring(i,l);

and then pass the newLoginName as the parameter to the native implementation.

Bhooooom!!!! Nothing happened as expected. When I looked at the logs, the input paremeters were right.

So I assumed the problem should somewhere be in the C implentation - especially while converting the Java String to C String.

Analyzed the C code that was written several months ago - Nothing helped!
Browsed through several sites to find if Java to C conversion of Strings had any problem - even this didn't help!!
Starred at my computer monitor for sometime, as if it would obey my words - This toooo didnt HELP!!!

Again thinking the problem should be in conversion, printed the length of C String in the log files.


image from www.nowhereland.it

The length was one more than the actual length of login name, that was expected.

Now I got where the problem was. The substring(...) method in Java would return a string extrated from the parent string - from the start Index to the End Index. My falut is that I had passed the index of '\' as the start index which means that character will also be present in the new extracted string.

All I wanted was "loginName" but by a very simple mistake i had extracted "\loginName"

Then why didn't the debug messages in the log show me this???

Very simple - '\' is an escape sequence and the hence the log file had skipped it while displaying.

I love the challenges in the software profession but never thought so much of efforts would be required to understand just two lines of code.

Good learning - alas a very costly one!!!

Labels: ,