Srividya

Monday, November 28, 2005

To set new root password if u foret one

The method i know for this is....
1) While booting at 'bootrecord', press 'e' to edit.
2) You can see the kernal-hd0 by moving the arrows.
3) Highlight that and then press enter.
4) Now press the space bar once and type single and then press enter.
5) Press b to boot.
6) You will get sh#
7) Type passwd root
8) And retype the password.
9) Then type reboot to boot again.

Friday, November 25, 2005

Good problem

An integer array of size 101 contains 51 numbers between 1-10000.
50 nos are stored twice.

how can u find the no which is stored once??
The solution might be very simple. Get an algorithm of the time complexity O(n) and the least utilization of memory.


One Solution is...

Find out the XOR of all the numbers. The result of this is the required answer, which also takes O(n) and one extra memory location for storing the result.


nice C-puzzle

void fun(void)
{
/*Do something here so that the printf stmt in main function prints something other than 20 */
}

int main()
{
int i = 20;
fun();
printf("%d", i);
}

One Solution is...


void fun(void)
{
#define printf(a,b) printf("%d",10);
// we can also use
// #define fun() i=10
}


int main()
{
int i = 20;
fun();
printf("%d", i);
}

Wednesday, November 16, 2005

Program to print 1 to 100 numbers without using any of the control structures

One solution:

#include "iostream.h"
#include "conio.h"
void print( int );
void print ( int i )
{
try
{
printf("%d\n",i);
int j = i/i;
i--;
print(i);
}
catch( ... )
{
printf("%d\n",i++);
throw;
}
}
main()
{
try{
print(100);
}catch(...)
{
cout<<"Mission Accomplised :))";
}
}

Another Solution:

void Print1toN( int N )
{

(N-1 > 0) &&amp;amp; Print1toN( N -1 ); // 1, 2, ... N
printf("%d\n",N);
}


void PrintNto1( int N )
{
printf("%d\n",N);
(N-1 > 0) &&amp;amp; PrintNto1( N -1 ); // N, N-1, ... 2, 1


}

Tuesday, November 15, 2005

Arthur Ashe

Arthur Ashe, the legendary Wimbledon player was dying of CANCER. From
world over, he received letters from his fans, one of which conveyed:

"Why does GOD have to select you for such a bad disease"?

To this Arthur Ashe replied:

The world over -- 5 crore children start playing tennis, 50 lakh learn to
play tennis, 5 lakh learn professional tennis, 50,000 come to the
circuit, 5000 reach the grand slam, 50 reach Wimbeldon, 4 to semi final,
2 to the finals.

When I was holding a cup I never asked GOD "Why me?" And today in pain I
should not be asking GOD "Why me?"

Sunday, November 13, 2005

A story tells that two friends

A story tells that two friendswere walkingthrough the desert During some point of thejourney they had anargument, and one friendslapped the other onein the face.The one who got slappedwas hurt, but withoutsaying anything,wrote in the sand:TODAY MY BEST FRIENDSLAPPED ME IN THE FACE.They kept on walkinguntil they found an oasis,where they decidedto take a bath.The one who had beenslapped got stuck in themire and started drowning,but the friend saved him.After he recovered fromthe near drowning,he wrote on a stone:TODAY MY BEST FRIENDSAVED MY LIFE.The friend who had slappedand saved his best friendasked him, "After I hurt you,you wrote in the sand and now,you write on a stone, why?"The other friend replied"When someone hurts uswe should write it downin sand where winds offorgiveness can erase it away.But, when someone doessomething good for us,we must engrave it in stonewhere no windcan ever erase it."LEARN TO WRITEYOUR HURTS INTHE SAND AND TOCARVE YOURBENEFITS IN STONE.They say it takes aminute to find a specialperson, an hour toappreciate them, a dayto love them, but thenan entire lifeto forget them.Do not value the THINGSyou have in your life. But value WHO you have in your life!

Friday, November 11, 2005

1000 GB mail space

This mail server provides us with 1000GB i.e. 1 Terabyte of mail space and the account creation is free

http://www.mailnation.net/

SUCCESS

S- Set your goal
U- Understand the Obstacle.
C- Clear the doubts.
C- Create the positive mental picture.
E- Entertain the challenge
S- Stay on the track.
S- Show the world what you can do for it.

Honest labour and proper approach leads to success.

Sunday, November 06, 2005

Instant messenger on demand

Instant messengers for emergency. If you in a net center and they
don't have the software installed. Don't worry and don't take the pain
of downloading your brand of instant messenger.

Just login to: http://www4.meebo.com/