Archive

Archive for the ‘Uncategorized’ Category

theecofind

June 10th, 2010 mahesh No comments

hey all,

Checkout my brand new website theecofind.com. It is an aggregator of all eco friendly products. I have been on the “green” bandwagon lately and thought I should contribute somehow to that movement. So, here it is!

From the technical perspective, it is just a rails app, backed my mysql and I use sphinx for search. As always, one of the plan is to try out new technologies. I have good usecase for using neo4j this time. I am looking forward to doing that! Also, I am getting tired of my hosting provider and the stupid restrictions and might make the move to heroku. That seems to be THE place for hosting rails apps nowadays.

I have also been reading a bit about SEO and marketing lately. See, my last site bombed because I am so awful at marketing. I totally think it was a good idea but of course my market was half way across the world :P Anyway, that is a topic for another blog post altogether. Time to change the strategy a little bit this time! I am also in touch with some vendors who are willing to list their products on my site. That’s a good start isn’t it?!

Feel free to give me feedback, tips, suggestions anything. I would love to hear it. I have a list of features in my backlog. Hope to crank them out all. oh, I should go add a “spread the word” link :P Watch out for more updates!

Cheers,
Mahesh Murthy

Categories: Uncategorized Tags:

Nexus one for existing customers

January 9th, 2010 mahesh No comments

If you are an existing t-mobile customer and are planning to get a nexus one, you probably know by now that you have to pay $279 and not $179 (which is for new customers only). I just can not understand the reasoning behind this. Anyway, since my contract has expired, I thought I can just get on a new plan with a new account if required and get the phone for $179. Guess what, you can’t even do that. After researching on various forums and piecing together, I got my nexus one for just 20 bucks more instead of shelling out 100 bucks!

So, what I did was, I called  tmobile and told them I want to cancel the account and go to another network for 3 months and come back as a new customer. That way I save 100 bucks. I was ok waiting for 3 months to get my hands on that phone. I am excited about that phone but not THAT desperate. It is after all just a phone. But guess what, tmobile was like, it anyway costs 35 bucks or so to activate when I come back as a new customer, so they agreed to give me $45 credit. So, I really put in only 20 bucks more and got the phone! Isn’t that cool? :) Let’s see when google will ship it to me.

If you are an existing customer, try that and see if it works for you as well or if there is any other workaround, I will be curious to know! Well, not really, I already got mine ;)

Cheers,
Mahesh Murthy!

Categories: Uncategorized Tags:

Beyond my understanding!

October 30th, 2009 mahesh No comments

I had a bug in my application where the calculation was a little off from expected. After putting debug statements, I narrowed it down to an interesting behaviour in ruby. Fire up irb and try it out yourself!

irb(main):001:0> (6.725*60*24).to_i
=> 9684
irb(main):002:0> (6.725*24*60).to_i
=> 9683

wtf?

Categories: Uncategorized Tags:

Annoying rails date validation

September 13th, 2009 mahesh No comments

I spent a good amount of time breaking my head over why a date field wasn’t getting set in one of the model after retrieving it’s value from a form. It turns out that if you pass a random string and not an actual date, rails will silently assign a nil to that field without complaining.

For example, I have a class Fact with date fields called from and to. Notice what is happening.

Loading development environment (Rails 2.3.3)
>> fact = Fact.new
=> #<Fact id: nil, from: nil, to: nil, timeToCount: nil, val: nil, remarks: nil, cp_detail_id: nil, created_at: nil, updated_at: nil>
>> fact.from = "foo"
=> "foo"
>> fact
=> #<Fact id: nil, from: nil, to: nil, timeToCount: nil, val: nil, remarks: nil, cp_detail_id: nil, created_at: nil, updated_at: nil>
>> fact.from = DateTime.now
=> Sun, 13 Sep 2009 09:53:29 -0600
>> fact
=> #<Fact id: nil, from: "2009-09-13 09:53:29", to: nil, timeToCount: nil, val: nil, remarks: nil, cp_detail_id: nil, created_at: nil, updated_at: nil>

script/console

Loading development environment (Rails 2.3.3)

>> fact = Fact.new

=> #<Fact id: nil, from: nil, to: nil, timeToCount: nil, val: nil, remarks: nil, cp_detail_id: nil, created_at: nil, updated_at: nil>

>> fact.from = "foo"

=> "foo"

>> fact

=> #<Fact id: nil, from: nil, to: nil, timeToCount: nil, val: nil, remarks: nil, cp_detail_id: nil, created_at: nil, updated_at: nil>

>> fact.from = DateTime.now

=> Sun, 13 Sep 2009 09:53:29 -0600

>> fact

=> #<Fact id: nil, from: "2009-09-13 09:53:29", to: nil, timeToCount: nil, val: nil, remarks: nil, cp_detail_id: nil, created_at: nil, updated_at: nil>

When I assign a value foo, it doesn’t complain but just assigns a nil.  Only if it had complained, I could have saved so much of my brain cells and time. Sigh …

Now, you might ask why am I assigning a foo instead of date. Well, I am still developing and was just putting random values to get the form to work  :P

Anyway, I hope it will help some nOOb like me someday.

Have a good week,
Mahesh Murthy

Categories: Uncategorized Tags:

Upgrade your wordpress plugin

July 8th, 2009 mahesh No comments

If you use wordpress plugin for your website, make sure you are using the latest version of it. If you are lazy like me, chances are that sooner or later your site will be hacked. Yeah, mine was hacked because I had not upgraded in ages. Thankfully my database was intact, so I didn’t lose anything. Here is a good read: http://ocaoimh.ie/did-your-wordpress-site-get-hacked/

have a good day,
Mahesh Murthy

Categories: Uncategorized Tags: