Archive for February, 2008

Knowledge - An Important Word In All Important Inspirational Words Of Important People

Posted on: Monday, February 25th, 2008 | Written by Wakish

Knowledge is a word which has so many meanings and varies from people to people. But, whatever the extent of knowledge someone has, it is always not enough in this rapidely changing world. Every little thing that we experience in our daily life, contributes to increasing our knowledge. We are reading something in an old newspaper, still we are gaining something. In every little thing or person, there is something to learn!

Knowledge

Let’s read and understand some of the inspirational words of some great people, all centered around the word Knowledge

1) Knowledge is power - by Hobbes

2) Knowledge is the only instrument of production that is not subject to diminishing returns - by J.M Clark

3) That knowledge which purifies the mind and heart alone, is true knowledge; all else is only a negation of knowledge - by Sri Ramakrishna

4) The law of nature is that a certain quantity of work is necessary to product a certain quantity of good of any kind, whatever. If you want knowledge, you must toil for it - by John Ruskin

5) We broaden our field of knowledge and reach generalisations of considerable magnitude as the result of numerous small thoughts brought together in the mind and carefully considered - by Alexander G.Bell

6) Knowledge is of two kinds. We know one subject ourselves or we know where we can get information upon it. - by Dr. Johnson

7) knowledge comes, but wisdom lingers - by Tennyson

8) Science is organised knowledge - by Herbert Spencer

9) Knowledge is proud that he has learned, wisdom is humble that he knows no more - by Cowper

Do you know any other? I’m sure you may have some great ones too.. Feel free to add to the list :)

bulb Suggested Reading:
=> Secret to your success! Do you have a vision of who you are & who you want to be ?
=> A True Teacher Is An Emperor Whose…
=> Method Of Presentation Of Topics
=> Writing the GP Essay - Write to convince!

Share This Article with your friends if you appreciate my effort to write it!

Posted in: Inspiration Motivation | Response(s): (5) Comments made - Say your part!

It’s Too Easy To Make This Simple, But Worse, Logical Error In Programming

Posted on: Sunday, February 24th, 2008 | Written by Wakish

- This article is relevant to almost any programming languages, namely C, C++, Java, C#, PHP..etc
- I will be using C++ for example illustrations
padlock
star The Two Operators Which Create Confusion To Beginners

Before we begin with the title, it is important that you understand the following Operators:
1) The assigment operator
Example:

int x = 10; //This statement assigns the value 10 to variable

Meaning, some memory location will be reserved or set aside, it will be named or referenced as the variable “x”. Then, the value “10″ will be stored in that location.

2) The equality operator

Example:
x == 10; //This is an evaluation statement

Meaning, evaluation will be done to verify if really the variable “x” contains the value “10″. If the location named “x” has a value of “10″, then the statement evaluates to TRUE (1), else it is FALSE (0)

I hope this is clear now? If yes, let’s proceed further..

star The Common Programming Error

Consider this piece of C++ Code:

void main()
{ int x=0; //declare a variable x and assign it a value 0 to prevent garbage values

//ask the user to input a value
cout << “Enter an integer: “;
//collect the input
cin >> x;

//an “if” statement to do something*
if (x = 5) //LOGICAL ERROR!
{ cout << “I knew it was 5!” << endl;
}
else
{ cout << “How can I possibly guess what you entered?” << endl;
}
}//end main

OUTPUT:
Enter an integer: 36
I knew it was 5!

As you can see from the output above, the result is wrong. We entered 36, and still the program is reacting as ‘if it was’ actually 5 that was entered!

star What Is Wrong Then?

The “if” statement was there to do something and that something was an “evaluation”.
bulb “if-else” statements always perform one and only one thing: EVALUATION.

Now, I think you are getting the picture; whenever there is an “if-else” statement, there is an “evaluation” and whenever there is an “evaluation”, we use the “equality operator”! (Say this aloud, stick it somewhere on your walls till it becomes natural to your brain) :)

star Further Explanation On the Error

The statement “if (x = 5)”, will always return a TRUE value. This is because an if statement is FALSE, if and only if, that statement evaluates to 0. In our case, the statement says, x=5. Hence, x is not 0. Therefore, if() evaluates to TRUE.
That is why the code body of the “if” statement will still get executed although this is not what we ‘intended‘ the program to do.

exclamation NOTE:
This type of error is called a “logical error” and is one of the worse error in programming since there is no way for the compiler to catch that error for you!
Compile-time errors are caught!
Run-time errors are also caught!
But, logical errors can never be caught!
So be careful! ;)
(I think now after reading the above, you will never ever make such an error) :P

star The Full Correct Code:

void main()
{ int x=0; //declare a variable x and assign it a value 0 to prevent garbage values

//ask the user to input a value
cout << “Enter an integer: “;
//collect the input
cin >> x;

//an “if” statement to do something*
if (x == 5) //GOOD!
{ cout << “I knew it was 5!” << endl;
}
else
{ cout << “How can I possibly guess what you entered?” << endl;
}
}//end main

OUTPUT:
Enter an integer: 36
How can I possibly guess what you entered?

If you liked this article, do subscribe to not miss other exciting tutorials ;)
And I would also love to hear your feedback, point of view or any suggestion.

star Recommended Reading:
=> Random Numbers in C programming

Share This Article with your friends if you appreciate my effort to write it!

Posted in: Programming | Response(s): No Comments yet - Be the first to respond!

Get A Free Linkback - Batch 03

Posted on: Sunday, February 24th, 2008 | Written by Wakish

star Here’s the third batch of Review My Blog and Get A Free Linkback:

1) Digital Guess

2) Blog Badly presents Bad Blog Reviews: Wakish Wonderz

Sorry for the lateness, it was because I was busy with My Final Custom Made Wordpress Theme

PS: I wonder what he now thinks of my new own made theme? :P

exclamationSo, you want to have your site, blog or forum figured FREELY on my PR4 Blog? To take this golden chance, read and respond to Review My Blog and Get A Free Linkbackbulb

star Previous Edition:
=> Get A Free Linkback - Batch 01
=> Get A Free Linkback - Batch 02

Share This Article with your friends if you appreciate my effort to write it!

Posted in: Review My Blog | Response(s): No Comments yet - Be the first to respond!

Sun Radiation - Did you know.. / Universe Edition 4

Posted on: Saturday, February 23rd, 2008 | Written by Wakish

Did you know.. Sun Radiation

bulb Only a very small portion (0.000 000 0005%) of the radiation emitted by the Sun reaches the Earth..

sun radiation

Image provided by The Climate Guide which presents a very nice informative article on Radiation from Earth (Make sure you read it ;) )

star Previous Editions:
=> Did you know.. - Universe Edition 1
=> Did you know.. - Universe Edition 2
=> Did you know.. - Universe Edition 3

Share This Article with your friends if you appreciate my effort to write it!

Posted in: Around The World | Response(s): (2) Comments made - Say your part!
Close
E-mail It