Remaining Ruby & Rails Conferences in 09

Posted over 2 years back at Riding Rails - home

The Ruby and Rails community is still growing strong and the sheer number of conferences coming up is proof of that. Below I’ve put together a list of all the conferences/events I could find before 2010 so you can hopefully make it out to at least one. ;-)

If you do attend one of these conferences, do me a favor and thank the organizer for taking the time to produce the event. Most of them spend a great deal of unpaid time making the event happen and most of them aren’t making a profit. Their passion and hard work helps keep our community strong.

Jul 17 – Jul 20 Rails Camp in Bryant Pond, Maine.

Cost: $120

Jul 17 – Jul 19 Ruby Kaigi 2009 in Tokyo, Japan.

Cost: Sold Out

Jul 24 – Jul 25 Rails Underground in London, UK

Cost: £240

Jul 31 – Aug 1 Rails Outreach Workshop for Women in San Francisco, CA

Cost: FREE

Jul 30 – Aug 1 RubyRx in Philadelphia, PA

Cost: $550

Aug 7 – Aug 9 eRubyCon in Columbus, OH

Cost: $299.00

Sep 10 – Sep 11 Ruby Rx in Washington DC

Cost: $550

Aug 7 – Aug 8 Oxente Rails in Natal, Brazil

Cost: R$ 200,00

Aug 27 – Aug 29 Lone Star Ruby Conf in Austin, TX

Cost: $250

Aug 28 – Aug 29 Ruby Hoedown in Nashville, TN

Cost: FREE

Aug 29 RS on Rails in Porto Alegre, Brazil Cost

Cost: R$50

Sep 1 – Sep 2 Rails Konferenz in Frankfurt, Germany

Cost: €215

Sep 7 – Sep 8 RubyWorld Conference in Matsue, Japan

Cost: ¥5000

Sep 12 Windy City Rails in Chicago, Il

Cost: $99

Sep 26 – Sep 27 Central eUropean RUby camp in Wien, Austria

Cost: Free

Oct 2 – Oct 3 Ruby Foo in London, UK

Cost: £ 220

Oct 5 – Oct 6 Aloha on Rails in Waikiki, HI

Cost: $199

Oct 13 – Oct 14 Rails Summit Latin America in São Paulo, Brazil

Cost: R$ 400

Oct 16 – Oct 19 Rails Camp UK in Margate, UK

Cost: £50

Oct 16 ArrrrCamp in Ghent, Belgium

Cost: Free

Nov 7 – Nov 8 Rupy 2009 in Pozna?, Poland

Cost: ? (registration not open yet)

Nov 13- Nov 14 Conferencia Rails in Madrid, Spain

Cost: ?

Nov 19 – Nov 21 Rubyconf in San Francisco, CA

Cost: ? (registration not open yet)

Nov 20 – Nov 23 Rails Camp Australia in Melbourne, Australia

Cost: $180

Let me know if I forgot any events, I’ll be happy to add them to this list.

Remaining Ruby & Rails Conferences in 09

Posted over 2 years back at Riding Rails - home

The Ruby and Rails community is still growing strong and the sheer number of conferences coming up is proof of that. Below I’ve put together a list of all the conferences/events I could find before 2010 so you can hopefully make it out to at least one. ;-)

If you do attend one of these conferences, do me a favor and thank the organizer for taking the time to produce the event. Most of them spend a great deal of unpaid time making the event happen and most of them aren’t making a profit. Their passion and hard work helps keep our community strong.

Jul 17 – Jul 20 Rails Camp in Bryant Pond, Maine.

Cost: $120

Jul 17 – Jul 19 Ruby Kaigi 2009 in Tokyo, Japan.

Cost: Sold Out

Jul 24 – Jul 25 Rails Underground in London, UK

Cost: £240

Jul 31 – Aug 1 Rails Outreach Workshop for Women in San Francisco, CA

Cost: FREE

Jul 30 – Aug 1 RubyRx in Philadelphia, PA

Cost: $550

Aug 7 – Aug 9 eRubyCon in Columbus, OH

Cost: $299.00

Sep 10 – Sep 11 Ruby Rx in Washington DC

Cost: $550

