RailsCamp 3 just finished, and it was another fantastic weekend of hacking with mates.

what a kerfuffle!

You’ve probably heard by now that Ben (the organiser of RailsCamp) and Kaz’s munchkin Liam came six weeks early. We’d been talking about babies coming early just the night before, since my son Toby was five weeks early. It was an eerie shock to hear that nearly the same thing had happened to Ben & Kaz! Liam is doing well, but is still in hospital for a little while.

The upshot of this twist was that Glenn Davy and I ended up running the camp. It was a pleasure as most of the heavy lifting had already been done by Ben. Thanks so much to Glenn and Ben for making the camp awesome, and to everyone else for being so easy-going over the weekend.

codings

Lack of internet is a key feature of the RailsCamp fun. To offset this, Lincoln Stoll set up a server chock full of VPS’s for hosting our apps. On top of that it served DNS and hosted gitorious. At camp it was at http://git.railscamp.net, and now we’re back its still at http://git.railscamp.net. (Some of these apps will no doubt go across to github in time).

A bumper crop of code came home from the camp this year:

  • Gitjour refactor

http://git.railscamp.net/projects/gitjour

A group of guys made their dissatisfaction with the current gitjour implementation manifest by refactoring it, waay into early saturday morning.

  • Gitnotify

Broadcast a growl notification each time you commit to git.

  • Gitman

http://git.railscamp.net/projects/gitman

Manage your git sharing, simply. By Mike Bailey

  • Swords

http://git.railscamp.net/projects/swords

A great start on a thesaurus based crossword generator. It has ascii and web interfaces.

  • Duke

http://git.railscamp.net/projects/duke

The return of the network jukebox. Gaming the duke voting system provided plenty of fun for all.

Myles Byrne and I were duke’s latest developers (everyone works on duke, some time). I failed to provide events for Myles, and I’m sorry.

  • bit-tags

http://git.railscamp.net/projects/bit-tags

Taggable snippets by the Brisbane boys.

  • iShare

http://git.railscamp.net/projects/ishare

An app for letting know what you’d like to hear or talk about at railscamp!

  • twonklist

http://git.railscamp.net/projects/twonklist

An anti-social networking application.

  • Twetter

http://git.railscamp.net/projects/twetter

A local twitter. Linc pointed twitter.com at twetter so that everyone’s Twitterific just worked. Matta writes about it here

Max dropped in and wrote up a Flex based client, too.

  • starjour

http://github.com/lachie/starjour/tree/master

I did some work on refactoring starjour. Still not really sure where this app is going, but it was good to see is list full of *jour services.

If I’ve forgotten any projects, let me know.

jq

I gave a talk on jQuery, which was a bit of a shamozzle as my version of firebug wasn’t playing with firefox 3. Preparation? Next time I suppose. Thanks to Hugh Evans for having a working ffx and some elegant jq code to show off.

feedback

If you have some feedback on the camp, please let me know: lachie (at) this domain.

One thing I’d like to see is some more emphasis on family at RailsCamp. Brodaigh brought her daughter Crystal to this one and Lone and I brought Toby to the first one. It adds a mellowing element to the camps that I really enjoy. And, I want a chance to beat Crystal at Set.

saving the day

When people started leaving on Monday morning, we hit a problem: someone had inadvertently taken Phil Oye’s bag.

After we’d finished tidying up and had hit McDonalds, I got a Twitter direct message on my phone from Dr Nic “what’s your ph num? we have someone’s black bag @ airport.”

I was able to put Phil in contact with Greg Fairbrother and it all ended happily ever after.

Twitter FTW

Summer 08 ? Winter 09 ?

So who’s going to step up next? Railscamp happens where ever someone organises it. It may be a structure-less weekend, but its still non-trivial to set one up If you think you’d like to give it a go, let me know and I’ll put you in touch with people who’ve done it before. lachie (at) this domain.

The guys from Brisbane are keen to put on a camp, probably in Winter 2009.

Who wants to organise an event for Summer 2008/9 ?

A couple of years ago, I designed and hand-printed three t-shirts.

DSCN3409 crabjam shirt ninja traced

It was a lot of effort, mainly due to having to hand-cut the stencils out of overhead projector slides. The quality was never quite up to snuff. And the paint was smelly and extremely messy. Despite all that, it was a blast.

So now that I have a bit of time off, I find myself wanting to do some designs again… This time I’m eschewing the heady chemical aroma of fabric paint and using Redbubble, a long tail publishing business based in Melbourne. They’ll print cards, prints and shirts from your artwork.

They charge a reasonable base price, over which you can mark up whatever profit you desire. Selling costs nothing, so at the very least you can get your own designs printed for only $21. Niice.

On top of that, the site is really nicely designed and runs on Rails. Our #roro friends Xavier Shay and Justin French work there.

so anyway:

buy my tshirt!

Here

If you don’t get it, have a clue: http://twitter.com

