Sunday, September 30, 2007

hello facebook

A great little article about setting up your first hello facebook app with Ruby on Rails.


current favorite show : man stroke woman

Tuesday, September 25, 2007

big requirements

Put your big requirements up front. This is a great little article.

This is just what I'm trying to do with the rewrite of the sunshine organics website. It's tough to keep this in mind, the tendancy is to make the application as cool as possible, with all the features that the client wants, but I think the primary goal should be to launch a site, and then when the site is launched, to incrementally add features to it.

Rails is great for this, it has tons of tools for incrementally moving forward, like migrations and built in unit/functional/integration testing.

I just recently took out a whole level of complexity out of the application, this level of complexity was actually in the original application, and I was trying to replicate it, but I realized that by taking out this complexity, I could make the whole application much simpler.

The layer of complexity that I took out was to have the City as part of the database. It made a lot of sense to have the City inside the application, with it inside, you could just have one database to keep track of, you could do lots of neat shortcuts, and potentially cut out a bunch of work for the client to do each week.

However, this layer of complexity got into just about every model in the database, just about every model would have to reference the City model, but not all of them could reference it, so it wasn't just boilerplate code, it was a lot of very complex code to keep the two cities apart.

What did I do instead? I decided to remove the City model from the application, and instead just run two different Ruby on Rails servers, one for each City. Wow, that totally simplified things, and made this project much more manageable. I'm so happy I did this, I was totally dreading writing all this City code into every model, and was holding back as long as possible before I did it.

So, for me the moral of the story is to not be afraid of simplifying your application if it's getting too complex. Luckily Ruby on Rails made this easy, and the decision I made this morning to remove the City controller and split the application is already implemented and running.

zsh svn move

I love zsh:

for i in *; svn move $i ../main

This runs "svn move" on all the files in the current directory and moves them to "../main"

Sunday, September 23, 2007


Some years, September makes me sad. This is one of those years.


enlightenment rpms for Fedora Core 7.

That's interesting and all, but I don't like the direction that E16 has taken, I still compile from source with version from 2004. That was the best version of Enlightement, I think.

It's sad about E17, it's been 7 years now, and it's still not ready for prime time.

sawfish looked really promising at one time.


Wow, I like jottit, it's a really easy way to publish simple websites, and dear me, it's so fast! It's got some awesome interactive features, when you build a page or change the colours of your page, it appears very quickly.

It's built with I should look into


subdomains in Rails

You can find the host of the current domain in Rails with:

If you want to find the subdomain, Rails nicely parses this out for
you in an array called subdomains.

So, if you had a hostname like "", you could get
the "pr" by going



How to publish a git repository. When I get more time, I'm going to switch over to git from svn. I love svn, and it works really well for me, since I'm the only person working on almost all my projects, but it would be really nice to have the great branch managment of git, since branches in svn are fairly painful to do.


Building a perfect 404 not found page.


A really neat name that colour application, you just click on the colour wheel, and the application tells you the name of the colour. Neato!

Another neat page is this one that shows you all the hex codes for all greys. Except Catherine. (inside joke)

Saturday, September 22, 2007

JAPAN DANCE DELIGHT-2005 2nd-[POPPING](Hamutsun Serve)


rails and php

A very interesting blog post about switching back to PHP from Rails, yes, you heard right, PHP instead of Rails. He has some really good points, and I think you'll start seeing people moving away from Rails for big, complex applications.

For small, quick to launch applications, Rails really rocks. As you get larger and larger applications, you start running into impedance mismatches between the way that you think about your application and the assumptions that Rails makes.

With the current project I'm doing, a rewrite of in Rails, I'm still at the point where Rails is going to work well, but the last month has been pretty difficult, trying to figure out how to convert my mental model of how the application should work into how Rails wants to do things.

The biggest problem, by far, is the really pitiful state of documentation for anything slightly "out there" in Rails. For simple things in Rails there is just tons of documentation and code samples, but for things that are even slightly pushing the boundaries, documentation and discussion on the Rails mailing list just isn't there.

It's really strange, and I don't really understand why. In all the other programming languages and projects that I've worked on before, it has been much easier to figure out what I want to do.

