Monday, August 04, 2008

SQL thinking the C++ way...


Some people never go straight. What do I mean? I mean many things…

Consider such a person building a house. He/she prepares a building plan. It usually will have something out of the way. They bribe the official and get it approved. What happens when the construction is over? It again will have something off track. Yes, the building won’t be as per the plan…

This is not just a possibility but I personally know a couple of such people and buildings. This is not just about building. Such people leaves a ‘trademark’ in whatever they do or even speak..

Ask them a straight question. You won’t get a straight answer, at least they will ask you

“Why?”

We might get surprised with such a ‘why’ and using that ‘extra time’ , they makes up some ‘not to the point’ answer. Strange, but it’s a reality. That is not the end of this story. Today I saw some such people giving a ‘poor fellow’ a help, by answering a technical question.

One guy asked how he can clear the screen in a VC++ console application. He specifically tells that he just started learning C++ and is looking for something similar to the ‘CLS’ of the DOS. I saw two surprising answers.

One person replies with another question:

“There are so many methods, which header file you are including?”

Another one went many steps ahead and replied this way:

“Hope this will help:

COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
SetConsoleCursorPosition(hConsole, coordScreen);
"
What the heck !

So, what is the solution here? Another person answered:

Use system(“CLS”)

So it was that simple…


This kind of situation can happen to anybody if we get a wrong person to at the other end. It can even be a teacher. Look at this:


10 years ago....I am sitting in a class room to attend a theory session of ORACLE. That was the first theory class on that subject for the course I had taken.


“I did not get, can you please explain it ?” asks me

“Do you know Pascal?”

“No”

“C or C++?”

“No”

“Fortran?”

I shook my head and he shrugs and then continues the class…


I came back home very disappointed and dull. Seeing a dejected looking husband, the wife asks:

“What happened?, you were very thrilled when you went”

I told her what happened.

“I think you got a wrong tutor. Your doubt has nothing to do with C or Fortran…”

That was the truth. (How do my wife know this? She had studied all those programming languages and was/is really good at ORACLE..)


So, when we are with wrong people, there is no need to get disappointed, especially with respect to studies. A right person can help us out, or may be some extra effort from our side might change the situation..


If any youngster is reading this, the message is, Don’t give up!

Did I start somewhere and end somewhere else?

I mean many things!

No comments: