Wednesday, September 21, 2005

E-mail IDs

E-mail IDs are simply the online addresses of people. Addresses to which electronic mails can be routed. Such a well intentioned invention has now become a major source of embarrasment or a perennial source for some fun, depending on which side of the ridicule you are, at my work place.

I work for HCL technologies' Network Products Division. The most important customer for this division is Cisco. There are close to 1300 people working on Ciscos projects alone. The relationship between HCL and CISCO is a very strong one and hence all employees of HCL who work on Ciscos projects are given Cisco e-mail IDs. This is were the problem starts for most people as Cisco has got a weird way of making e-mail IDs. Typically the E-mail IDs are "firstname"."secondname"@"domain.com", atleast in many companies like Infosys, CTS, TCS etc... But Cisco does not follow this pattern. Instead it feeds the first name, middle name and last name to a software and that software returns an e-mail ID.

As a result of this we get some really hilarious e-mail IDs i.e. as long as it is not your own. Sample some of the e-mail IDs.

Gnanashekaran Gnanapandian - gngnanan
Rathneswar joshi - ratjoshi
Madhneskar yadav - madyadav
Supraja Pandiarajan - suppandi

and the clincher......


Badhrinath Soundarajan - badsound

There are other IDs like karamamu, aragotha, aguggili, etc... which are definitely funny but not on the same league as the above mentioned ones. I am sure there are many other interesting IDs that are yet to be explored by me.

Imagine your state if you have to say your e-mail ID to your friend/fiancee or whoever as badsound. Shit..... This would also be printed prominently in your business card. Now if e-mail IDs were to be just that, online addresses to which e-mails are routed, then the embarrasment would be limited. But unfortunately the culture at CODC (this is what they call the centre in HCL that works for Cisco - Cisco Offshore Development Centre) is that people rarely address you by your first names. This is true even for people who know you well. Everyone addresses you by your e-mail ID. So the embarrasment caused to those who have those extremely funny IDs continues for a long time.

There are a whole lot of places where e-mail IDs are used.
1.) Your customers will address you by your e-mail ID on conference calls.
2.) Youll have to put your e-mail ID on the various documents that you edit.
The list of places where your e-mail ID is used, is endless and hence the sources of fun is also endless. Some people stop using their names altogether and start using their e-mail IDs even when they have to introduce themselves. For a good portion of my first month at HCL, I was thinking my project managers' name was anku while it was actually anand kumar.

I just thought of some names and the resulting e-mail IDs. I guess these are very common names. The E-mail IDs are only my guesses but there is a good possibility of such names actually getting these IDs. Very funny indeed. Sample some...
1.) pulliraj - Pulliman Rajamurugan (remember the popular pulliraja)
2.) yamaraja - Yamini (Whatever second name that can be formed from araja)
3.) aarupanni - Aarumugam Pannirselvam (Aarupanni in tamil means six pigs)
4.) shitami - Shivkumar tamilselvan
5.) kutipani - Kutila Panirselvam (kutipani in tamil means small pig)
6.) korangan - Koushik Ranganathan
7.) gandhand - Ganapathi Dhandapani (First four characters in hindi = .... )
8.) muchakra - Murali chakrapni
You should have got the picture by now.

Sample some conversations that I hear on a daily basis
"Hey badound, what happened to that document"
"Has suppandi checked in that C file"
"Dei ratjoshi, inga vaa da"
Ill be laughing like mad everytime I heard these during my initial days resulting in the aggrieved people giving me some stern looks. But I am kind of used to all these now.

Thankfully not everyones names lends itself to the forming of such IDs. Yours truly also escaped this trauma. I got a rather manageable pkarasan. This was formed from my first name and surname.

Saturday, September 17, 2005

Answers to questions in C

1.) The array is already sorted. Bubble sort will hence come out of the loop on the first iteration. So it will be the most efficient.

2.) Since both i and j are integers (i/j) and (j/i) will only produce an integer. Since i and j have not been initialized, they will have some junk values and hence most of the times they will not be equal. As a result either i/j or j/i will result in a decimal value between 0 and 1. This value when converted to an integer will become 0 and hence k will be zero. In the rarest of rare cases when the two junk values (i and j) have the same value k will evaluate to 1.

3.) This will result in a compilation error. z is declared as a void pointer. No arithmetic is possible on void pointers.

