Getting to Consistency

I just found slides from the SXSW Interactive Panel I moderated back in 2007.

Making software predictable and consistent makes it much easier to use. This session will explain UI consistency and point out examples of failures and their consequences. We’ll discuss when it’s appropriate to break consistency, and how to build tools and process to ensure applications are consistent with human interface guidelines and real-world practices.

Moderator: Paul Schreiber Screen Real Estate Agent, Apple
Jennifer Fraser Lead User Experience Designer, Corel
Alex Graveley Senior Engineer, VMware
Steve Johnson Senior User Experience Mgr, Adobe

They don’t make things like they used to

Last year, I stayed with a friend in north Austin during SXSW. A bike was the best way to make the three-mile journey downtown. I had a few options:

  • Renting I called Bicycle Sport Shop and a couple other stores. The problem is that people rent bicycles as entertainment, not transportation, and they’re priced accordingly. At $30 a day to start, that’s more than a car. A 10-day rental would have cost $210.
  • Yellow Bike The Austin yellow bike project was in the middle of a move, and most of their bikes were in storage.
  • Shipping my bike both ways — UPS or FedEx ground — would have run me about $80.
  • Buying a bike The cheapest thing to do was to buy a bike. Academy had some cheap mountain bikes. Target’s were a bit cheaper. I ended up with a Magna Glacier.

I always wondered who bought those department-store bikes.

All was fine for a couple of days. Then: boom. The chain breaks, gets caught in the rear wheel and causes the bike to fishtail. I go down. Hard. I tore my new jeans and ripped a gash in my arm. Oops.

That turned out to be a very expensive “cheap” bicycle.

Check out what happened. The chain was so poorly made, that the metal itself bent and buckled:

Last year, I bought my own snowboarding gear. I snagged a great deal on the board from REI and picked up the bindings from Sports Basement. Since the prices were so good, I upgraded from EX to RX bindings.

Ride’s RX bindings are a step up from their EX model, which is a step up from the LX model. Got that? With an MSRP of over $200, this isn’t the bottom of their line.

Then why, Ride, would you use a plastic release?

Think your airline joining Star Alliance helps you?

Last fall, Continental Airlines joined Star Alliance.

Since I have most of my points/miles with Air Canada’s Aeroplan—also a member of Star Alliance—I thought that would be good news.

It’s not.

There’s no way to combine points from both programs to get an award, and no way to move points from from one Star Alliance partner to another.

When to buy a refurbished Mac

No, I’m not going to tell you when during the year to buy a Mac (“not the week before WWDC”), but I am going to share a neat trick. Tragedy of the commons, here we go.

Apple’s online store has refurbished Macs for sale. These are often a very good deal — today’s selections range from 13-26% off the original prices.

Refurbished Macs carry the same full one-year warranty as new ones and are eligible for the free printer rebate and AppleCare. (Aside: if you don’t need the support, your credit card’s extended warranty protection many be enough.)

But if you look right now, there’s only one refurbished MacBook:

No, Apple hasn’t sold every refurbished MacBook they own. They’re only sold out for today.

If you check back at 1 AM PDT (4 AM EDT), you’ll see a much larger selection. (Didn’t see much? Try again the next day.)

This means by the time the west coast wakes up, the east coast early birds have snapped up the best deals. Suggestion: stay up late.

Handling Rails errors: custom error pages, logging, notification

I wanted to improve error handling In my Rails applications. Specifically, I wanted three things:

  • a custom error page that matched the site's design
  • the errors to appear in the error log (production.log)
  • email notification of server errors

Note: these steps are for Rails 2.3.2–2.3.8. Other versions may require different instructions.

Custom error page

Normally, when server error occurs, Rails renders public/500.html. You can customize this. However, if you include your site's layout information here, you violate the DRY principle.

  1. Create a directory for error templates mkdir app/views/errors
  2. Create the error file: touch app/views/errors/500.html.erb
  3. Remove the static file: rm public/500.html
  4. In application_controller.rb, override render_optional_error_file:
    protected def render_optional_error_file(status_code) render :template => "errors/500", :status => 500, :layout => 'application' end
  5. To test your error handler in the development environment, in application_controller.rb, add this line: alias_method :rescue_action_locally, :rescue_action_in_public be sure to comment this out when you're done, so you can see backtraces.

Logging errors

Because we overrode render_optional_error_file instead of using rescue_from (2), errors still go to the log (production.log).

Email notification

There's a terrific exception notification plugin that handles this for you.

This is a bit confusing, because there are three versions of the plugin floating around:

  1. The master version on github, for Rails 3
  2. A branch on github, for Rails 2.3
  3. The old version, which also works with Rails 2

Important If you install via the standard method (script/plugin install), you'll get an old version of the plugin, and the current instructions (on github) won't work. (See below for legacy instructions.)

If you install from github, you'll get a version for Rails 3 by default, and that won't work, either.

Here's what to do:

  1. Install the plugin from the 2-3-stable branch from github: script/plugin install git://github.com/rails/exception_notification.git -r 2-3-stable
  2. In application_controller.rb, place this at the top: include ExceptionNotification::Notifiable
  3. In environment.rb, add these lines at the very end, after the |config| block:
    ExceptionNotification::Notifier.exception_recipients = %w([email protected]) ExceptionNotification::Notifier.sender_address = %("Application Error" <[email protected]>) ExceptionNotification::Notifier.email_prefix = "[Fancy App] "
  4. To have sendmail send email (instead of using raw SMTP), add this line to environment.rb: ActionMailer::Base.delivery_method = :sendmail

Legacy exception_notification instructions

  1. Install the plugin: script/plugin install exception_notification
  2. In application_controller.rb, place this at the top: include ExceptionNotifiable
  3. In environment.rb, add these lines at the very end, after the |config| block:
    ExceptionNotifier.exception_recipients = %w([email protected]) ExceptionNotifier.sender_address = %("Application Error" <[email protected]>) ExceptionNotifier.email_prefix = "[Fancy App] "