faded picture of luke
a semi-random photo | click for the full photo gallery
click to browse photos
homepage navigation

Luke Melia

October 23, 2007

A good reminder about Agile

Great post from James Shore, whose upcoming book I’m eagerly awaiting.

In the pre-Agile world, methods got so focused on documents and processes that they stopped talking about how to design, develop, and code. They turned to naval-gazing and lost sight of this essential fact: in software development, software is king.

Agile development started out as a reaction to this problem. Nowadays, I fear that the agile community is falling prey to the same mistake.

He captures my feelings about XP very well.

October 12, 2007

Looking Back on Oxygen

On Tuesday morning at the office, we interrupted our pair programming sessions to walk up to the 8th Floor for announcement. The night before, the papers were signed that will lead to the purchase of the company (for $925 million by NBC Universal) where I’ve worked the last 7.5 years.

Oxygen is a company started to entertain, inform and empower women. So it is ironic that it is while working at Oxygen that I became a man.

I moved back to New York during the height of the Internet boom in late 1999 at 23 years old and my phone rang off the hook with recruiters. (My first call was from my high-school football team’s linebacker turned tech recruiter.) Oxygen happened to be the very first place I interviewed and the job I ultimately accepted.

Within my first two weeks on the job, I was celebrating the cable network’s launch with the likes of Oprah Winfrey and Candice Bergen. I danced on stage with Luscious Jackson that night. I had no idea what I had gotten myself into or that the woman at the podium that night, Gerry Laybourne, would one day be a friend and personal inspiration to me.

It was a chaotic, fast-growing company back then, but it seemed tame to me coming off owning my own software startup and living in India, where chaos is taken to a whole new level in the streets of the major cities.

I was hired based on my largely self-taught skills with Perl CGI and HTML/Javascript. My foundation was a weekend in the Sacramento garage of a guy who was around when the first graphical web browser, Mosaic, was being built in Chicago. That and the cheap technical books I devoured living in India the 6 months before. Back then, I was proud of my abilities to produce nice-looking web layouts using table tags.

My first week on the job, a project manager showed me how to use ftp on the command line (thanks, Carrie!). Unix was a vast trove of magic, revealing more power and amazement every day. Oxygen sent me to training at Sun when the company was getting serious about focusing development efforts on Java. Object Oriented Programming was a huge revelation to me. I dreamed of objects sending messages to other objects.

I moved into Manhattan after a few months on the job. Commuting is not for me. It is not easy to get a foothold in the Manhattan real estate scene, and I’m glad I started when I did. I love living in the city and love walking to work. The Chelsea Market building, Oxygen’s home for most of the last 8 years, is a living, ever-changing thing that has energized me every day that I walked through it.

I broke up with a long-time girlfriend while at Oxygen. I dated a co-worker and had crushes on many others. I traveled northern Laos with an Oxygen colleague. Later, I married an ex-Oxygenite and after that, Jeanhee gave birth to Chiara, the ninety-something-ish Oxygen baby.

A couple years into my time at Oxygen, the company shut down a Seattle-based software company it had purchased, and relocated a bunch of people to New York. Looking back now, my life would be so different absent that cross-continental migration.

These outdoorsy Northwesterners eagerly accepted my pitch to start an Oxygen volleyball team. We had so many good times competing, playing in the park, and relaxing afterwards. I was honored to be described as “more Seattle-ish” than many of their friends in Seattle. Some have returned to Seattle by now, and a shocking number have married/cohabitated each other. Seattle my favorite place to visit now.

Kris, Ken, and Steve lasted the longest of the Seattlites at Oxygen. We still work together every day and enjoy strong, effective professional relationships solidified in the lean years after the Bust. Kris and I pair-programmed for a year, just the two of us. We nearly killed each other but ultimately figured out how work together very well. Kris is the most brilliant developer I’ve ever worked with and what I learned from him over that year and since has been my single most significant educational program in software development.

Freshest in my head, and dearest to me, has been the opportunity to build a stellar agile team over the last year and a half. I can barely express in words how fulfilling it has been to collaborate with this amazing group of people building the coolest product of my career so far.

I’ve been looking back, because it is to look forward right now is to look into a fog. The work of integrating these two companies starts soon, and the evaluations and explorations of what may or may not be our team’s role at NBCU will happen over the next several weeks.

Regardless of what happens next, it’s the end of an era… and what an amazing ride it has been.

October 9, 2007

alt.net conference

I spent the weekend in Austin, Texas with my colleague Ken and 100+ fellow developers at the first alt.net conference.

