Programming and Animation

Friday, November 25, 2005

Collection of Famous(Funny) cricketing quotes.

Collection of famous quotes by Navjot Singh Sidhu:

1. That ball went so high it could have kissed an air hostess .

2. There is light at the end of the tunnel for India, but it's that of an
incoming train which will run them over.

3. Experience is like a comb that life gives you when you are bald.

4. This quote was made after Ganguly called Dravid for a run and midway sent
him back and Dravid was run out in the third test against the **West Indies*
at **Barbados**."Ganguly has thrown a drowning man both ends of the rope."

5. Sri Lankan score is running like an Indian taximeter.

6. Statistics are like miniskirts, they reveal more than what they hide.

7. Wickets are like wives - you never know which way they will turn!

8. He is like Indian three-wheeler, which will suck a lot of diesel but
cannot go beyond 30!

9. The Indians are going to beat the Kiwis! Let me tell you, my friend that
the Kiwi is the only bird in the whole world, which does not have wings!

10. As uncomfortable as a bum on a porcupine.

11. The ball whizzes past like a bumble -bee and the Indians are in the sea.

12. The Indians are finding the gaps like a pin a haystack.

13. The pitch is as dead as a dodo.

14. Deep Dasgupta is as confused as a child is in a topless bar!

15. The way Indian wickets are falling reminds of the cycle stand at
Rajendra Talkies in **Patiala** one falls and everything else falls!

16. Indian team without Sachin is like giving Kiss without a Squeeze.

17. You cannot make Omelets without breaking the eggs.

18. Deep Dasgupta is not a Wicket Keeper, he is a goalkeeper. He must be
given a free transfer to **Manchester** United.** *

19. He will fight a rattlesnake and give it the first two bites too.

20. One, who doesn't throw the dice, can never expect to score a six.

21. This quote was made after Eddie Nichols, the third umpire, ruled
Shivnarine Chanderpaul 'NOT OUT' in the second test at **Port of Spain** T&T
"Eddie Nichols is a man who cannot find his own buttocks with his two
hands."

22. Anybody can pilot a ship when the sea is calm.

23. Nobody travels on the road to success without a puncture or two.

24. You got to choose between tightening your belt or losing your pants.

25. The cat with gloves catches no mice.

26. Age has been perfect fire extinguisher for flaming youth.

27. You may have a heart of gold, but so does a hard-boiled egg.

28. He is like a one-legged man in a bum kicking competition.

29. The third umpires should be changed as often as nappies and for the same
reason.

30. Kumble's bowling at the moment is flat as a Dosa

Ha ha ha.
Hope you enjoyed this one.
:)
Paramesh.

Thursday, November 24, 2005

Creating a Website - Part 3

Hello friends,

Did you like my birds?
Never mind. Lets see what is
Control Panel.

Mananging your webhost account online has never been easier. The control panel is click and point software which simplifies most tasks. The website control panel makes most website hosting management tasks very easy. It eliminates the need to read the detailed online manual.

Most of the control panel include features like:

File Manager
Browser based FTP client
HTML compressor
Install/Manage password protected directories
Manage email configuration
Manage autoresponders
Install/Disable daily stats
Customize Server Error Pages
Manage Counters
FormMail, Guestbook, WwwBoard and others
Control your site from your browser

Up

So, The first thing you have to do is to use the file manager to manage your files.
You can upload files from your computer, edit files in the server or delete files using the file manager.

After you create a hosting account, when you type your domain name in your browser, you'll see some files and not the html page or Welcome page.

The control panel location is normally a subdomain in your website, say "www.yourdomain.com/cpanel".

When you look at the file manager, some basic files will be:

public_html
public_ftp
www
tmp
....

You should never delete any of these files or folders.
They indicate the basic structure of your website.

So, the first thing you have to create is a index.html file and store it in the root folder of your website.
i.e public_html folder.

So, create a sample file with some text and save it as index.html
Upload the file in the public_html folder.

Once you upload, when you type "www.yourname.com", then the index.html file will be automatically loaded.
So, the index.html will be your startup page.

There are many control panels available, some are free and some are costly.
It depends on your hosting account.

My favourite control panel is CPanel, and most of the hosts provide you with CPanel.
CPanel has very rich features, and you can find them in this site:
http://www.cpanel.net/

In the next post, lets see about the various features of a control panel and creating a simple forum in our site.

