My experience with rails development - Html options with select_hour helper

Nowadays i am showing more interest with twitter bootstrap framework and started implementing in our projects. After facing lot of challenges with Html5 & CSS3, it gives me a lot more confident in working with that.

image

I faced a trivial issue while working with rails but kills more time to fix it. A quick idea raised to share that and here is the post.

Read More

My experience with rails development - rake assets:precompile

As we have released our rails based startup app, our team now focussed towards the payment integration.

While working with the UI integration of the payment screens, i faced an issue which makes me to stuck up with that for an hour. I just want to share my experience about the issue and how i solved that.

Read More

We write small pieces of code that make a test pass. Bad code is hard to test, so if we write the test first, we are less likely to write complex code. Therefore our app will be easier to maintain on the long run.
I read the above point while working on Rails Unit Testing. This is extracted from the lessons learnt by the author and this is the point that need to be keep in mind in software development. I liked this and hence i posted this as a quote.

Our Day-2 Short summary @RubyConfIndia 2012

RubyConfIndia

In this post we (@manimaranm and @anansubu) plan to give our views of Day-2 @RubyConfIndia 2012.

Today we felt more comfortable with venue as well as the ruby folks, and said “Hi” to all new friends whom we got on Day1. 

Ajey Gore started the day two proceedings with a quick welcome note. As the session was ended quickly, we were eagerly waiting for the next session.

Next session was our most awaited one - How to Win? by Mikel Lindsaar. It was awesome. The session was more about on the principles that need to be adapted by the developers in their life in order to win.

All other sessions were good. Among them the speeches given by Niranjan Prabhakar Sarade, Sidu Ponnappa and Aninda Kundu was more informative.

As the closing video keynote was cancelled, the day ended with Lightning Talks.

We took photographs for our memories.  

Overall organizers really done a very good job. Most special thing about them was all were helping the conference attendees with utmost care from the Day-1 morning and kept the momentum going till to the end of Day-2 sessions.

The organizers got feedback from the attendees in order to correct their mistakes in the upcoming conferences. This we felt as a good thing. At the same time, Closing and Networking was not happened as we expected.

As a whole, we had a wonderfull experience at RubyConfIndia 2012. We would also like to give some brief on individual sessions that we liked most in our upcoming posts. Stay tuned..!

Our Day-2 Plan @RubyConfIndia 2012

We both(@manimaranm and @anansubu) are ready for day-2 at @RubyConfIndia 2012. Here is our plan for the day.

We are going to attend the following sessions which we struggled a bit to choose from the Day-2 sessions. It seems all are very interesting. 

Hope the welcome speech by @AjeyGore will start the day in good mood. We are already spoke with @lindsaar about our expectations on his keynote. We are eager to listen to his speech - How to Win?

Sex, Money and Evolution - Simulation and Data Analysis with Ruby and R by Chang Sau Sheong

      Hope his speech will initiate more interest on data analysis.

What lies beneath the beautiful code? by Niranjan Prabhakar Sarade

      We are very eager to know how ruby code is interpreted behind the scenes. How complex the things are happening behind to make the language more fun.

Smells and patterns in test/spec code by Sidu Ponnappa and Aninda Kundu & Large scale Ruby project, challenges and Pitfalls by Karunakar

        The above two sessions are going to be more helpful in setting up the project environment and writing the test cases. Our team struggled a lot in this and i hope this sessions will be an eye opener in writing test cases.

Which Mobile Development framework should I choose? by Abhishek Nalwaya

         Our company is planning to enter in to mobile development and we hope this session will be an initiator for that.

All set and we are looking forward to Day-2  @RubyConfIndia 2012. 

Our Day-1 Short summary @RubyConfIndia 2012

RubyConfIndia 2012

In this post myself along with @anansubu want to give some quick snapshot of Day-1 @RubyConfIndia 2012.

The day one went as per our schedule. But we missed few things here and there. 

The venue is nice. The WiFi connectivity helped the people to share their thoughts about the sessions on the go in their social media.

We were able to meet all the people whom we planned to meet. We talked with @lindsaar and @IndianGuru and also took some snaps with them.

All the sessions were good. Among them the speeches given by @headius and @deobald were really awesome. 

The speakers who handled the session after lunch struggled hard to keep the people awake due to the delicious lunch.

Day 1 ended with lightning talks which is new to us. Though the speeches were really at lightning fast, we were able to catch some interesting information.

The organizers did a wonderful job on day 1 except one thing which we would like to comment. The people felt inconvenient to identify which session on which track as the summary information is not available at the venue other than the RubyConfIndia site.

Overall, we liked the Day 1 session, a lot. We would also like to give some brief on individual session in our upcoming posts. Stay tuned for that.

Our Day-1 Plan @RubyConfIndia 2012

As a followup of my previous post, i am going to write my plan for @rubyconfindia along with @anansubu.

We have come across lot of topics on Day-1 session and all seems to be interesting. But parallel sessions are there. We don’t want to miss anything but its not possible for attending all of them. And hence we decide to attend based on our interests and needs. Also by analyzing the various speaker keynotes, we have decided to attend the following sessions.

