14 Aug 2008

Tutorial #2: Recap

Posted by Jamis on Thursday, August 14

So, the second Capistrano tutorial session has come and gone. It was a great session, though it started pretty rough. (I was very unprepared for some windows-related configuration issues during the first half-hour. That won’t happen again.) I appreciate everyone’s patience who participated!

I’m going to be quiet on the tutorial front for the next several weeks, but its not because I’ve given up on them. I’m going to be rethinking some aspects of them. I really want these to be opportunities for people to master capistrano, and while these first two tutorials have been very useful to those who attended (their words, not mine), I think they could be even better.

Stay tuned!

Posted in Reviews | 3 comments

11 Jan 2008

Advanced Rails Recipes and Capistrano

Posted by Jamis on Friday, January 11

Mike Clark’s Advanced Rails Recipes (still in beta) is fantastic. I can’t recommend it enough. And if you’re looking for new ways to use Capistrano, you’ll find Mike’s book stocked with (at last count) 9 great deployment- and capistrano-related tips, including how to create custom maintenance pages, running multistage deployments, preserving files between deployments, responding to remote prompts, and more. You won’t be disappointed.

Posted in Reviews | 5 comments

29 Jun 2007

Ostrava on Rails

Posted by Jamis on Friday, June 29

Well, it’s been a week, and I’m finally finding a moment to write up my experiences at Ostrava on Rails.

What a great time.

The original plan was that I would spend a few hours in Prague, sightseeing with Tobias Luetke, but that didn’t quite work out. Instead, I spent the time in the Praha-Holešovice train station, watching a terrific thunderstorm and wondering how to pronounce the words on the signs all around me.

Tobi arrived just in time for the train to Ostrava, as did Saimon and Filip. Filip, being a native of Prague, was also able to instruct me in general Czech pronunciation (and also put up with my ceaseless questions about the Czech language—thanks a ton, Filip!). The train ride was nice, and when we arrived at Ostrava-Svinov station, Lucie Malikova was there to drive us to our hotel.

Day #1 of the conference dawned bright and sunny, and Lucie arrived early to show us the way to the venue, which was within walking distance. The walk was pleasant, and the venue (the Technology Park at the college there) was very, very nice. I got to speak first (a 45-minute variation on the 3-hour Capistrano tutorial I gave at the Portland RailsConf), which let me relax nicely for the rest of the day, and to enjoy Saimon Moore’s presentation (on I18N), Tobi’s (about the origins of Shopify and founding a startup on Rails), Luke Francl’s (about sending/receiving MMS messages with Ruby and Rails) and Tim Lossen’s (about building an inexpensive Rails cluster).

Dinner that night was at a fantastic restaurant—I had some of the best trout I’ve ever had. The menu was really varied. After that, our guests wanted to show us one of Ostrava’s most famous features, Stodolni street, which is lined with pub after pub. A sudden rain cancelled that walk, though, so instead we were shown to a really cool little place built atop a theater club, and we were the only ones there. I had a good opportunity to chat with Robert Cigan, one of the organizers of the conference and one of the few professional Rails programmers in the Czech Republic.

The next day was all in Czech, but the slides were English. I’ll admit I dozed off for a bit during Robert’s presentation (sorry, Robert!). All through both days, though, you could really feel the energy and excitement about Rails. The Czech Republic (and many other central European countries, I imagine) are at an interesting point in their adoption of Rails. It’s about where the US was two years ago, with lots of skeptics and very few professionals using Rails. The very first Rails hosting service in the Czech Republic was even announced at the conference. To some (Robert, I’m talking to you) it can seem pretty lonely to be a Rails programmer in CZ right now, but I predict that the next year will see some pretty significant changes.

All in all, I loved that conference. It was a wonderful opportunity, and I hope I find my way back to the Czech Republic again sometime. Many, many thanks to Jiři Štursa and all the others who worked so hard to bring it off!

Posted in Reviews | 1 comment