It was my first experience with the OpenSpace conference format. and I thought it was great. The hallways and bar is usually my favorite part of conferences, and this format takes the most relevant aspects of those conversations and makes them the core of the conference.

My biggest takeaway on the uber-theme was that this community is learning how to be in a functional relationship with Microsoft. It’s easy to be in a dependent, one-way relationship with a company of Microsoft’s size and habits. It’s difficult to be in a two-way, respectful (but not enabling) relationship with such a company. To our credit, this community is figuring it out.

My Rails project workspace script

When I'm ready to start a session working on Tracks on my MacBook, I open up iTerm, and type:

CODE:
  1. Last login: Tue Oct  9 02:44:39 on ttyp6
  2. Welcome to Darwin!
  3. LukeBlackBook:~ lmelia$ cd devprojects/tracks/
  4. LukeBlackBook:~/devprojects/tracks lmelia$ workspace

And then, the following happens:

  • A new iTerm session opens, with four tabs:
    • A tab running script/server
    • A tab running script/console
    • A tab running autotest
    • A tab with a prompt in the project directory
  • A new TextMate window opens with the project tree in it's drawer.
  • A new Firefox tab opens with the http://0.0.0.0:3000/

The magic is enabled by this combination of shell and applescript:

CODE:
  1. #!/bin/sh
  2.  
  3. if [[ $# == 0 ]]; then
  4.   PROJECT_DIR=$PWD
  5. elif [[ $# == 1 && -d "$1" ]]; then
  6.   PROJECT_DIR="$@"
  7. else
  8.   print "usage: workspace.sh [rails project directory]"
  9.   return 1
  10. fi
  11. PROJECT_NAME=`basename $PROJECT_DIR`
  12.    
  13. osascript <<-eof
  14.   tell application "iTerm"
  15.  
  16.     make new terminal
  17.  
  18.     tell the last terminal
  19.  
  20.       activate current session
  21.  
  22.       launch session "Default Session"
  23.  
  24.       tell the last session
  25.           set name to "$PROJECT_NAME"
  26.           write text "cd \"$PROJECT_DIR\""
  27.           write text "clear; ls"
  28.       end tell
  29.  
  30.       launch session "Default Session"
  31.       tell the last session
  32.           set name to "server"
  33.           write text "cd \"$PROJECT_DIR\""
  34.           write text "./script/server"
  35.       end tell
  36.  
  37.       launch session "Default Session"
  38.       tell the last session
  39.           set name to "console"
  40.           write text "cd \"$PROJECT_DIR\""
  41.           write text "./script/console"
  42.       end tell
  43.  
  44.       launch session "Default Session"
  45.       tell the last session
  46.         set name to "autotest"
  47.         write text "cd \"$PROJECT_DIR\""
  48.         write text "autotest"
  49.       end tell
  50.  
  51.     end tell
  52.   end tell
  53. eof
  54. open http://0.0.0.0:3000/
  55. mate $PROJECT_DIR

Props to Rob Orsini for the inspiration for this. My version has just minor tweaks from his original.

October 3, 2007

Clickable Ruby Stacktraces with iTerm & TextMate

UPDATED: Rev'd the script to strip out "stupid rails /../ crap". Thanks, Ryan.

When I'm working in Ruby on my delightful new MacBook, I sometimes miss a feature of VisualStudio: the ability to double-click a line of a stacktrace in a test failure and open that file and line number in the editor.

I started thinking about how it might be possible at RubyEast on Friday, and tonight I hacked something together that works for TextMate and iTerm, my tools of choice. Here's the scoop:

iTerm has a feature where you can Command-Click a URL in terminal window and "follow" it using the app registered for that protocol. TextMate has a txmt:// URL scheme that lets you open files in textmate.

I wrote a ruby script that filters input to convert stacktrace lines to the txmt::// format. So here is a normal test failure (without processing through the filter):

CODE:
  1. $ /usr/local/bin/ruby -I.:lib:test -rtest/unit -e "%w[test/unit/some_test.rb].each { |f| require f }"               
  2. Loaded suite -e
  3. Started
  4. .....F...
  5. Finished in 0.128739 seconds.
  6.  
  7.   1) Failure:
  8. test_spec {Someone, in general, } 006 [should say something](Someone, in general, )
  9.     [/Users/lmelia/devprojects/secret/config/../vendor/plugins/test_spec_on_rails/lib/test/spec/rails/test_spec_ext.rb:6:in `equal'
  10.      ./test/unit/blog_entry_factory_test.rb:68:in `test_spec {Someone, in general, } 006 [should say something]'
  11.      /Users/lmelia/devprojects/secret/config/../vendor/gems/mocha-0.5.3/lib/mocha/test_case_adapter.rb:19:in `__send__'
  12.      /Users/lmelia/devprojects/secret/config/../vendor/gems/mocha-0.5.3/lib/mocha/test_case_adapter.rb:19:in `run']:
  13. <"Someone's clever response goes where?"> expected but was
  14. <"Someone's clever response goes here.">.
  15.  
  16. 9 tests, 11 assertions, 1 failures, 0 errors
  17. $

And here it is running through the textmate_urls Ruby script:

CODE:
  1. $ /usr/local/bin/ruby -I.:lib:test -rtest/unit -e "%w[test/unit/blog_entry_factory_test.rb].each { |f| require f }" | textmate_urls
  2. Loaded suite -e
  3. Started
  4. .....F...
  5. Finished in 0.111423 seconds.
  6.  
  7.   1) Failure:
  8. test_spec {Someone, in general, } 006 [should say something](Someone, in general, )
  9.     [txmt://open?url=file:///Users/lmelia/devprojects/secret/vendor/plugins/test_spec_on_rails/lib/test/spec/rails/test_spec_ext.rb&line=6 :in `equal'
  10.      txmt://open?url=file:///Users/lmelia/devprojects/secret/test/unit/blog_entry_factory_test.rb&line=68 :in `test_spec {Someone, in general, } 006 [should say something]'
  11.      txmt://open?url=file:///Users/lmelia/devprojects/secret/config/../vendor/gems/mocha-0.5.3/lib/mocha/test_case_adapter.rb&line=19 :in `__send__'
  12.      txmt://open?url=file:///Users/lmelia/devprojects/secret/config/../vendor/gems/mocha-0.5.3/lib/mocha/test_case_adapter.rb&line=19 :in `run']:
  13. <"Someone's clever response goes where?"> expected but was
  14. <"Someone's clever response goes here.">.
  15.  
  16. 9 tests, 11 assertions, 1 failures, 0 errors
  17. $

Now I can mouseover any of the stacktrace lines above, hold down command and click, and I'm automatically switched to TextMate with the specified file and line showing.

Yay!

My next step is to figure out how best to integrate it with autotest. If you have ideas, please leave a comment!

Here's the script:

RUBY:
  1. #!/usr/local/bin/ruby -ws
  2. #
  3. # textmate_urls - by Luke Melia <luke@lukemelia.com>
  4. #
  5. # usage:
  6. #  test.rb | textmate_urls
  7.  
  8. ############################################################
  9.  
  10. class TextmateUrls
  11.  
  12.   def self.urlize
  13.     trap 'INT' do exit 1 end
  14.     TextmateUrls.new.urlize
  15.   end
  16.  
  17.   ##
  18.   # Scans input looking for stacktrace lines and rewrite them with textmate urls in the output
  19.  
  20.   def urlize(input=ARGF, output=$stdout)
  21.     cwd = `pwd`.chomp #remember the current working directory to rewrite relative paths in the stacktrace
  22.     old_sync = output.sync
  23.     output.sync = true
  24.     while line = input.gets
  25.       case line
  26.         when %r{(^[a-z_]+\([A-Za-z]+\)) \[\.?(/?.*):(\d+)\]:}
  27.           line = "#{$1}\ntxmt://open?url=file://#{File.join(cwd, $2)}&line=#{$3}"
  28.           line.gsub!(%r|/[^/]+/\.\./|, '/')
  29.         when %r{^\s*(\[?)(/.+):(\d+):(.*)$} # a stacktrace line
  30.           line = "#{$1}txmt://open?url=file://#{$2}&line=#{$3} #{$4}"
  31.           line.gsub!(%r|/[^/]+/\.\./|, '/')
  32.         when %r{^\s*(\[?)\.?(/?.+):(\d+):(in .*)$} # a stacktrace line with a relative file reference
  33.           line = "#{$1}txmt://open?url=file://#{File.join(cwd, $2)}&line=#{$3} #{$4}"
  34.           line.gsub!(%r|/[^/]+/\.\./|, '/')
  35.       end
  36.       output.puts line
  37.     end
  38.     output.sync = old_sync
  39.   end
  40. end
  41.  
  42. TextmateUrls.urlize

Happy stack-walking!

LukeMelia.com created 1999. ··· Luke Melia created 1976. ··· Live With Passion!
Luke Melia on software development freelance web development how to contact me Luke Melia, Software Developer letters and more from my travels photo gallery personal philosophy