Aug 7 – Aug 8 Oxente Rails in Natal, Brazil

Cost: R$ 200,00

Aug 27 – Aug 29 Lone Star Ruby Conf in Austin, TX

Cost: $250

Aug 28 – Aug 29 Ruby Hoedown in Nashville, TN

Cost: FREE

Aug 29 RS on Rails in Porto Alegre, Brazil Cost

Cost: R$50

Sep 1 – Sep 2 Rails Konferenz in Frankfurt, Germany

Cost: €215

Sep 7 – Sep 8 RubyWorld Conference in Matsue, Japan

Cost: ¥5000

Sep 12 Windy City Rails in Chicago, Il

Cost: $99

Sep 26 – Sep 27 Central eUropean RUby camp in Wien, Austria

Cost: Free

Oct 2 – Oct 3 Ruby Foo in London, UK

Cost: £ 220

Oct 5 – Oct 6 Aloha on Rails in Waikiki, HI

Cost: $199

Oct 13 – Oct 14 Rails Summit Latin America in São Paulo, Brazil

Cost: R$ 400

Oct 16 – Oct 19 Rails Camp UK in Margate, UK

Cost: £50

Oct 16 ArrrrCamp in Ghent, Belgium

Cost: Free

Nov 7 – Nov 8 Rupy 2009 in Pozna?, Poland

Cost: ? (registration not open yet)

Nov 13- Nov 14 Conferencia Rails in Madrid, Spain

Cost: ?

Nov 19 – Nov 21 Rubyconf in San Francisco, CA

Cost: ? (registration not open yet)

Nov 20 – Nov 23 Rails Camp Australia in Melbourne, Australia

Cost: $180

Let me know if I forgot any events, I’ll be happy to add them to this list.

Patron: A Simpler Ruby HTTP Client for Ruby

Posted over 2 years back at Ruby Inside

Phillip TolandUntil recently, I had been using the Curb library for making HTTP requests with Ruby, and I must say I was fairly happy with it. Phillip Toland, on the other hand, wasn't satisfied with Curb's API and the fact that it is tricky to modify (being implemented mainly in C). So, he came up with an alternative called Patron, written as much as possible in Ruby.

Patron is based on libcurl, just like Curb, but it aims to provide a simpler interface whilst still taking advantage of libcurl's strengths. To use Patron you can instantiate a Session object with your desired options:

sess = Patron::Session.new
sess.base_url = "http://search.twitter.com/"

...and then call methods against that session to perform your GET, HEAD, PUT, POST or DELETE operations. For example:

response = sess.get "search.json?q=ruby"

I really like the way that Patron lets you can send custom headers with your request, as I found this a bit fiddly in Curb.

sess.post("/foo/stuff", "some data", {"Content-Type" => "text/plain"})

Phillip provides more background about his design choices on his blog. You can find Patron on Github or install it as a gem.

The Journey to Ruby 1.9

Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home

Thanks to some late-night hacking at Boston.rb and plenty of awesome contributors, our gems are now Ruby 1.9 compatible. If you’re wondering what’s different in the newest version of Ruby, check out this great list from Eigenclass.org. Here’s some tips and tricks for those who want to upgrade their own Ruby install and have their gems to be compatible.

Installation

It’s dead easy to run Ruby 1.8.* and 1.9 together on the same machine. Check out how to install it on OSX here, or on Ubuntu here. If you’ve got a great blog post on how to install it on your favorite OS, drop a comment. The most important thing to remember is when you configure your install, add

--program-suffix=1.9

as a flag so all of the binaries end in 1.9. Also, don’t forget to grab the latest RubyGems version. Once you’ve got it downloaded and unpacked, install with:

sudo ruby1.9 setup.rb --format-executable

Make sure to tack on --format-executable whenever you do a gem1.9 install. This will setup executables with the 1.9 suffix, so for instance you can have cucumber and cucumber1.9 living harmoniously together.

Gotchas

Here’s a list of some of the roadbumps we ran into while upgrading our gems, and hopefully you can keep an eye out for them in your code as well.

Files with non-ASCII characters need an encoding set.

The basic solution to this is adding # encoding: utf-8 to the top of your file. Ruby just won’t parse the file without it. Of course, if your file has a different encoding you’ll need use that instead.