21 Feb 2007

Review: Build Your Own Ruby on Rails Web Applications

Posted by Jamis on Wednesday, February 21

I was recently sent a copy of Patrick Lenz’s Build Your Own Ruby on Rails Web Applications, published by SitePoint. While I am certainly not in its target audience, I still found the book’s style refreshing, and even learned something about Rails I didn’t know before! (The debug helper, for inspecting models in your views.)

The book is marketed as “the ultimate beginner’s guide to Ruby on Rails”, and while I don’t know that I would go quite that far, it is definitely a good introduction, especially if you are new to Ruby. I felt it spent about three or four chapters too many on introductory matter (you don’t really start doing anything with Rails itself until chapter 5) but once the book gets started it does a good job of helping you get a new Rails application off the ground.

  • It was written for Rails 1.2, making it one of the few books available covering the newest version of the framework.
  • It encourages unit and functional tests. Patrick mentions TDD, but does not follow it in the book, which is probably for the best in a book targeting people with little prior programming experience. Instead, each chapter ends with a section in which he walks through the process of adding tests for the features added in that chapter. Effective, but only as a step towards learning better testing practices.
  • It makes good use of the code generators and migrations, demonstrating their strengths well.
  • It shows how to use RJS templates to implement Ajaxed features, and the respond_to method to implement graceful degradation for browsers without Javascript enabled.
  • It shows how to implement a basic user authentication system without resorting to plugins! Far, far too many newcomers to Rails jump on the user-auth plugin bandwagon, which leads to cargo-culting. My advice is: never use a plugin you would not be able to write yourself. (Later in the book Patrick uses the acts_as_taggable plugin to implement tagging, but ultimately the point of the chapter was to show how to use plugins.)
  • It walks you through setting up your first production environment. Although it doesn’t use Capistrano (which would be well beyond the scope of the book), it does mention Capistrano, as well as many other possible deployment environments (including SCGI, Mongrel, nginx, and more).

So, are you new to Ruby and Rails? Want to learn how to write dynamic web applications? This book will suit you nicely. However, if you have prior experience with building Rails apps, you’ll probably find this book too simple for your own needs.

Great work, Patrick! And congrats on getting a book based on Rails 1.2 out the door so quickly.

Posted in Reviews | 9 comments

25 Jan 2007

Review: Beginning Ruby on Rails E-Commerce

Posted by Jamis on Thursday, January 25

I was recently asked to review Beginning Ruby on Rails E-Commerce, a book by Christian Hellsten and Jarkko Laine, published by Apress. It was plugged on the Riding Rails weblog back in November, so it’s not exactly “hot off the presses”, and unfortunately it was written against Rails 1.1 (not their fault—Rails is a moving target that makes any author go gray prematurely). That said, it is still a compelling book, packed with all kinds of good stuff.

To start, I’ll say that I really liked the writing style. They tie the chapters together using a story about an online store owner named George, who has hired them as contractors to build a new bookstore, using Rails. George is very, very believable (is he a real person, Christian and Jarkko??), and he adds a nice dash of humor. It makes what is otherwise a very information-heavy book fun to read.

Another plus: the book preaches test-driven development (TDD), which is something I’ve not seen other Rails books try to do. It demonstrates it by example, showing how you would write your tests first and your code after. It’s a technique that I’m still learning to love, but which has all kinds of wonderful benefits. On the downside, their use of TDD in the book is a bit inconsistent, but at lease they are upfront about when they are going to go test-first, and when they aren’t.

They also advocate using Rails migrations right off the bat, which is definitely a best practice. If you aren’t using migrations yet, you should be. And yes, that is chastisement you hear!