Regards,
Paramesh.


My Birds Posted by Picasa

Wednesday, November 23, 2005

Creating a Website - Part 2

We now know how to create a domain from part 1.

Now, we'll move on to hosting a website.
Hosting definition:

The World Wide Web is a massive collection of web sites, all hosted on computers (called web servers) all over the world. The web server (computer) where your web site's html files, graphics, etc. reside is known as the web host. Web hosting clients simply upload their web sites to a shared (or dedicated) webserver, which the ISP maintains to ensure a constant, fast connection to the Internet.

So, the web host is the place where you have all your files stored.

How to host our new website?
Consider that the domain name is "www.yourname.com".

We should first find a suitable hosting options for our website.
For example,
How many users will visit the site at a time?
How many files do i have to store in my website? etc..

If you want to have a lot of files and many users will visit the site at a time or daily, we have to select a hosting account that has a large storage space and transfer.

For example, a low priced plan may have a storage capacity of 100MB along with 10GB transfer per month.
It may also offer money back guarantee!

But if you want a forum to be created in your website, then you should look at other options also.
For example, many forums need PHP and MySQL.
So, you should check with your host whether they are available in the particular hosting plan.

There are 3 types of hosting: Windows, Linux and FreeBSD.
If your website code has ASP or ASP.net content choose windows hosting.
Generally windows hosting costs more because the licensing fee required is greater for windows.

But to the end user everything is same and dont be confused about it.

Many companies that you create a new domain offers a web hosting account also.

Once you have created a new hosting account, you are given a username and password.
When you go to your domain name for the first time say "www.yourname.com". It will ask you for the username and password.
Enter them and you'll be taken to a new place called: Control Panel.

That will be explained in part 3.
If you have any comments or questions, feel free to ask.

Regards,
Paramesh.

How to show the report card to Dad... Funny story.

Letter to a DAD

A father passing by his son's bedroom was astonished to see the bed
was nicely made and everything was picked up.

then he saw an envelope propped up prominently on the center of the bed.

it was addressed, "dad".
with the worst premonition, he opened the envelope and read the letter
with trembling hands:

dear dad,
it is with great regret and sorrow that i'm writing this. I had to elope with my new girlfriend because i wanted to avoid a scene with mom and you.
i've been finding real passion with barbara and she is so nice even with all her piercing, tattoos, and her tight motorcycle clothes.

but it's not only the passion dad, she's pregnant and barbara said that we will be very happy.

even though you don't care for her as she is much older than i, she already owns a trailer in the woods and has a stack of firewood for
the whole winter.

she wants to have many more children with me and that's now one of
my dreams too.

barbara taught me that marijuana doesn't really hurt anyone and we'll be growing it for ourselves and trading it with her friends for all the cocaine and ecstasy we want.

in the meantime, we'll pray that science will find a cure for aids so barbara can get better; she sure deserves it!!

don't worry dad, i'm 15 years old now and i know how to take care of myself.

someday i'm sure we'll be back to visit so you can get to know your
grandchildren.

your son,
john

p.s. dad, none of this is true. I'm over at the neighbor's house. I just wanted to remind you that there are worse things in life than my report card. That's in my desk center drawer. I love you!

call when it's safe for me to come home.
:)
---------------------------------------------------

Dont lie to ur mother

Mrs. Smith had always suspected her son, Mike, was having an intimate relationship with his roommate, Jennifer.
One night, Mike invites his mother over for dinner. All thru the night, Mrs. Smith watched Mike and Jennifer interact, and was pretty sure there was more than met the eye. Mike saw his mother watching them and assured her that they were just roommates.
A few nights later, Jennifer went to Mike with a problem.
"Ever since your mother was here for dinner, I have been unable to find the gravy ladle. Do you think she took it?"
Mike replied, "I doubt it, but I'll e-mail her and ask her anyway."
Mike sat down at the computer and composed the following e-mail:

Dearest Mother,
I'm not saying you did take the gravy ladle, and I'm not saying you did not take the gravy ladle. But the fact remains, since you were here for dinner, we have been unable to find the ladle.
Love always,
Mike

Two days later, Mike received the following reply from his mother:

Dearest Michael,
I'm not saying you do sleep with Jennifer, and I'm not saying you do not sleep with Jennifer. But the fact remains, had Jennifer been sleeping in her own bed, she would have found the ladle by now.
Love,
Mother

