"How I'm going to cross the mountain ?" asked the disciple.
"One step at a time." said the Master.
When you view the life as a whole, the life may seems to be a big beast or a very long journey. This view might send a lighting into your spine, it may shock you. To make it easy, Norman Vincent Peale, the author of Positive Thinking, advises to live in Day-Tight compartment.
When we have a Big Goal, a Big Dream, as it is big, it might seem IMPOSSIBLE. But when you break it, it becomes I M Possible. Step by Step, one step at a time, start living the dream. Don't worry about the BIG GOAL, start concentrating on the break-ups.
Think about the Small Step, however small, which you can take toward the realization of the BIG GOAL.
Always keep a Daily Journal, near your bedside. So that before you sleep, fill it up with the Day's Accomplishments, however small. You don't need to worry about the Life's Big Challenges. All you need to think about is, how to make My One Diary Page as much beautiful just for this Day(Just Today).
There is only TODAY, no TOMORROW. TOMORROW Never Comes.
Wednesday, September 10, 2008
Monday, September 01, 2008
Sword of Truth
I'm currently Reading "Wizard's First Rule" by Terry Goodkind. It is the first book in the series of "Sword of Truth". It has lot of good quotes in it.
"You are what you are, neither more nor less" - a great quote. It can be said in many ways:
* We are what we think we are.
* Cognito Ergo Sum (I think wherefore I'm, I'm what I think)
Perception is very important aspect in life. Every one has their own unique perception. A Mouse will have a Perception of a Cat, which is entirely different from the Cat's own. So, Watch your Perception, it might be a delusion.
"You are what you are, neither more nor less" - a great quote. It can be said in many ways:
* We are what we think we are.
* Cognito Ergo Sum (I think wherefore I'm, I'm what I think)
Perception is very important aspect in life. Every one has their own unique perception. A Mouse will have a Perception of a Cat, which is entirely different from the Cat's own. So, Watch your Perception, it might be a delusion.
Ahana Bookshop
I was been to Ahana Bookshop in Velachery near to Aquatic Complex, Velachery. It is a shopper's paradise for book lovers. You will get 20% discount for most of the books. It is one of the main difference between Ahana and Land Mark Bookshop.
Land Mark is very vast in its collection of books, literally you name it, you will mostly get it in Land Mark. Ahana is not so, it has very limited books (mostly best sellers). So, My Book shopping algorithm is changed, First check the availability of the book in Ahana if I'm lucky I will get it with 20% discount, Else move on to Land Mark.
Land Mark is very vast in its collection of books, literally you name it, you will mostly get it in Land Mark. Ahana is not so, it has very limited books (mostly best sellers). So, My Book shopping algorithm is changed, First check the availability of the book in Ahana if I'm lucky I will get it with 20% discount, Else move on to Land Mark.
Wednesday, August 06, 2008
The Spark
I just read an article posted on an Orkut Community. It was speech given by a well known author Chetan Bhagat. In it he talks about how to keep up and nurture the spark in everyone. The Spark he refers to is nothing but Enthusiasm.
3 Things That will Nurture the Spark:
=> Reasonable Goals
=> Balance in Life
=> Don't take life too seriously
4 Things That could put off the Spark:
=> Disappointment
=> Frustration
=> Unfairness
=> Loneliness of purpose (Isolation)
3 Things That will Nurture the Spark:
=> Reasonable Goals
=> Balance in Life
=> Don't take life too seriously
4 Things That could put off the Spark:
=> Disappointment
=> Frustration
=> Unfairness
=> Loneliness of purpose (Isolation)
Wednesday, July 30, 2008
My French Class
I have started attending French Classes from Monday (28-July-08). I'm attending it for my own self interest. The classes are conducted in my company (CARC) by professor Shobana Varma from Alliance Francaise.
For the Past one week I have learned:
* Greetings in French (Bonjour, Au revoir, a demaine, Je vous en prie)
* Days of the Weeks
* Months of the Year
* Number (0-69)
There are few French phrases we often use without knowing its French Origin. Here is the List:
* Tete-a-tete
* L'oeuf (in tennis - love-all, it means egg)
* RSVP (Repondez s'il vous plait)
I like learning French.
For the Past one week I have learned:
* Greetings in French (Bonjour, Au revoir, a demaine, Je vous en prie)
* Days of the Weeks
* Months of the Year
* Number (0-69)
There are few French phrases we often use without knowing its French Origin. Here is the List:
* Tete-a-tete
* L'oeuf (in tennis - love-all, it means egg)
* RSVP (Repondez s'il vous plait)
I like learning French.
Thursday, July 24, 2008
Knowledge Portfolio
Your Knowledge Portfolio is very important to your career, so keep updating it. In this hot industry, the only thing that is not changing is 'Change'. Change is everywhere in IT industry, so it should be one of our goal to be up-to-date with the change.
Here are some of the tips from the Book, The Pragmatic Programmer:
=> Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut. Additionally, learning many languages is far easier now, thanks to the wealth of freely available software on the Internet. (You can start by learning Haskell/Lisp/Prolog)
=> Read a technical book each quarter. Bookstores are full of technical books on interesting topics related to your current project. Once you're in the habit, read a book a month. After you've mastered the technologies you're currently using, branch out and study some that don't relate to your project. (Stalin, this is not for you)
=> Read nontechnical books, too. It is important to remember that computers are used by people—people whose needs you are trying to satisfy. Don't forget the human side of the equation. (You can start by reading GEB, Infinity and Mind, Books by Roger Penrose, Richard Meyers, Steven Pinker) (Stalin, this also is not for you)
=> Take classes. Look for interesting courses at your local community college or university, or perhaps at the next trade show that comes to town.
=> Participate in local user groups. Don't just go and listen, but actively participate. Isolation can be deadly to your career; find out what people are working on outside of your company.
=> Experiment with different environments. If you've worked only in Windows, play with Unix at home (the freely available Linux is perfect for this). If you've used only makefiles and an editor, try an IDE, and vice versa.
=> Stay current. Subscribe to trade magazines and other journals. Choose some that cover technology different from that of your current project.
=> Get wired. Want to know the ins and outs of a new language or other technology? Newsgroups are a great way to find out what experiences other people are having with it, the particular jargon they use, and so on. Surf the Web for papers, commercial sites, and any other sources of information you can find.
Here are some of the tips from the Book, The Pragmatic Programmer:
=> Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut. Additionally, learning many languages is far easier now, thanks to the wealth of freely available software on the Internet. (You can start by learning Haskell/Lisp/Prolog)
=> Read a technical book each quarter. Bookstores are full of technical books on interesting topics related to your current project. Once you're in the habit, read a book a month. After you've mastered the technologies you're currently using, branch out and study some that don't relate to your project. (Stalin, this is not for you)
=> Read nontechnical books, too. It is important to remember that computers are used by people—people whose needs you are trying to satisfy. Don't forget the human side of the equation. (You can start by reading GEB, Infinity and Mind, Books by Roger Penrose, Richard Meyers, Steven Pinker) (Stalin, this also is not for you)
=> Take classes. Look for interesting courses at your local community college or university, or perhaps at the next trade show that comes to town.
=> Participate in local user groups. Don't just go and listen, but actively participate. Isolation can be deadly to your career; find out what people are working on outside of your company.
=> Experiment with different environments. If you've worked only in Windows, play with Unix at home (the freely available Linux is perfect for this). If you've used only makefiles and an editor, try an IDE, and vice versa.
=> Stay current. Subscribe to trade magazines and other journals. Choose some that cover technology different from that of your current project.
=> Get wired. Want to know the ins and outs of a new language or other technology? Newsgroups are a great way to find out what experiences other people are having with it, the particular jargon they use, and so on. Surf the Web for papers, commercial sites, and any other sources of information you can find.
Thursday, July 17, 2008
40 Tips for Better Living
- Take a 10-30 minutes walk every day. And while you walk, smile.
- Sit in silence for at least 10 minutes each day..
- Sleep for 7 hours.
- Live with the 3 E's -- Energy, Enthusiasm, and Empathy.
- Play more games.
- Read more books than you did in 2007.
- Make time to practice meditation, yoga, and prayer. They provide us with daily fuel for our busy lives.
- Spend time with people over the age of 70 & under the age of 6.
- Dream more while you are awake.
- Eat more foods that grow on trees and plants and eat less food that is manufactured in plants.
- Drink plenty of water.
- Try to make at least three people smile each day.
- Don't waste your precious energy on gossip.
- Forget issues of the past. Don't remind your partner with his/her mistakes of the past. That will ruin your present happiness.
- Don't have negative thoughts or things you cannot control. Instead invest your energy in the positive present moment.
- Realize that life is a school and you are here to learn. Problems are simply part of the curriculum that appear and fade away like algebra class, but, the lessons you learn will last a lifetime.
- Eat breakfast like a king, lunch like a prince and dinner like a beggar.
- Smile and laugh more.
- Life is too short to waste time hating anyone. Don't hate others.
- Don't take yourself so seriously. No one else does.
- You don't have to win every argument. Agree to disagree.
- Make peace with your past so it won't spoil the present.
- Don't compare your life to others'. You have no idea what their journey is all about. Don't compare your partner with others.
- No one is in charge of your happiness except you.
- Forgive everyone for everything.
- What other people think of you is none of your business.
- GOD heals everything.
- However good or bad a situation is, it will change.
- Your job won't take care of you when you are sick. Your friends will. Stay in touch.
- Get rid of anything that isn't useful, beautiful or joyful.
- Envy is a waste of time. You already have all you need.
- The best is yet to come.
- No matter how you feel, get up, dress up and show up.
- Do the right thing!
- Call your family often.
- Your Inner most is always happy. So, be happy.
- Each day give something good to others.
- Don't over do. Keep your limits.
- When you awake alive in the morning, thank GOD for it.
- Please Forward this to everyone you care about
I'm publishing this post using XP Word. Try it out, its cool.
Meditate Online
Meditation is for me is:
The Path of enlightenment
Cannot be charted or measured:
Highest of the high,
Vast beyond limit,
Deepest of the deep,
Profound beyond fathoming,
Big enough to contain
Heaven and earth,
Small enough to enter
An infinitesimal point,
Thus it is called the Path
- Records of the Lanka
I usually Meditate in the office for 5 to 10 minutes mostly after lunch(I don't have heavy lunch these days). I sit in my chair and play Tibetan Bells Music and open the Online Meditation Link. This has a good effect on me. Try it if you have time.
Last week, I have completed reading Sabriel by Grath Nix. I like that book, I have also some of my already read book into Shelfari(bookshelf plug-in in the left).
The Path of enlightenment
Cannot be charted or measured:
Highest of the high,
Vast beyond limit,
Deepest of the deep,
Profound beyond fathoming,
Big enough to contain
Heaven and earth,
Small enough to enter
An infinitesimal point,
Thus it is called the Path
- Records of the Lanka
I usually Meditate in the office for 5 to 10 minutes mostly after lunch(I don't have heavy lunch these days). I sit in my chair and play Tibetan Bells Music and open the Online Meditation Link. This has a good effect on me. Try it if you have time.
Last week, I have completed reading Sabriel by Grath Nix. I like that book, I have also some of my already read book into Shelfari(bookshelf plug-in in the left).
Wednesday, July 02, 2008
Anger and Love (No Limits...)
While a man was polishing his new car, his 4 yr old son picked stone & scratched lines on the side of the car.
In anger, the man took the child's hand & hit it many times, not realizing he was using a wrench.
At the hospital, the child lost all his fingers due to multiple fractures. When the child say his father.... with painful eyes he asked "Dad when will my fingers grow back?"
Man was so hurt and speechless. He went back to car and kicked it a lot of times. Devastated by his own actions...... sitting in front of that car he looked at the scratches, child had written "LOVE YOU DAD".
The next day that man committed suicide...
Anger and Love has no limits, so let the river of life flow in Limits so that this fresh water stream is never scattered.
Thanks to Srini.
In anger, the man took the child's hand & hit it many times, not realizing he was using a wrench.
At the hospital, the child lost all his fingers due to multiple fractures. When the child say his father.... with painful eyes he asked "Dad when will my fingers grow back?"
Man was so hurt and speechless. He went back to car and kicked it a lot of times. Devastated by his own actions...... sitting in front of that car he looked at the scratches, child had written "LOVE YOU DAD".
The next day that man committed suicide...
Anger and Love has no limits, so let the river of life flow in Limits so that this fresh water stream is never scattered.
Thanks to Srini.
Monday, June 30, 2008
The Taste of Biriyani
Biryani is one of the dish I like most since my childhood. My mom don't know how to cook Biryani. But my kids have better luck than me, My wife knows how to cook Biryani. She makes one of the Best Biryani, I have ever tasted.
In the early days of my marriage life, My Wife don't know cooking at all. I usually didn't liked her cooking, that's the reason why we often used to dine outside. After 2 years of our married life, She is improved her cooking skills drastically. Thanks to My mother-in-law and Chef Dhamodaran (Achi Masala samayal Programme).
Now-a-days, I like her non-veg dishes than any other restaurant's. Don't forget to ask for "Chicken Biryani" when anyone visit my home.
In the early days of my marriage life, My Wife don't know cooking at all. I usually didn't liked her cooking, that's the reason why we often used to dine outside. After 2 years of our married life, She is improved her cooking skills drastically. Thanks to My mother-in-law and Chef Dhamodaran (Achi Masala samayal Programme).
Now-a-days, I like her non-veg dishes than any other restaurant's. Don't forget to ask for "Chicken Biryani" when anyone visit my home.
Wednesday, June 25, 2008
Pointer to functions - Simplified
Here is the code
1 #include < iostream >
2
3 using namespace std;
4
5 int add(int a, int b) {
6 return a+b;
7 }
8
9 int sub(int a, int b) {
10 return a-b;
11 }
12
13 // typdef pointer to a function
14 typedef int (*fpp)(int, int);
15
16 // Array of pointers to function
17 fpp fp[2];
18
19 // Function returning a pointer to a function
20 int (* getfp(int i) ) (int, int) {
21 if(i==1) return & add;
22 else return & sub;
23 }
24
25 // Pointer to a function returning a pointer to a function
26 int (* (*fgetfp)(int)) (int, int);
27
28 int main() {
29
30 fgetfp = &getfp;
31
32 fp[0] = (*fgetfp)(1); // same as fgetfp(x)
33 cout<<"10 + 20 = "<< fp[0](10,20)<< endl;
34
35 fp[1] = fgetfp(2);
36 cout<<"10 - 20 = "<< fp[1](10,20)<< endl;
37 return 0;
38 }
39
Thursday, June 19, 2008
The Little Prince
Today, I have completed reading "The Little Prince" written by aviator Antoine de Saint Exupéry. It is one of the short children book. I love this book next to Alice in the wonderland and Looking through the Glass.
The book comes under the category of novella(a short novel). It is children book but with lot of insights for adults.
The novella is about a Little Prince, who lives in a Asteroid name B612, which has 3 volcanoes and 1 Flowering plant.
I recommend it for all. Enjoy reading.
Here is an introduction in WiKi Link
The book comes under the category of novella(a short novel). It is children book but with lot of insights for adults.
The novella is about a Little Prince, who lives in a Asteroid name B612, which has 3 volcanoes and 1 Flowering plant.
I recommend it for all. Enjoy reading.
Here is an introduction in WiKi Link
Wednesday, June 18, 2008
Epictetus: The Art of Living
Two days back, I completed reading a translation of Epictetus. Epictetus is a 3rd century Stoic philosopher. He was born as a slave and later he became a Stoic philospher. The book is very small and it's very good to read.
Jacob anna and Santo, it is a highly recommended book. I want you to enjoy it.
Here is a classic translation of "The Enchiridion"
Here is some of his quotes:(collected from http://www.brainyquote.com/quotes/authors/e/epictetus.html)
First learn the meaning of what you say, and then speak.
First say to yourself what you would be; and then do what you have to do.
God has entrusted me with myself.
He is a wise man who does not grieve for the things which he has not, but rejoices for those which he has.
If evil be spoken of you and it be true, correct yourself, if it be a lie, laugh at it.
If you want to improve, be content to be thought foolish and stupid.
It is impossible to begin to learn that which one thinks one already knows.
Men are disturbed not by things, but by the view which they take of them.
No greater thing is created suddenly, any more than a bunch of grapes or a fig. If you tell me that you desire a fig, I answer you that there must be time. Let it first blossom, then bear fruit, then ripen.
No man is free who is not master of himself.
Practice yourself, for heaven's sake in little things, and then proceed to greater.
Silence is safer than speech.
Whenever you are angry, be assured that it is not only a present evil, but that you have increased a habit.
Jacob anna and Santo, it is a highly recommended book. I want you to enjoy it.
Here is a classic translation of "The Enchiridion"
Here is some of his quotes:(collected from http://www.brainyquote.com/quotes/authors/e/epictetus.html)
First learn the meaning of what you say, and then speak.
First say to yourself what you would be; and then do what you have to do.
God has entrusted me with myself.
He is a wise man who does not grieve for the things which he has not, but rejoices for those which he has.
If evil be spoken of you and it be true, correct yourself, if it be a lie, laugh at it.
If you want to improve, be content to be thought foolish and stupid.
It is impossible to begin to learn that which one thinks one already knows.
Men are disturbed not by things, but by the view which they take of them.
No greater thing is created suddenly, any more than a bunch of grapes or a fig. If you tell me that you desire a fig, I answer you that there must be time. Let it first blossom, then bear fruit, then ripen.
No man is free who is not master of himself.
Practice yourself, for heaven's sake in little things, and then proceed to greater.
Silence is safer than speech.
Whenever you are angry, be assured that it is not only a present evil, but that you have increased a habit.
Friday, June 06, 2008
Paradoxical Commandments
The Paradoxical Commandments by Dr. Kent M. Keith
People are illogical, unreasonable, and self-centered.
Love them anyway.
If you do good, people will accuse you of selfish ulterior motives.
Do good anyway.
If you are successful, you will win false friends and true enemies.
Succeed anyway.
The good you do today will be forgotten tomorrow.
Do good anyway.
Honesty and frankness make you vulnerable.
Be honest and frank anyway.
The biggest men and women with the biggest ideas can be shot down by the smallest men and women with the smallest minds.
Think big anyway.
People favor underdogs but follow only top dogs.
Fight for a few underdogs anyway.
What you spend years building may be destroyed overnight.
Build anyway.
People really need help but may attack you if you do help them.
Help people anyway.
Give the world the best you have and you’ll get kicked in the teeth.
Give the world the best you have anyway.
People are illogical, unreasonable, and self-centered.
Love them anyway.
If you do good, people will accuse you of selfish ulterior motives.
Do good anyway.
If you are successful, you will win false friends and true enemies.
Succeed anyway.
The good you do today will be forgotten tomorrow.
Do good anyway.
Honesty and frankness make you vulnerable.
Be honest and frank anyway.
The biggest men and women with the biggest ideas can be shot down by the smallest men and women with the smallest minds.
Think big anyway.
People favor underdogs but follow only top dogs.
Fight for a few underdogs anyway.
What you spend years building may be destroyed overnight.
Build anyway.
People really need help but may attack you if you do help them.
Help people anyway.
Give the world the best you have and you’ll get kicked in the teeth.
Give the world the best you have anyway.
Wednesday, June 04, 2008
Programming & Maths
Programming Books
=================
http://www.amazon.com/gp/richpub/syltguides/fullview/13FHH28JQNLRD/ref=cm_syt_dtpa_f_1_rdssss0?pf_rd_p=253457301&pf_rd_s=sylt-center&pf_rd_t=201&pf_rd_i=0139798099&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0E0JVZ79T9VVSWCWE296
1. Structure and Interpretation of Computer Programs by Harold Abelson
2. Art of Computer Programming - D.E. Knuth
3. Computer Organization and Architecture by William Stallings
4. C Programming Language
5. Advanced Programming in the UNIX Environment
6. Thinking in C++
Mathematical Books (for Programmers)
==================
http://www.amazon.com/exec/obidos/tg/guides/guide-display/-/3MLMYHG1P537N/ref=cm_bg_em_vg_htm_btm/
1. Polynomials (Problem Books in Mathematics) by E.J. Barbeau
2. Calculus, Vol. 1 by Tom M. Apostol
3. Calculus, Vol. 2 by Tom M. Apostol
4. How to Solve It: A New Aspect of Mathematical Method by G. Polya
5. Basic Notions of Algebra by I.R. Shafarevich
6. Discrete Mathematics and Its Applications by Kenneth H. Rosen
7. Mathematical Analysis by Tom M. Apostol
8. Introduction to Analytic Number Theory by Tom M. Apostol
=================
http://www.amazon.com/gp/richpub/syltguides/fullview/13FHH28JQNLRD/ref=cm_syt_dtpa_f_1_rdssss0?pf_rd_p=253457301&pf_rd_s=sylt-center&pf_rd_t=201&pf_rd_i=0139798099&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0E0JVZ79T9VVSWCWE296
1. Structure and Interpretation of Computer Programs by Harold Abelson
2. Art of Computer Programming - D.E. Knuth
3. Computer Organization and Architecture by William Stallings
4. C Programming Language
5. Advanced Programming in the UNIX Environment
6. Thinking in C++
Mathematical Books (for Programmers)
==================
http://www.amazon.com/exec/obidos/tg/guides/guide-display/-/3MLMYHG1P537N/ref=cm_bg_em_vg_htm_btm/
1. Polynomials (Problem Books in Mathematics) by E.J. Barbeau
2. Calculus, Vol. 1 by Tom M. Apostol
3. Calculus, Vol. 2 by Tom M. Apostol
4. How to Solve It: A New Aspect of Mathematical Method by G. Polya
5. Basic Notions of Algebra by I.R. Shafarevich
6. Discrete Mathematics and Its Applications by Kenneth H. Rosen
7. Mathematical Analysis by Tom M. Apostol
8. Introduction to Analytic Number Theory by Tom M. Apostol
Tuesday, June 03, 2008
My Physics Interest
One of the subject which I love during my school days is Physics. And One of the Subject I love during my college days is Maths (esp. Calculus). But If you ask me what is my score in these subjects in my 10th and +2, I'm a very below average performer.
When I ask myself why I was not able to perform much in my school days, I could say that its the teachers fault in my school. I thinks it is the same fate with every school in India.
Why do one LEARN ? For me "To Learn is to understand." But in schools esp. in India "To Learn" is to "To Memorize." This is the same reason, why I'm able to shine better in Computer Science, because I Understand What I learn. I was able score good marks passed with distinction in my B.Sc (Computer Science) and M.C.A. by understanding.
As a Science subject, Physics is more interesting to me than Chemistry. My interest are more into Astronomy (yes, I know how to identify Big Dipper and Little Dipper. I learned it from a Russian Books (Ursa Major, Ursa Minor)) and Relativity Theory. Here are some of the Good Links for understanding Physics (which I browsed today):
http://www.einstein-online.info/en/elementary/index.html
http://staff.washington.edu/aganse/blog/files/relativityintro.html
http://staff.washington.edu/aganse/blog/files/centrip.html
When I ask myself why I was not able to perform much in my school days, I could say that its the teachers fault in my school. I thinks it is the same fate with every school in India.
Why do one LEARN ? For me "To Learn is to understand." But in schools esp. in India "To Learn" is to "To Memorize." This is the same reason, why I'm able to shine better in Computer Science, because I Understand What I learn. I was able score good marks passed with distinction in my B.Sc (Computer Science) and M.C.A. by understanding.
As a Science subject, Physics is more interesting to me than Chemistry. My interest are more into Astronomy (yes, I know how to identify Big Dipper and Little Dipper. I learned it from a Russian Books (Ursa Major, Ursa Minor)) and Relativity Theory. Here are some of the Good Links for understanding Physics (which I browsed today):
http://www.einstein-online.info/en/elementary/index.html
http://staff.washington.edu/aganse/blog/files/relativityintro.html
http://staff.washington.edu/aganse/blog/files/centrip.html
Wednesday, May 21, 2008
C/C++ If statement
Lately, I was been reading C/C++ Coding Styles. It talks about parenthesis-ing, spacing, alignment, etc...
I also recommends some common software practices, such as putting the numerical constant first in the comparison statements like if, while, for and ?:
for example:
Why does it emphasize this rule ? It will help you to avoid ambiguous assignments in the conditional statements.
A common mistake in for loop
=====================
whenever we write "for" loop we are tend to use the post-fix operator ++ instead of pre-fix ++. First one need to understand what is the difference between i++ and ++i, and when to use what.
i++ is more complex and takes more clock cycles than ++i. So please make it a habit to use ++i instead of i++, this may make your code a little bit faster.
I also recommends some common software practices, such as putting the numerical constant first in the comparison statements like if, while, for and ?:
for example:
if (1000 < stack_size) {
...
}
while (10 != num) {
...
}
for (int i=0; 20 == value; ++i) {
...
}
Why does it emphasize this rule ? It will help you to avoid ambiguous assignments in the conditional statements.
A common mistake in for loop
=====================
for(int i=0;i < X; i++)
whenever we write "for" loop we are tend to use the post-fix operator ++ instead of pre-fix ++. First one need to understand what is the difference between i++ and ++i, and when to use what.
i++ is more complex and takes more clock cycles than ++i. So please make it a habit to use ++i instead of i++, this may make your code a little bit faster.
Monday, May 19, 2008
My Birthday and Pat & Stan
I have done my birthday shopping last weekend. Tomorrow (21-may) is my 30th birthday. hmm...
I feel good,
Miles to go before I sleep,
Miles to go before I sleep ....
My kid Rohan and myself love watching The Owl and Pat&Stan from JetX Channel. The imaginative work involved in these cartoons are very cool. I have a Pat&Stan singing "In the jungle" in my blog.
I'm making steady progress in my goals and objectives in my life. It is very slow, but very steady.
1. I'm doing meditation on the weekends
2. Solved 1 ACM (2062) last week
3. Reading The C++ Programming Language
I feel good,
Miles to go before I sleep,
Miles to go before I sleep ....
My kid Rohan and myself love watching The Owl and Pat&Stan from JetX Channel. The imaginative work involved in these cartoons are very cool. I have a Pat&Stan singing "In the jungle" in my blog.
I'm making steady progress in my goals and objectives in my life. It is very slow, but very steady.
1. I'm doing meditation on the weekends
2. Solved 1 ACM (2062) last week
3. Reading The C++ Programming Language
Wednesday, May 14, 2008
Make "make" work for you
Make - tool to control the compilation and creation of executables. I was hacking into this tool for quite sometime. I feel "make" is good for all the linux/unix c/c++ programmers.
Here is a simple Tutorial of Make:
source file (helloworld.c)
========
#include ...
int main() {
using namespace std;
cout<<"hello world\n"; return 0;
}
simple makefile(gnumakefile/makefile)
===========
helloworld: helloworld.c
TAB g++ -o helloworld helloworld.c
TAB - is important, otherwise gnumake will prompt for error.
command
=======
make TARGET
make helloworld
Example 2
========
/* sum.c */
int sum(int a, int b) {
return a+b;
}
/* diff.c */
int diff(int a, int b) {
return a-b;
}
/* main.c */
int main() {
...
c=sum(20,30);
...
d=diff(30,23);
...
}
/* Make file */
CC = g++ /* which compiler*/
CFLAGS = -Wall -g -ansi /* compiler flags */
sum.o: sum.c
$(CC) $(CFLAGS) -c -o $@ $<
diff.o: diff.c
$(CC) $(CFLAGS) -c -o $@ $<
main: sum.o diff.o main.c
$(CC) $(CFLAGS) -o $@ $^
clean:
-rm core *.o main
Special Tags
=========
$@ -- current target name
$LT -- First name of the prerequisite
$^ -- List of all prerequisite
$* -- List of all prerequisite (without prefix)
So, dudes, start using make. It is cool, it makes life a lot easier for c/c++ programmers.
Here is a simple Tutorial of Make:
source file (helloworld.c)
========
#include ...
using namespace std;
cout<<"hello world\n"; return 0;
}
simple makefile(gnumakefile/makefile)
===========
helloworld: helloworld.c
command
=======
make TARGET
make helloworld
Example 2
========
/* sum.c */
int sum(int a, int b) {
return a+b;
}
/* diff.c */
int diff(int a, int b) {
return a-b;
}
/* main.c */
int main() {
...
c=sum(20,30);
...
d=diff(30,23);
...
}
/* Make file */
CC = g++ /* which compiler*/
CFLAGS = -Wall -g -ansi /* compiler flags */
sum.o: sum.c
$(CC) $(CFLAGS) -c -o $@ $<
diff.o: diff.c
$(CC) $(CFLAGS) -c -o $@ $<
main: sum.o diff.o main.c
$(CC) $(CFLAGS) -o $@ $^
clean:
-rm core *.o main
Special Tags
=========
$@ -- current target name
$LT -- First name of the prerequisite
$^ -- List of all prerequisite
$* -- List of all prerequisite (without prefix)
So, dudes, start using make. It is cool, it makes life a lot easier for c/c++ programmers.
Monday, May 12, 2008
My Study on Virtue
We use some words without knowing what is the exact meaning of it. One such word is Virtue, What does it mean ?
Virtue - it stands for Moral Excellence of a person.
The four cardinal (hinge) virtues are
1. Justice
2. Courage
3. Wisdom
4. Moderation
The four classic Western cardinal virtues are:
1. Temperance - Self discipline
2. Prudence - Wisdom
3. Fortitude - Courage
4. Justice
Buddhist practice as outlined in the Noble Eightfold Path can be regarded as a progressive list of virtues.
1. Right Viewpoint - Realizing the Four Noble Truths
2. Right Values - Commitment to mental and ethical growth in moderation
3. Right Speech - One speaks in a non hurtful, not exaggerated, truthful way
4. Right Actions - Wholesome action, avoiding action that would do harm
5. Right Livelihood - One's job does not harm in any way oneself or others; directly or indirectly
6. Right Effort - One makes an effort to improve
7. Right Mindfulness - Mental ability to see things for what they are with clear consciousness
8. Right Meditation - State where one reaches enlightenment and the ego has disappeared
The Four Noble Truth:
1. The Nature of Suffering
2. Suffering's Origin
3. Suffering's Cessation
4. The Way Leading to the Cessation of Suffering - (It is the Noble Eightfold Path)
Capital Vices
1. Pride or Vanity — an excessive love of self
2. Avarice (covetousness, Greed) — a desire to possess more than one has need
3. Lust — excessive sexual desire. "lust detracts from true love".
4. Wrath or Anger — feelings of hatred, revenge or even denial, as well as punitive desires outside of justice
5. Gluttony — overindulgence in food, drink or intoxicants, or misplaced desire of food as a pleasure for its sensuality
6. Envy or jealousy - resentment of others for their possessions "Love of one's own good perverted to a desire to deprive other men of theirs")
7. Sloth or Laziness - idleness and wastefulness of time allotted. Laziness is condemned because others have to work harder and useful work can not get done.
----- Collected from Wiki ----
Virtue - it stands for Moral Excellence of a person.
The four cardinal (hinge) virtues are
1. Justice
2. Courage
3. Wisdom
4. Moderation
The four classic Western cardinal virtues are:
1. Temperance - Self discipline
2. Prudence - Wisdom
3. Fortitude - Courage
4. Justice
Buddhist practice as outlined in the Noble Eightfold Path can be regarded as a progressive list of virtues.
1. Right Viewpoint - Realizing the Four Noble Truths
2. Right Values - Commitment to mental and ethical growth in moderation
3. Right Speech - One speaks in a non hurtful, not exaggerated, truthful way
4. Right Actions - Wholesome action, avoiding action that would do harm
5. Right Livelihood - One's job does not harm in any way oneself or others; directly or indirectly
6. Right Effort - One makes an effort to improve
7. Right Mindfulness - Mental ability to see things for what they are with clear consciousness
8. Right Meditation - State where one reaches enlightenment and the ego has disappeared
The Four Noble Truth:
1. The Nature of Suffering
2. Suffering's Origin
3. Suffering's Cessation
4. The Way Leading to the Cessation of Suffering - (It is the Noble Eightfold Path)
Capital Vices
1. Pride or Vanity — an excessive love of self
2. Avarice (covetousness, Greed) — a desire to possess more than one has need
3. Lust — excessive sexual desire. "lust detracts from true love".
4. Wrath or Anger — feelings of hatred, revenge or even denial, as well as punitive desires outside of justice
5. Gluttony — overindulgence in food, drink or intoxicants, or misplaced desire of food as a pleasure for its sensuality
6. Envy or jealousy - resentment of others for their possessions "Love of one's own good perverted to a desire to deprive other men of theirs")
7. Sloth or Laziness - idleness and wastefulness of time allotted. Laziness is condemned because others have to work harder and useful work can not get done.
----- Collected from Wiki ----
Subscribe to:
Posts (Atom)