jlaine.net

A Day at the University

Wednesday was a really good day in many ways. I was giving my first lecture ever about Rails and it went real smooth. The audience consisted of about 30 students of “Programming Hypermedia” class given at the Hypermedia Lab of Tampere University of Technology. As it was my first real public presentation both about Rails and in general, I was a bit nervous about how it would go. Turned out I really was equipped to give such a talk. The students seemed to be genuinely interested. I got many good questions (like “how does it scale?”) and could even answer them (“share nothing, baby!”).

It seemed that some of the people in the audience had really been burned by their php assignments so my 45-minute demo of setting up a blog with rss feed hopefully hit the target.

So the conclusion is: I really know Rails reasonably well, so well that I can give presentations and demos on it without losing my audience. So if you’re interested in Rails and would like it to be presented to your team or the whole office, drop me a line and we will put up a workshop to share the love.

“But wait!”, you say. “What other things made the past Wednesday so great?” Well, Liverpool tied with Juventus and went on with 2-1 in aggregate goals to the semifinals of UEFA Chapions League, not less because of the rock-solid defense led by the Finn Sami Hyypiä.

PHP and Fat Burning

A Swedish guy just posted this link to a Swedish online bookstore Bokus. It’s the page for book PHP Bible by Joyce Park and Tim Converse.

What’s special in that page are the community features of modern online stores. On the bottom of the page there is a section called “Your click list”. It contains items that have been bought by people who have explored the same items as I. When the click list consists of only the one abovementioned book, the first suggestion is Allt om fettförbränning 1 (All about fat burning 1). Whoa!

But the fun doesn’t end there. There is also a section called “In the same bookshelf” that has items bought by people who also bought the current item. What could we possibly find from that list on a PHP Bible page? Well, the first item (Allt Om Glykemiskt Index : Fettförbränning, Hälsa, Viktminskning, Styrka, U) seems to indicate that PHP hackers are at least concerned about their overweight. But wait! What else is there? Att Ta Sig Upp När Man Är Nere : Hjälp Till Självhjälp Vid Depressioner (Taking you up when you’re down: Help for self-help in the case of depression).

Hmmm… you can’t deny the facts, can you? So what can you say?

Dear PHP coders, please lighten up. The summer is coming even in Sweden some day. I know that PHP coding can be depressing but don’t lose your faith. Maybe even your boss will trip onto Ruby on Rails some day. Oh, and believe me, you can make a difference. Take a look at RoR today, create a cool prototyope using it tomorrow and who knows – maybe your firm is using Rails for the next project.

Running Your Own Lighttpd (on TextDrive) and Keeping It Alive, Too (Part I)

Now that TextDrive supports lighttpd and I’m eventually moving all my sites to a lighttpd/fastcgi setup, I’m confronted with a new problem: the webserver process is now mine and I’m the one responsible for keeping it running.