lambda is strict about arity

% irb
irb(main):001:0> lambda { 2 + 2 }.call(13)
=> 4
% irb1.9 
irb(main):002:0> lambda { 2 + 2 }.call(13)
ArgumentError: wrong number of arguments (1 for 0)
    from (irb):2:in `call'
    from (irb):2
    from /opt/local/bin/irb1.9:12:in `<main>'

We saw this in Paperclip and Factory Girl. The solution is to make sure you’re calling the lambda with the right amount of arguments, and checking #arity if you have to.

Block-local variables don’t leak scope

This has probably been mentioned on every Ruby 1.9 blog post in existence, but it’s still worth noting.

% irb
irb(main):001:0> item = 1
=> 1
irb(main):002:0> lambda { |item| }.call(2)
=> nil
irb(main):003:0> item
=> 2

% irb1.9
irb(main):001:0> item = 1
=> 1
irb(main):002:0> lambda { |item| }.call(2)
=> nil
irb(main):003:0> item
=> 1

Basically, just make sure that you’re naming things properly. Here’s where we fixed it.

#instance_methods, #methods, and their cousins now return symbols, not strings.

% irb
irb(main):001:0> Object.methods[0..5]
=> ["private_class_method", "inspect", "name", "tap", "clone", "public_methods"]

% irb1.9
irb(main):001:0> Object.methods[0..5]
=> [:allocate, :new, :superclass, :freeze, :===, :==]

The basic fix for this is to tack .map(&:to_s) onto the call. This was happening in quite a few gems.

Array#to_s does more of an inspect instead of its behavior in 1.8

% irb
irb(main):001:0> ["test", nil].to_s
=> "test" 

% irb1.9
irb(main):001:0> ["test", nil].to_s
=> "[\"test\", nil]" 

We saw this in one of Paperclip’s tests. While the new behavior seems to make more sense, just watch out if old code depends on it.

The __FILE__ constant is an absolute path in tests.

This example is a default jeweler generated gem with p __FILE__ in a test:

% rake
(in /Users/qrush/Dev/ruby/test-gem)
/opt/local/bin/ruby -I"lib:lib:test" "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test-gem_test.rb" 
Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
"./test/test-gem_test.rb" 
.
Finished in 0.000371 seconds.

% rake1.9                 
(in /Users/qrush/Dev/ruby/test-gem)
Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler
/opt/local/bin/ruby1.9 -I"lib:lib:test" "/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test-gem_test.rb" 
Loaded suite /opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
"/Users/qrush/Dev/ruby/test-gem/test/test-gem_test.rb" 
.
Finished in 0.000728 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

The solution to this was to use File.expand_path to make sure that it worked on both versions. This happened in Paperclip’s tests as well.

Onward!

We test all of our gems on 1.8.7 and 1.9.1 on our Integrity CI server as well, if you’re curious. As of today we’re not yet running full time on 1.9, but we hope to be there soon. The main reason we’re not is because some gems/plugins aren’t compatible, and some hosts don’t support it. We’ll post more articles in the future once we’re running our Rails projects on Ruby 1.9.

The Journey to Ruby 1.9

Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home

Thanks to some late-night hacking at Boston.rb and plenty of awesome contributors, our gems are now Ruby 1.9 compatible. If you’re wondering what’s different in the newest version of Ruby, check out this great list from Eigenclass.org. Here’s some tips and tricks for those who want to upgrade their own Ruby install and have their gems to be compatible.

Installation

It’s dead easy to run Ruby 1.8.* and 1.9 together on the same machine. Check out how to install it on OSX here, or on Ubuntu here. If you’ve got a great blog post on how to install it on your favorite OS, drop a comment. The most important thing to remember is when you configure your install, add

--program-suffix=1.9

as a flag so all of the binaries end in 1.9. Also, don’t forget to grab the latest RubyGems version. Once you’ve got it downloaded and unpacked, install with:

sudo ruby1.9 setup.rb --format-executable

Make sure to tack on --format-executable whenever you do a gem1.9 install. This will setup executables with the 1.9 suffix, so for instance you can have cucumber and cucumber1.9 living harmoniously together.

Gotchas