Moral of the story: Don't lie to your mother!

----------------------------------------------------------

:)
Ha Ha Ha. Hope you enjoyed this one...
Paramesh.

Tuesday, November 22, 2005

Creating a Website - Part 1

Hello friends,

I just completed creating a website with a forum in this link: Anna University Forums
The site is still in construction, so dont feel bad.

Creating a website is a cumbersome process.
You should spend a little money for creating and maintaining a website.
Many companies will setup all the things you want when you pay them money.
Some may set up for free and some may ask money.

I wanted to learn how to create and maintain a website, so i thought i could tell others how to create one, so that it may help sometimes.

Here we start:
The first step you have to take while creating a website is to create a domain.
Oh. What is a domain first?
Domain is the name which you want to type in your browser.

For example, if you want to create a new website with "www.yourname.com", then the "www.yourname.com" is called the domain.

We have to create a domain before creating the content of the website.
But how to create a domain?
There are many sites offering to create a domain.
Here is a link where you can create a domain for $6.99
Domain Site

Your domain may cost more if you want different type of extensions.
For example, there are many extensions such as:
.com .net .org
.info .in .biz
.cn .us .ws
.bz .cc .tv

Most of them have similar costs, but info is lesser costly(not recommended).

.net or .com is the most recommended one.

Once you have decided your domain name, you have to check whether it is available or not.
For example, "www.yourname.com" may already be selected by any other person in the world.
So, type the name you want to create the website in the textbox and verify whether it is available.
If it is available, then go on to purchase the domain name.

The next step is to buy hosting to your domain, which will be explained in part 2.

Regards,
Paramesh.

Sunday, November 06, 2005

How to get(or read) arrow key input in a C program?

How to get(or read) arrow key input in a C program?
Hello friends,

This is the most important topic in C programming.

How to read the arrow keys in a C program?

This was an interesting discussion in many forums and still going on.
Here is some information that i extracted from them:

ISO C has no concept of 'arrow keys', or 'keys',
or 'keyboards'. All i/o is expressed with
'streams of characters'. How a keyboard or
other input device presents this stream to
a C program is platform-specific.
You could unbuffer your input stream so that you could read
one character at a time from the OS, but the OS or shell
might be buffering the characters until end of line (or end of file)
instead of delivering them upwards immediately. There is no
mechanism in the C standard to ask the OS to deliver the keypresses
individually.

The only way is to use nonstandard methods.

Each OS would do this a different way, for instance DOS might require a SIGINT or
something (I seem to recall handling the mouse used an int86() call),
whereas Windows would return an event to your program that you can
handle

If you are willing to weaken down to POSIX.1 instead of pure portable
C, then POSIX.1 has appropriate mechanisms.
POSIX is a ieee standard about OS interfaces.more information can be
found at ieee.org.

termcap or terminfo give you convenient ways of representing which
character sequence means which arrow key. If you have turned off echo
and all you need is to know which arrow key has been pressed, then
terminfo / termcap or any other such correspondance table would do just
as well.

Curses is a library built on top of termcap/terminfo.
termcap and terminfo are databases of terminal device capability
information. The original termcap was developed by Bill Joy to make
vi portable to terminals other than the ADM3a, sometime in the late
1970s or early 1980s, and predates the curses library considerably.
The original curses was written by Ken Arnold in 1986; his paper
"Screen Updating and Cursor Movement Optimization" notes right in the
front matter that "[t]hese routines all use the termcap(5) database",
and credits Bill Joy.

If you want to be able to position the cursor to a particular point
on the screen, -then- you bring in curses rather than reinventing the
wheel. Provided, that is, that you are working with a text-based
output rather than a graphical output.... but of course if you
are working with graphical output, you are rather distant from
the original goal of using pure C to deal with arrow keys.

Terminfo, some versions of termcap, and some versions of curses have support for these non-ASCII keys. Typically, a special key sends a multicharacter sequence (usually beginning with ESC, '\033'); parsing these can be tricky. (curses will do the parsing for you, if you call keypad first.)

Under MS-DOS, if you receive a character with value 0 (not '0'!) while reading the keyboard, it's a flag indicating that the next character read will be a code indicating a special key. See any DOS programming guide for lists of keyboard codes. (Very briefly: the up, left, right, and down arrow keys are 72, 75, 77, and 80, and the function keys are 59 through 68.)