4.) There are three solutions to this.
a.) add a '-' before the 'i' in the comparison statement.
b.) change the 'i' in 'i--' to 'n--'.
c.) change the '<' in the comparison statement to '+'

5.) void main() { if( printf("Hello world") ) {} }

6.) Recursion is when a function calls itself. Mutual recursion is when a function A calls function B and B calls back A.

7.) 0 (atleast on linux systems.. not tested on windows platform)
Scratch your heads how...

8.) Semaphores implement what is called atomocity which application programmers will not by using the boolean. i.e.
the statement if (a == 1) in C will be a bunch of commands for the microprocessor
So pre-emptive processors might stop the programs execution in any of those commands and hence it will not be possible to implement the semaphore action by application level code. By using atomic function calls, semaphores will avoid pre-emptive scheduling microprocessors for critical sections of code.

Friday, September 09, 2005

Interesting questions in C

Here are some intersting questions in C. Just for fun questions.

Me being a techie (atleast Id like to think of myself like that) Ill torment people often with such stuff... :) Kindly bear with me...

1.) You have an integer array of 1000 elements with the ith element obtained by the formula
a[i] = 2*i+3
Which of the following sorting algorithms will sort the array the fastest..
a.) Quick sort b.) Bubble sort c.) Selection sort d.) Heap sort

2.) What will be the output of the following code snippet
int i, j, k;
k = (i/j) * (j/i);
printf ("%d", k);

3.) Predict the output
main() { int x=5, *y; void *z; y=z=&x; y++; z++; printf("\n%u%",y,z); }

4.) In the current format, the following code snippet will run infinitely.
int i;
for (i=0; i<5; i--) printf ("*");

By just adding/deleintg/modifying a single character in the second line of the above code snippet make the code print exactly five *'s

5.) Write a program in C to print the string "Hello World". The constraint is that there should not be any semi-colons in the code.

6.) What is mutual recursion?

7.) What is the output of the following program?
void function(int a, int b, int c)
{
char buffer1[5];
char buffer2[10];
int *ret;
ret = buffer1 + 12;
(*ret) += 8;
}

void main()
{
int x;
x = 0;
function(1,2,3);
x = 1;
printf("%d\n",x);
}

8.) Most programming languages provide a facility called semaphores to lock resources for exclusive use. Why is this needed? Why cant the application developer have a boolean to control the access of the boolean?

Answers in the next post....

Sunday, September 04, 2005

Me, Myself and my Alter

I am a gemini and as a consequence of which I have two personalities within myself. Often both are at loggerheads with each other. The first one is my normal self which is visible to everyone. The second one makes its presence felt whenever I am contemplating on some issue. It will rear its ugly head and pose all sorts of dumb questions that would really piss me off. By the end of it all it would have done its best to have me nonplussed and would have ensured that my decision making abilities are at an abyss. On its day, my alter would have been so succesfull that Id seriously start beleiving that my IQ/EQ/etc.. levels are rivalling that of a third rate moron. But on most days I do manage to scrape through without much damage.

Recently it reared its ugly head at the most uninvited moment and started asking all sorts of uncomfortable questions on my new found passion - blogging. On this occasion I was left high and dry and totally battered. My state at the end of it all - "Total Damage". This is what transpired between us then.

"Hey you dumbo... what are you doing sitting all alone in your house. Poor chap you are. What else can you do. You dont have a social life. You need a girl for that". That was my alter..

"Get lost dude... I am in no mood to entertain you now..."

"Thats OK man. Now that I am here, you ought to entertain me. You cannot wish me away. LOL. Tell me what you are thinking about now"

"Oh... get lost you miserable swine..."

"OK dude. I understand. You are thinking about the angular momentum of the seconds hand in your wrist watch right".

"Grrrrrrrrrr"

"Or are you contemplating ways and means of becoming REMO. Hahahaha. Forget it dude. You are totally incapable of anything remotely similar. You can constrain yourself to UNIX shell scripting, LV and such things that are totally bereft of even a scintilla of fun. You are not capable of things that normal guys of your age do so easily."

"Oh god. What did I do to endure all this crap... Someone please help me throw this guy out of me"

"Its OK man cool it. Its not as easy. Coming to the point, I know you like the back of my hand. I have been with you for a looooooong time machchi. Dont try to obfuscate your thoughts from me."

