onrails.org home

RailsConf 2007 - Day 1

Here we go, RailsConf 2007, has started. It’s bigger than ever, more tracks, more sessions. This is the first day where they provide full or half-day tutorials sessions. I will try to cover the different sessions I will attend so stay tuned.

Today I will attend: “Scaling a Rails Application from the Bottom Up.” and “Harnessing Capistrano.”

Scaling a Rails Application from the Bottom Up. by Jason Hoffman

Jason Hoffman, CTO of Joyent. Did also form Textdrive.

Six part presentation:

I. Introduction and foundation
II. Where do I put stuff
III. What stuff?
IV. What do I run on this tuf?
V. What are the patterns of deployment?
VI. Lessons learned

His presentation will answer the following questions:

Maybe it’s a little early, or I am not awake, but the talk seems a little slow. But Jason seems to do a good job at describing how the different people (developer, sysadmin, …) see scalability.

Ease of management is on log scale. It’s not just a Rails issue. A $5000 Dell 1850 costs $1850 to power over 3 year.

This is a really good presentation from a point of view of what is involved to build data center. I should have read better the description of the presentation.

So I am going to move over to Thomas Fuchs presentation:

Is JavaScript Overrated? Or: How I Stopped Worrying and Put Prototype and script.aculo.us to Full Use by Thomas Fuchs

I am just tuning in to his presentation and he is showing of how to use selectors with Prototype.

DOM traversal:

$(‘blech’).previous(‘ul’).down(‘.somesuch’,2)
$(‘homo-sapiens’).descendantOf(‘australopothecus’)

Element methods:

$(‘a_div’).update(‘blah’).show().setStyle({opacity:0.5});
$(‘myform’).focusFirstElement();
$(‘person-example’).serialize();
Element.addMethods(‘form’) {
valid: function(element) {
// code to valid form
}
}

What’s new in Prototype 1.5.1:

DOM, Events, Forms, Position:

Function.prototype: curry(), wrap(), defer(), delay()
Q: When is the next release of Prototype?
A: When it’s ready.

A 10 minute break now, the Thomas is going to present Scriptaculous Effects.

script.aculo.us adds advanced User Interface interaction to the DOM. Extracted from Real-World applications. Started with Fluxiom. The two main parts are Visual effects and Drag&Drop. Today we will only look at the Visual Effects. They are other parts such as Autocompleter, In-Place Editor, Slider control, DOM Builder, and Unit testing. They won’t be more advanced components.

Effects engine: the ideas behind the engine is timeline based animations.

Core Effects:

Based on the Effect.Base.prototype class.
Effect life cycle: intialize(), setup(), update(), finish(). Each frame calls update().

Effect.DefaultOptions = {
transition: Effect.Transitions.sinoidal,
duration: 1.0,
fps: 100,
sync: false,
from: 0.0,
to: 1.0,
delay: 0.0,
queue: ‘parallel’
}

Morphing: came out with Scriptaculous 1.7.

$(‘mydiv’).morph(‘font-size:20px; color:“#abcdef”);
$(’mydiv’).morph(‘warning’); //limited to top level classname

TimeLines:

new Effect.Blah(‘element_2’)
new Effect.Blah(‘element_2’, {duration:0.6, delay:0.3});

You have to be careful with effects created that will run in parallel as the javascript engine are not multi-thread. Better solutions is to use queues:

new Effect.Blah(‘element_1’, {queue:’end’});
new Effect.Blah(‘element_2’, {queue:’front’});

and use scope:

new Effect.Blah(‘element_1’, {queue:{scope:’blech’}});
new Effect.Blah(‘element_2’, {queue:{scope:‘blech’, position:’end’}});
new Effect.Blah(‘element_3’, {queue:’front’});

Utilities:

Element.toggle(‘element’, ‘blind’);
Element.tagifyText(element);
Element.multiple(‘element’, Effect.Fade, {speed:0.05});

Do it yourself: Thomas now shows how to create an Effect programatically.

Future features:

Part IV: Testing

Thomas is flying through testing…

Mostly unit testing, but some functional testing is available.
Most assert take a message. I.e. assertXYZ(params, message)

Resources:

JRuby talk by Charles Nutter and Thomas Enebo

(note taken by Robert Hall, thanks man!)

LUNCH: will be back at 1:30pm

Harnessing Capistrano by Jamis Buck

Jamis will focus Capistrano 2.0 today. Some things will not be backward compatible with Capistrano 1.0.

His slides are online at http://presentations.jamisbuck.org/railsconf2007/.

Fork me on GitHub