30.5.08

Modern Panchtantra Story

Modern Panchtantra Story [ IT HUMOR ]
Once upon a time, there was a software engineer who used to develop programs on his Pentium machine, sitting under a tree on the banks of a river. He used to earn his bread by selling those programs in the Sunday market.

One day, while he was working, his machine tumbled off the table and fell in the river. Encouraged by the Panchatantra story of his childhood
( the woodcutter and the axe )
He started praying to the River Goddess. The River Goddess wanted to test him and so appeared only after one month of rigorous prayers. The engineer told her that he had lost his computer in the river.
As usual, the Goddess wanted to test his honesty. She showed him a match box and asked,
" Is this your computer ?"
Disappointed by the Goddess' lack of computer awareness, the engineer replied,
" No."
She next showed him a pocket-sized calculator and asked if that was his. Annoyed, the engineer said
"No, not at all !!"
Finally, she came up with his own Pentium machine and asked if it was his.The engineer, left with no option, sighed and said "Yes."

The River Goddess was happy with his honesty. She was about to give him all three items, but before she could make the offer, the engineer asked her,
"Don't you know that you're supposed to show me some better computers before bringing up my own ?"
The River Goddess, angered at this, replied, "I know that, you stupid donkey! The first two things I showed you were the Trillennium and the Billennium, the latest computers from IBM !". So saying, she disappeared with the Pentium!!

Moral: If you're not up-to-date with technology trends, it's better to keep your mouth shut and let people think you're a genius than to open your mouth and remove all doubt.

28.5.08

SCJP study material!!!its worth

Love Letter in JAVA




The Donkey Factor

Some theories that your Teacher did not teach you!!!

Amazing Theorem ..... (Just for fun)

Equation 1
Human = eat + sleep + work + enjoy
Donkey = eat + sleep

Therefore,
Human = Donkey + work + enjoy

Therefore,
Human - enjoy = Donkey + work

In other words,
Human that don't know to enjoy = Donkey that work
============ ========= ========= ========= ========= ===
Equation 2Men = eat + sleep + earn money
Donkeys = eat + sleep

Therefore,
Men = Donkeys + earn money

Therefore,
Men - earn money = Donkeys

In other words,
Men that don't earn money = Donkeys
============ ========= ========= ========= ========= ====
Equation 3
Women = eat + sleep + spend
Donkeys = eat + sleep

Therefore,
Women = Donkeys + spend

Therefore,
Women - spend = Donkeys

In other words,
Women that don't spend = Donkeys
============ ========= ========= ========= ========= =====
To Conclude:

From Equation 2 and Equation 3
Men that don't earn money = Women that don't spend.

So, Men earn money not to let women become Donkeys! (Postulate 1)
And, Women spend not to let men become Donkeys! (Postulate 2)

So, we have?
Men + Women = Donkeys + earn money + Donkeys + spend money

Therefore from Postulates 1 and 2, we can conclude,

Man + Woman = 2 Donkeys that live happily together!

21.5.08

Really beautiful

Ours was an arranged marriage. It was done the traditional way. Our Parents took care of everything. My only condition was that she should be ready to work. Our horoscopes and photos were exchanged. Everything Matched. I spoke to her over the phone. We talked about things two strangers would talk. She was a lecturer in Bangalore who felt Chemistry was more important than Hindi movies. There was no engagement. The date for marriage was fixed in 2 weeks as I could not get a vacation after that. Even the vacation time I got was just 10 days.

Everything was fixed. It was supposed to be very hectic for me. We got married and 2 days later we had to leave the country. She cried like there was no tomorrow when we left. She would not talk to me on the plane. I thought that was usual for an Indian girl. I thought she would get over it. Once home she would not talk to me. She sat in a corner staring at the TV. For the first couple of days I had to catch up on some work and did not take her mood seriously.

A week later I sat beside her and asked her, "What is wrong?"

"Why did you bring me here?"

"What do you mean? What happened?"

"I want to go home"

"This is your home"

"No. I want to go home. Please buy me a ticket"

"Look, everybody feels homesick. I did when I came here the first time. It is normal. You will get over it. Sorry I have been busy with work.

We can go out this weekend. You will meet my friends and other people who will be very friendly. Come on be a good girl"

"I hate this place. I miss my family, my friends, my college. All the people I know are not here. I want to go home"

"Think for a minute. Try to reason it out yourself. What is your plan by the way? So you want to go back and never come back?"

"Yes"

"Are you crazy?"

"If you think this is crazy then I am."