Other techniques and technologies they present in the book:

  • Ferret (a full-text search engine inspired by Lucene, written in Ruby), though actually it is more a demonstration of the acts_as_ferret Rails plugin. I was a little disappointed that they didn’t delve into things like maintaining a Ferret installation, since from what I’ve heard that’s the hard part.
  • Simple HTML sanitization by using the h() method. Did you know you can do <%=h person.name %> in your views to prevent script-kiddies from messing with your pages? Well, you can. And you should.
  • Foiling form and URL manipulating by using attr_protected. This is a feature that many people don’t know about—I often forget about it myself, and wind up doing things the hard way. They also talk about avoiding SQL injection vulnerabilities and cross-site scripting issues.
  • Integration with payment gateways, using a few different Rails plugins.
  • Internationalization (I18N) and localization (L10N). Not having ever done this myself, I found their discussion of these topics very enlightening.
  • RJS and render.
  • Using Selenium with Rails applications to do automated acceptance testing. This is definitely something I’d like to explore more. Their discussion in this book was pretty compelling, and did a good job of showing off the strengths of this tool.
  • Capistrano! Any book that plugs something I wrote has to be good, right? ;) They did a good job of taking you from installing Capistrano to running your first deploy. In fact, they cover a lot more than just Capistrano—they take you through the whole process of installing an entire stack on your server, from lighttpd, to fcgi (or mongrel), to getting Ruby and all your assorted dependencies going.
  • Optimize your application with caching. They demonstrate all three caching techniques, too: action, page, and fragment caching.

That said, there were a few things I wasn’t so impressed with. For instance, they used request.xhr? to determine whether a request was Ajax or not, while the best practice since Rails 1.1 has been to use respond_to blocks:

1
2
3
4
5
6
7
8
9
10
11
12
# don't do this
if request.xhr?
  render(:update) { |page| ... }
else
  redirect_to(...)
end

# do this instead
respond_to do |format|
  format.html { redirect_to(...) }
  format.js   { render(:update) { |page| ... } }
end

Also, they used scaffolding to build parts of the application in the book… I know scaffolding has it’s place, and can be valuable to newcomers as an aid in getting them to the “meat” of Rails without stumbling over too many details, but I have lots of issues with scaffolding. It puts the emphasis on the application’s model, instead of the user interface, and that’s all backwards. I won’t rant too much here—I’ll save that for a separate post. :) That said, I have to grudgingly admit that a book that teaches Rails probably does well in using scaffolding as a shortcut, but I still wish it wasn’t so prevalently used as a “best practice”.

So, overall, I was quite impressed with the book. It covered a lot of ground, and covered it well for the most part. It’s a great “getting off the ground” book, and anyone wanting to write an e-commerce site in Rails could do much worse than reading this book. (Just keep in mind that some of what they demonstrate has been deprecated in Rails 1.2, like end_form_tag and assert_tag.)

Well done, Christian and Jarkko!

Posted in Reviews | 19 comments

12 Dec 2005

The Lion, the Witch, and the Wardrobe

Posted by Jamis on Monday, December 12

My wife and I found a babysitter this afternoon and went and saw The Chronicles of Narnia: The Lion, the Witch, and the Wardrobe. I’ve been especially curious about the film after reading afew scathing reviews lambasting it for its “religious themes”.

Well, I absolutely loved the movie. I haven’t been so moved by a film in a long time. The acting was superb, the scenery was beautiful, and the special effects were great. The religious themes are certainly there, if you look for them (but they’re in Lord of the Rings, too, if you look for them, and no one ever condemned that film for it).

I never see a film twice in the theater, but I would definitely make an exception for this one.

Posted in Reviews | 7 comments

09 Dec 2005

Phonewords

Posted by Jamis on Friday, December 9

I was recently pointed at Phonewords, a Mac OS X Cocoa application for discovering words hidden in your phone number(s). It’s a fun little program—the free version will give you up to ten words, and for $10 you can register and have it give you every word it can find.

It also comes with an address book plugin that allows you to generate and select phonewords from within your address book. (There’s even a demo movie that shows off this feature).

The sad news is that my phone number doesn’t work out to anything meaningful. My cell-phone number at least gave me something memorable. But whether you get anything meaningful or not, it’s still a fun app to play with.

