Wednesday, June 27, 2007

Appending text in Ruby

My coworker was just appending some text in Ruby and found something out:

While using the syntax '+=' the process of appending text took 1.8 seconds for this particular case. However, adding the text to an array and then converting the array to text took ~.9 seconds - almost a second difference. On further investigation the syntax '<<' also took ~.9 seconds.

In summary, use '<<' and not '+='

Tuesday, June 26, 2007

assloads of capacity.

With hard work, strict storyboarding, and a computing capacity that is measured not in megs or gigs, but in assloads. - Wired

Monday, June 25, 2007

Friday, June 22, 2007

The bird is done.

We were referencing this on the way back from lunch. I love the way that the bird just poofs into a cloud of feathers.

Thursday, June 21, 2007

Hyrule Jewelery

Self proclaimed nerd makes Zelda style jewelery

Worst movies ever

Someone put together a list of really bad acting in really bad movies.

My Uncle was in Troll 2 - possibly the worst movie. Ever. You should definitely watch it for the sake of awful-ness.

Wednesday, June 20, 2007

Parkour

This is awesome. Incredibly inspiring to think that people - who on average seem to be getting less athletic can accomplish such feats of strength and agility.
If you've seen the newest bond movie(Casino Royale) - the opening chase scene gets its kicks from parkour.



Our aim is to take our art to the world and make people understand what it is to move.
—David Belle, BBC News

Shoelaces?

Wow, this guy loves his shoelaces... I do however, find it interesting, and my self proclaimed 'fly kicks' will most likely get a lace treatment soon.

Monday, June 11, 2007

Using Multiple Buttons in a Form

Sometimes, one button to rule them all just isn't good enough, and you need more than one button in a form. With Rails, it's surprisingly easy to set up multiple buttons on a form.

In the View, we'll have the form with three buttons: Button 1, Button 2 and Button 3


...Juicy Form Goodness...

<%= submit_tag 'Button 1', :name => "submit" %>
<%= submit_tag 'Button 2', :name => "submit" %>
<%= submit_tag 'Button 3', :name => "submit" %>


In the Controller, we'll use a case statement to decipher which button was pressed and redirect to the corresponding action.

def filter_reports
case params[:submit]
when "Button 1"
redirect_to :action => :button_1_action, :id => params[:id]
when "Button 2"
redirect_to :action => :button_2_action, :id => params[:id]
when "Button 3"
redirect_to :action => :button_3_action, :id => params[:id]
end
end

Awesome, now you can add as many buttons as you want/need to a form.

Friday, June 8, 2007

Wicked Problem

Yesterday we started working on a Wicked Problem. Pretty interesting new term, I think.