Archive for May, 2008

Good Error Messages Point the Way

Ran into an odd error today, the result of this line in a library I’m using:

raise '@level is blank. Did you override the allow_to method in your controller?' if @level.blank?

A quick check of my code and “err no, I don’t think so. Should I?”

Yes I should, and in that then call super() to initialize @level. So I rewrote the error message in that lib to read as the following, because I know it’s going to bite me again some time:

raise '@level is blank. Did you override the allow_to method in your controller? You should, and call super() from within it.' if @level.blank?

Bad error messages throw up an error number. Mediocre ones hint at the problem. Good error messages point the way to a solution.

No Comments »

chris on May 31st 2008 in /dev/random

Panic With Redmine

(I do love a sensational headline.)

The guys at Panic (makers of the most excellent Transmit and Coda) were recently in the market for a new bug tracker to replace their own home-grown in-house app.

It seems they’ve settle on Redmine, an open-source bug tracker created by Jean-Philippe Lang and built atop Ruby on Rails.

In the past three weeks I’ve performed two Redmine installs under Ubuntu, both running Passenger (mod_rails) (which works amazingly well and I’m going to write more about that in a bit), one for work and one at home and I must say, Redmine is extremely impressive, particularly for something still versioned at v0.7.

Particular features of note:

  • git integration. Actually Redmine appears to integrate with damn near every popular SCM but I’ve wanted to check out git for some time now and it was the perfect excuse to switch over my side-project. I delight in the in-browser diff viewing.
  • Configurable project features. Modules of functionality can be turned on or off per project. I have no need for the wiki or news on my home project so I checked off the feature and it disappeared, simplifying my overview. I like that.
  • Rails-based. Blah blah fix it yourself. Blah blah beholden to no vendor. Blah blah control your data. Rails is just fun, Ruby is just fun, both far more fun than monkeying with PHP, for instance. And reading the Redmine code is often a pleasure through which I’ve learned a few tricks (check out role.rb for has_many block trickery, for instance).

If you’re in the market for a bug tracker/project tracker, I recommend checking it out. It’s not yet FogBugz slick but it’s certainly head and shoulders above most of the rest of the market.

No Comments »

chris on May 29th 2008 in /dev/random

Good Rails Editor Linux?

One thing I tend to take for granted when using TextMate is the idea of the “Project” and the ensuing ability to search through an entire site easily. Drag a folder onto TextMate and *poof*, fully-searchable project. I often locate a file that needs to be worked on by searching for a chunk of text in the file rather than remembering which file contains the text.

Can anyone recommend a good graphical editor for Linux that affords the same functionality? (Let’s just assume that all the vim/vi/emacs suggestions have already been made and move past that, shall we? I’m not interested in accommodating the learning curve just to edit some HTML files locally.)

6 Comments »

chris on May 23rd 2008 in /dev/random

You’re Not Programming, You’re Blowing Foam

Andrew Brown over at the Guardian writes in “Programming is destroying my capacity for reflective thought” (and I pilfer his closing paragraph here since the rest is just him complaining about moving his blog from one platform to another):

The difference between a sentence that works and one that doesn’t can be quite as large and important as the difference between a computer program that works and one which causes a satellite to crash for want of a semicolon; but capacity for patient, reflective thought needed to hear what’s wrong with a sentence is exactly what programming drives out of my mind.

Which reminds me of the old joke:

Patient: Doctor, doctor! It hurts when I do this!
Doctor: Then don’t do that.

Alas Mr. Brown while I understand your sentiment, from what I gather of your opening paragraph:

Maybe I’m growing stupid, but I find that programming destroys my capacity for reason. I spent much of last week moving my little blog from Movable Type over to Wordpress; something that might have been easy, except that I wanted the change to be unnoticed by the outside world.

you weren’t programming, you were fiddling with CSS and HTML and some basic PHP tags. Calling that “programming” is akin to throwing small rocks from one pile to another and calling it “construction”.

Follow-up
In the post above I am rather flippantly dismissive of the troubles Mr. Brown was having. Make no mistake: I don’t consider CSS + HTML to equal programming (flame away those who’ve build careers as “programmers” doing it, I’ll explain why another time) however that doesn’t change the fact that working in the guts of software often sucks. To wit: “Hours of boredom punctuated by moments of sheer elation.”

My favourite analogy when trying to help people understand “programming” is construction. Specifically the construction of houses. To a contractor, spending a whole day blowing spray-in foam insulation into a new home is an exercise in abject tedium at best, a filthy mess taking hours to clean up at worst. But is it reasonable for that contractor to say “Gah, spraying insulation is mind-numbingly dull - construction sucks!” Not so much. A facet of construction sucks, sometimes.

Here’s the rub: some part of everything sucks every now and then. Get fixated on that one part and you have a forest/trees problem. Unfortunately it sounds as though Mr. Brown stopped at blowing foam and has yet to discover the joy of picking up a hammer.

No Comments »

chris on May 22nd 2008 in /dev/random

Installing Passenger (mod_rails): “Command not found”

If you’re installing Passenger (aka: mod_rails) and you hit the following error at the stage in which you run passenger-install-apache2-module:

sudo: passenger-install-apache2-module: command not found

all this means is that you don’t have the gems bin directory in your PATH so do this instead:

sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module

No Comments »

chris on May 21st 2008 in /dev/random

