geolocalization & gtg, take 1

Came across the GTG project and was interested in possibly doing some development on it. The first major hurdle I encountered was getting a VM setup that worked with the right libraries. Since I was interested in working on the geolocalization features in GTG, I had to install the python modules for geoclue, clutter, and champlain. Turns out I was having a hard time getting python-clutter to install because it seemed that the apt sources were from an older version of Debian (squeeze) than what I was running (wheezy). Modifying the /etc/apt/sources.list, as…Read more …

sinatra + heroku + postgres

Now that the (read-only) web service was working locally on my machine, I wanted to see if I could push it to Heroku. The first thing I did was to dump my Postgres database. Since the basic/free Heroku account only supports databases with at most 10k rows, I truncated the zip code database. There are a total of 42k+ rows, so chomping off this many rows is significant, but I'm mostly doing this just as a demonstration. Usually, you'd run pg_dump to export an entire Postgres database to a file. However, pg_dump is…Read more …

test-driven development (TDD) in sinatra

In the last post, I built a simple web service for looking up some basic geolocation information for a given zip code. To make sure the database was returning the expected output, I used irb to run specific commands. I decided to try out MiniTest and follow basic TDD principles to programmatically test out the zip code web service. MiniTest makes this really easy and, as a programming language, it's quite readable. Check out the simple test cases I used to make sure that the web service was returning accurate information (at least for 1…Read more …

git/github workflow

In the past, I've only used github for personal projects, so I didn't have to deal with collaborating with other folks. Now that I'm working on an open-source project, I'm starting to get more familiar with all the cool features of git and github. So here's the scenario: Project A is on github (aka the original repo). Alice has forked Project A on github and created a branch(/patch) off of that fork. (As a side note, the branch was already sent as a pull request to the original repo, but it hasn't been…Read more …

getting started with sinatra and postgres web service

I'm in the process of resurrecting some of my past projects. One of them is a web service that provided details for a given zip code. For example, you could lookup the zip code '15213' and the web service would spit out the geographical center for the zip code (i.e., the latitude and longitude coordinates), as well as the city and state for that zip. I originally programmed the web service using Ruby on Rails, but using RoR for a relatively simple API is a bit overkill. So I decided to use this project…Read more …