Brains for Business, Inc.

Brains for Business, Inc.

Software Development & Consulting

  • Home
  • The Institute on Women
  • About

YourHomeScore.com

Posted in Ruby on Rails, Software Development by dave.parfrey
Oct 23 2010
TrackBack Address.

I haven’t posted anything in a few months, here’s the reason why: YourHomeScore.com. Please visit the site and tell me what you think.

44 Comments »

Aptana Studio 3 Beta for Rails Development

Posted in Ruby on Rails by dave.parfrey
Jul 04 2010
TrackBack Address.

I’ve been using TextMate along with a terminal window for my Rails development. When I was doing PHP development, I had settled on Eclipse as my IDE. However, since most of the people I knew used either TextMate or Emacs for their Rails work, I reluctantly purchased TextMate  and gave it a shot.

I really like TextMate. It’s got a lot of power that’s not immediately obvious. As I got into it more, I learned enough keystrokes to really make editing code a breeze. I also kept a terminal window open to run the usual Rails commands, like “rake db:migrate” and “script/server”. This two-pronged setup served me well, until…

I was testing a somewhat complicated set of database operations and was getting strange results. As I started adding logging statements to figure it out (old-time c-programmers like me call it the “printf” method of debugging), it hit me. This would be much easier if I used a debugger!

After reading several articles online about debugging Rails with TextMate, I came to the conclusion that I wanted something more robust and easier to use. Enter Aptana Studio 3.

Aptana Studio 3 is currently in Beta, and I’ve run into a few things that either don’t work properly, or maybe I just don’t know how to use those features. There’s a definite learning curve, especially figuring out good keystrokes to do things that were easy in TextMate. And it’s a bit slower than TextMate, especially starting up. But I can handle all of that, ’cause the debugger makes it all worthwhile! It’s easy to set breakpoints, step through my code, and view my variables. Very nice!

Oh, did I mention that it has Git support built in? The stage/commit process is very visual and easy to use, with a nice diff display.

I’ve been using Aptana Studio full-time for about 5 days now, and haven’t been tempted to return to TextMate. Check it out!

7 Comments »

SPA-Wrestling iPhone App Released

Posted in iPhone/iPod/iPad by dave.parfrey
Jun 29 2010
TrackBack Address.

Our latest iPhone app went live last week: SPA-Wrestling. It’s only $1.99, available through the App Store. We’re still working with sports psychologist Dr. Chris Stankovich, we should have several more versions of the iPhone app available by the end of the summer.

3 Comments »

SPA Local Media Coverage

Posted in iPhone/iPod/iPad by dave.parfrey
Jun 08 2010
TrackBack Address.

Our Sports Performance Assessment iPhone app was featured on the local Fox station’s Good Day Columbus this morning. It was a relatively long segment, over 3 minutes! See it on YouTube here.

2 Comments »

Two New iPhone Apps

Posted in iPhone/iPod/iPad by dave.parfrey
Jun 01 2010
TrackBack Address.

The summer baseball and softball season is here! To celebrate, we’ve released two new iPhone apps: SPA-Baseball and SPA-Softball! As before, these apps are available through a partnership with sports psychologist Dr. Chris Stankovich.

5 Comments »

iPhone App(s)

Posted in iPhone/iPod/iPad by dave.parfrey
May 14 2010
TrackBack Address.

My first iPhone app has been in the App store for about a month now. It’s called the Sport Performance Assessment (SPA) and helps athletes in team sports measure and increase their mental toughness. It’s done through a partnership with Dr. Chris Stankovich, a local sports psychologist. We’ve also released  a version for golfers called SPA-Golf, as well as one for Pool (as in billiards) players called SPA-Pool.

Here are some mentions of the apps in the press:

  • Local NBC TV spot
  • AZBilliards.com
1 Comment »

Using named_scope to filter records

Posted in Ruby on Rails by dave.parfrey
May 13 2010
TrackBack Address.

Here’s a simple RoR solution to an interesting database problem. Assume you have a web-based quiz. There’s a ”questions” table with the questions, a “tests” table with the total results, and an “answers” table with answers to individual questions. Here’s the Model classes:

class Question < ActiveRecord::Base
  has_many      :answers
end
 
class Tests < ActiveRecord::Base
  has_many      :answers
end
 
class Answer < ActiveRecord::Base
  belongs_to  :question
  belongs_to  :test
end

The problem is, you don’t typically want to see all the answers to a question, just the ones for the test you’re displaying. The solution is to use named_scope, as follows:

class Question < ActiveRecord::Base
  has_many      :answers
 
  # returns the answer for the given test
  def answer_for_test test
    answers.for_question_and_test(self, test).first
  end
end
 
class Tests < ActiveRecord::Base
  has_many      :answers
end
 
class Answer < ActiveRecord::Base
  belongs_to  :question
  belongs_to  :test
 
  named_scope :for_question_and_test, lambda { |question, test| { :conditions => ['question_id = ? and test_id = ?', question.id, test.id] } }
end

Pretty simple! For more information about this solution, here’s the articles I used to research the issue:

  • named_scope
  • has_finder (which became named_scope)
No Comments yet »

Best Business Book … Ever!

Posted in Reading Material by dave.parfrey
May 13 2010
TrackBack Address.

If you haven’t already read it, you must read REWORK, by Jason Fried and David Heinemeier Hansson. If you have a low tolerance for corporate BS, this is the book for you.

3 Comments »

Site Search

Categories

  • Software Development  (8)
    • iPhone/iPod/iPad  (4)
    • Reading Material  (1)
    • Ruby on Rails  (3)

RSSLatest Tweets

  • Twitter is unavailable
Copyright ©2009 by Brains for Business, Inc. All Rights Reserved.