27th Jun, 2005

1 comment

Ubuntu on Rails: Getting up to speed with Ruby on Rails and Ubuntu

I got my introduction to Rails with O’Reilly’s Rolling with Ruby on Rails article. Unfortunately, it’s very Windows oriented. Thankfully there’s great docs for getting everyting going on Debian or Ubuntu.

Install Ruby on Rails
The Ruby on Rails wiki provides a great tutorial. Basically, you apt-get install a bunch of ruby packages, manually install rubygems (a ruby module manager a la CPAN), and then use gems to install rails. I needed to have sudo to run most of the commands.

Read About Rails
You can start on page 2 of the O’Reilly Article, since the first page is all about installing on Windows. There’s more Windows-centricity to work around, see below.

The Webserver
The article recommends using the supplied webserver. I used that for now since I was more interested in getting a taste of Ruby than I was of Apache conf files. Initially I started the webserver in the background, but it spits a lot of output. You’ll probably want to redirect the output with a command like.

ruby script/server &> /tmp/rubylog

The Database
The article assumes a GUI MySQL admin interface. I prefer the command line. Here’s a sql file that handles all the table creations for you.

Gotchas
The database/model naming convention is goofy. Table names are plural, foreign keys singular, and models singular. That tripped me up. I’d much prefer the table names be singular so that they can match the foreign keys.

A lot of the commands in the article were written for a Windows server so some of the slashes are backwards.

Resources
Rolling on Rails, Part Two
Explanation of Minutae in the Rolling Articles
Programming Ruby, the book, online, for free.
Ruby on Rails site

27th Jun, 2005

No comments

How did Mad Hot Ballroom survive the copyright cartel?

45% of the budget for Mad Hot Ballroom went toward getting copyright clearances for the movie.

Here’s the danger of these sorts of requirements for documentary makers.

Sewell: Well, we had to watch out for billboards and Frito-Lay trucks all the time. But I usually didn’t care, we would just shoot. The biggest danger with clearances is when they interfere with documenting real life. Something spontaneous like a cell phone ringing is different than a planned event. If filmmakers have to worry about these things, documentaries will cease to be documentaries! What happens when the girls go shopping and there’s music playing in the stores? We were lucky because in our movie the music wasn’t identifiable, but otherwise what are we supposed to do: walk up to the store manager and say, “Excuse me but can you turn off your radio?”

22nd Jun, 2005

No comments

XQuery Shell

My coworker Andy Bruno just uploaded an XQuery shell for MarkLogic. It looks pretty sweet.

Read the docs or download the code.

Andy and fellow programmer Ryan Grimm are doing amazing things with xquery. I can’t wait until we can release some of it.

17th Jun, 2005

No comments

Habits for Successful Regular Expressions

O’Reilly just announced Damian Conway’s Perl Best Practices book. I tech reviewed the regex chapter – it’s full of great advice.

If you find that’s too much advice, let me recommend my own Five Habits for Successful Regular Expressions.

If that’s still too much advice let me leave you with just two hints: use extended whitespace and test. Nobody can read regular expressions so the least you can do is put in some line breaks and comments. Also you’re going to be tweaking your regex. Everybody does this – regex is the ultimate for code and fix development. What you need is a list of test cases that you can run after each tweak. I recommended a quick and dirty Perl test harness in the article above.

16th Jun, 2005

No comments

Net::Safari – An API Wrapper for Safari Bookshelf

I just uploaded a perl module for connecting to Safari Bookshelf’s API, Net::Safari. There’s still some work to do, but I’ve been getting use out of it so I thought other people might too.

The Safari API can be really useful if you want to search within books. For example, in my POD search app I wanted to display books related to the current module. The Safari API let me search inside code examples for mentions of the module. It’s not just search inside the book – it’s search inside the code.

You can read more about the Safari API on the Safari site.

13th Jun, 2005

No comments

f-spot Photo Gallery

I used f-spot for Linux to organize my Tibet photos and put together my photo gallery. f-spot uses tags to help you organize your pictures. That’s a great idea – totally pragmatic and flexible. It also produces gorgeous online galleries.

The software is alpha, and thus a little buggy. It doesn’t have the ability to edit EXIF data yet. The timestamps on the photos from me and my friends were all over the map, so I had to correct them with an outside program. However, f-spot didn’t recognize the new timestamps unless I removed and readded the pictures. Of course that meant readding my tags.

The other problem I had was that it wouldn’t generate my photo album. That’s a problem that mysteriously disappeared. Good thing too, the photo album that it did produce looks great.

13th Jun, 2005

No comments

Quotes From The Experts

“In a room full of expert software designers, if any two agree, that’s a majority.”

Greg Moreno’s gaboogle.com blog turned up in my Steve McConnell watchlist with this list of quotes from software development experts.

The rest of his blog is quite good and worth adding to your rss reader.