Here’s a list of some of the roadbumps we ran into while upgrading our gems, and hopefully you can keep an eye out for them in your code as well.

Files with non-ASCII characters need an encoding set.

The basic solution to this is adding # encoding: utf-8 to the top of your file. Ruby just won’t parse the file without it. Of course, if your file has a different encoding you’ll need use that instead.

lambda is strict about arity

% irb
irb(main):001:0> lambda { 2 + 2 }.call(13)
=> 4
% irb1.9 
irb(main):002:0> lambda { 2 + 2 }.call(13)
ArgumentError: wrong number of arguments (1 for 0)
    from (irb):2:in `call'
    from (irb):2
    from /opt/local/bin/irb1.9:12:in `<main>'

We saw this in Paperclip and Factory Girl. The solution is to make sure you’re calling the lambda with the right amount of arguments, and checking #arity if you have to.

Block-local variables don’t leak scope

This has probably been mentioned on every Ruby 1.9 blog post in existence, but it’s still worth noting.

% irb
irb(main):001:0> item = 1
=> 1
irb(main):002:0> lambda { |item| }.call(2)
=> nil
irb(main):003:0> item
=> 2

% irb1.9
irb(main):001:0> item = 1
=> 1
irb(main):002:0> lambda { |item| }.call(2)
=> nil
irb(main):003:0> item
=> 1

Basically, just make sure that you’re naming things properly. Here’s where we fixed it.

#instance_methods, #methods, and their cousins now return symbols, not strings.

% irb
irb(main):001:0> Object.methods[0..5]
=> ["private_class_method", "inspect", "name", "tap", "clone", "public_methods"]

% irb1.9
irb(main):001:0> Object.methods[0..5]
=> [:allocate, :new, :superclass, :freeze, :===, :==]

The basic fix for this is to tack .map(&:to_s) onto the call. This was happening in quite a few gems.

Array#to_s does more of an inspect instead of its behavior in 1.8

% irb
irb(main):001:0> ["test", nil].to_s
=> "test" 

% irb1.9
irb(main):001:0> ["test", nil].to_s
=> "[\"test\", nil]" 

We saw this in one of Paperclip’s tests. While the new behavior seems to make more sense, just watch out if old code depends on it.

The __FILE__ constant is an absolute path in tests.

This example is a default jeweler generated gem with p __FILE__ in a test:

% rake
(in /Users/qrush/Dev/ruby/test-gem)
/opt/local/bin/ruby -I"lib:lib:test" "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test-gem_test.rb" 
Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
"./test/test-gem_test.rb" 
.
Finished in 0.000371 seconds.

% rake1.9                 
(in /Users/qrush/Dev/ruby/test-gem)
Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler
/opt/local/bin/ruby1.9 -I"lib:lib:test" "/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test-gem_test.rb" 
Loaded suite /opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
"/Users/qrush/Dev/ruby/test-gem/test/test-gem_test.rb" 
.
Finished in 0.000728 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

The solution to this was to use File.expand_path to make sure that it worked on both versions. This happened in Paperclip’s tests as well.

Onward!

We test all of our gems on 1.8.7 and 1.9.1 on our Integrity CI server as well, if you’re curious. As of today we’re not yet running full time on 1.9, but we hope to be there soon. The main reason we’re not is because some gems/plugins aren’t compatible, and some hosts don’t support it. We’ll post more articles in the future once we’re running our Rails projects on Ruby 1.9.

The Journey to Ruby 1.9

Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home

Thanks to some late-night hacking at Boston.rb and plenty of awesome contributors, our gems are now Ruby 1.9 compatible. If you’re wondering what’s different in the newest version of Ruby, check out this great list from Eigenclass.org. Here’s some tips and tricks for those who want to upgrade their own Ruby install and have their gems to be compatible.

Installation

It’s dead easy to run Ruby 1.8.* and 1.9 together on the same machine. Check out how to install it on OSX here, or on Ubuntu here. If you’ve got a great blog post on how to install it on your favorite OS, drop a comment. The most important thing to remember is when you configure your install, add

--program-suffix=1.9

as a flag so all of the binaries end in 1.9. Also, don’t forget to grab the latest RubyGems version. Once you’ve got it downloaded and unpacked, install with:

