andhapp Random ramblings

Spammers have grown up

Getting spam in your e-mail or via comments on your blog is not a new thing. I do it all the time and mine is not even a popular blog and in my case Akismet has caught 20268 up till today. Imagine GigaOm for that matter, they must be bombarded with spam all day long. However, the spam messages have improved over the years and they are no more Viagara, or Enlarge your ... but they are carefully selected and polite. For instance, see below the last couple of spam messages I ‘ve received on this blog:

“How long has this blog been around? I have been searching for this kind of information for the past week and a half.”

That rss feature on your website here is brilliant, you should tell more folks about it in your next post. I haven’t noted it a first, now I’m using it each morning to check on any updates.

They are so soft and nice and I am actually tempted to just accept them just to show how popular my blog is. So, spammers have grown up and gone are the days of nasty spam messages. There might be a few odd ones that fall through Akismet’s trap but the nice once always come through. I have no idea about this shift in the trend but I don’t mind it because it is better to read a nice message before you reject it then a nasty one.

Update: Yet another nice message from the spammers who found this blog. But the contents of the message are legit and polite. Here it is:

This is truly a greatwebsite. I’ve a few myself. I truly love your format. I understand this is off subject however,did you make this design your self,or buy from a social networking site?

Kernighan's law

As per Kernighan’s law:

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

What that means for me?

Either don’t write smart code or stop fixing my bugs because I will never be able to. Perfect!

Install mysql, pg gems with bundler 0.9.x

If you use ruby on rails, at some point you have to install mysql and pg gems (no offences to sqlite) and for some reason I keep forgetting the whole install procedure. Silly me! This post is dedicated to the loss of build_options.yml in bundler 0.9.x and my subsequent struggle and frustration to install mysql and pg gems and the occurence of eureka moment proving why I am still a n00b.

Let us cut to the chase. Bundler is the new gem dependency superhero. If you didn’t know it perhaps you need to wake up and start using that thing they call the feed reader and subscribe to some ruby and rails feeds. The fun of working with open source is that one day you wake up do a git pull and everything stops working. It is quite like your life, everything is going swimmingly and then the most unexpected thing hits you.

Bundler 0.9.x leaves no stone unturned in frustrating you, if you had accustomed to the comfortable 0.8 api. However, after a a while you do realise the benefits of the changes. In 0.8 there was a way to specify build_options (via build_options.yml) to install gems like mysql and pg. That has disappeared in 0.9. I added an issue and you can see how it has taken shape in last few weeks. But what now? I can’t run rails test on my machine now. I was so looking forward to refactor the hell out of active-record’s relation class. I spent quite sometime wondering how the hell can I install mysql and pg gems using bundler.

It is quite simple if you think about it. mysql and pg gems need to know the location of mysql and pg on your machine. It should have been added to the PATH when they are installed but for some reason it did not. So, what you gotta do is simple. Add them to the PATH so when bundler installs them it can resolve the dependencies. Here are the commands:

export PATH=/usr/local/pgsql/bin:${PATH}
export PATH=/usr/local/mysql/bin:${PATH}

And then just run bundler’s install command. Voila!

I am so glad to have figured this out as now I can go back hacking into rails.

Quote of the day

I was reading this article and I had to put this quote on my blog.

Robert A. Heinlein says:

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.

iPad alternative

iPad has been released and does not live up to the expectations. Some call it is going backwards since it is not a multi-tasker. Anyways, I found this company via Reddit which can create a device from your Mac, similar to iPad but a lot better than it. Check it out.