"It is ok if you do not answer this question. Is there someone else?"

"No. I want to go home. I will call 911 if you do not send me""First cool down. Think about it. Think about our parents. It is less than a month that we got married and now you want to return home. You very well knew that you had to come here. What were you thinking? Even if you are returning home what happens to our marriage?"

"I am not blaming you. I take the blame. It is my mistake. I can't stay so far away from my family. If you are so interested come to India"

"I am family too! What you are asking is ridiculous."

The next day she would not change her mind. I called my folks. They said that it was my decision and they would stand by me. I booked her ticket and put it in her hand the next evening. She was to leave in 2 days.

Nothing would convince her to change her mind. She was crying like a kid. Then she left.

She had done nothing for me to miss but something inside me was telling me that I was at fault. I tried to shake it off but as time grew I started feeling more guilty. I called her. She made it clear that she did not find me despicable but she would not leave her city. Her parents apologized profusely but they were helpless too.

I have had crushes. None of them were serious. There was this girl in my high school tuition whose phone no I managed to find out. Then the prettiest girl in college whom everybody loved, who talked to me once. Then the girl from my city who was at my university in USA who made me feel at home when I visited her place. I had ignored them once I crossed their paths. But Anjali was my wife. I could not ignore her.

I decided to quit my job. I went home. No one back home knew I was returning. I wanted to surprise her. I dropped off my bags at my place and went to the college she was teaching. The gate keeper would not let me in. So I had to wait outside for the classes to get over.

She walked out alone, struggling to carry her bag, tired, with slow steps. She was walking towards the bus stop. I silently followed her and went behind her and whispered, "Do you mind if I carry your bag?"

She was startled and turned to face me. Her eyes lit up. I was not sure if I could hug her. I was smiling and she had a 100 questions written all over her face. "I want to spend a week with you in this city. Show me the things that you could not miss"

That one week went in a jiffy. She was treated a kid at home with all the comforts. That explained her behavior. Coffee was brought to her in the morning. Even her dress was laid out for her. She would have breakfast and leave. The bus journey was an hour. She would sit near the window with a book. Then once in the college she would teach her classes and come out tired in the evening. She would stand in the crowded bus carrying her bag which would look heavy. Then she would alight, go home, have a snack and would head out to a friend's place. Some times she'd stay home watching TV or listening to music. When her dad returned she would join him and they'd have dinner. Then her mom would tuck her in bed. Weekends were not much different. She would sleep late, wake up for breakfast and lie down talking on the phone. Then she would visit the temple in the evening and would have her singing lessons. Then she would eat out and would head home late.

That was her life. It was something every human being wanted - simple, content and happy. Of course to her I was a villain. I told her that I understood her. I wanted to know if it was ok if she stayed in the same city but away from her parents. Her only condition was that I should not stay at my parent's place to which I agreed. So we moved into a small apartment. She knew nothing. She had to be taught everything. She learnt. It was hard to make her understand that she had duties and she had a husband. Coffee had to be brought to her in the morning. She made the rules and broke them. She did not care for me. Sometimes she would not return home but go to her parents' place without informing me. I would have had to go bring her back.

Slowly she started realizing about married life. She would wake up before me, try to cook, agree for a movie, visit my friend's place, invite me to her college, let me dress her up, dance in front of me, teach me Chemistry, talk about her crushes, play cricket with me, make me cry for a change. She was growing mature day by day. One day she apologized for the whole thing. I brushed it aside. Finally I had her the way I wanted.

Today I am happy and content with my life. She is still there crying to get her things done. I keep reminding her how she had threatened to call the police. She laughs it away. Some times I wonder how life would have been if I had not returned. Then again some things are left as they are.That's how life is...

There are two ways of meeting difficulties:

”You alter the difficulties, or you alter yourself to meet them"

Top 29 things an Indian does after returning to India from "US"........

Top 29 things an Indian does after returning to India from "US".

29. Use Nope for No and Yep for Yes.
28. Tries to use credit card in road side hotel.
27. Drinks and carries mineral water and always speaks of health conscious.
26. Sprays deo such so that he doesn't need to take bath.
25. Sneezes and says 'Excuse me'.
24. Says "Hey" instead of "Hi".
23.Says "Yogurt" instead says "Curds".
22.Says "Cab" instead of "Taxi".
21.Says "Candy" instead of "Chocolate".
20.Says "Cookie" instead of "Biscuit".
19.Says " Free Way " instead of "Highway".
18.Says "got to go" instead of "Have to go".
17.Says "Oh" instead of "Zero", (for 704, says Seven Oh Four Instead of Seven Zero Four)
16. Doesn't forget to crib about air pollution. Keeps cribbing every time he steps out.
15. Says all the distances in Miles (Not in Kilo Meters), and counts in Millions. (Not in Lakhs)
14. Tries to figure all the prices in Dollars as far as possible (but deep down the heart multiplies by 40 times).
13. Tries to see the % of fat on the cover of a milk pocket.
12. When need to say Z (zed), never says Z (Zed), repeats "Zee" several times, if the other person unable to get, then says X, Y Zee(but never says Zed)
11. Writes date as MM/DD/YYYY, on watching traditional DD/MM/YYYY, says "Oh! British Style!!!!"
10. Makes fun of Indian Standard Time and Indian Road Conditions.
9. Even after 2 months, complaints about "Jet Lag".
8. Avoids eating more chili (hot) stuff.
7. Tries to drink "Diet Coke", instead of Normal Coke.
6.. Tries to complain about any thing in India as if he is experiencing it for the first time.
5. Pronounces "schedule" as "skejule", and "module" as "mojule".
4. Looks suspiciously towards Hotel/Dhaba food.
Few more important:
3. From the luggage bag, does not remove the stickers of Airways by which he traveled back to India , even after 4 months of arrival.
2. Takes the cabin luggage bag to short visits in India , tries to roll the bag on Indian Roads.
Ultimate one:
1.. Tries to begin conversation with "In US ...." or "When I was in US..."

Unrealized Fact

A worldwide survey was conducted by the! UN. The only question asked was:
"Would you please give your honest opinion about solutions to the food shortage in the rest of the world?"


The survey was a huge failure, In Africa they didn't know what 'food' meant, In India they didn't know what 'honest' meant,

In Europe they didn't know what 'shortage' meant, In China they didn't know what 'opinion' meant,
In the Middle East they didn't know what 'solution' meant, In South America they didn't know what 'please' meant,
And in the USA they didn't know what 'the rest of the world' meant!

The Evolution of a Programmer

High School/Jr. High
10 PRINT "HELLO WORLD"

20 END

First year in College
program Hello(input, output)

begin

writeln('Hello World')

end.

Senior year in College

(defun hello

(print

(cons 'Hello (list 'World))))

New professional

#include

void main(void)

{

char *message[] = {"Hello ", "World"};

int i;

for(i = 0; i <>

printf("%s", message[i]);

printf("\n");

}

Seasoned professional

#include

#include <>

class string

{

private:

int size;

char *ptr;

public:

string() : size(0), ptr(new char('\0')) {}

string(const string &s) : size( s.size)

{

ptr = new char[size + 1];

strcpy(ptr, s.ptr);

}

~string()

{

delete [] ptr;

}

friend ostream &operator <<(ostream &, const string &);

string &operator=(const char *);

};

ostream &operator<<(ostream &stream, const string &s)

{

return(stream <<>

}

string &string::operator=(const char *chrs)

{

(this != &chrs)

{

delete [] ptr;

size = strlen(chrs);

ptr = new char[size + 1];

strcpy(ptr, chrs);

}

return(*this);

}

int main()

{

string str;

str = "Hello World";

cout <<>

return(0);

}

Master Programmer

[

uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)

] library LHello

{

// bring in the master library

importlib("actimp.tlb");

importlib("actexp.tlb");

// bring in my interfaces

#include "pshlo.idl"

[

uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)

]

cotype THello

{

interface IHello;

interface IPersistFile;

};

};

[

exe,

uuid(2573F890-CFEE-101A-9A9F-00AA00342820)

]

module CHelloLib

{

// some code related header files

importheader();

importheader(<>);

importheader();

importheader(" pshlo.h");

importheader(" shlo.hxx");

importheader("mycls.hxx");

// needed typelibs

importlib("actimp.tlb ");

importlib("actexp.tlb");

importlib("thlo.tlb");

[

uuid(2573F891-CFEE-101A-9A9F-00AA00342820),

aggregatable

]

coclass CHello

{

cotype THello;

};

};

#include " ipfix.hxx"

extern HANDLE hEvent;

class CHello : public CHelloBase

{

public:

IPFIX(CLSID_CHello);

CHello(IUnknown *pUnk);

~CHello();

HRESULT __stdcall PrintSz(LPWSTR pwszString);

private:

static int cObjRef;

};

#include

#include

#include <>

#include

#include "thlo.h"

#include "pshlo.h"