We have such overwhelming abundance as a society; that we continue to squander it brings me close to despair. Acting only as a diluted 2020 herd is abdicating our responsibility.

We’re the top of the pile; the assumption of personal responsibility stands as the only mechanism left to us to achieve the things we need to.

The education system will never tailor itself to your kids. You will need to shoulder the burden of education yourself.

The bulk of society will likely never grasp technology as fully as we do. Its up to us to promulgate and fulfill its promise.

We’re not helpless motes in the plasma of society. We’re the white blood cells.

Merb tips

So there’s only one at the moment, but i really wanted to write this down:

0.5.x make the development logger log DEBUG messages…

Put this in Merb.root/config/environments/development.yml

:log_level: DEBUG

0.9.x freezing gems

The way of installing the latest merb release is
$ cd to/your/app
$ gem install merb -i gems --source=http://merbivore.com

Unfortunately, this command won’t install merb’s dependencies as it won’t be able to look inside the normal gems repository on rubyforge.

This should do the trick though
$ cd to/your/app
$ gem install merb -i gems --source=http://merbivore.com --source=http://gems.rubyforge.org

Yay!

(Note that this is only a problem while the merb gems aren’t pushed to rubyforge).

point one

Quicksilver

point two

I want to act without doing in web apps.

point three

qs_score.js

For example

I don’t know if its because I’m nosy, or because I’m a control freak, or perhaps both, but I really do like to read the source code. It occurs to me that this is probably why I feel so at home in the open source world.

As much as I like something like Cocoa, it pains me not to be able to trace problems all the way down the stack. Even java solved this problem by shipping with its own source.

Proclivities aside, I really like source, and am always looking for ways to make it easier to get at. cd /usr/lib/ruby/gems/1.8/gems gets old quick.

I started with this little cough gem from Dr Nic. Integrating it with my shell, I could now type

$ gems activerecord

and up pops the activerecord gem in Textmate. So some new releases of activerecord came out, and suddenly my naive script is giving me the old version. Without looking too far into it I added gem requirement support so that I could type

$ gems activerecord '>=2'

and get a recent activerecord in Textmate. As good as this is, I was really after something with less typing and smarter pants. Well tonight I cracked it and I thought I’d open the source:

#!/usr/bin/env ruby

require ENV['TM_SUPPORT_PATH']+"/lib/ui" 
require 'rubygems'

gems = Gem.source_index.latest_specs.collect {|spec| spec.full_name}.sort

TextMate::UI.request_item(:title => 'open a gem', :items => gems) do |selected_gem|
    gem_path = Gem.source_index.specification(selected_gem).full_gem_path
    %x{open -a TextMate #{gem_path}}
end

Honestly, that’s it! Bung that in a command using Textmate’s Bundle Editor and assign it a key (I gave it cmd-shift-G, as I don’t regularly search backwards).

Double click on one and you’re golden… neat.

At Jelly Sydney last Friday, I went to see if my merb gems were up to date. You know:

$ gem list --remote

*** REMOTE GEMS ***

Updating metadata for 114 gems from http://gems.rubyforge.org
...

Each dot was taking aages, and there were to be one hundred and fourteen of the blighters!

In a nutshell

The rubygem server seemed to be having issues serving up incremental metadata. Until the rubygems server got back on its feet, I set my bulk threshold to a lower value:

echo :bulk_threshold: 1 >> ~/.gemrc

I won’t leave it there, because it could impact the overall rubygem system’s performance (well maybe if everyone decided to do this all the time).

Detailure

There were about seven peoples on the NerfPalace Wifi by this stage, so it was only natural to ask:

Lachie: “Hey Tim, is the network slow?”

Tim: “Nah aah, girlfriend. You slow. Or yo gems are slow, biatch.”

Well! It turns out that Tim had noticed the same thing and had started digging into the very source code of gems in search of an answer.

Teh Pwobwem

In order not to overtax the rubygem servers’ bandwidth, gem first finds out how many of its cached metadata are out of date. If the number is greater than an arbitrary threshold, it performs a bulk update in which all the metadata is updated at once.

If the number is below the threshold, each metadatum is fetched and updated individually (incrementally you might say).

By default, this number is 1000. Say each update was taking a second and there were 999 gems to update, this process would take more than a quarter of an hour. Presumably the average case is much better than this, but on Friday, each increment of the update was taking forever.

The complete source_cache is currently ~850k gzipped. Although in aggregate this could cost the rubygems people a fair bit of bandwidth, it would never take 15 minutes on today’s broadband.

What we needed was some way of forcing the bulk update, which at the time was much faster than the alternative. The mechanism for this is not very clear, so we got by by hacking the code.

HOWTO

Thankfully, there is a better way or changing the threhold! Although its not well documented or, well, documented at all, you can set the bulk_threshold variable in the .gemrc file kept in your home directory. Its YAML, y’know:

:bulk_threshold: 1

See that colon out the front of the bulk_threshold key? Its because its a symbol once it gets inside the ruby.

As I mentioned above, its probably not good manners to leave your threshold at 1, since the authors have built the system in a certain way (even if its not always optimal) and we’re not paying the rubygem bandwidth fees. Just think, it’d be terrible for The Authors to chuck a Zed and shut rubygems down!

Hooray for Rubygems!

Last RORO Sydney meetup I did a talk on DRYing up your views.

I was very pleased with how it went – this really does get easier with practice! The first couple of slides were dropped, but you didn’t miss much of note :)