Welcome by Ajey Gore, Keynote by Charles Nutter and Video Keynote by Matz

      This initial sessions will definitely help us to adapt to the new environment. Also hope these speeches will give more interests to attend the upcoming sessions.

View Components in Rails by Harun Abbas Pathan

        This is the first session we both are planning to attend. The reason behind attending this session is to fully understand some key points in using view components in rails. As we are facing difficulty in using rails views effectively in our startup project, hope this session will guide us to overcome that.

Ruby for the soul of Big Data nerds by Abhishek Parolkar

         @anansubu will be attending this session. As a database and cloud enthusiast, this session will give more idea for him on data analysis.

Sandboxing Ruby Code - Lessons from the battlefield by Tejas Dinkar and Jasim A Basheer

       As we are planning to set up Continuous Integration server in our project environment, i am more interested to attend this session. Hope i will get some practical guidelines through this session.

Responsive Design: now 90% easier with SASS! by Arpan CJ

      As our startup project is going to be used by various gadget users, we are both planning to attend this session. Hope this SASSY thing will give some food for our thought.  

clojure is my favourite ruby by Steven Deobald

    As i have come across clojure while i start learning ruby through RubyLearning, i do have some interest to get more knowledge on this. But i didn’t get a chance to go through that. Hope this will give some initiate on this.

Unity by Arun Tomar & VoIP on Rails in India by Sandip Ransing and Shailesh Patil

    As we don’t have much idea on these sessions, we need to decide which to attend on the run.

Lightning Talks

    As from the title, we are able to get that this session will be more interactive and we are eagerly expecting this session.

Hope we will be gaining some benefits in the Day 1 sessions to share with our Kyyba folks - @gauravkishore, @sundarishree & @judesahayaraj.

Stay tuned for our experience on the above sessions in the upcoming posts.

Ruby Pair Programming

As we all know, Learning Ruby is fun, i just want to use this post to share my experience in Ruby pair programming. Initially i don’t have any idea on pair programming and after i learnt i found that, this is one type of writing unit testing in Java. Also, its just like the approach of Test Driven Development, that is what i understood.

Writing tests and writing code based on that test and checking every time the test are passed whenever we do modifications… that is what finally pair programming is.. so what will be the advantage? New modifications in the code should not break the existing functionality as iteration is the important aspect in software development.

Our mentor Victor Goff teach this concept to me like how a father can teach to his kid… i really admired of his teaching skill and its my duty to say special thanks to him as this post is mainly because of his inspiration. I do not know whether i will post all the inputs that he shared with me, but i will try my best to achieve that.

Lets start jump towards the pair programming…

For that we need rubydoctest to be installed. My concentration is mainly towards Windows since for Mac and other OS there needs to me some more settings we need to do for installing that. Mostly these types are installed as gem and hence other OS users can do some google on it to identify the steps for rubydoc installation.

Just install the rubydoctest as below
You can choose the directory where Ruby is installed if it throws any error. I hope it will not throw any error but i am not sure… so try it if you want.

The next step is towards writing the program.
Create a file called hello_world.rb and type the following in it.

Now run the file in the command prompt as below and we will get the following result.The errors and failures are 0 and this is the good startup.
So, whatever doctest we need to write, we have to write it within the comment block = begin and =end

Next we are going to start by writing the first doctest for our program.
For that we just update the lines as below in the hello_world.rb file

when we run the rubydoctest, we will get the following outputSo, we are calling a method called hello_world but its not defined.
In order to correct this error, we can define the method as below.

Now when we again run the rubydoctest, we can see the ouput as belowNow the error becomes 0 but the failure is 1. That means the expected output doesn’t match with the result output.
So, we have to think about how to correct it. The expected output is “Hello World!”. We will update the code as like below and we will check whether we are able to correct this error or not.

Run the rubydoctest, and check the output which is as shown below.Now there are no errors and failures since the we get the expected output.

This is how the pair programming works and hence it mimimizes the error while coding.

Similar to the above steps, we can add ‘n’ number of doctest and we can check for the output result.

Whatever steps we learnt above is the basic for running the rubydoctest.
I can show two more iterations from which we can get more comfort with this process.

Iteration 1:

Add the following doctest and run the program.

doctest: I can pass a name to hello_world and get “Hello Mani!”
» hello_world “Mani”
=> “Hello Mani!”
In order to correct the error, update the method as below:

Now when we run the doctest, we will get the output without errors as like below.So, by passing the arguments to the existing method, we are able to correct the error. Also, note that, the existing doctest is also not failed.

Iteration 2:

In this iteration, we just add one more argument to the method. We will write the doctest as like below.

doctest: I can also ask a question by passing “Erik”, “?”
» hello_world “Erik”, “?”
=> “Hello Erik?”

By running the test, the ouput will be as like below.In order to correct the error, we need to modify the method as like below.

And the output after running the doctest will look like this.Now all the tests are passed and your code is working fine without affecting the existing functionality.

