FizzBuzz

    This post is inspired by  Jeff Atwood's blog post Why Can't Programmers.. Program? So I thought of writing a FizzBuzz myself. I was successful (according to me ;) ) in writing those, but later after some googling I understood there was a better way for it. The code I presented here is the latest version and you can checkout my initial version of  FizzBuzz here. If you are interested more, you can check out the more complex versions of FizzBuzz in a reddit discussion.


FizzBuzz in ruby

FizzBuzz in Python

FizzBuzz in PHP

If you have a better version, please share it with me.
Thank you

Install Feedzirra on ubuntu

Last day when I tried to install Feedzirra gem, I faced some dependency issues due to some missing libraries in ubuntu. After some googling I just got it installed. Here I listed out all the dependencies and procedures to successful installation of Feedzirra.

You can install the dependencies using the following command


Now try to install Feedzirra gem.



install rvm readline on ubuntu

     I always get frustrated while installing readline package for rvm and need a bunch of googling for successful installation. So I thought of no more googling for this stuff and I just noted step by step procedures for doing it with ease. This post assumes that you already setup rvm and ruby on your workstations and using Ubuntu.

The Prerequisites
     You need to install the following packages as prerequisites for readline package. Choose the prerequisites according to the Ubuntu version.

Ubuntu 11.04
  • libncurses5-dev
  • libreadline5-dev 
use the following command to install those prerequisites
Ubuntu 11.10
      If you are using ubuntu 11.10 and rvm 1.10.0 then try using rvm requirements command to find all the dependencies. For readline we require only the two packages which are listed below.
  • libreadline-gplv2-dev
  • lib64readline-gplv2-dev 
use the following command to install those prerequisites
Common for both Ubuntu 11.10 and Ubuntu 11.04
      ncurses-dev package is common for both Ubuntu 11.04 and 11.10.

Installing readline
     Now the prerequisites are over. Now we can install the readline package

Configuring readline
     Use the following commands to configure readline. The directory may change accordingly to which ruby version you are configuring readline.