Posted in Reviews | 5 comments

Returning to Firefox

Posted by Jamis on Friday, December 9

Since moving to the Mac in March of this year, I made a 7-month effort to fall in love with Safari. I almost succeeded, especially since the default look-and-feel of Firefox on the Mac is excrutiating. However, there was just enough pain involved in using Safari that I began to look at making Firefox my default browser again. In particular:

  • Safari makes debugging Javascript very, very painful. Often, you’ll get an error message with a line number of 0. The only way to debug those are to throw alerts everywhere. That, or use Firefox (or Opera, which really seems to have figured out how to report JS errors, backtrace and all!).
  • The tab key never seems to behave like I expect in Safari. I’ve tried the various options for changing its behavior, but it still surprises me. I haven’t really tried to sit down and define why it surprises me, but Firefox seems to behave more in keeping with my expectations.
  • The tab key in dialogs in Safari never seems to work—I have to explicitly point-and-click when I want to click something other than the default button. Grrr!
  • Safari doesn’t have Greasemonkey! I decided I wanted to see what all this hoodwinkiness is about, and it was too much of a pain to have both Firefox and Safari open at once.

So, I turned to Google to see if I could solve the look-and-feel issues I had with Firefox on the Mac. And, lo and behold! I found the following nuggets of wonder and beauty:

  • GrApple is a very nice OSX-ish theme for Firefox. Makes it look much (much!) nicer. (Unfortunately, at the time of this writing the site appears to be having problems…hopefully that gets resolved soon.)
  • Tab X is a Firefox extension that puts the “X” button (for closing tabs) on each tab.
  • Firefoxy is a MacOS app that updates your Firefox chrome to make form widgets look a bit more like OS X widgets. (Just a bit—but it’s a lot better than the klunky Win32 look that Firefox sports otherwise.)

Furthermore, Firefox has a feature that lets you import your Safari bookmarks! Very nice. It even preserved the contents of my bookmarks toolbar, which I had set up just so in Safari and was a bit trepidatious about replacing.

These, taken together with the speed improvements in Firefox 1.5, make using Firefox on the Mac much nicer. I now use Firefox exclusively, and only dust Safari off every now and then for testing.

Posted in Reviews | 18 comments

17 Oct 2005

RubyConf 2005

Posted by Jamis on Monday, October 17

What an incredible weekend.

I just got back from RubyConf 2005 last night. Late. I would have blogged about it as it was occurring but I was spending every spare minute I had hacking on Rails, gearing up for the release of 1.0 RC1.

So, now that I have a minute, I figured I’d sit and write about some of my impressions.

It was definitely unforgettable. Almost 200 Rubyists packed into a conference room, Mac laptops everywhere (are you PC folks feeling any pressure to change, yet?) and ideas and code flying fast and furious. I finally got to meet most of the Rails core team face-to-face, which was a real treat. I am honored to be a part of that group.

Late nights, hacking. Every night. Combine that with early mornings (to get a decent seat) and you wind up with a real recipe for sleep deprivation.

I loved listening to Matz talk about Ruby, although it was unfortunate that so many people turned his keynote into a “why can’t you just…” session. Still, I was very impressed with how he handled that, listening to people and responding politely.

Probably the most life-changing thing that occurred at the conference was that I decided to give TextMate another try. It has certainly progressed quite a bit since I last tried it, and although I do miss the implementation of some of vim’s features (like joining the next line with the current—TextMate does it, too, but not as cleanly) I think I could grow to love TextMate. The hard part now is learning how to be effective in this new editor. Having used a mode-based editor for so long, it’s difficult to remember how to use anything else!

Posted in Reviews | 9 comments

15 May 2005

The Sad State of Mac Genealogy Software

Posted by Jamis on Sunday, May 15

I’ve recently been experiencing a renewal of interest in family history research. About 4 or 5 years ago I did quite a bit of work on my genealogy, but what with kids (and Ruby!) I’ve only recently rediscovered that passion.

