Be Your Own Big Brother

This is only peripherally related to the subject of this blog (my search for a new career) but it's a topic that fascinates me. That may be because I spent many years involved with smart passionate people who were fighting like hell to protect their personal privacy from the looming spectre of Big Brother. Now I'm on the fringes of other communities of smart passionate people who seem intent on taking whatever shards of personal privacy they might have left and deliberately destroying them by putting their entire lives on the Internet. I'm talking about more than just the rise of blogging and Flickr and Twitter (where you'll find me as MikeG1) and all the other outlets for the extroverts of the new millenium (minor digression: I think we actually need a new category for folks who are introverts in "real life" but extroverts on line, but that's a topic for another day). The part that's fascinating me tonight is lifestreaming - the idea that since all this stuff we're throwing on line ends up in RSS feeds, we might as well combine it all into a single personal master feed and be done with it. As far as I can tell Jeremy Keith gets the credit for the name, though with the number of tools already out there, the idea was definitely in the air.

Intelligence agencies used to spend a bundle on the sort of painstaking assembly of apparently unrelated facts to draw a conclusion, and here we are handing it to them on a silver platter. I dunno; on the one hand, it all seems sort of creepy, on the other it seems inevitable. After all, anyone who wants to can already subscribe to the half-dozen RSS feeds that describe my life, so why not make it easy for them? And we're clearly in the early days here, where only the technical weasels are playing with this stuff. If it catches on, we can bet on all sorts of unanticipated outgrowths:

  • recombinant lifestreams where people steal bits of other people's feeds to make themselves sound cooler

  • spammers finding a way to sneak ads into our lifestreams (in return for bandwidth?)

  • couples combining into a single lifestream

  • shortly followed by a messy lifestream divorce

  • some automatic Web 2.0 service ("hey, your lifestream is similar to X's, you should meet!")


Anyhow, if you're interested in this stuff, either as a fascinated observer or a potential participant, there are a whole mess of tools out there already (you knew I couldn't do a blog entry without linking to a bunch of tools, right?). Here's what's crossed my radar so far:

  • FeedGrab - A plugin for the ExpressionEngine blogging engine that can merge multiple RSS feeds into a single stream.

  • Jaiku - Focused on creating a "presence stream." So you can add whatever feeds you like, but it only shows title, time, and source on Jaiku itself, and you click through to get to the original item.

  • Planet Venus is a newsreader that works by intermingling multiple RSS feeds together into a single "river of news." Edward O'Connor uses it to hack together a lifestream here .

  • Profilactic is a "digital life aggregator" that you point at all your online identities. Then it automatically builds a mashup of them all. It can also search out and keep track of mentions of you on the Web.

  • Slife is an OS X app that tracks your desktop interaction with apps like Mail, Safari, and iChat, so you can keep track of things that don't even generate RSS feeds. This gives you a client-side record which you can then choose to share with the world through their Slifeshare site.

  • SuprGlu - Lets you take a batch of RSS or Atom feeds, apply a template, and republish them as a Web page to make a sort of recombinant blog.

  • Yahoo Pipes - With its ability to mix RSS feeds together, Pipes lets the tinkerer build their own lifestream, though sorting is a bit iffy at the moment. Jon Rowett has hacked together an example .


(Thanks to Emily Chang for a couple of links).

Double Shot #9

I continue to be amazed at all the things I find on the Web. Fortunately, I don't inflict most of them on you here.

Double Shot #8

Ran into a bunch of stuff over the weekend...

Database Design Tool with Some Rails Smarts

SQL Editor is an entity relationship diagram (ERD) tool for OS X with a tie-in to Rails. This might be of interest to folks who want to bring complex database designs into a Rails app, though I think there might be some mismatch there between the idea of big design up front and Rails more agile TDD approach. Anyhow, the idea is that SQL Editor lets you build this:

SQL Editor screenshot

And with a single save operation get this:

Migration screenshot

SQL Editor certainly doesn't have all the bells and whistles of some of the high-end ERD tools I've used under Windows, but for a $69 shareware package it's serviceable enough. In addition to generating Rails migrations, it can export DDL for MySQL, Postgresql, or Oracle, as well as reverse engineer existing databases via JDBC.

Double Shot #7

