Archive for June 10th, 2009

ABC to install Gnuplot SuSE 11.1

June 10, 2009

GNU Plot is not installed in SuSE 11.1 by default. But, the  installation is fairly simple. It is going to take less than a minute !

The easiest way to install Gnu Plot is to use the Installation disk. Just a package needs to be installed ! The steps are as follows –

1. Go to YaST Control Center. Select ‘Software’ on the left panel and then open ‘Software Management’ on the right.

2. Make a search for ‘gnuplot’.

3. The is only one package for gnuplot. Check mark that. Have a look at the  snap if something wasn’t clear.

YaSt Software management

YaSt Software management

4. Click on Accept and the Installation start. Remember to insert the Installtion disk when propmted. :P

How to use scanf to read Strings with Spaces ?

June 10, 2009

I knew this for two years now, but it dint strike me before to put it up in the blog; don’t know why ?

Its easy and simple, I don’t think I need to explain. Only the syntax needs to be remembered.

scanf(” %[^\n]s”,a);

May be you get a question in your mind. What does ‘[^\n]’ do ? Does it set the delimiter to ‘\n’. Well, you on the right track. Yes, it does. Instead on ‘\n’, if you had put a ‘\t’ it would consider all words with spaces as string until you press a ‘Tab’. You can even have a  ‘  ‘(a space). The scanf can be expanded as

scanf(” %[^ ]s”,a);  // Note – There is a space after ^

The only differece between scanf(” %s”,a) and scanf(” %[^ ]s”,a) is that, when you enter a string with two words, the former considers each word as a new string whereas the latter consider only the first word as a string and the other word is ignored.

As a Example, consider the string “Hello World“, the former reads “Hello” and “World” as two strings (if you had called ‘scanf’ twice) and the latter reads only the first word “Hello” (even if you had called ‘scanf’ twice) ! Go ahead and experiment with other delimiters !! 😀

Why Men never get Depressed ?

June 10, 2009

Men Are Just Happier People– What do you expect from such simple creatures? Your last name stays put. The garage is all yours. Wedding plans take care of themselves. Chocolate is just another snack. You can be President. You can never be pregnant. You can wear a white T-shirt to a water park. You can wear NO shirt to a water park. Car mechanics tell you the truth. The world is your urinal. You never have to drive to another gas station restroom because this one is just too icky. You don’t have to stop and think of which way to turn a nut on a bolt. Same work, more pay. Wrinkles add character. Wedding dress $5000. Tux rental-$100. People never stare at your chest when you’re talking to them. New shoes don’t cut, blister, or mangle your feet. One mood all the time.

Phone conversations are over in 30 seconds flat. You know stuff about tanks. A five-day vacation requires only one suitcase. You can open all your own jars. You get extra credit for the slightest act of thoughtfulness. If someone forgets to invite you, he or she can still be your friend.

Your underwear is $8.95 for a three-pack. Three pairs of shoes are more than enough. You almost never have strap problems in public. You are unable to see wrinkles in your clothes. Everything on your face stays its original color. The same hairstyle lasts for years, maybe decades. You only have to shave your face and neck.

You can play with toys all your life. One wallet and one pair of shoes — one color for all seasons. You can wear shorts no matter how your legs look. You can ‘do’ your nails with a pocket knife. You have freedom of choice concerning growing a mustache.

You can do Christmas shopping for 25 relatives on December 24 in 25 minutes.

No wonder men are happier.

Send this to the women who can handle it and to the men who will enjoy reading it (Well this is the reason I put it in my blog :D). From my  side now, pass it on to your friends ! 🙂

Kudos to the person who wrote this. In just three words it is just the plain, simple and real truth !!

%d bloggers like this: