Tdd All the Time


Test Driven Development (TDD) is one of the best practices that extreme programming (Xp) suggests. As defined by Wikipedia, TDD is a software development process, in which a developer writes a failing test case, that defines a new improvement, or new functionality, then produce the code to pass that test and finally refactors it to acceptable standards.

Having said that, the series of questions I hear from people who are introduced to TDD are,

Read more ⟶

Missing Data During Tire Indexing


Am working on a RoR project, which uses Postgres for data storage and ElasticSearch (ES) for providing the search functionality. We were using Tire to talk to the ES server. Ran into an issue recently, where in the search results didn’t return a particular document. For the purpose of this post lets consider a model like the one defined below.

class Document < ActiveRecord::Base
# t.integer id
# etc., etc.,
end

The particular record, that i was looking for, was available in the DB, but was not available in the ES index. So, the first and foremost thing that i did is to re-build the index. Tire provides you with a rake task to import the indices. So, I can do

Read more ⟶

Datatype support for MongoModel


Mongomodel is a ruby gem that does the Data mapping for mongo db. It supports the most commonly used data types. Recently our team had a requirement to handle (persist and retrieve back data from mongodb) OpenStruct. Since the mongomodel documentation doesn’t provide enough information on how to extend it to support a new datatype, we tried to give it a shot ourselves and to our surprise it was much easier and straight forward than what we thought.

Read more ⟶

Integration testing Search - Clash of the indices


ElasticSearch is an Open Source (Apache 2), Distributed, RESTful, Search Engine built on top of Apache Lucene. It promises to solve all the pain points of implementing search in a web application. Tire is one of the popular ruby clients for elasticsearch. Though it is important to have integration test for models while using tire in a ruby app, it is equally important to make sure that the test doesn’t corrupt the development indices.

Read more ⟶

Monkey see, Monkey do - Why can't we?


Empathy - The ability to understand and share the feelings of another person - is one quality that we have been taught to have since childhood. I’m sure everyone of us would have felt the emotions, that the presence or absence of empathy, brings to us. I was under the impression that empathy or putting oneself into the other person’s shoes or being on the other side of the table or whatever you call it, is a skill that every human being should try and develop, till I started reading “Just Listen” by Mark Goulston. It was interesting to know that it is not a skill that a person develops but instead it is wired in his brain. In fact that is something that we inherited from our ancestors during the evolution.

Read more ⟶

Android vs Wp7


After a short stint in android development, I thought of experimenting with a different mobile platform. I didn’t have too many options. iPhone development was ruled out since i did not have a mac and wasn’t quite comfortable with Objective C. I chose WP7, hoping to catch up with C# coding which I haven’t been doing for a looong time. And moreover the latest buzz about the next version of windows phone, Mango added up to the excitement to see what it offers to the developers. I made up my mind and setup the environment and started off with a simple BMI calculator application for WP7 and android. Here is the summary of stuff that I discovered last week.

Read more ⟶

Ruby - Gems - Manage dependencies


Had a chance to work on a Ruby on Rails project recently. It is almost impossible to have a ruby application without using any gems. Gem is a packeged ruby application or library which can be used in other applications (equivalent to a jar in a java project). You can specify the gem dependencies for your application in the Gemfile. The bundler takes care of resolving the gem dependencies of the application for you. It makes sure that the same version of gems are used in all the machines/environments wherever you develop/deploy the application.

Read more ⟶

Model form - Get it working


Started playing around with python and django last week. There is a lot of stuff that django provides us to build a basic web app. Despite its very good documentation, I found it hard to get the model form working. Model forms are useful when you have a basic model with some fields defined and you need a form to either add or edit the model. Writing views for such models is redundant, since both of them are going to contain the same information anyway and its prone to human error. Model form comes in handy in such situations.

Read more ⟶

Tamil in Android


Displaying tamil characters in android can be easily achieved by using TSCII (Tamil Standard Code for Information Interchange) fonts. TSCII is an extended ASCII encoding standard. Unlike ASCII which uses 7 bits for encoding, TSCII makes use of all the 8 bits in a byte. The first 128 bytes remains the same as that of ASCII. The tamil vowels and consonants along with the common prefixes, suffixes and other special characters fill up the rest of the 128 bytes.

Read more ⟶