Unfortunately, this renewal of interest coincides with my adoption of Mac OS X. I say unfortunately, because I have looked and looked for a decent genealogical program for OSX and am frankly astounded by the lack.

“Lack” is probably too strong of a word. There are actually quite a few applications for the Mac, and a few of them are even free. But I have been less than impressed what what I’ve seen.

  • Reunion by Leister Productions appears to be the suite of choice for most Mac-using genealogy enthusiasts. Unfortunately, it is also butt-ugly. I can’t emphasize that enough. I’m sure there are plenty of ugly Mac programs, but I can’t believe people would pay $100 for something this hideous. It’s like they couldn’t decide on a color schema and so went for as many pastels as they could find. And the list of children, there at the bottom? What’s with the bizarre diagonal layout?
  • Heredis is a bit better—it at least looks like a Mac application. But it follows a philosophy of “make everything available in a single window”, which I found a bit overwhelming. It also took forever to import my database (20k individuals), which doesn’t exactly make me confident in its ability to handle large databases. Not something I’m willing to spend seventy bucks on.
  • MacFamilyTree is the most visually appealing of the three commercial apps I checked out—I was very impressed by its look. However, my impression of it is that it would make a very good application for a beginning genealogist, who has a very small database. It doesn’t handle rapid data entry well at all, and it cannot handle databases larger than a few thousand individuals. It also uses the GEDCOM file directly as the persistant storage, which does not scale. (A side-note: I cannot understand why so many programmers of genealogy software persist in thinking that a raw GEDCOM file is a good way to store genealogical data. It is a data transfer format, for crying out loud! Any program that uses the GEDCOM directly as the database is unsuitable for my uses, because the raw GEDCOM file as data storage mechanism cannot scale to tens of thousands of individuals. Figure it out, people!)

I also looked at several free applications for the Mac, and they either were extremely minimal, funtionally, or they used the GEDCOM file directly. (I’ll forego a second rant.)

I know there are some decent apps that run under X11 (like GRAMPS), but (for one) I don’t want to have to install all the million little dependencies those have, and (for another) I’ve never found those apps very well suited for my style of research.

Frankly, the only genealogy application I’ve ever really liked is the Personal Ancestral File versions 4 and 5, which only runs on Windows. I really don’t want to have to do all my research on Windows. Really. I cannot use Windows anymore without becoming extremely frustrated.

So, unless someone can point out another option for the Mac that I haven’t already looked at, I’m thinking about writing my own. (This is one of the “need” applications I mentioned in my last post.) In general, web-based genealogical programs are very difficult to use for anything other than browsing one’s database, but I’ll probably use a simple Rails-based interface so I can work out the data model, and then I’ll try and learn ruby-cocoa in order to make a prettier UI.

My requirements:

  • Scale to tens of thousands of individuals.
  • Easily navigate the database, not only from parent to child and child to parent, but jumping to specific individuals quickly.
  • An evidence system that isn’t just an afterthought. Sources are critical to genealogical research, a fact which too many apps seem to overlook.

Anyway, we’ll see what comes of this. Regardless, I’ve got to find something.

Posted in Reviews | 39 comments

10 Apr 2005

Text Editing Dilemma

Posted by Jamis on Sunday, April 10

So, I’m facing something of a dilemma. Almost a crisis. I’m on a Mac, and I need a text editor.

Wait, I know, many of you reading this will eagerly submit TextMate or BBEdit to my attention. Or even Vim.

Well, I’ve been using vim, almost forever. It’s definitely my editor of choice. But I like to use gvim because I can have multiple editor windows open without having to have multiple terminals open. (Yah, I know about screen, but it’s not as nice as having multiple independent windows.) Vim on Mac works very well from a terminal-but gvim is not quite as well polished. It is definitely a second or third-class citizen of the OSX desktop, with very minimal integration with the UI. I’ve been able to work around or overlook most of the issues for a while, but things are coming to a head, and I’m aching for something that fits in more naturally.

