The dip

I just finished reading "The dip".  It is a really small book and the  material is light. You could finish reading the entire book  in 3 - 4  sittings if you want.  I think it is a good read but honestly, I was expecting more out of it. Here is what I got out of the book. 1. You have to quit doing things which you know you can't be best at so that you can focus all your energy on something you can excel in. 2. Majority of the people quit when they are in a dip. So, don't quit when you are having trouble staying afloat. 3. If you keep quitting, it becomes a habit. Don't get into that mode. Think hard before even getting into something. At the end, I was still disappointed with this book. No doubt, it gives some good anecdotes about how people quit things to concentrate on something they badly wanted and how they succeeded  in it and stuff. But it never tells you how to recognise that you are in a culdesac and not a dip. You cut when you are in culdesac and you don't quit when you are in a dip. The million dollar question is,  when you are in the middle of something and you are having a hard time, how do you differentiate between the two? Update: I forgot one big point he makes in the book. People who are experts in one thing are so much more valuable than generics (jack of all trades).  He gives some compelling examples for this. I completely agree with it. Quit everything else to become a master in one. If there is anyone out there who has read this book, you are welcome to answer my question. Seth - If you happen to run into this blog post, feel free to answer my question ;) Have a good weekend! Mahesh Murthy

Bug in my laundry swipe card

So, I had a balance of  $0.75 in my laundry card and I went confidently to the laundry room to put my clothes go through the torturous dryer once again. The cost of dryer is $.50.  Any normal human being would think that 50 < 75 and so it should magically work. But guess what, I got a nice error message saying "INSUF FUNDS"!!!  zkupbneygouiegashab??????? I am trying to think, what the engineer who wrote that piece of code was thinking? Or wait, may be it is configurable in which case what was the person who has control of configuring it thinking?? Seriously, what is it? Here are some things I can think of. 1.  if(fundsInCard < 1.0) { print "INSUF FUNDS"; } Seriously, if this is how it is coded, there is only one option. Fire that guy who wrote this. 2.   Now, with inflation the costs go up. So, in the next 6 months the price for dryer might be $1.00. So, they just configured it for $1.00??? That doesn't make any sense. But hey, I am just brainstorming here. That is all I can think of. If you know what could have gone wrong, where the bug is, let me know. May be the owner of that card reader company will read my blog and post a comment. May be the guy who wrote the code or may be the person who configured it will post a comment.  hmm .. what are the chances of that happening.  Let's see. On average, there is one comment per post on my blog. That means, there might be a grand total of  "1" comment for this post. Now, taking into consideration that the owner, configurer, coder is just one out of say 5000000 people in this counry and the considering the chances of him reading blogs at the first place and then considering he bumps into my awesome blog, the probability is pretty close to "ZERO".  Feel free to correct me if I am wrong. On that note, have a good day! Mahesh Murthy

restful authentication rails

I just followed the screencast for restful authentication and it is really straightforward. Even though it is for rails 1.x, it works for 2.x since the plugin is updated. The only problem I had was when I tried signin, it was giving me "uninitialized constant SessionController" error.  I had to change my  routes.rb file to add the controller name like below: map.resource :session, :controller => 'session' rails by deafult assumes that the controller is sessions (plural) but I had to force it to be singular. It works like a charm now! I am going to tweak it fit my application now. In the process, I also learnt to add plugin repositories to your application so that it is easy to pull in plugins. Here is an example. script/plugin source http://svn.techno-weenie.net/projects/plugins script/plugin install restful_authentication

spam comments

In the past few weeks, the number of spam comments posted on my site has increased. I wonder what happened recently. Not that I am posting some really good posts and the popularity of my site went up. I upgraded my wordpress recently. That's all. Nothing else. Anyway, I was reading the wikipedia article on spam in blogs . It has some tips on how to combat it. I am sure there are tons of plugins out there to combat this menace. I am going to look for it today sometime. If you know of any popular wordpress plugin which does a good job, let me know.

git-start

I am using git on my hostmonster shared server for my personal rails projects. I have started liking it already. Well, the only other source control system I have really used is accurev (at work). So, not much to compare I guess. I like the idea of branching in git where you can kinda have two different workspaces in same place. It took a minute to digest that but in the end, I got it. It is so cool. As of now, I have only been doing the basic things. Hope to explore more of git soon.

Welcome back me

Happy new year to all! I am back from vacation to India. I shall start blogging seriously this time. The latest update is that I just ordered 2 more books on amazon. 1. The Dip: A Little Book That Teaches You When to Quit (and When to Stick) 2. Pragmatic Thinking and Learning: Refactor Your Wetware (Pragmatic Programmers) The second one, I will be reading in the book club at work. The first one, I bought because I am a big fan of Seth Godin. If you don't read his blog, you are missing out seriously.