sudo ruby1.9 setup.rb --format-executable

Make sure to tack on --format-executable whenever you do a gem1.9 install. This will setup executables with the 1.9 suffix, so for instance you can have cucumber and cucumber1.9 living harmoniously together.

Gotchas

Here’s a list of some of the roadbumps we ran into while upgrading our gems, and hopefully you can keep an eye out for them in your code as well.

Files with non-ASCII characters need an encoding set.

The basic solution to this is adding # encoding: utf-8 to the top of your file. Ruby just won’t parse the file without it. Of course, if your file has a different encoding you’ll need use that instead.

lambda is strict about arity

% irb
irb(main):001:0> lambda { 2 + 2 }.call(13)
=> 4
% irb1.9 
irb(main):002:0> lambda { 2 + 2 }.call(13)
ArgumentError: wrong number of arguments (1 for 0)
    from (irb):2:in `call'
    from (irb):2
    from /opt/local/bin/irb1.9:12:in `<main>'

We saw this in Paperclip and Factory Girl. The solution is to make sure you’re calling the lambda with the right amount of arguments, and checking #arity if you have to.

Block-local variables don’t leak scope

This has probably been mentioned on every Ruby 1.9 blog post in existence, but it’s still worth noting.

% irb
irb(main):001:0> item = 1
=> 1
irb(main):002:0> lambda { |item| }.call(2)
=> nil
irb(main):003:0> item
=> 2

% irb1.9
irb(main):001:0> item = 1
=> 1
irb(main):002:0> lambda { |item| }.call(2)
=> nil
irb(main):003:0> item
=> 1

Basically, just make sure that you’re naming things properly. Here’s where we fixed it.

#instance_methods, #methods, and their cousins now return symbols, not strings.

% irb
irb(main):001:0> Object.methods[0..5]
=> ["private_class_method", "inspect", "name", "tap", "clone", "public_methods"]

% irb1.9
irb(main):001:0> Object.methods[0..5]
=> [:allocate, :new, :superclass, :freeze, :===, :==]

The basic fix for this is to tack .map(&:to_s) onto the call. This was happening in quite a few gems.

Array#to_s does more of an inspect instead of its behavior in 1.8

% irb
irb(main):001:0> ["test", nil].to_s
=> "test" 

% irb1.9
irb(main):001:0> ["test", nil].to_s
=> "[\"test\", nil]" 

We saw this in one of Paperclip’s tests. While the new behavior seems to make more sense, just watch out if old code depends on it.

The __FILE__ constant is an absolute path in tests.

This example is a default jeweler generated gem with p __FILE__ in a test:

% rake
(in /Users/qrush/Dev/ruby/test-gem)
/opt/local/bin/ruby -I"lib:lib:test" "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test-gem_test.rb" 
Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
"./test/test-gem_test.rb" 
.
Finished in 0.000371 seconds.

% rake1.9                 
(in /Users/qrush/Dev/ruby/test-gem)
Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler
/opt/local/bin/ruby1.9 -I"lib:lib:test" "/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test-gem_test.rb" 
Loaded suite /opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
"/Users/qrush/Dev/ruby/test-gem/test/test-gem_test.rb" 
.
Finished in 0.000728 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

The solution to this was to use File.expand_path to make sure that it worked on both versions. This happened in Paperclip’s tests as well.

Onward!

We test all of our gems on 1.8.7 and 1.9.1 on our Integrity CI server as well, if you’re curious. As of today we’re not yet running full time on 1.9, but we hope to be there soon. The main reason we’re not is because some gems/plugins aren’t compatible, and some hosts don’t support it. We’ll post more articles in the future once we’re running our Rails projects on Ruby 1.9.

Siren: a JSONQuery interpreter for Ruby

Posted over 2 years back at Ruby Inside

sirenSiren is a JSON and JSONQuery interpreter for Ruby by James Coglan. Before I dive into talking about Siren, a little bit of background:

JSON is a lightweight, human-friendly data interchange format, for which there is already good Ruby support in the form of the json gem. JSONQuery was originally added as part of the dojo javascript toolkit and provides querying tools for JSON such as filtering and sorting etc. (check out this article on SitePen for more details). You can also find a stand-alone port of JSONQuery on Github.

Anyway, using Siren lets run queries against any type of Ruby object. In addition to the standard JSONQuery features, Siren allows JSON objects to be assigned IDs, enabling cross referencing and cyclic data structures. It also allows you to tell the parser to cast objects to an instance of a particular type, populating instance variables with the data (rather than just using vanilla hashes or arrays like most JSON tools).

Siren is available on James's Github account. Check out the README for more details on the supported features.

jslab.pngAlso.. Jumpstart Lab in Washington, DC is offering workshops teaching Ruby for beginning female programmers (Ruby Jumpstart) on August 1st and 2nd, then beginning Rails (Rails Jumpstart) for everyone on August 15 & 16. Save 10% with code "rubyinside"!

Article:Kernel Comparison of three Quasi-Unix OS

Posted over 2 years back at InfoQ Personalized Feed for unregistered user - Register to upgrade!

This article briefly examines and compares the kernels of the three most widely used quasi-Unix operating systems using three axes of comparison: efficiency, evolvement, and user friendliness. The operating systems compared (kernel only) are: OpenSolaris, Windows Vista, and Linux 2.6. By Dingze Zhu

Should We Rely on Language Constraints or Responsibility?

Posted over 2 years back at InfoQ Personalized Feed for unregistered user - Register to upgrade!

Bruce Eckel, Michael Feathers, Niclas Nilsson, Keith Braithwaite, and others on the question: should languages be fully flexible, allowing the developers to tweak them as they like, and trusting they will be responsible in their work, or should there be clear constraints set in the language from its design phase to avoid mistakes that create bad code, hard to maintain or to read? By Abel Avram

Double Shot #498

Posted over 2 years back at A Fresh Cup


Early morning with small child and thunderstorms.

My Apprenticeship - Friday, July 16, 2004

Posted over 2 years back at Jake Scruggs

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

Friday 7-16-04

Today I rode my bike into the city in search of a passport. City Hall: Big, confusing, lots of stairways leading to locked doors. First goal: Get a birth certificate. Long line, filled out misleading paperwork wrong, but accomplished. Second goal: Get passport. Not so fast, Mr. man, this office is closed inexplicably for an hour starting... Now. Kill time, eat pizza, come on back. I was waiting at the wrong place! Even thought the sign above the door clearly said 'U.S. Passports.' But the real passport place is upstairs in the same room where you apply for city jobs.

Silly of me.

For all those of you who like to complain about yer passport photo, I'd like to point out that you probably didn't wear a bike helmet in rain and let your hair dry in a pizza parlor before you got your photo taken. Did ya? That taken care of, I paid the nice lady $160 ($85 for city and federal fees, $60 because I want the passport sometime this year, and $15 for the photo) and peddled my soggy self home.

I remember being pretty worked up about asking Object Mentor for a day off so I could get my passport. They were very cool about it. On the other hand I was working for free that summer. And by working I mean floundering. They were probably excited to have a day where they didn't have to listen to me complain about a '5 minute install' all day long.

Five Features from Mercurial That Would Make Git Suck Less

Posted over 2 years back at Nuby on Rails

Some of the smartest programmers I know are also the most well rounded.

No one can deny that Why the Lucky Stiff is a strong advocate for Ruby, yet he knows Python well enough to write a bytecode converter that targets it.

Last year I switched to zsh because Christian Neukirchen recommended it, yet he is conversant with the next version of Bash, comparing and contrasting their features with ease.

Over the last few weeks I’ve been using the Mercurial distributed source code management system. I had encountered it when checking out a few open source projects like BWToolkit and wanted to become more familiar. Most blog posts that champion Git feature a few Mercurial commenters claiming that “Mercurial is easier to use.” Is this true? Why do they say that?

This isn’t an attempt to convince you to use Mercurial exclusively. And I’m intentionally skipping any mention of Mercurial’s shortcomings. I want to see these features in upcoming versions of Git. If I’ve missed something and that feature is already available, then I’d love to know about it! Leave a comment even though it won’t show publicly (I’m dealing with spam problems).

So here are 5 features Git should steal from Mercurial.

An Intelligent Setup Command

Mercurial (command hg) has a much smarter command for creating repositories. You can create both a directory and initialize a new repository with one command.

hg init my_project

Git assumes that you are in an existing directory and will squawk otherwise.

Accomplishing this in Git would take something like this:

mkdir my_project
        cd my_project
        git init

In addition, you can clone an empty repository. Imagine creating a new repository on GitHub and being taken immediately to your new project page with a link to clone the repository. That’s the experience you get with Mercurial.

No local setup is required. No editing of your .git/config file. Just clone and start adding files.

Put these together and you get a Bash function like this to create a private remote SSH repository and clone it locally:

function new-hg {
          ssh user@example.com "hg init $1" 
          hg clone ssh://user@example.com/$1
        }

Call it like this:

new-hg my_project

Right now Git requires that you commit one changeset before it will let you clone a repository. A simple solution is to add a .gitignore to the project. In fact, that would be a great feature request for the GitHub workflow!

Branches Everywhere

Git makes branching easy. Much easier than it was with Subversion.

But good luck trying to use those branches! Once you go beyond the local machine you’ll encounter cryptic commands abounding with switches and options that are weird but commonly used:

# Delete a Git branch
        git push origin :refs/heads/feature-tweak

Mercurial branches are not only easy to make, they are also easy to use! They go everywhere the repository does. You don’t have to worry about tracking branches or weird pushes to get them onto your remote repository.

hg branch feature-tweak
        hg commit
        hg push

Once you’re done, close the branch and they disappear.

hg commit --close-branch

I’m sure someone will counter with the argument from Linus that this requires coordination between developers to avoid branch name clashes. First, this isn’t really a problem unless you’re on a large team that shares a single repository.

And even in that case, why not use your name as a namespace?

git branch topfunky-feature-tweak

Git branches are already separated by the name of the remote repository. Why not just prepend the developer’s name to it as well? Then let me checkout a branch with that identifier and commit to it.

git checkout topfunky/feature-tweak

Quick Local References

Mercurial provides a nice local shortcut for referring to commits. Instead of making ASCII art with specifiers like master^_^, you can use a nice integer:

# 18:a432bc
        hg checkout 18

These numbers don’t travel across clones, but they make it much easier on the local machine.

Sensible Defaults

You can use Mercurial for a long time without using command flags. Most commands can be used without requiring knowledge of the underlying guts of the SCM.

hg revert .

Compare this to:

git reset --hard ORIG_HEAD

Commits happen Subversion-style. Yes, this is a feature! No need to add files before every commit or use a flag. Just commit and any changes since the last one will be included.

The incremental commit feature of Git has always confused me. I understand the theoretical beauty of being able to commit just one part of a file, but that means you’re committing a changeset that you’ve never used, never run tests against.

Easy Serving

Serving files happens easily without any arguments via the built-in webserver:

hg serve

You can visit the site at http://localhost:8000. As a bonus, you can clone it directly over HTTP:

hg clone http://localhost:8000 my_project

Again, simple and straightforward. No post-commit-hook tweaking is required.

Conclusion

I’ve intentionally left out any of the nasty bits of Mercurial, preferring to feature Git’s instead.

The good news is that most of these features could be implemented as surface-level improvements. I already use a handful of scripts to manage the otherwise unsavory tasks involved with using Git daily. Perhaps a few more could make it even better.

Product Placement

My pal and co-worker Dan Benjamin has prepared a fantastic PeepCode screencast on Mercurial. I assume that most readers of this blog are probably comfortable with Git. But if you’re like me and are continually looking for ways to improve your tools or adopt new ones, I think you’ll find it satisfying.


PeepCode Screencasts – Learn Ruby on Rails and Javascript! Hour-long screencasts for $9.

The wise Latina comment in historical perspective

Posted over 2 years back at DABlog - Home

I’ve watched no more of the Sotomayor hearings than has happened to be on while I’ve waited for the guy behind the counter to toast my bagel, and things like that. I don’t see much point in watching them, since it’s pretty easy to predict what her critics are going to ask her and say about her, and not terribly interesting to hear her answers.

But I do want to say something about this “wise Latina” thing, if I can do so without boring myself as well as you to death.

