Ruby on Rails, Io, Lisp, JavaScript, Dynamic Languages, Prototype-based programming and more...

Thursday, July 27, 2006

Ridiculously easy ways to distribute processor intensive tasks using Rinda and DRb

Here are the slides for my FOSCON talk. Additionally, I wrote code during the talk which is also available. Run these in order to get it working:

  1. ruby rinda.rb

  2. ruby prime_finder.rb

  3. ruby prime_client.rb

Saturday, July 22, 2006

Codecamp Talk Slides

Introduction to Ruby on Rails
An Exercise in Meta-Programming with Rails
Using Cross-Domain AJAX Today

I'd love comments and feedback.

Thursday, July 20, 2006

My Talking Schedule

I am giving a number of talks in the next few weeks. If you like how I write, are going to be in Portland, and are so inclined to say hi, come by any of the following places.

In two days, Saturday the 22nd, I will be giving 3 talks at Portland Code Camp:

9:15-10:30am: Introduction to Ruby on Rails
10:45-12:15am: An Exercise in Meta-Programming with Rails
2:45-4:00pm: Using Cross-Domain AJAX Today

Then at OSCON I will be doing a few events:

12-1:30pm on Monday, July 24th: Book signing at the Powell's booth
11:15-11:45am on Wednesday, July 26th: Best of the Ruby Cookbook talk at the O'Reilly booth

I am also talking at FOSCON on Wednesday night:

7:30 PM-??? on Wednesday, July 26th: Ridiculously easy ways to distribute processor intensive tasks using Rinda and DRb

I hope to see you at any or all of the above events.

Monday, July 10, 2006

Use or Force an Index with Rails

I just found an ActiveRecord hint that is very useful and very undocumented. If you are working with a table who's indexes are sufficiently complex, MySQL will inevitably guess the wrong index at times. To counteract that in SQL, you write:
SELECT * FROM alphas USE INDEX (some_index) WHERE betas = gamas;

Rails does not have a corresponding :use_index for find methods. However, it does have an un-documented :from option.
Alpha.find(:all, :from => "alphas USE INDEX (some_index)", :conditions => "betas = gamas")

Keep this in the back of your mind if you are going to be working with complex database tables any time soon.