I recently read 'Who will cry when you die?' book written by Robin Sharma - the author of the best seller 'The Monk who sold his Ferrari'. The book is a collection of 101 life lessons explained in a very short but succinct manner. Even if we practice only some of these lessons in our day to day life, it will certainly enrich the quality of our personal and professional life. Listing some of the lessons that I liked the most:-
- Start Your Day Well
- Talk to Yourself
- Remember, Genius Is 99 Percent Inspiration
- Get Up Early
- Laugh More
- Spend a Day Without Your Watch
- Take More Risks
- Live a Life
- Always Carry a Book with You
- Enjoy the Path, Not Just the Reward
- Get Good at Asking
- Connect with Nature
- Use Your Commute Time
- Get Serious About Setting Goals
- Walk in the Woods
- Listen to Music Daily
- Learn to Meditate
- Stop Complaining and Start Living
- See Your Day as Your Life
- Be Humble
- Don’t Finish Every Book You Start
- Sleep Less
- Learn How to Walk
- Plant a Tree
- Be an Adventurer
- Respect Your Instincts
- Love Your Work
Enjoy reading !
Saturday, October 23, 2010
Tuesday, October 19, 2010
The right perspective
I must thank my friend Sudhir Bangera for sending this very nice story to begin with my day of work. It's actually a food of thought for all ... Sharing the same.
Two brothers grew up in an orphanage. The warden of the institution was a pesky fellow, who would often say terrible things to the children.
Years passed. The little boys grew up to become fine young men, and in time got married and had families of their own.
The elder brother grew up to become bad tempered and gave his family lot of grief. The younger brother, however, turned out to be a good parent and husband. He was successful both in his professional and personal life. People who knew them would express surprise over how the two brothers were so different from each other, in spite of facing the same circumstances while growing up.
The elder brother would say, “The warden, whom we all looked upon as almost a father, set us a bad example. I had no one to guide me, so I couldn’t help but turn out the way he was. It’s not my fault, I have become like him because of my circumstances.”
And, the younger brother would say, “The warden never taught me good values or behavior. But growing up, I made a promise to myself, to hold him as an example of what not to be and to make sure that I don’t to do the things he did.”
How many times have we blamed our failures over bad circumstances or rotten luck? True success and happiness comes from making the best out of a bad situation and looking at things with the right perspective. Look at the brighter side of situations ...
Have a thoughtful day ahead ! :-)
Two brothers grew up in an orphanage. The warden of the institution was a pesky fellow, who would often say terrible things to the children.
Years passed. The little boys grew up to become fine young men, and in time got married and had families of their own.
The elder brother grew up to become bad tempered and gave his family lot of grief. The younger brother, however, turned out to be a good parent and husband. He was successful both in his professional and personal life. People who knew them would express surprise over how the two brothers were so different from each other, in spite of facing the same circumstances while growing up.
The elder brother would say, “The warden, whom we all looked upon as almost a father, set us a bad example. I had no one to guide me, so I couldn’t help but turn out the way he was. It’s not my fault, I have become like him because of my circumstances.”
And, the younger brother would say, “The warden never taught me good values or behavior. But growing up, I made a promise to myself, to hold him as an example of what not to be and to make sure that I don’t to do the things he did.”
How many times have we blamed our failures over bad circumstances or rotten luck? True success and happiness comes from making the best out of a bad situation and looking at things with the right perspective. Look at the brighter side of situations ...
Have a thoughtful day ahead ! :-)
Sunday, October 17, 2010
Panoramic view of Naigara falls
Saturday, October 16, 2010
Mount Washington photos
On October 2, 2010, my wife and I visited Mount Washington (New Hampshire) along with my friends. Mt. Washington is the highest peak in the Northeastern United States. (6288 ft). It was a wonderful experience that can not be expressed in the words. I have tried to capture the nature's beauty in my camera! Sharing some photos...