With very few exceptions, all Supreme Court justices, ever, have been white men. So have most other judges in the U.S. That means that someone, somewhere along the line, felt that white men make wiser decisions than people who are not white men. Maybe closer to “everyone” than “someone”, in fact.

White male jurists never have to say anything public to the effect that white males as wiser, as jurists, than people who aren’t white males, because it’s been said for them. It’s been said by virtually every President who has made judicial appointments and nominations, every Senator on whom the strangely homogenous pattern has not weighed heavily, and every citizen who never considered withholding a vote from the perpetrators of this centuries-long exercise in exclusion.

In short, the entire history of the Supreme Court and much of the rest of the judiciary amounts to a sustained assertion that white men make wiser decisions than anyone else.

So along came Sotomayor, and expressed a different opinion. She expressed an opinion that was not the opinion on which the entire history of the Supreme Court has been predicated. She espoused the belief that white men do not, in every imaginable case, make wiser judges.

Well!

How dare she?!

Doesn’t she realize that The Universal Opinion on this subject has already been established?

Of course it’s the same old thing. The belief that white males are wiser is so widespread, so ingrained, so taken for granted, that it seems natural. You don’t have to think about it; your thinking has been done for you. And you don’t have to be so gauche as to say that you believe it, because as long as you don’t saying anything, it will be assumed that that’s what you think.

All Sotomayor did was to respond. She was responding to history. History was saying—loudly, repeatedly, in chorus echoing down the centuries—that white men make wiser jurists. Sotomayor said: maybe not, under some circumstances.

That’s all.

Think of it this way. Sotomayor walks down the street every day, her whole life, and every couple of blocks, somebody says to her: White male jurists make wiser decisions than anyone else. Senators say it; Supreme Court justices say it. Citizens say it; Presidents say it.

After a lifetime of that, Sotomayor says: well, not necessarily.

And everyone gets mad at her.

The every-couple-of-blocks thing represents about one millionth of one percent of what Sotomayor, and the rest of us, have actually had communicated to us over our lifetimes. So why the hell shouldn’t she respond? And why are people treating her like Oliver Twist asking for more gruel?

A few Hoptoad UI adjustments

Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home

Since we launched the Hoptoad redesign we’ve been discussing ways to improve usability which has lead to a few changes as well as some new features. Below is an overview of some of these changes:

Error Index hoptoad ui

1. Rails environment indicator: in order to save space we trimmed the environment to the first character which will expand when you hover over it. Additionally we added the environment indicator to the project error view.

2. Nicely truncated error messages: error messages are now longer than before and truncated based on the width of your browser. Go ahead and maximize the window to your 30” monitor and enjoy.

Error show page hoptoad iu

1. Sensible left column: We’ve limited the information on the left to be more global in nature.
2. Error message: We moved the error message to the main column and grouped it with similar information. This allows it to display in a full and unencumbered form.
3. Navigating errors: You can now navigate through similar errors using these handy buttons.
4. Link to GitHub: This button will take you directly to the file in question if it’s available in GitHub.


We’re continuing with improvements throughout the app in order to make daily use of Hoptoad as pleasant as possible. As always, thanks for riding the toad.

A few Hoptoad UI adjustments

Posted over 2 years back at GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS - Home

Since we launched the Hoptoad redesign we’ve been discussing ways to improve usability which has lead to a few changes as well as some new features. Below is an overview of some of these changes:

Error Index hoptoad ui

1. Rails environment indicator: in order to save space we trimmed the environment to the first character which will expand when you hover over it. Additionally we added the environment indicator to the project error view.

2. Nicely truncated error messages: error messages are now longer than before and truncated based on the width of your browser. Go ahead and maximize the window to your 30” monitor and enjoy.

Error show page hoptoad iu

1. Sensible left column: We’ve limited the information on the left to be more global in nature.
2. Error message: We moved the error message to the main column and grouped it with similar information. This allows it to display in a full and unencumbered form.
3. Navigating errors: You can now navigate through similar errors using these handy buttons.
4. Link to GitHub: This button will take you directly to the file in question if it’s available in GitHub.


We’re continuing with improvements throughout the app in order to make daily use of Hoptoad as pleasant as possible. As always, thanks for riding the toad.