So, I downloaded TextMate, which is free to play with for 30 days. I’ve been using it for about 4 days now, and it is definitely a step upward in the OS-integration department. A nice UI, and all that. But I am really missing:

  • split windows, so you can view multiple parts of a document simultaneously
  • vim’s ”.” operator, so you can easily perform the last action repeatedly, without having to go through creating a macro for it
  • the “J” command, to join the next line with the current line
  • the syntax highlighting definition language seems somewhat weaker than vim’s. I’ll admit I’m not proficient in it, but I wasn’t able to find a way to highlight heredocs, for instance.
  • the black-background for (at least) Ruby files is not very appealing to me. Personal preference, I’ll admit, but I couldn’t see any way to change the colors…
  • other issues, too, but they’re probably too nitpicky to mention

Much of what I’m feeling is just “switching pains”, I know. I’d feel some of the same no matter what editor I switched to, no matter how powerful. But at this point, I would gladly pay the $50 for TextMate-gladly!-if it was simply Vim with the TextMate UI.

I’m going to continue evaluating TextMate—4 days is hardly a fair evaluation of any text editor worth its salt, especially one that has come as far as TextMate in so short a time. I know that the author of TextMate is still working hard on it, and there are lots of improvements in the works. I just had to take a moment from editing text to whine about the unfair state of my sad existence. ;)

Posted in Reviews | 4 comments

09 Mar 2005

The Pragmatic Programmer

Posted by Jamis on Wednesday, March 9

I finally finished reading The Pragmatic Programmer, by Dave Thomas and Andy Hunt. I’d long intended to read it, and a month ago I found it at Barnes and Noble. Having a gift certificate from Christmas to spend, I picked it up.

I really, really liked it. I’ve already found myself changing how I write software. The biggest change I’ve noticed in myself is that I am now trying to think about how I write software, and why I make various decisions while programming. It’s the kind of book, though, that you need to review periodically. I’ll definitely be keeping it handy.

Next on my bookshelf to read: Extreme Programming Explained, by Kent Beck.

Posted in Reviews | 0 comments

06 Feb 2005

Java SDK 1.5 Beta -- Tiger

Posted by Jamis on Sunday, February 6

Sun recently released the public beta of Tiger, the codename for version 1.5 of their Java programming language. Ever since I first read about the features it will sport, I’ve been eager to try it out—Sun has put a lot of effort into removing some of the klunkiness from the language. For example, 1.5 features generics (templated classes), an enhanced for loop (allowing you to easily iterate across collections), annotations (arbitrary metadata that you can attach to methods, classes, and fields), autoboxing, and variable argument lists, just to name a few improvements.

I finally got my hands on it yesterday and I must say, I’m very impressed. Here’s a small sample program that simply creates a list and iterates through it. It demonstrates both autoboxing and the enhanced for loop:

  import java.util.ArrayList;

  public class ArrayTest
  {
    public static void main( String[] args )
    {
      ArrayList<Integer> list = new ArrayList<Integer>();

      list.add( 5 );
      list.add( 7 );
      list.add( 15 );
      list.add( 17 );

      for( int element : list )
      {
        System.out.println( element );
      }
    }
  }

The annotation feature is pretty slick, too; here’s an example in which I define a new annotation type (called “Author”), and attach it to a method so that it can be referenced at runtime by the program:

  import java.lang.annotation.*;
  import java.lang.reflect.Method;

  @Retention(RetentionPolicy.RUNTIME)
  @interface Author {
    String name();
    String dept() default "OIT Engineering";
  }

  public class AnnotationTest
  {
    @Author( name = "Jamis Buck" )
    public static void main( String ... args ) throws NoSuchMethodException
    {
      Method method = AnnotationTest.class.getMethod( "main", String[].class );
      Author author = method.getAnnotation( Author.class );

      System.out.println( "----------------------------" );
      System.out.println( "Author of AnnotationTest.main: " + author.name() );
      System.out.println( "             Their department: " + author.dept() );
    }
  }