"Oh for gods sake. I am trying to identify points to add to my next blog. Please let me gloss over it in peace"

"Your blog!!!! I just have one question. What is the difference between you blogging your thoughts and I putting my thoughts in a notepad and storing in my PC"

"Elementary, my dear alter. If I blog my thoughts, it is on the internet and my fans/friends/well wishers all over the world can read it. Seems like you are out of touch with technology. Poor old alter"

"Hahahahahahahahahahaha. You ass. You cant even pick up sarcasm. What kind of a dumbo are you. If atleast one other person cares to read it, then there would be some use to it. Not a single person has cared to read it more than once. A couple of people probably read it immediately after that unabashed mail that you had sent begging people to read your blogspace. After that not a single soul would have bothered to visit this. Most probably theyd have deleted that mail too."

"Excuse me alter. You see, that 10 commandments was written by me a long time back and most of my friends knew it already and hence they didnt bother to comment on it. Also you seem to be totally oblivious to my contacts. People are indeed reading my blogs and are commenting on it... "

"Man, I am getting really bored of that evil laughter. Let me try a different version this time around. Heeeeeeheeeeeeoooooooolaaaaaaaaa..."

"and whats this for"

"for the joke of the millenium that you just cracked. how can you be so naive to say that people are commenting on your blog."

"Check it out man. I have four comments already. I am new to blogging. Also I do agree that I dont posses a great sense of humour but people do take me seriously. Remember, it all starts with a trickle but soon it will be a tsunami. People will start flocking to my blogspot and the day when I start getting atleast 15 comments on each of my posts is not far away..."

"Impossible. 15 comments on each of your posts. You must be joking. I know all about the virtues of having a BHAG - Big Hairy Audacious Goal. But this is just too much. Pigs will evolve into flying creatures before that will happen. Osama would have converted to Budhdhism. You need to be reborn again to get such things to happen. Face it dude. Some things are just not possible. One just needs to look at the current state of comments in your blog. 4 comments for 7 blogs. and the worst part, two out of the four comments are self comments. Yuk.. shit... ooovaeee... will be right back after i pewt. hold on...."

"Hey wait... what happened"

After a wait that seemed like ages he comes back...
"ok i'm back."... "hehehehehe.. i have a very good analogy for that"

"analogy for what and why did you have to pewt. were you drunk last night"

"I had to pewt for what you said ass. You know my brain is allergic to such outrageous thoughts. Hmmm..... One commenting on ones own blog as there is no one else to comment on it. you know what it sounds like..."

"shut up you pervert. I can get your innuendo. this is neither a X rated blog nor is this meant only for stags"

"Not a X rated blog. agreed. Not meant only for stags. Cant agree to that. OK you have not explicitly stated that this is only for guys. But the probability of a species from the opposite sex visiting your blog is nill. So by stating that this is not only for stags, you are implicity stating that you expect women to visit your blog. This according to me, in fact according to simple logic, is not possible. So in effect your blog is only for stags. In fact its only for two stags. One is you and the other unfortunate creature is myself. You know, sometimes I simply cannot comprehend on how someone can be Panglossian enough to assume such things."

"What simple logic...???"

"Elementary Logic da machchan. The only two women whom you know are your mom and your sister. your mom does not know how to hold the mouse and you sister hardly gets any net access. So no women has probably visited this blog and in all probability never will."

"What disgusting logic...."

"OOhhh aaah ooh aa!! Yes. Yes. Yes. I should probably be given a life time free membership to Mensa. My skills at reasoning is indeed improving by the day and at the moment it has crossed all theoretical limits for human intellignce. I should go and submit myself to SETI, Search for Extra terrestrial intelligence, as a specimen.

"Shit..."

"Also I think I should recommend you to some committee who can award you a prize for this achievement. No women contacts except mom and sister and you are a software professional and 23. I think you are well on your way towards becoming the most famous of Brahmachari cum software professional of the 21st century. please gimme your autograph now itself..."

"oh my god. you are really getting under my skin. I cant take it any more. GET LOOOOOOST"

"the pleasure is all mine. please stop blogging. check out this blog of OKA. http://sleepless-in-iima.blogspot.com/2005/08/fools-proof.html There were 56 comments just on that one post on last count. Now thats blogging. Please dont pollute this wonderful blogging community by publishing junk which no one ever cares to read, let alone comment upon. "

"Grrrrrrrrrr"