Saturday, October 22, 2005

Abstract Class


class AbstractClass
{
public:
void bar();
virtual void foo() = 0; //function not defined
AbstractClass();
virtual ~AbstractClass();

};

void AbstractClass::bar()
{
foo(); //calling the undefined function
}


This code will compile.

Friday, October 14, 2005

Why not CON?

Received a forward today.

>An Indian discovered that nobody can create a folder anywhere named as
>"con "

>This is something pretty cool...and unbelievable... At Microsoft the whole
>team, including Bill Gates, couldn't answer why this happened! Try it out
>yourself...


The first part of the excerpt is true. But the second is probably (I hope) an exaggeration!

The reason for the restriction is that CON is the special name for the computer-console in DOS and the command-shell. CON is a device name; to create a file from the command-line, we would say COPY CON filename and then type the contents of the file, stoppping with a Ctrl-Z (the DOS end of file indicator) and pressing ENTER. And because filenames are case-insensitive, no variant of CON will be allowed.

Other names not allowed as file/folder-names include: PRN, LPTx, COMx - all device-names.
But interestingly for COMx, even if you have 4 COM ports, COM5, COM6 etc aren't allowed!!! So, does this mean Windows won't allow more than 9 COM ports??? Why not? That would be the real restriction!!!

Tuesday, October 04, 2005

Finding the space gobblers

Find out top 10 directories eating up your disk space:
du -cksh * | sort -rn | head -10

Google And The Truth

"Google first, think later. " is the mantra that everybody, especially the software professional, lives by.

1. There is a problem.
2. Nothing new under the sun.
3. It must have been faced by someone else too.
4. Somebody must have solved it back then.
5. Why reinvent the wheel?
6. Let's get it solved. ... fast.

In this age of instant karma and instant nirvana, the top search result is what becomes the objective truth for the vast majority..

What cannot be found might as well not exist. - TJ