I’m excited to spend more time playing with this—hopefully it’ll be quickly adopted and I can start using it “for real.”

Posted in Reviews | 0 comments

29 Jan 2005

Building of Basecamp

Posted by Jamis on Saturday, January 29

So, I’m just returned from the most recent Building of Basecamp workshop in Seattle, put on by those web-wizards at 37signals.

A one word summary: “wow!”

Jason Fried, Ryan Singer, and David Heinemeier Hansson gave the presentation, each standing to offer something to the current topic. That approach worked very well. They fielded questions throughout the eight-hour workshop, and were very professional.

Virtually everything they talked about rang true for me, even their most controversial statement that denied the conventional wisdom of the usefulness of functional specifications. Jason was quite firm on this point, even in the face of some push-back from a few attendees. He believes (as do I) that one of the big problems with functional specs is that it gives a false sense of solidarity between the parties involved. The spec, which is typically a written document, can (and will) be interpreted in any number of ways by those participating, which means that when the document is approved, it is approved with different ideas of what it means by everyone involved. Thus, when the product is finished, there is disagreement about whether or not it actually meets the criteria given in the spec.

Instead of a functional spec, the 37signals crew recommends paper sketches and HTML mockups. These, being visual elements, are much easier for participants to relate to, and are more susceptible to immediate feedback regarding their accuracy.

I also really liked Ryan’s segment of the presentation, in which he talked about some of the design issues involved in the creation of Basecamp. He demonstrated the Yellow Fade Technique that 37signals introduced with Basecamp. He also emphasized the importance of semantic markup. This came up when asked what HTML editor they used—they replied, “vim”, and said that they prefer to write the markup themselves.

And then, of course, David talked about the implementation of Basecamp, taking it from the HTML screens mocked up by Jason and Ryan, and plugging the code into it. This was fascinating because he talked about the evolution of Rails. He didn’t sit down intending to write Rails—he was out to write Basecamp. But as he worked on Basecamp, he saw portions of the code that were reused frequently, and he refactored those pieces out into a separate framework. This framework eventually became Rails. He emphasized, as he did at RubyConf, that a “framework should be extracted,” not just built ex nihilo.

After the workshop we all went downstairs to “The Alibi Room” and chatted. I sat at a table with Dave Thomas, David Heinemeier Hansson, and Ryan Davis, among others. Very fascinating conversation.

Then the 37signals crew treated me to dinner at “The Pink Door”, an italian restaurant in a dark alley with no sign… The restaurant was recommended by a native that we asked, but it still felt like we were entering a speakeasy. ;) It turned out to be a very nice restaurant, and the food was magnificent.

I was originally going to hook up with David and Dave Thomas the next morning, but my flight had to leave a few hours earlier than I had thought, so I had to skip out on them. And not having any way to contact them (I didn’t know what hotels they were staying in) I could only hope that they wouldn’t wait around too long for me. I’m not usually a flake, I promise!

Anyway, it was a great workshop. If you ever have a chance to attend a Building of Basecamp workshop, do not pass it up. Fantastic stuff.

Posted in Reviews | 0 comments

05 Dec 2004

Muttifying my Mail

Posted by Jamis on Sunday, December 5

A recent thread on ruby-talk culminated (for me) in this post, in which I derided mutt for requiring too much configuration and being too hard to use. As I said in the post, “why should I bother learning/installing/configuring fetchmail and procmail AND mutt, when I could simply use Thunderbird and have it work with minimal configuration?”

Almost as soon as I posted that, I got to thinking. I use vim, don’t I? I’m no stranger to the CLI. So what have I got to be afraid of?

I had tried mutt, once. But I was trying to pop my mail directly from mutt, and the configuration just got in the way, and the interface drove me nuts, and I ran screaming. Was I ready, really ready, to try again?