ScribbleLive Launches

Congrats to Jonathan and team for leaving alpha and entering beta with the launch of ScribbleLive, a very sweet live-blogging tool that’s getting its beta-inaugural test drive at the Mesh Conference in Toronto.

You know how people are using Twitter to comment in real-time during conferences? ScribbleLive is like that without the lousy character limitation, the short attention span, the need to refresh the page or the server outages. And a bit more.

Very nice indeed and the site looks great too. Well done guys!

Update
Momentum seems to be picking up for Jonathan and Michael with ScribbleLive: Two Guys In Canada Launch Sweet Liveblogging Platform on TechCrunch cross-posted to the Washington Post.

Note that in the TechCrunch article Erick laments:

This is something I would want to use for liveblogging events, if only they offered an embeddable widget that I could put directly into a TechCrunch post. Right now, the posts exist on ScribbleLive’s Website.

According to Jonathan this embeddable functionality already exists.

1 Comment »

chris on May 21st 2008 in /dev/random

Uh Oh, They’re Here

Apple’s always had a pretty strong presence in Vancouver, at least as long as I’ve been here, with WestWorld, Simply Computing and numerous others. But now the mother-ship has landed: Apple Store, Pacific Centre.

This could get expensive.

No Comments »

chris on May 20th 2008 in /dev/random

Crypto-Gram Turns 10

Bruce Schneier’s most excellent newsletter / blog turns 10 this month and to mark the anniversary Bruce expounds on CG’s evolution as determined by changes in technology, politics, and his own savvy:

Over the years, Crypto-Gram’s focus has changed. Initially, it was all cryptography. Then, more computer and network security. Then — especially after 9/11 — more general security: terrorism, airplanes, ID cards, voting machines, and so on. And now, more economics and psychology of security. My career has been a progression from the specific to the general, and Crypto-Gram has generalized to reflect that.

If you’re the sort of person who reads this blog I highly recommend you also either subscribe to Crypto-Gram or add the RSS feed to your reader. Despite the name of it, Bruce’s focus has expanded well beyond just cryptography and into the realm of all facets security-related (also perhaps known as “the theatre of the absurd”). I’m sure you’ll enjoy it.

The best fan mail I get from a reader says something like: “You changed the way I think.” That’s what I want to do. I want to change the way you think about security. I want to change the way you think about threats, and risk, and trade-offs, about security products and services, about security rhetoric in politics. It matters less if you agree with me or disagree, only that you’re thinking differently.

No Comments »

chris on May 15th 2008 in /dev/random

Save Should Die

Save the cheerleader, save the world.I quite like Reg Braithwaite’s recent post Show, Don’t Tell. It’s a worthwhile read on that phenomenon we’ve all experienced in which we spend breaths and breaths trying to tell someone something to no avail, only to show them out of frustration and be met with a “oh, yeah, I get it”.

More interesting to me though is the comments on that post regarding the venerable “Save” command.

I am of the opinion that “Save” as a concept, as a modality, is deeply anachronistic and whose demise is being heralded, appropriately enough, by the web. As I type this WordPress is dutifully saving my words across the internet, from Vancouver into a database in Toronto, every couple of minutes. It works so well I often forget it’s working at all. And it’s doing so because there’s no file-based save available to WordPress. Yet the vast majority of desktop apps can’t accomplish this amazingly useful feature at all, despite having measurably more capability than my lowly web browser does.

The closest any desktop app that I use comes is TextMate, which has a preference to allow it to save all unsaved documents when I switch context away from TextMate (from editing code to viewing in a browser, for instance). That’s an amazingly handy feature - don’t use TextMate without it - but alas it’s only about 70% of the way to realizing its full potential.

Reg, in the comments on his post, hints that version control of today should be the save of tomorrow*. I love that idea. I hope he expands on that - I smell a rant…. Let’s get rid of “naming” documents and simply tag them instead. Get rid of the “Save” icon and simply store the deltas of all documents that changed on my machine since n seconds ago - and certainly don’t bother me with the details of it!

Apple’s TimeMachine comes pretty close to accomplishing this but its granularity isn’t quite fine enough. However, imagine TM with a per-file view in which, instead of viewing the history of an entire directory, you just browsed the content history of a single file? Right there, in the Finder. Historical timeline scrubbing of a document’s contents from within the document itself perhaps?

In this day, in the land of terabyte drives, let’s just save it all and never again gasp in fear and wonder “did I save?”

* I realize some people, most notably in the Linux world, have been doing this to varying degrees of limited success for years but using CVS or Svn (home dir in git anyone?) seem like a square peg/round hole solution - again, maybe 70% of what it should be.

6 Comments »

chris on May 12th 2008 in /dev/random

Date.js and Timeframe.js and Load Order

Javascript’s all the rage these days, with some amazing libraries popping up daily. Two I really like are Date.js and a recent player for manipulating times, Timeframe.js.

However it turns out if you’re going to combine these into the same project (at least for Timeframe 0.2 and Date 1.1 Alpha-1, check your versions) you need to be careful about the load order otherwise some stomping goes on.

Load date.js and then timeframe.js, otherwise the display values for Timeframe get stomped and you’ll see the raw formatting codes rather than dates.

For the Railies:

<%= javascript_include_tag 'date.js', 'timeframe.js', :cache => true %>

No Comments »

chris on May 11th 2008 in /dev/random