#include "shlo.hxx"

#include "mycls.hxx"

int CHello::cObjRef = 0;

CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)

{

cObjRef++;

return;

}

HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString)

{

printf("%ws\n", pwszString);

return(ResultFromScode(S_OK));

}

CHello::~CHello(void)

{

// when the object count goes to zero, stop the server

cObjRef--;

if( cObjRef == 0 )

PulseEvent(hEvent);

return;

}

#include <>

#include

#include " pshlo.h"

#include "shlo.hxx"

#include " mycls.hxx"

HANDLE hEvent;

int _cdecl main( int argc, char * argv[] )

{

ULONG ulRef;

DWORD dwRegistration;

CHelloCF *pCF = new CHelloCF();

hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

// Initialize the OLE libraries

CoInitializeEx(NULL, COINIT_MULTITHREADED);

CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwRegistration);

// wait on an event to stop

WaitForSingleObject(hEvent, INFINITE);

// revoke and release the class object

CoRevokeClassObject(dwRegistration);

ulRef = pCF->Release();

// Tell OLE we are going away.

CoUninitialize();

return(0);

}

extern CLSID CLSID_CHello;

extern UUID LIBID_CHelloLib;

CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */ 0x2573F891,

0xCFEE, 0x101A, { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 } }; UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */ 0x2573F890,

0xCFEE,

0x101A,

{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }

};

#include

#include

#include <>

#include <>

#include

#include "pshlo.h"

#include "shlo.hxx "

#include "clsid.h"

int _cdecl main( int argc, char * argv[] )

{

HRESULT hRslt;

IHello *pHello;

ULONG ulCnt;

IMoniker * pmk;

WCHAR wcsT[_MAX_PATH];

WCHAR wcsPath[2 * _MAX_PATH];

// get object path wcsPath[0] = '\0';

wcsT[0] = '\0';

if( argc > 1) {

mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);

wcsupr(wcsPath);

}

else

{

fprintf(stderr, "Object path must be specified\n");

return(1);

}

// get print string if(argc > 2)

mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);

else

wcscpy(wcsT, L"Hello World");

printf("Linking to object %ws\n", wcsPath); printf("Text String %ws\n", wcsT);

// Initialize the OLE libraries hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);

if(SUCCEEDED(hRslt)) { hRslt = CreateFileMoniker(wcsPath, &pmk);

if(SUCCEEDED(hRslt)) hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);

if(SUCCEEDED(hRslt)) { // print a string out pHello->PrintSz(wcsT);

Sleep(2000);

ulCnt = pHello->Release();

} else

printf("Failure to connect, status: %lx", hRslt); // Tell OLE we are going away. CoUninitialize();

} return(0);

}

Believe me, all this gives the same output "Hello World"

The NEW Washerman and Donkey - MUST READ!!!

Have you heard the story of " The Washer man and the Foolish Donkey" ?

To refresh your memory, and for the benefit of those who have not grown up listening to this moral story, it goes like this…

There was once a washer man who had a donkey and a dog. One night when the whole world was sleeping, a thief broke into the house, the washer man was fast asleep but the donkey and the dog were awake. The dog decided not to bark since the master did not take good care of him and wanted to teach him a lesson. The donkey got worried and said to the dog that if he doesn't bark, the donkey will have to do something himself. The dog did not change his mind and the donkey started braying loudly. Hearing the donkey bray, the thief ran away, the master woke up and started beating the donkey for braying in the middle of the night for no reason.

Moral of the story " One must not engage in duties other than his own"

Now take a new look at the same story…

The washer man ( J ) was a well educated man from a premier management institute. He had the fundas of looking at the bigger picture and thinking out of the box. He was convinced that there must be some reason for the donkey to bray in the night. He walked outside a little and did some fact finding, applied a bottom up approach, figured out from the ground realities that there was a thief who broke in and the donkey only wanted to alert him about it. Looking at the donkey's extra initiative and going beyond the call of the duty, he rewarded him with lot of hay and other perks and became his favorite pet. The dog's life didn't change much, except that now the donkey was more motivated in doing the dogs duties as well. In the annual appraisal the dog managed a " meets requirement" . Soon the dog realized that the donkey is taking care of his duties and he can enjoy his life sleeping and lazing around. The donkey was rated as " star performer". The donkey had to live up to his already high performance standards. Soon he was over burdened with work and always under pressure and now is looking for a job rotation…

Disclaimer: All characters in the story are not at all imaginary. Any resemblance to any person living or dying of work is purely intentional.