I think that a big part of the problem is that Rails developers are way too entranced by doing magic things with Ruby, doing things with little magic solutions that sure look cool, but if you aren't totally immersed in the Rails culture are hard to immediately grok.

Another part of the problem is that Rails developers really like the latest "cool" solution, three years ago, Rails had all this ActiveWebService support, and then DHH got all anti on web services, and everything is all REST now. Well, there are major issues with REST, the biggest one is that GET, POST, PUT and DELETE are just not enough verbs to support many kinds of applications. They're fine for a certain subset of applications, but just don't have enough diversity for many applications.

Imagine English with just four verbs. The verb is the active center of a sentence, you hang nouns off of your central verb, and a language with four verbs is just not going to be very expressive.

I'm not sure what the solution is. I love Ruby, I love lots of things about Rails, but I think the whole Rails culture needs a reboot.

Wednesday, September 19, 2007


Wow. I just was part of one of the best jam sessions of my life.

It was out of control.

hedge fund stress

hedge funds are down about 2.5% this year and hedge fund managers are stressed.


A good article about Rush at the NY Times. Rush is my all time favorite band.

pirate day

arrr, me hardies... Today is International Talk Like a Pirate Day.

give me yer booty!

Tuesday, September 18, 2007

secrets, secrets

A really good Val's Art Diary this week.

groups of animals

I was watching an Inspector Lindley recently where they mentioned that a group of apes together is a "shrewdness", which piqued my curiosity to find this page that discusses those names. Some of my favorites:

A sleuth of bears.
A obstinacy of buffalo.
A clutter of cats.
A peep of chicks.
A business of ferrets.
A skulk of foxes.
A charm of hummingbirds.
An exaltation of larks.
A labor of moles.
A mischief of mice.
A watch of nightingales.
A romp of otters.
A parliament of owls.
A gaze of raccoons.
A surfeit of skunks.
A descent of woodpeckers.

Monday, September 17, 2007


Wow. Drool.

This is Ableton Live running some seriously cool plugins, all the in the effort to make out of control bass.




This is my handsome father in my beautiful garden, taken just now.
Posted by Picasa

Nine Inch Nails - Trent Dialogue / TDTWWA (Live: Sydney)

Trent Reznor tells everyone to steal his music.


From the lovely xkcd, my current favorite comic.


"With proprietary operating systems increasingly designed to restrict and control the user, with digital 'restrictions' management, their users are subjugated even more now than before. If you don't want chains on you hand and foot, your only escape is to switch to a free operating system." - Richard Stallman


Sunday, September 16, 2007


I always wondered about the Rails error message:

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

I was poking around the Rails source code and found it in:


It's explained in the following blog post. It turns

Wow, that's totally a horrible error message, it's not even grammatically correct, and it sure doesn't give new users any clue as to what is going on.

The Rails error messages are generally horrid, but this one is one of the worst.

Monads 1

Saturday, September 15, 2007

Green Day - Brain Stew/Jaded

DJ Sara Ver 1

Go DJ Sara!

DJ Sara and DJ Ryusei Ver 1

unknown gmail features

A list of 10 mostly unknown Gmail features, part 1 and part 2.

gmail advanced search

Advanced search operators to use with Google.

Ok, what I really want is pine + Gmail. I get really tired of the little lags between pressing "c" and when the message is ready to type. Gmail is quite fast, but these little second long pauses between pressing a button and the action are getting tired.

I really don't see that we can have that super fast responsiveness with web applications, there are just too many steps between when I press a button on my keyboard and something happens on my screen.

I keep thinking about the next phase of applications: Web-aware applications that live partly on my computer, for speed, and partly on the network, for reliability. These are going to be difficult applications to build, you'll have to build both the full web application and then extend this to the client.

I wonder, could we do all the work on the client in Javascript? Is it going to be fast enough? Right now, it's not quite fast enough, but with the new work going into javascript on Firefox 3, it just might be.

If we can't do it in Javascript, it's going to be back to compiled applications for each different platform that will interact with the data on the web.

Now that I think of it, of course there will be a continuum. Some applications will be entirely on the web, some will have some persistance and functionality on the client with Javascript in the browser, like Gmail, and some, like Picasa will be a compiled application that interacts with data on the web.

Unfortunately, it's often very different toolsets that you would use to build each of these. It would be nice to have one toolset that you could more easily transition from one type of application to the next.