In which the intrepid author continues exploring new realms of software.

  • Getting into TextMate - Pointers to a bunch of resources for making better use of the TextMate editor. This is one of those tools that I know I will never really master, master-of-none that I am.

  • FiveRuns - A Web-hosted systems monitoring solution. This one is built on Rails and features specific monitoring hooks for Rails applications. I know from my time at MCP, though, that this sort of product is a hard sell compared to in-house monitoring solutions; monitoring is not the sort of thing that most IT departments want to outsource.

Filling up the Mac Toolbox

As I switch more of my computing life over to the Mac (it's now home to most of my e-mail accounts, my calendar, my task list, and some of my Web work, as well as the bulk of the Rails development I'm doing), I find myself accumulating bits and pieces of software. It's dangerous to draw any conclusion based on the small exposure to Macs that I have so far, but it seems to me that most of the Mac apps I've looked at are more visually polished and have more internal coherence (i.e, they do one thing and do it well) than most Windows apps that I'm familiar with, but they also tend to have less inherent functionality. On the whole I'm very satisfied with the Mac experience (especially on days like today, when my main Windows development box blue-screened five times).

Stereotypes and sweeping statements aside, it might interest some other Windows refugees to have a list of some of what I've found it reasonable to install so far:

  • Adium (free) is a reasonable enough multi-network IM client. It's still a bit lacking in functionality compared to "Trillian"http://www.ceruleanstudios.com/ on Windows though.

  • Chamonix (free) is a CHM file viewer. Not as pretty as Chmox but more functional.

  • CSSEdit ($29.95) is a real find; this CSS Editor is way more functional than anything I've worked with on the Windows side.

  • EasyTask Manager ($19.99) is my choice for task lists at the moment. They oversell the GTD-ness of the application, but they have one key feature I can't live without: recurring tasks.

  • Firefox (free) remains my browser of choice. I can't imagine doing without its wealth of extensions in favor of anyone's native browser.

  • Growl (free) is somehow far less annoying, perhaps because it's more consistently a standard, than any of the "toast" notification options on Windows.

  • Navicat ($99) is doing for a MySQL GUI client for now. It's got a ways to go, but it's better than doing everything with the command line tools.

  • NeoOffice (free) is so far handling my light word processing and spreadsheet requirements on the Mac. I'll probably have to revisit this as I move more office work over, but I have no intention of letting a Microsoft product on to this box.

  • OmniOutliner Pro ($29.95 upgrade price) is taking care of my unstructured text and list needs. This is a category I've always kept some application or other busy in, so it was good to see lots of choices here on the Mac. This one clicked for me better than Yojimbo or Tinderbox though they're both intriguing as well.

  • Pukka ($5) is a del.icio.us client. That's not a category of software I thought I needed, but it's very well done and useful.

  • QuickSilver (free) has actually gotten me using a keyboard-driven program launcher, something none of the Windows entrants in the field ever done. I'd like to see it pick up some of the Web-driving goodness of DQSB on Windows (I know, I could program a lot of that in myself but I'm lazy).

  • Shrook (free) will probably be my RSS reader when I move my feeds over. Everyone raves about the look of Newsfire but trying to read 400 feeds in that UI would drive me mad. NetNewsWire probably has the right functionality but I'm not going to subject myself to Newsgator's software registration system.

  • TextMate (€39) is just as fabulous a prrogrammer's text editor as everyone says it is. It's obvious why people are trying to clone this for the PC.

  • Twitterific (free) does absolutely nothing for my productivity but it's fun to watch all these random people wander by on my screen.

Double Shot #6

A couple more things of interest in this new space I'm exploring.

  • Rails for Java Developers - The latest from Pragmatic Press. Not being a Java developer myself (and having no ambitions to become one), I'm going to stay far away, but I expect some folks will find it useful. Now, if they publish Rails for .NET Developers I'll snap up a copy immediately.

  • Gyre - "the open source, web-based IDE and debugger for Rails". Yes, web-based. Looks spiffy, but they caution it's still very early in the development cycle. (via Ruby Inside)

Double Shot #4

Why "Double Shot"? Why not? My daily links column over at Larkware is called "Daily Grind," so somehow that just seems to fit. Well, at least as much as anything fits.

  • Shiny new Subversion and Trac cluster - The Rails team has just gotten a server upgrade, and having checked out a new Edge tree last night, I can confirm that it's a whole lot faster. There's also a change of URL for the Rails Subversion repository, though the old URL will continue to work. Here's some info on switching an existing checkout to point to the new URL.

  • Streamlined 0.0.7.1 - I blinked and missed the announcement a few days ago, but the plugin version of this tool for building spiffy Rails views is out now.

  • Show database migration versions with Rake - A simple Rake task to pull the current version out of the database. I imagine this could be useful in a busy shop with multiple devs writing migrations.

  • Site5 Deployment Problems with Capistrano > 1.2 - A fix to some mystery Capistrano permissions problems. I think it's a feature, but this could still be pretty helpful if you hit the same situation.

  • Getting Started with Subversion on OS X - Ben Wong has some basic information.

Moving E-Mail Again

At the start of the year I switched my e-mail client from Outlook to Thunderbird on the PC. Yesterday I made another transition - I'm now using Apple's standard Mail app on the Mac to read my mail. I considered using Thunderbird on the Mac, but while it's a reasonably serviceable client, Thunderbird just doesn't have the fit-and-finish or feature level of either of the native applications.

I looked at using Emailchemy to bring my existing archive over from Thunderbird, but it didn't do a good job converting the Thunderbird 2.0 beta files (after importing the files into Mail, it claimed all the messages were on the server, which was very odd considering that the mailboxes were POP, not IMAP). Ultimately I decided that it didn't matter, as I'll have access to the archive on the PC for the foreseeable future.

Overall, my first impression is that Mail is way ahead of Thunderbird as far as polish and functionality go, but somewhat behind Outlook in functionality. On the other hand, it's not as much of a bloated pig as Outlook either, and after using it I'll probably discover some things it can do that Outlook can't. Adding in MailTags takes care of several big missing chunks of functionality, and Growl notifications are nice as well. So for the moment I'm happy.

Quick Links

Quick Links

A few more to pass along this morning before I get any actual work done.

Basic Routing in Rails

Coming (as I did) from an ASP.NET background, the support for routing in Rails was one of many aspects of this new world that impressed me considerably. It's easy to see why that should be so: the support for a similar facility in ASP.NET (mapping of friendly URLs to internal URLs) is rudimentary at best. The reasons why point up the difference in approach between the two development teams: Microsoft has apparently chosen to avoid shipping any usable URL rewriting code until they can bombproof it for every conceivable use and size of enterprise, while the Rails team has chosen to give us something that's good enough for most applications right now.

The point of routing is quite simple: it decouples the internal design of your Rails application from its external interface. For example, it may make perfect sense to you to have all of the methods that deal with handling image management, including the administrative tools for uploading images and a method for showing images, within a controller named upload. But that doesn't mean that referring to an image within your application must be done with a URL such as /upload/show/4. With routing, you are perfectly free to use a URL such as /images/4 instead.

To do this, you define a route within the file config/routes.rb in your application. In this particular case, the route would look like this:

# show a single image
map.connect '/images/:id', :controller => 'upload', :action => 'show'

You can think of the routes.rb file as a set of rules that is followed by Rails in dispatching incoming HTTP requests to the controllers that will handle them. Rails scans down these rules in order and sends each request to the first matching rule. In this particular case, the rule matches any incoming request for the exact text /images/ followed by precisely one word (in the regular expression sense of a contiguous set of letters and numbers). The word becomes the :id parameter which is passed to the show action within the upload controller. So this particular route would be invoked for /images/16 but not for /images/16/172.

As it stands, this route would also be invoked for /images/wintergreen.jpg, which is a problem if your show action is expecting to be passed an :id parameter. Generally it's considered poor form for your application to blow up in the user's face. To avoid having routes try to process requests that they can't handle, you can qualify them further with requirements expressed as regular expressions. In this particular case, we can add the requirement that the :id parameter be numeric:

map.connect '/images/:id', :controller => 'upload', :action => 'show',
:requirements =>{ :id => /\d+/ }

This can be expressed more concisely as:

# show a single image
map.connect '/images/:id', :controller => 'upload', :action => 'show', :id => /\d+/