Another method is using the ncurses.h header.
Here is a link for that:
Arrow key scanning.

Here is a link for the ncurses documentation:
ncurses.h


In DOS, there are many ways. One way is by using the conio.h header file.
By using getch() and getche() functions.
There is another way by using kbhit( ) function.

The arrow and the Esc keys and various other key inputs cannot be read by the scanf( ) function. These keys are special in the sense they are identified be their 'scan codes'.
In fact every key on the keyboard has a unique scan code which is passed to the computer everytime a key is pressed. The following function with the help of the
kbhit( ) function can scan the key that has been pressed:

CPP / C++ / C Code:

/* this routine returns the 'scan code' of the key that has been hit */

#include
int get_scancode( )
{
union REGS inregs, outregs ;

while( !kbhit( ) ) /* while the keyboard is inactive */
; /* do nothing */

inregs.h.ah = 0 ;
int86(22, &inregs, &outregs) ;
return ( outregs.h.ah ) ;
}


The function module above in C returns the scan code of the keys that are hit.
Following is a list of keys and their respective scan codes:

up arrowkey 72
downarrow key 80
leftarrow key 75
rightarrow key 77

Finally, here is the information given by GID Forums senior member Dave:

Compiler-specific functions such as getch() are traditional for Microsoft DOS and Windows compilers such as Borland (from the earliest TurboC up to the current versions). These are very useful, and, since there are no standard library functions that do the same thing, it's appropriate to use getch(), kbhit(), etc. if they are present with your compiler.

For Linux, the possibilities are numerous, using ioctl() calls to make the input stream "raw" (unbuffered and, therefore untranslated). has useful functions on my Linux systems.

Here is an example of something that I have used in Linux to take the place of getch() for inhibiting console output when the user enters a password:

How to hide characters as they are keyed on

You can play around with it in Linux if you want to see how the arrow and function keys work on your system.

This also works for me with gnu gcc on my Windows XP system.

Note that not all keyboards in all countries in the world actually have the same keycodes.

Regards,
Paramesh.

Thursday, November 03, 2005

Morning Humor-part 1

Hello friends,

This is text extracted from the Famous Sunday Morning Humour thread of GID Forums.

Here is the one that i liked the most:
A Programmer and an Engineer are sitting next to each other on a
long flight from LA to NY. The Programmer leans over to the
Engineer and asks if he would like to play a fun game. The
Engineer just wants to take a nap, so he politely declines and
rolls over to the window to catch a few winks. The Programmer
persists and explains that the game is real easy and a lotta fun.
He explains "I ask you a question, and if you don't know the
answer, you pay me $5. Then you ask me a question, and if I don't
know the answer, I'll pay you $5." Again, the Engineer politely
declines and tries to get to sleep. The Programmer,
now somewhat agitated, says, "OK, if you don't know the
answer you pay me $5, and if I don't know the answer, I'll pay
you $50!" This catches the Engineer's attention, and he sees
no end to this torment unless he plays, so he agrees to the game.

The Programmer asks the first question. "What's the distance
from the earth to the moon?" The Engineer doesn't say a word, but
reaches into his wallet, pulls out a five dollar bill and hands it to the

Programmer. Now, it's the Engineer's turn. He asks the Programmer
"What goes up a hill with three legs, and comes down on four?" The
Programmer looks up at him with a puzzled look. He takes out his
laptop computer and searches all of his references. He taps into
the Airphone with his modem and searches the net and the Library
of Congress. Frustrated, he sends e-mail to his co-workers -- all to
no avail.

After about an hour, he wakes the Engineer and hands him $50.
The Engineer politely takes the $50 and turns away to try to get back
to sleep. The Programmer, more than a little miffed, shakes the
Engineer and asks "Well, so what's the answer?" Without a word,
the Engineer reaches into his wallet, hands the Programmer $5,
and turns away to get back to sleep.

Best Regards,
Paramesh.

Wednesday, November 02, 2005

Missing or corrupt system32\drivers\ntfs.sys - Exclusive answers:

Hello friends,

This is an exclusive extract from the GID Forums about the common problem Missing or corrupt system32\drivers\ntfs.sys

Visit this link for full fledged replies:
Missing or corrupt system32\drivers\ntfs.sys

Best Regards,
Paramesh.