Posted on 15-05-2008
Filed Under (Code, Process) by Dary

I tried to use Ruby's built-in Active Record fixtures module to import an Excel-exported CSV file. No dice. Kept getting cryptic errors about improper formatting. Whoops. So then I installed this wicked cool gem named FasterCSV and piggy-backed off of this migration import script and everything went great. So for all those people with ancient (and kinda useless) Excel data files, now there's a relatively quick and painless way to import them into SQL dbs. Here are the steps I went through:

Install the gem:
sudo gem install fastercsv

Now I have several tables in my College Football spreadsheet and for this example I'll use the one with ratings data for College Football games. Each entry has a game_id, region_id (for the various regions where ratings data comes from, e.g., Atlanta and Austin), a rating, and a duration in quarter hours (since some games are only cut-ins, e.g., Georgia Tech-Georgia ends early and the Atlanta region picks up the last half hour of the Texas-Oklahoma game). So here's the script that imports my gross Excel spreadsheet into a useable SQL table - db-agnostic by the way (How do I love thee Rails? Let me count the ways.)

require 'fastercsv'

class LoadRatingsData < ActiveRecord::Migration
def self.up
FasterCSV.foreach("#{RAILS_ROOT}/db/migrate/fixtures/ratings.csv", :row_sep => "\r") do |row|
id,game_id, region_id, rating, duration = row
Rating.create(:id => id, :game_id => game_id, :region_id => region_id, :rating => rating, :duration => duration)
end
end

def self.down
end
end

And it's just that easy. Another cool thing, that I haven't done yet, is that you could take that one bulky Excel sheet that has way too much information in it, break it into useful models, and form actual relationships between the data. What a novel idea!

In Conclusion,

This rules!

(7) Comments    Read More   
Posted on 30-04-2008
Filed Under (Process) by Jorge

Scrum is the glue that holds our agile iterative development process together. You can get a more official and in-depth definition on the Scrum process from wikipedia or any number of places around the web.

We've found it to be one of the most helpful processes that helps keep our small group working together on a large project on task through improved communication and high transparency.

Here is how we run our daily scrum:

Since we our team is made up of people from different locations, we all call into a conference number at the same time every morning. Once we get everyone on we do a quick round table which involves each participant giving their status update.

Each team member answers three questions:

1) What did you do yesterday?

2) What are you planning to work on today?

3) Do you have any road blocks (any issues that are impeding your progress)?

And that's pretty much it!

A Scrum with 4-6 people participating shouldn't take much longer than 10-15 minutes. Sometimes it can go a bit longer or shorter depending on if any road blocks are brought up, and if there are larger issues that come up that warrant more discussion, we table them and schedule a separate meeting to discuss in depth.

So, keep a set time, round table the three questions, and get back to writing code!

(0) Comments    Read More