gmail from

A great new tip to get Gmail to use a different From address in messages you send.


Using Xen for System Administration. Neat idea, basically give each user their own virtual machine.

One of my hosts is hosted by the excellent hosting provider Quantact, and this machine is a Xen slice. I just love it, it's fast and responsive, and it has a really cool backup system where I can create an image of the whole machine to restart from.

This is tougher to do when running your own dedicated remote host, like my other server at iWeb, where I have to be more careful when doing my system administration.

This whole virtualization with Xen and things like it is very cool, and we've just seen the start of what we can do with it.

typography by hand

A very neat video about a guy who still prints by hand with a big old linotype machine.

Thursday, September 13, 2007

tricky rails

here's a tricky little bug in Rails:

If you omit the :update parameter in a observe_form call, like this:

<%= observe_form 'form1',
:url => {:action=>'todo_line', :only_path => false} %>

Rails won't return the params of the form to the application with todo_line. You need to pass an empty hash for :update, like this:

<%= observe_form 'form1',
:update => {},
:url => {:action=>'todo_line', :only_path => false} %>

I got all this from the rails wiki.


For the site, I've finally got the basic core built, and have been in mostly Test Driven Devlelopment (TDD) mode for the last month. Something neat that happened recently was that as soon as I script/created a model, I wrote the test/spec for it.

I really like test/spec, it lets me mix up my specifications and my tests together so that if something really feels like a test instead of a spec, you can write it. I actually haven't written a single test yet, it's all been specs, but I like the idea that I could write a test if I really felt like it.

urban harvest looks really interesting, it's a weekly fruit and vegetable delivery service with a web front end, delivering to Kelowna. Looks really neat, I like that story about everyone who works there, that is really well done.

This is similar to out here at the coast in Powell River and the Comox Valley, which is the site that I'm redoing in Ruby on Rails.

Wednesday, September 12, 2007

working with clients

Get Out from Behind the Curtain talks about the benefits of including clients all through your design process.

style input file

Some sweet file input styling with CSS and the DOM.


How to customize attachment_fu file names. I love my attachment_fu, I use it in my new projects, after switching over from file_column.



webistrano is a web based interface to Capistrano.

fixtures in ruby

errtheblog tells us to write fixtures in Ruby.

fixtures and datetime

For some reason, I found it really hard to find the correct format for datetime fields in a Ruby on Rails YAML fixture. Here it is:

For a "completed_at" column that is of format datetime:

t.column :completed_at, :datetime

Use the following in your fixtures:

completed_at: '2006-06-09T10:50:13-0700'

neat code

some neat code from

Tuesday, September 11, 2007

In between sessions of coding on sunshine, I was playing on my drums tonight, recording things, adding effects, multiple tracks, clips and such, and just having so much fun. This is the final anthem of the evening. It somehow reminds me of marching around the walls of Jericho somehow.



I'm basing my new admin colour scheme on Swallowtails Again from the mighty

Here's the Flickr Picture

my current project

This is what I'm working on at the moment. I'm building an interface in Rails, Emacs, and Firefox, and it's sweet.

Now, if I could only get this kind of goodness for my desktop...

what time is it?

So neat, just google "what time is it" to get the current time where you are, plus a few other international cities.

Monday, September 10, 2007

zsh magic

mmm, zsh is the most awesome shell in the world. I had a slightly tricky problem where I wanted to get the last occurrence of a line that matched a pattern in a logfile, and wanted to do this over multiple logfiles.

I was going to use find, and just about had a command line that would do this, but then I realized that I'm living in zsh, and maybe...

so, I went to the zshtips page, and found what I was looking for. here's what I came up with:

new 283 [~/bittorrent] % for i in **/*.txt; grep -H percent $i | tail -1
mckenna-lecture-1.txt:percent done: 100.0
mckenna-lecture-2.txt:percent done: 100.0
mckenna-lecture-3.txt:percent done: 31.6
mckenna-lecture-4.txt:percent done: 25.0
mckenna-lecture-5.txt:percent done: 100.0
mckenna-lecture-6.txt:percent done: 1.0
mckenna-lecture-7.txt:percent done: 23.0

What this does is:
- look in all files that end it *.txt
- find any lines that match "percent"
- take the last line of this match
- print out the filename of those matching files as well

This is probably more readable than the corresponding find command.


Another great post from Barcelona Food Girl. This one is about paella... mmm paella...

slashdot jumps shark

Noah Gift asks the question When Was The Exact Day Slashdot Jumped The Shark?

I think it was when they went with this new CSS based design, it just isn't the same as the old HTML slashdot.

Isn't that funny, seeing how I'm the CSS fanatic now, table based HTML designs absolutely make me cringe.


Sunday, September 09, 2007


Fix a Frozen System with the Magic SysRq Keys - wacky!

I thought you had to have that compiled into your kernel, maybe modern ones do..


Atlas restaurant in downtown Courtenay.

yui fonts

For this latest project, the redesign of, I'm first redoing the Admin interface, as it used to be a combination of Microsoft Access and PHP.

For the new Admin interface, I can do it from scratch, so I'm trying out the Yahoo Web Framework, I'm working with grids.css, reset.css, and fonts.css. It's neat.

Here's a good reference for the sfont sizes in YUI fonts.css.

Saturday, September 08, 2007





Trippy happenings, right in my front yard!

Bemused Bistro is putting on an art show for Robert Colasanto. Excellent photographs, come see, and then join me for an iced latte on the patio below.
Posted by Picasa


just for fun, for this big project I'm working on, I'm going to use a butterfly palette. So many to choose!

Psy's colour palettes, this is a neato site:, I like.


The Gamma-Ray Large Area Space Telescope (GLAST) is going to go looking for the gamma-rays produced when WIMPs (Weakly Interacting Massive Particles) collide.


A really good article on heavier elements in stars and how they are produced.


World's first X-ray Free Electon Laser (XFEL) is being built at SLAC (Stanford Linear Accelerator Center). This is so sweet, this has the potential to totally revolutionize crystallography.

The world's second XFEL might be built at DESY. I remember when I was over in Holland, they were talking about this quite a bit.

When I went to the IUCR in Florence, there was a great presentation about XFEL by a guy from SLAC, it blew me away.


How gold is created in stars. Very interesting to realize, that stars can only burn up to Iron, going past that, into the fusion of Iron with more protons requires energy, so Iron is the heaviest thing that can be produce by nuclear fusion in a star.

So, how about elements more heavy than that, like gold?

Well, there are lots of different theories about that, a couple of them talk about processes in Supernova.

And how about the really heavy ones, like uranium?

Friday, September 07, 2007



Posted by Picasa


A very cool Quicksilver demo by its creator, Nicholas Jitkoff.

Now, we just need to do that with Emacs instead.

I've been thinking for some time that Emacs should start recognizing common keystrokes and command paths and offer to create macros of them for you.

Also, we need a better way to call and assign macros to keys. I guess it's not too bad:

do things here

But I just don't find myself doing this all that much.

I do create a lot more macros though, with the new F3 and F4 keys in Emacs 22. I just need a better way to keep track of them. Often, they should offer to create themselves, binding themselves to a Super-key or Hyper-key, to differentiate them from normal macros.

So, I should sometime get Super- and Hyper- working. I just about had it, but it got too a little too confusing with xmodmap.

Wednesday, September 05, 2007

responsive disclosure

I was looking for a good model for the Sunshine Organics admin replan and redesign in Ruby on Rails, and I think that Responsive Disclosure will be a great way to present lots of the information I need to show.

Now, for some good icons for the basic concepts.


yahoo, hmm:

yahoo aggressively blocking forwarded messages.

Tuesday, September 04, 2007


clowns fight racism

Sweet, an anti-racism counter-protest by clowns, anarchists and activists. So cool!

This is the totally the way to oppose racist rallies.

Sunday, September 02, 2007

emacs + multi-tty

Yay, finally they've merged multi-tty into the CVS head of Emacs.

I'm downloading it now, it's been soo long since I've used CVS. I use Subversion now almost exclusively. What was funny was that the multi-tty branch of Emacs used an even more advanced code repository, bazaar.

Anyways, it was a little hard to find this info, which helpfully gave me:

cvs -z3 co emacs


The release of Python 3.0a1. I'm surprised at how rapidly and aggressively they're doing this.

I think it's great, it's much harder on the users when the don't know when the new language spec will be complete.