The first thing to remember (and to fix) is that my lighttpd process is not started automatically at server bootup. This is fortunately easy to fix:

  1. Login to webmin (e.g. http://webmin.bidwell.textdrive.com) and click Scheduled Cron Jobs under System. Important: you can’t use usermin as it doesn’t seem to have the necessary privileges to schedule cron jobs. So do yourself a favor and dive right into webmin.
  2. Click Create a new scheduled cron job.
  3. Type your lighttpd startup command in the Command field. For example, /usr/local/sbin/lighttpd -f /usr/home/[yourname]/sites/[yoursite]/config/lighttpd.conf. Remember that you need to use the whole paths in your command, otherwise all hell can break loose.
  4. Select Simple schedule and When system boots from the drop-down menu.
  5. Submit the form clicking Create.

Congrats! Your lighttpd service should now survive the unfortunate days when “a pair of redundant UPS units fail”.

We’re not quite there yet, though. As sure as people die some day, processes die too. Wouldn’t it be even nicer if we could somehow monitor that our beloved lighttpd is up and running at all times? Hint: yes, it would.

So, next we’re going to wrap up a Ruby script that keeps a keen eye on our webserver. But that’s a great topic for a sequel (I’ll never get to write sequels unless I break my stories in multiple parts). So go ahead and implement your own reboot-surviving lighttpd machine. More to come later.

Rails Gets More Exposure in Finland

Only about a week before my lecture, “Ruby on Rails – Web applications with a glimpse in the eye”, Assemblix.net, a major developer newsletter in Finland publishes an above-the-fold article about Rails. The article goes briefly through the MVC pattern implementation of Rails. The conclusion states that “some people have sung the praises of Rails while others think that the same can be accomplished with [replace-with-your-favourite-tool]” (translation mine).

I would like to point out that the magic of Rails is not what can be done with it, but rather how it can be done: extraordinary fast, keeping the focus on the end product instead of implementation details, and – most importantly – always with a smile on your face.

However, I find the article a major breakthrough in the given newsletter and the developer community in Finland in general. This is to my knowledge the first editorial article in Assemblix breaking the mold of Java-Windows-PHP, the emphasis having been on the first two.

So I salute the editors of Assemblix, although one could say the buzz around Rails makes it impossible to go wrong with such an article. Anyway, it’s great to get more publicity for Rails here in the land of reindeers and aurora borealis, too.

Aaltonenshoe.com Runs Lighttpd

My latest Rails project, Aaltonenshoe.com is now running on a lighttpd/fastcgi setting. Moving the setup over from an Apache/CGI one was a matter of minutes with the help of Jason’s Having one’s own lighttpd and running it, too

After I got the port from Jason, I made a few small changes to the llighttpd config file I was using on my local dev server, went to Webmin (Apache => Aliases and Redirects) and pointed aaltonenshoe.com to aaltonenshoe.com:8504. Saving those settings resulted in an error in webmin but that was fixed by Jason very fast.

My conclusion: The site now runs very, very fast without any caching.

What’s in a Mac?

David Heinemeier Hansson of Ruby on Rails fame has yet again stirred a hor€est by stating that he would “have a hard time imagining hiring a programmer who was still on Windows for 37signals.

While David’s tone is (more or less intentionally) pretty provocative, most of the angry commenters seem to have taken his thoughts totally backwards:

Great programmers are made by talent, not by the tools and platform they choose, damn it. Saying anything remotely otherwise is incredibly ignorant. … Like I said, talent. I really don’t see any link between the above and the choice of tools.

Well, David never said great programmers are made of the tools. But as anyone who’s read Pragmatic Programmer: From Journeyman to Master knows, great hackers are passionate about the tools they use. That’s why David is concerned about the “covers both needs just fine” attitude a few of the commenters advocate.

I wouldn’t be as harsh as David. I can imagine there are reasons why people really want to have a Windows PC. But if a developer is not passionate about making herself more productive, how could she be passionate about the project I would be hiring her for?

What surprises me most, tho, is that still – in 2005 – the most common reason for avoiding a Mac seems to be the price. Well, let me tell you something. Powerbooks start at €1500 here in Finland, probably the most expensive corner of Europe. Believe me, you will have a hard time finding a comparative PC laptop at that price, let alone half of it.

And to Simen Brekken, who’s starting to love his 12" PowerBook but thinks it’s too slow: it doesn’t need a new CPU. It needs more RAM. Running Photoshop, Indesign and Illustrator simultaneously is nothing spectacular for G4, as long as it has 1GB or more RAM.

A Touch of Mark II

A word of caution: this entry has no other meaning than to show off.

My hand and a Canon

Yes, that is my hand holding a brand new Canon EOS-1Ds Mark II. The bad news: it’s not mine (with the voice of Austin Powers). We were visiting Maria’s parents after a while and I finally got a chance to play a bit around with my father-in-law-candidate’s new baby.

So how does it feel? Like a brick. I’m telling ya baby, that’s a helluva pack of hardware. I never touched an EOS-1, but this is certainly heavier than an EOS-3. Of course it has the vertical hand grip built-in, but dragging an EOS-1Ds with e.g. the 70-200mm/2.8 lense for a day sure beats a gym session.

A flower

I took a few quick photos with the camera (and another few of it) and posted them to a Flickr set. Nothing spectacular, I seem to a be a bit rusty after shooting too much with the wide focal area of a digital point’n’shoot. In 1Ds with default settings (especially with the 100mm macro lense) the area is so razor sharp and narrow that I seem to have missed the target in all but a few of the photos.

My set was exported as medium jpeg’s (that’s 6MP, folks!) and even then the quality of the photos was astonishing. Can’t wait to get a hold of the 16MP RAW files after a real shooting session, which I sure hope I can get arranged later this spring.

Rails Tip for Today

Caching is turned off by default in the development environment. If you want to try it out before switching to full production mode, change the following line in [yourapp]/config/environments/development.rb:

ActionController::Base.perform_caching = false

to

ActionController::Base.perform_caching = true

Invasion of Rails Books

Announcements about Rails-related books seem to be popping up like mushrooms in the rain today. First, Scott Barron (and later DHH) announced that he and Marcel Molina jr. have signed up with Pragmatic Bookshelf to write Pragmatic Rails Recipes: A Guide to Elegant Web Development. The book would be a sequel for the probably first-ever Rails book, Dave Thomas’ Agile Web Development with Rails, about to be published in July.

Only a few hours later Curt Hibbs comes up and tells on the Rails mailing list that

Bruce Tate and David Geary (author of Core Java Server Faces, Core JSTL, and more) have signed with O’Reilly to write a “Rails Developer Notebook” (obviously one of O’Reilly’s new Developer Notebooks series).

These are really great news. The profound interest publishers like Pragmatic Programmers and O’Reilly are showing towards Rails is a clear sign that there is something worthwhile being done in the community and that the framework won’t end up as just another one-night-wonder. We’re clearly on the roll!

It’s About Trust, Baby

O’Reilly Network has a great interview with Jason Fried, president of 37signals. Something Jason says in the interview really resonates with me (also quoted by DHH):

If you don’t trust your developer to choose the right environment, then how can you trust him to build the best application? Trust is critical here. And, further, why would you dare impact your developer’s morale by throwing him or her into a language where he can’t be as productive or as satisfied? You only get good work from people who enjoy doing the work. I’ll take a happy average programmer over a disgruntled, frustrated master programmer any day.

I don’t understand how any other attitude would make any sense, and still this globe is full of CTO’s “knowing” what’s the best for their developers. I’m privileged to work with clients like Aaltonen Shoefactory who trust in my opinion to choose the best tools and solutions for my and, ultimately, their needs. A great thank you for that.