But hold on a minute here: surely in a well-designed application, you'd like to allow people to retrieve images by name as well as by id. That's certainly possible; all that you need to do is define another method (let's call it find_by_name) in the controller and add another route. In this case, though, you must include requirements in the route. Why? Because by default, the dot character, like the forward slash, is treated as a separator between elements in a route. So you need to explicitly tell Rails that you want the dot treated as part of a parameter:

# show a single image by name
map.connect '/images/:imagename', :controller => 'upload', :action => 'find_by_name',
:imagename => /.*/

Another potential use of routes lies in protecting some URLs from being inadvertently called in a way that can lead to unwanted side-effects. You can use conditions to route requests differently depending on which HTTP verb is used to invoke them. For example, consider this pair of routes:

map.connect 'admin/update/:id', :conditions => { :method => :get },
:controller => "admin", :action => "list"
map.connect 'admin/update/:id', :conditions => { :method => :post },
:controller => "admin", :action => "update"

If a URL such as /admin/update/7 is called via an HTTP GET (perhaps as a result of an overenthusiastic search-engine listing), the first route will redirect this to the list action. Only requests that come in via POST (presumably from an editing form) will be processed by the second route and sent to the update action.

Routes can be made even more flexible with the addition of defaults. Supplying defaults allows you to create routes where trailing portions of the URL can be omitted. Going back to the image handling example, suppose you wanted to show an image catalog when the plain /images URL is accessed? Here's a route to handle that:

map.connect 'images/:action/:id', :defaults => { :action => "catalog"},
:controller => "upload"

If you don't supply an :action parameter, the value catalog will be used. There are two special defaults - "default defaults," if you will. By convention, :action defaults to index and :id defaults to nil. This explains how a single default route can handle the dispatching chores in a simple Rails application:

map.connect ':controller/:action/:id'

Finally (for now), the last element of a route path can be a catch-all element, using the syntax *name. Here's a route that catches anything, no matter how strangely-composed:

map.connect '*incoming' :controller => "admin", :action => "sitemap"

The incoming parameter in this case will point to an array containing all of the components of the incoming URL. Because this route will match anything, it must be the last one in your routes.rb file (well, there can be other routes after it, but they will never match anything because Rails processes routes from the top of the file down).


That's enough to get started with Rails routing for the purpose of URL rewriting, but there's a lot more to learn. In particular, I haven't covered the creation and use of named routes, or the use of the new resource-based routing. I may get to them in future installments.

Quick Links

Most of my readers here are, I think, familiar with the Daily Grind postings I do over at the Larkware site, tracking interesting stuff in the .NET universe. While I'm not yet going to commit to doing the same thing over here for the non-Microsoft world, I do have a couple of things bookmarked this morning that are worth quickly pulling together. Who knows, I might do more of these.

Progress Report

One month into 2007 I seem to have settled on Rails as my new direction of choice, at least for the time being. The way that Rails applications are put together appeals to me and it seems like a good fit for the size of application that I enjoy building. On a more pragmatic level, it also has good buzz and the change of getting work appears, at least in the medium run, to be reasonable (which puts it ahead of some potentially technically superior alternatives for my own particular circumstances).

At this point, though I can hardly claim to be fluent in Rails, I've at least taken a broad survey of the whole framework. I'm reasonably comfortable banging out basic sites that hook up databases to Web pages, and I have some sense of which bits do what. I can find what I'm looking for in the documentation and books with a minimum for fuss.

The next month or so goes for refining those skills, going into a bit more depth, and really digging into Ruby, I think. I need to get more than a passing acquaintance with the underlying language, and learn more Rails simply by using it more. I'll probably try to write an article or two as well - that's one of the best ways I know to develop my own understanding. Stay tuned.

Scaling Rails

I've been groping towards defining the difference in philosophy between ASP.NET and Ruby on Rails. I'm not quite ready to pull together my thoughts on the subject yet, but in the meanwhile Scott Stevenson addresses one piece of the puzzle in Does Ruby on Rails Scale? .

Rails Bump

On the theory that I'd like to track this stuff for folks who aren't subscribing to everything: Rails 1.2.2 is out, with renewed SQLite compatibility and a few other feature improvements.

Rails Baby Steps

Ruby On Rails Tutorial : The Basics comes from Huw Collingbourne of SapphireSteel Software. It goes only so far as a first controller and first view, and of course uses Ruby in Steel as an IDE (though you should be able to follow along easily enough no matter what environment you're using for Rails development).

I'm starting to get the itch to write a few simple Rails articles myself. Time to start hunting markets...

It May Be Obvious, But…

Some of the folks following me over to this blog might be a bit hazy on the finer points of open source. Keith Casey gives a good introduction to the distinction between the "free software" and "open source" movements in The Open Souce Community 101: Two Facets . Worth a read if you haven't run into these tensions before, or are carrying around the mental image of all open source folks as bomb-throwing anarchists.

subscribe via RSS