The problem is, it is really an all-or-nothing when trying a new mail client. It’s not like you can easily go back-and-forth between clients, unless you leave your mail on the server, which is a pain because it’s got to be deleted from the server somehow... At any rate, I steeled myself for the pain and went for it.

I found the Gentoo Guide to Mutt E-mail to be an invaluable resource in getting all the pieces set up. It guided me through the configuration of fetchmail and procmail, and hinted at some good practices for tying all the pieces together. It took the better part of Saturday, but I’ve got all my old mail copied over from Thunderbird. In fact, I even got really brave and uninstalled Thunderbird, so I’m pretty much dedicated at this point. Mutt will have to be pretty painful, indeed, to motivate me to go through all that again.

So what do I think of this new setup? What has it bought me?

I’m still not 100% converted to the mutt philosophies, but I’m finding myself pleasantly surprised by some things.

  • Because I fetch my mail and store my mailbox locally, I can finally use the Gnome applets for checking my inbox. And because the applet only checks one folder per instance of the applet, I’ve got four instances of the applet going, each with a different animation, and each representing a different folder. This lets me see, at a glance, whether the new messages are specific to the Ruby mailing list, or the UUG, or just my default inbox. Very nice.
  • Because mutt is so thin, almost a gnat to Thunderbird’s behemoth, I don’t have to leave it up continuously. I’ve configured the applets to open mutt to the appropriate folder when clicked. Then, when I’m done reading my email, I simply close mutt. Very fast.
  • Because I’m using procmail, I can set up all kinds of customized filters to process my incoming mail, filtering them through (in my case) Spambayes to catch the ridiculous amount spam I get, and so forth. (Incidentally, I love spambayes. I’ve trained it on a corpus of about 100 spam messages and it is already nearly 100% accurate in determining what is spam, and what is ham. And it even has the “unsure” category, which is something that Thunderbird’s junk filter lacks, and which I absolutely cannot live without.)
  • I’m also using gurgitate-mail, a mail filter that uses Ruby scripts to filter messages. Mostly I’m just experimenting with it, but I like it a lot right now because it is so much more readable than procmail recipes. And because it’s a Ruby script, you can do anything with it.
  • I’ve also written a news aggregator in Ruby (I’m calling it “Feed My Mail” currently) that is tailored specifically to this kind of setup (procmail/mutt). It runs as a cron job, polling all of my configured feeds once per hour, on the hour. Then, it constructs an email message out of each new item and sends it through procmail. This means that I can use procmail and gurgitate recipes on my RSS feeds, too! (If you’re interested in “Feed My Mail”, I’m thinking about cleaning it up and posting it on my website. It’s pretty minimalistic right now, but certainly functional!)

But, it’s not all roses. I’m still trying to puzzle out a few things, and have had a few headaches:

  • Compiling mutt with slang made it impossible for me to select a white (as opposed to light gray) background. I prefer black-on-white color schemes, and I couldn’t do that with mutt until I recompiled mutt against ncurses. Took me a good hour and a half to figure that one out. The documentation still seems to indicate slang can do white backgrounds, but I couldn’t get it to work.
  • Charsets! Argh. Frustrating. I can’t seem to get extended characters (tildes, umlauts, japanese, korean, etc.) to work. I know it can work, but I don’t have the time to spend on it right now. As soon as I must have this feature, I’ll probably stop everything and puzzle it out, but for now it’s just a frustration.
  • Learning curve. I’m still dizzy from the mass of options and key bindings that mutt makes available. Like vim, though, you take it a little at a time. I just wish I wasn’t such a power user—I’m wanting to do all kinds of advanced stuff, but am being forced to take baby steps to work my way up to that.

Anyway, it looks like I’ve got mail. Judging from which applets are animated, it looks like ruby-talk and my news aggregator have borne fruit. Time to read!

Posted in Reviews | 0 comments