Friday, October 15, 2010
We do not have enough time to improve ?
I was reading a book - 'Who will cry when you die?' by Robin Sharma and came across a very nice and thought provoking quote by him :-
"Saying that you don't have time to improve your thoughts and your life is like saying you don't have time to stop for gas because you are too busy driving. Eventually it will catch up with you."
I am sure reading this quote must have started a thought cycle in your mind !
"Saying that you don't have time to improve your thoughts and your life is like saying you don't have time to stop for gas because you are too busy driving. Eventually it will catch up with you."
I am sure reading this quote must have started a thought cycle in your mind !
Monday, October 11, 2010
Analyze your app performance with newrelic_rpm
I used newrelic_rpm(2.13.1) (http://www.newrelic.com/) - Ruby performance management system in my rails application to find out the performance bottlenecks and it helped me a lot.
First, it took me only 2 minutes to set up newrelic into my application. Second, the detailed level of information that it provided helped me to debug at granular level starting from sql query execution time to individual template load time. I also liked the Pie chart representation of the analysis.
Here are the installation steps :-
http://support.newrelic.com/faqs/docs/ruby-agent-installation
Readme doc :-
http://github.com/newrelic/rpm/blob/master/README.rdoc
First, it took me only 2 minutes to set up newrelic into my application. Second, the detailed level of information that it provided helped me to debug at granular level starting from sql query execution time to individual template load time. I also liked the Pie chart representation of the analysis.
Here are the installation steps :-
http://support.newrelic.com/faqs/docs/ruby-agent-installation
Readme doc :-
http://github.com/newrelic/rpm/blob/master/README.rdoc
Thursday, September 30, 2010
Moving rails app from 2.3.5 to 2.3.9
In my last post, at the end, I mentioned about migrating my rails app from version 2.3.5 to 2.3.9 for making it more closer to rails 3.0. I worked on the same and it went well. I localized rack-1.1.0 version as rails 2.3.9 has this dependency. Most of the steps that I followed were similar to my earlier post except the change in version number.
Listing the deprecation warnings that need to be fixed that I received during the migration :-
(1) DEPRECATION WARNING: Giving :session_key to SessionStore is deprecated, please
use :key instead. (called from new at app_root/vendor/rails/actionpack/lib/action_controller/middleware_stack.rb:72)
Change :session_key to :key in environment.rb file :-
config.action_controller.session = {
:key => '_radar_session',
:secret => '271c2f352da72.....'
}
(2) DEPRECATION WARNING: config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
Change in the environment.rb file :-
From config.load_paths to config.autoload_paths
(3) DEPRECATION WARNING: Date#last_month is deprecated and has been removed in Rails 3, please use Date#prev_month instead. (called from ./spec/models/my_model_name_spec.rb:10)
(4) DEPRECATION WARNING: Time#last_month is deprecated and has been removed in Rails 3, please use Time#prev_month instead. (called from ./spec/models/my_model_name_spec.rb:41)
Here are the actual changes in rails 2.3.9 :-
app_root\vendor\rails\activesupport\lib\active_support\core_ext\date\calculations.rb
(5) DEPRECATION WARNING: Rake tasks in vendor/plugins/xss_terminate/tasks are deprecated. Use lib/tasks instead. (called from app_root/vendor/rails/railties/lib/tasks/rails.rb:10)
Move the tasks folder inside the lib folder of the plugin directory and the deprecation warning should go away. But you may need to change some require file paths according to new placement of tasks folder.
(6) DEPRECATION WARNING: Object#returning has been deprecated in favor of Object#tap. (called from helper at app_root/vendor/gems/rspec-rails-1.3.0/lib/spec/rails/example/helper_example_group.rb:59)
I googled around for this deprecation warning and found some useful articles. Sharing one of those articles :-
Upgrading to Rails 3: Beware of the Object#tap pattern
http://feeds.simonecarletti.com/simonecarletti/en
I also tried with rspec-rails-1.3.2 gem, but it also threw same deprecation warning. So I just opened the corresponding class and extended the implementation as :-
From
@helper_object ||= returning HelperObject.new do |helper_object|
To
@helper_object ||= HelperObject.new.tap do |helper_object|
I made similar change for app_root\vendor\gems\rspec-rails-1.3.0\lib\spec\rails\mocks.rb :-
From
returning model_class.new do |model|
To
model_class.new.tap do |model|
Now, I am much closer to moving my app to Rails 3.0 version :-)
Listing the deprecation warnings that need to be fixed that I received during the migration :-
(1) DEPRECATION WARNING: Giving :session_key to SessionStore is deprecated, please
use :key instead. (called from new at app_root/vendor/rails/actionpack/lib/action_controller/middleware_stack.rb:72)
Change :session_key to :key in environment.rb file :-
config.action_controller.session = {
:key => '_radar_session',
:secret => '271c2f352da72.....'
}
(2) DEPRECATION WARNING: config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
Change in the environment.rb file :-
From config.load_paths to config.autoload_paths
(3) DEPRECATION WARNING: Date#last_month is deprecated and has been removed in Rails 3, please use Date#prev_month instead. (called from ./spec/models/my_model_name_spec.rb:10)
(4) DEPRECATION WARNING: Time#last_month is deprecated and has been removed in Rails 3, please use Time#prev_month instead. (called from ./spec/models/my_model_name_spec.rb:41)
Here are the actual changes in rails 2.3.9 :-
app_root\vendor\rails\activesupport\lib\active_support\core_ext\date\calculations.rb
(5) DEPRECATION WARNING: Rake tasks in vendor/plugins/xss_terminate/tasks are deprecated. Use lib/tasks instead. (called from app_root/vendor/rails/railties/lib/tasks/rails.rb:10)
Move the tasks folder inside the lib folder of the plugin directory and the deprecation warning should go away. But you may need to change some require file paths according to new placement of tasks folder.
(6) DEPRECATION WARNING: Object#returning has been deprecated in favor of Object#tap. (called from helper at app_root/vendor/gems/rspec-rails-1.3.0/lib/spec/rails/example/helper_example_group.rb:59)
I googled around for this deprecation warning and found some useful articles. Sharing one of those articles :-
Upgrading to Rails 3: Beware of the Object#tap pattern
http://feeds.simonecarletti.com/simonecarletti/en
I also tried with rspec-rails-1.3.2 gem, but it also threw same deprecation warning. So I just opened the corresponding class and extended the implementation as :-
From
@helper_object ||= returning HelperObject.new do |helper_object|
To
@helper_object ||= HelperObject.new.tap do |helper_object|
I made similar change for app_root\vendor\gems\rspec-rails-1.3.0\lib\spec\rails\mocks.rb :-
From
returning model_class.new do |model|
To
model_class.new.tap do |model|
Now, I am much closer to moving my app to Rails 3.0 version :-)
Tuesday, September 28, 2010
Migrating rails app from 2.2.2 to 2.3.5
I recently migrated my rails app from rails version 2.2.2 to 2.3.5. I enjoyed the work as it was a good learning for me. Listing the steps that I followed and some issues that I faced during the migration.
Gems installed on my windows machine :-
mongrel (1.1.5 x86-mingw32)
rake (0.8.7)
rack (1.0.1)
rubygems-update (1.3.7)
(1) I installed rails :-
gem install rails -v=2.3.5
(2) Deleted rails folder (2.2.2) from app/vendor.
environment.rb file -
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
Go to the project root and execute :-
rake rails:update --trace
It will update some js files and also renames application.rb to application_controller.rb
** Invoke rails:update (first_time)
** Invoke rails:update:scripts (first_time)
** Execute rails:update:scripts
** Invoke rails:update:javascripts (first_time)
** Execute rails:update:javascripts
** Invoke rails:update:configs (first_time)
** Execute rails:update:configs
** Invoke rails:update:application_controller (first_time)
** Execute rails:update:application_controller
app_root/app/controllers/application.rb has been renamed to app_root/app/controllers/application_controller.rb, update your SCM as necessary
** Execute rails:update
(3) Rename application_spec.rb to application_controller_spec.rb
(4) Localize rails version into the app.
rake rails:freeze:gems
(5) I was having rspec(1.2.3) and rspec-rails(1.2.3) plugins which I removed and installed rspec(1.3.0) and rspec-rails(1.3.0) gems instead and then localized in the app/vendor.
gem install rspec -v 1.3.0
gem install rspec-rails -v 1.3.0
environment.rb file :-
config.gem "rack", :version => "1.0.1"
config.gem "rspec-rails", :lib => false, :version => ">= 1.3.0"
config.gem "rspec", :lib => false, :version => ">= 1.3.0"
Go to the project root and execute :-
rake gems:unpack
(6) I kept a copy of my customized spec/spec_helper.rb file because I wanted to run "ruby script/generate rspec" for upgrading rspec-rails in the app which overwrites these three files :-
* spec/spec.opts
* spec/rcov.opts
* spec/spec_helper.rb
(7) While running the specs, I got flash.now[:message] specs failing.
I added following in the spec/spec_helper.rb file to fix the issue with that spec.
module DisableFlashSweeping
def sweep
end
end
module EnableFlashSweeping
def sweep
keys.each do |k|
unless @used[k]
use(k)
else
delete(k)
@used.delete(k)
end
end
# clean up after keys that could have been left over by calling reject! or shift on the flash
(@used.keys - keys).each{ |k| @used.delete(k) }
end
end
And I used the calls in the spec before the action as :-
it 'should retain the flash message only for the current request' do
controller.instance_eval { flash.extend(DisableFlashSweeping) }
post :create, :work_loc => {:country => "India", :state => "Maharashtra"}
response.should be_success
flash[:message].should == "Error in Loc mapping!"
end
(8) I changed in rspec from
response.should render_template(:states) '
TO
controller.should_receive(:render).with(:partial => 'states')
(9) Changed response.headers["Status"] to response.status in some of the controller specs.
(10) I got one deprecation warning about formatted_url :-
DEPRECATION WARNING: formatted_action_name_controller_name_url() has been deprecated. Please pass format to the standard action_name_controller_name_url method instead..
So changed :action from
:action => formatted_action_name_controller_name_url('js')
to
:action => action_name_controller_name_url(:format => 'js')
Now, along with the rspecs, my app is looking good with rails 2.3.5
Planning to go ahead with migrating to 2.3.9 to make the app more closer to Rails 3.0.
Gems installed on my windows machine :-
mongrel (1.1.5 x86-mingw32)
rake (0.8.7)
rack (1.0.1)
rubygems-update (1.3.7)
(1) I installed rails :-
gem install rails -v=2.3.5
(2) Deleted rails folder (2.2.2) from app/vendor.
environment.rb file -
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
Go to the project root and execute :-
rake rails:update --trace
It will update some js files and also renames application.rb to application_controller.rb
** Invoke rails:update (first_time)
** Invoke rails:update:scripts (first_time)
** Execute rails:update:scripts
** Invoke rails:update:javascripts (first_time)
** Execute rails:update:javascripts
** Invoke rails:update:configs (first_time)
** Execute rails:update:configs
** Invoke rails:update:application_controller (first_time)
** Execute rails:update:application_controller
app_root/app/controllers/application.rb has been renamed to app_root/app/controllers/application_controller.rb, update your SCM as necessary
** Execute rails:update
(3) Rename application_spec.rb to application_controller_spec.rb
(4) Localize rails version into the app.
rake rails:freeze:gems
(5) I was having rspec(1.2.3) and rspec-rails(1.2.3) plugins which I removed and installed rspec(1.3.0) and rspec-rails(1.3.0) gems instead and then localized in the app/vendor.
gem install rspec -v 1.3.0
gem install rspec-rails -v 1.3.0
environment.rb file :-
config.gem "rack", :version => "1.0.1"
config.gem "rspec-rails", :lib => false, :version => ">= 1.3.0"
config.gem "rspec", :lib => false, :version => ">= 1.3.0"
Go to the project root and execute :-
rake gems:unpack
(6) I kept a copy of my customized spec/spec_helper.rb file because I wanted to run "ruby script/generate rspec" for upgrading rspec-rails in the app which overwrites these three files :-
* spec/spec.opts
* spec/rcov.opts
* spec/spec_helper.rb
(7) While running the specs, I got flash.now[:message] specs failing.
I added following in the spec/spec_helper.rb file to fix the issue with that spec.
module DisableFlashSweeping
def sweep
end
end
module EnableFlashSweeping
def sweep
keys.each do |k|
unless @used[k]
use(k)
else
delete(k)
@used.delete(k)
end
end
# clean up after keys that could have been left over by calling reject! or shift on the flash
(@used.keys - keys).each{ |k| @used.delete(k) }
end
end
And I used the calls in the spec before the action as :-
it 'should retain the flash message only for the current request' do
controller.instance_eval { flash.extend(DisableFlashSweeping) }
post :create, :work_loc => {:country => "India", :state => "Maharashtra"}
response.should be_success
flash[:message].should == "Error in Loc mapping!"
end
(8) I changed in rspec from
response.should render_template(:states) '
TO
controller.should_receive(:render).with(:partial => 'states')
(9) Changed response.headers["Status"] to response.status in some of the controller specs.
(10) I got one deprecation warning about formatted_url :-
DEPRECATION WARNING: formatted_action_name_controller_name_url() has been deprecated. Please pass format to the standard action_name_controller_name_url method instead..
So changed :action from
:action => formatted_action_name_controller_name_url('js')
to
:action => action_name_controller_name_url(:format => 'js')
Now, along with the rspecs, my app is looking good with rails 2.3.5
Planning to go ahead with migrating to 2.3.9 to make the app more closer to Rails 3.0.
Tuesday, September 21, 2010
The Last Lecture by Randy Pausch
Today I received an email from my uncle about The Last Lecture by Randy Pausch. I was wondering why I did not get this email from anyone else before as it seems a quite old email. It's ok ! The important thing is I got a chance to read Randy's simple but succinct view points about life. I can not resist myself to share those with all.
----
On September 18, 2007, Carnegie Mellon professor and alumnus Randy Pausch delivered a one-of-a-kind last lecture that made the world stop and pay attention. It became an Internet sensation viewed by millions, an international media story, and a best-selling book "The Last Lecture" that has been published in 35 languages. To this day, people everywhere continue to talk about Randy, share his message and put his life lessons into action in their own lives.
In a letter to his wife Jai and his children, Dylan, Logan , and Chloe, he wrote this beautiful "guide to a better life" for his wife and children to follow. May you be blessed by his insight.
POINTS ON HOW TO IMPROVE YOUR LIFE
Personality:
1. Don't compare your life to others'. You have no idea what their journey is all about.
2. Don't have negative thoughts of things you cannot control. Instead invest your energy in the positive present moment
3. Don't over do; keep your limits
4. Don't take yourself so seriously; no one else does
5. Don't waste your precious energy on gossip
6. Dream more while you are awake
7. Envy is a waste of time. You already have all you need..
8. Forget issues of the past. Don't remind your partner of his/her mistakes of the past. That will ruin your present happiness.
9. Life is too short to waste time hating anyone. Don't hate others.
10. Make peace with your past so it won't spoil the present
11. No one is in charge of your happiness except you
12. 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.
13. Smile and laugh more
14. You don't have to win every argument. Agree to disagree.
Community:
15. Call your family often
16. Each day give something good to others
17. Forgive everyone for everything
18. Spend time with people over the age of 70 & under the age of 6
19. Try to make at least three people smile each day
20. What other people think of you is none of your business
21. Your job will not take care of you when you are sick. Your family and friends will. Stay in touch.
Life:
22. Put GOD first in anything and everything that you think, say and do.
23. GOD heals everything
24. Do the right things
25. However good or bad a situation is, it will change
26. No matter how you feel, get up, dress up and show up
27. The best is yet to come
28. Get rid of anything that isn't useful, beautiful or joyful
29. When you’re awake alive in the morning, thank GOD for it
30. If you know GOD you will always be happy. So, be happy.
Here is the video link as well :-
http://video.google.com/videoplay?docid=-5700431505846055184#
----
On September 18, 2007, Carnegie Mellon professor and alumnus Randy Pausch delivered a one-of-a-kind last lecture that made the world stop and pay attention. It became an Internet sensation viewed by millions, an international media story, and a best-selling book "The Last Lecture" that has been published in 35 languages. To this day, people everywhere continue to talk about Randy, share his message and put his life lessons into action in their own lives.
In a letter to his wife Jai and his children, Dylan, Logan , and Chloe, he wrote this beautiful "guide to a better life" for his wife and children to follow. May you be blessed by his insight.
POINTS ON HOW TO IMPROVE YOUR LIFE
Personality:
1. Don't compare your life to others'. You have no idea what their journey is all about.
2. Don't have negative thoughts of things you cannot control. Instead invest your energy in the positive present moment
3. Don't over do; keep your limits
4. Don't take yourself so seriously; no one else does
5. Don't waste your precious energy on gossip
6. Dream more while you are awake
7. Envy is a waste of time. You already have all you need..
8. Forget issues of the past. Don't remind your partner of his/her mistakes of the past. That will ruin your present happiness.
9. Life is too short to waste time hating anyone. Don't hate others.
10. Make peace with your past so it won't spoil the present
11. No one is in charge of your happiness except you
12. 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.
13. Smile and laugh more
14. You don't have to win every argument. Agree to disagree.
Community:
15. Call your family often
16. Each day give something good to others
17. Forgive everyone for everything
18. Spend time with people over the age of 70 & under the age of 6
19. Try to make at least three people smile each day
20. What other people think of you is none of your business
21. Your job will not take care of you when you are sick. Your family and friends will. Stay in touch.
Life:
22. Put GOD first in anything and everything that you think, say and do.
23. GOD heals everything
24. Do the right things
25. However good or bad a situation is, it will change
26. No matter how you feel, get up, dress up and show up
27. The best is yet to come
28. Get rid of anything that isn't useful, beautiful or joyful
29. When you’re awake alive in the morning, thank GOD for it
30. If you know GOD you will always be happy. So, be happy.
Here is the video link as well :-
http://video.google.com/videoplay?docid=-5700431505846055184#
Sunday, August 1, 2010
Beautiful nature snaps...
Subscribe to:
Posts (Atom)