We’re really starting to refine the workflow for recording talks and I’m planning a write up of our experiences so far.

Big thanks to Tim Lucas for putting this months’ ‘casts together.

The Rails log is a very valuable resource. It contains a lot of information and its relatively easy to read.

However, I find that It doesn’t take long to get pretty sick of scrolling around, visually decoding, not to mention that the ansi covered SQL is a pain.

Logeye is my itch-scratcher to make it better and more useful. You point it at either your RAILS_ROOT or directly at a log file, and watch the requests flow past as you develop your app.

logeye 0.3.5 screenshot

Download

logeye icon
Logeye 0.3.6

Features and problems

  • In the open dialog you select RAILS_ROOT, not the log file itself.
  • Double click a log entry to open the corresponding controller file in your editor (set in preferences)
  • You can set window alpha, and make the windows float above other apps (set in preferences)
  • The zoom + does something useful.

Upcoming Features

  • filtering, searching
  • smarter opening.
  • refined log details view with visual distinction for each kind of line.
  • easy copying of SQL.
  • easy opening of files referred to in backtraces.
  • backtrace filtering.

update 1 2007/08/19

Released Logeye 0.3

changes:
  • refined look
  • ability to open log files directly
  • parsing of intra-request fluff

update 2 2007/08/19

Released Logeye 0.3.5

changes:
  • now opens nested controllers
  • it remembers which logs it was tailing last time you had it open and reopens them
  • more looks

Logeye 0.3.6 is a minor bugfix

Hornsby

A while back I gave a talk at the Sydney Rails Group about Hornsby, my plugin for example based modeling. I always meant to release it, but as it got a work out it never really gave me the satisfaction I craved.

Recently, there was an Err post about layering a DSL over fixture scenarios. The idea of an expressive DSL for setting up test or spec data was super, but I had trouble getting it to work with RSpec. Oh and fixtures? Why cling to these much maligned giblets of yaml?

So here’s Hornsby, reborn: A Scenario Builder without the fixture pain.

Read the rest of this entry

On the 18th of August I hosted a RoRo Hax day. 13 people turned up bright and early (for a Saturday) and got hacking on diverse Rails and Ruby stuff. Hax Day

Lone baked up a storm all day, fueling some great work.

Read the rest of this entry

Well whaddaya know? The second roro Sydney July presentation video has dropped. This time it’s Patrick Crowley from SD Ruby, San Diego talking about his two latest plugins, Headliner and Styler

“Phat models & skinny controllers” is the new catch-phrase of RESTful rails. Of course, in the name of small corèdness, there’s no default implementation of the aforementioned skinny controller, their monotonous commonality notwithstanding.

Camping’s controllers are willfully simpler than rails.

Luke Redpath’s restful_exposure provides a flexible implementation for skinny controllers. The implementation however, gives me the chills. I feel that its willfully complex.

Airbed is my response to these problems, for camping.

Read the rest of this entry

Here’s a post about getting down and dirty with an example of modeling something in both C and Ruby.

In C, Object Orientation can be used (somewhat clumsily) as a pattern for modeling and implementing your problem domain. The power of real object oriented languages like Ruby is that this pattern is integrated seamlessly into the language itself.

I’m not planning on detailing Ruby syntax itself, but hope that you’ll pick it up in the course of the discussion.

For a complete overview of OO concepts, refer to Object-oriented programming at Wikipedia.

This is the first of a series of articles covering Ruby OO techniques for C developers:
  1. Basic Modeling in OO
  2. Inheritance
  3. Encapsulation
  4. Polymorphism

Anyway. Let’s model!

Read the rest of this entry

There’s a great vibe in Oceania at the moment, especially if you’re a rails developer.

Inaugural intrameetup drinkies

Sydney folk gathered on the roof of the Glenmore Hotel, drank beer and shot the breeze. We pondered what the future holds with passionate developers looking for work often from risk averse businesses.

the first video from Sydney Rails July Meetup

Matt Allen talked about the site he works for, http://iseekgolf.com. Its a good example of a fairly large Rails site.

Tim recorded the screencast, while Jason was sound man. I post produced it, with wicked tuneage from Ben. The biggest thing I learned is that editing this stuff sucks without the right tools. Also, the right tools don’t exist yet.

My cocoa hat is coming off the shelf tomorrow.

The roro site reskin happened (!)

http://rubyonrails.com.au

Thanks to everyone who put in the elbow grease, it looks tops.