Skip to Content

A self-powered house?

Last night we had a blackout in our neighbourhood. This in itself is not a big deal, but when you consider that a) I live in a very large city (Calgary, Alberta, Canada), and b) we have had a series of blackouts over the last couple years, well, one begins to wonder. So, let's put on our "pure speculation" hats for now.

Rails Model Relations - Quick Guide

Sometimes a lengthy explanation is not quite what we're looking for. So, here's a quick guide to using the relationship indicators in Rails models. (As always, the Rails API should be referenced for the official usage.)


Use belongs_to :something when a table has a one to one relationship. (i.e. a car has one steering wheel.) This relationship always goes on the model that has the foreign key field (i.e. steering_wheel_id)


Rails Models - Setting up the relationships

In my last post we defined our application, and created some Rails migrations to the database tables. That's a good start, but now we need to tell Rails how our tables are related. This might seem a little redundant seeing as the database can do this, but with the migration approach we haven't defined the relationships and Rails makes our life easier if we spend a little time defining them.

Grover's law strikes again!

I've been coding long enough that I've begun noticing things about programming in general. In this case I've noticed what I'm referring to as a "Grover's Law" (just because it sounds better than "Grover's rule or thumb".

My law goes something like this:

The solution to a problem is inversely proportional to the time it takes to find the cause of the problem.

Or in plain english:

The longer you look to find the cause of a problem, the simpler the solution is.

Novell Parodies the "I'm a Mac" commercials

Novell has released a couple of videos that parody the infamous "I'm a PC/I'm a Mac" commercials seen on television for the past year.

These commercials are well done, and would be even better if they can release the video files in a better quality format. Web based video a la YouTube just isn't that great.

Rails Migrations

I want to share with you the parts of Ruby on Rails that I've been finding to be eye opening for me. To do this, I need to start someplace. So what we'll do is define a simple application, that we will build on to illustrate the points. In this instalment, we will define that application, and setup our application environment, and then using Rails Migrations to setup our database.

The application

The Secret Debunked?

I had opportunity to listen to a little bit of The Secret. If you are considering picking this up, read on. I will give you a quick summary, and a theory I think counter's the gist of "The Secret".

So, The Secret is "The law of attraction". I'm not spoiling anything here, heck they did a spoof of this on Saturday Night Live this past weekend. But let's explore this a bit more so that we understand just what is meant by this law of attraction.

Getting Started With Rails

In my last post I talked about how Rails would change the world. Well, ok, maybe that's exaggerating. But I did talk about the things that sets Rails apart from more traditional approaches to web development. The natural extension of that discussion would be how to get started with Rails. So tonight we'll discuss setting up the development environment for Rails.

Ruby on Rails - First Thoughts

I was starting a PHP project and was trying to find a way to minimize the amount of SQL code that would be needed. I'd really rather focus on writing code to do something, than trudging through yet another SQL select statement, or insert, or update. These are a necessary evil but are very much the same every single time. There are some facilities out there that help with this - PEAR MDB for example, as well as some of the other PEAR modules. I've used PEAR MDB before but was looking for something a little more robust this time around.

Gentoo in Crisis

Ever have one of those moments where you make a comment about something, and that something is suddenly in the news? In my earlier post I had explained why my servers are no longer running Gentoo. Now I have just received an update in my RSS feeds titled Gentoo in Crisis.

Syndicate content