This is how the advantage of pair programming stands. We keep on adding the functionalities over by over. At the same time, some care needs to be there to check the existing thing and thats why we are checking all the tests. If any one of the test failed, that means we are doing something wrong and we will be cautious while coding.

If you understand the above concept, surely you will try to go to the next step in that. You can try this Blog post on Ruby Doctest of my mentor which will definitely help you to move little bit further. (I feel little bit hard :( while going through that.. May be because of getting the input directly from him)

Hope all enjoy this post and Happy pair programming until the next post.. :)

Journey towards Ruby - Nautical Mile 1

A little bit of distance i reached after i started the journey towards Ruby. I want to mainly focus on the initial startup of few things that i learnt so far.

Very happy to start my week 1 course. This is my first online class that i have attended in my lifetime. Since i don’t have any experience, i do have lot of expectations. Also, i heard that there is no screen casts provided from their forum and i thought how they can handle without that.

They have posted week1 lessons. Also, i have bought the online book which the course is based upon. Initially i thought the book is not needed but anyway i have bought that E-book, The ultimate guide to programming which seems to be useful.

There are limited portions that need to be read for the week1. Also, the exercises that are posted in the forum are quite interesting. Quiz is also there. I am more interested in reading about the different people answers for the questions in their own way. Also, challenges have been posted which gives more enthusiasm while participating.
The only thing i feel bad is that, the people who have some knowledge in Ruby start applying that concept while answering the questions leads to some confusion while going in the right path. Anyway the tutors Sathish Talim and Victor Goff guide us during that time by replying to the answer in a nice manner of learning those things in detail in the coming week. This gives some more confident to the people who are little bit new to this.

First, i start struggle to set up the environment and IDE. I am able to install Ruby as i had some experience already on that but i forget the exact tools what i used for IDE. I tried with this Geany IDE. I have downloaded that from here… Download Geany. But i am not feeling comfort with this. I start using SCITE editor. I found this two blog post useful when i start google for the SCITE IDE - Post1 and Post2. The above two post give some idea on SCITE tool and its advantages.

Also i have gone through some other useful books which can give some quick reference. And i found the following book, The Ruby Pocket Reference which is a good reference book in order to see all the usage of syntax and keywords. But the above link has only limited pages and i bought this book from here. I also bought the kindle(thought to write some post related to my experience on this later :)) version of this book, which makes me to read with more eagerness.

I have made some friends through this training program. Still i want to make some more contacts. I started posting some answers for the exercises and i felt good. I thought i reached little bit of distance from where i have started. More experiences on the upcoming posts :)

A journey towards Ruby

Ruby is one of the popular language of this time and i want to make use of this post to share my experience of how i get started with that.

As a Java developer, my full concentration is towards Java based technologies. This mindset gets changed when i start using social media. I came to know that many popular applications like Twitter, BaseCamp, etc are built based on Ruby on Rails platform.
I started analyzing the reason behind that…

Nowadays lot of applications are created based on web. Deploying and hosting the application is one of the major hurdle everyone is facing. In my experience, there are lot of PHP based web applications available in the market. The main reason behind is that, lot of hosting services are supporting PHP. But what happen when we develop applications based on Java. Yes, there are few hosting services that are available to host Java based web apps but the cost is more compared to PHP based hosting services.

One more problem is the deployment. Deploying a Java based applications is not that much easy even though lot of tools are there. The main reason is, we need to set up lot of configuration parameters. Also the time taken for development is more for Java based application. Even for building a small application, we need to set up the required environment which can be set as similar to large enterprise applications. So, Java is mainly suited for large enterprise applications.

What is the alternate for that? PHP - Its more suited for the programmers who know C# Dotnet environment and they can easily picked up and move towards the environment.Also the learning curve is more for any person who want to move towards PHP since it will be easy at the startup. Even i start maintaining the website built on PHP based on my little knowledge. But what will be the alternate for Java developers like me?

Here comes Ruby. Learning Ruby is fun… :) That is what i come across. Learning curve is simple… Hiring the people and getting the people trained is more easy.. Quick development cycle… Easy deployment… what more? For quick launch of small products, Ruby platform is good…

With that in mind, i start studying the Ruby based framework.. Ruby on Rails(ROR).. i started a year before… its like entering in to the struts framework directly without knowing much knowledge in Java. Initially i didn’t know about that and have fun reading the entire book, Head First Rails. Quickly did some basic programs… even i start posting blog on that - Setting up Ruby on Rails Environment in Windows and also deploy the sample application in Heroku.. a popular hosting provider for free…

Bit everything stops once i reached a particular stage. Reason is, i do not know about the interior programming language, Ruby. Now i realized and searched for some course and i found the Rubylearning and i enrolled in the course.
I missed the chance of joining it for free what they have provided it for their 25th batch. But anyway i paid it through my company and i joined. The course started and also thus my journey…

The first thing i learnt is Learning Ruby is Fun :) but mastering Ruby is difficult :(

I will post my experiences towards this journey so that the people like me who are coming from other language can get some idea on this.