Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: December 2010

Tyler Schultz

Standup 2010-12-10: Flash <embed> Scaling, Heroku + Amazon RDS, Overriding Default Scope

Tyler Schultz
Friday, December 10, 2010

Help

  • Some pivots are having trouble with a flash embed tag’s scale attribute. The desired behavior is that the movie scale to fit the size of the element. According to documentation, this should just work. The flash content will not scale, instead the content is getting cropped.

  • Anyone have experience using Amazon RDS with Heroku?

    Several projects at Pivotal have used this combination with great success.

Interesting

  • A project had some intermittently slow queries. The problem was traced back to some large strings in one of the columns. The team solved this problem by overriding the default scope, and only selecting the expensive column when needed.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Tyler Schultz

Standup 2010-12-09: Aggregating hudson builds, Time gotcha

Tyler Schultz
Thursday, December 9, 2010

Help:

  • Does anyone know of a way to aggregate multiple projects into one hudson build? A pivot currently has 4 hudson projects that he’d like to show as one status. If any one project fails to build, then the build should go red, but hudson should still build the other three.

Interesting:

  • Time gotcha:

In 1.8.7 you’ll see this:

 > Time.now
 => Wed Dec 08 22:26:37 -0800 2010

 > 1.day.ago
 => Wed, 08 Dec 2010 06:26:44 UTC +00:00

 > 1.day.ago.to_date
 => Wed, 08 Dec 2010

 > (Time.now - 1.day).to_date
 => Tue, 07 Dec 2010

In 1.9.2 you’ll see this:

 ruby-1.9.2-p0 > Time.now
 => 2010-12-08 23:28:26 -0800

 ruby-1.9.2-p0 > 1.day.ago
 => Tue, 07 Dec 2010 23:28:26 PST -08:00

 ruby-1.9.2-p0 > 1.day.ago.to_date
 => Tue, 07 Dec 2010

 ruby-1.9.2-p0 > (Time.now-1.day).to_date
 => Tue, 07 Dec 2010
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Pairing tete-a-tete

Pivotal Labs
Thursday, December 9, 2010

At Pivotal Labs, we spend most of the day pair programming. The typical setup is an Apple iMac with a keyboard and mouse for each developer. We’ve been using the 24″ iMacs for a while, usually with a second 17″ display off to the side. But all our new machines are 27″ iMacs, and those are so big we don’t usually use the second display. The pair sits side-by-side at a desk facing the screen together. Here’s what it looks like:

side-by-side

We have had great success pairing this way at Pivotal. But while it is a good setup in a lot of ways, it falls short ergonomically. First off, both people have to sit off to the side of the display, which can cause leaning, slouching, and twisting to get into a position to both see and type. And it’s also hard to actually look at your partner without craning your neck around. Even though the desk is wide, keyboards and mice take up room, so there can be a lot of jostling and adjustment on the desktop, and chairs and such can collide as well. Those things aren’t terrible, but they do detract from the experience and my spinal fitness.

For a while I’ve been wanting to try and improve the situation. Earlier this year I sketched out a concept for how to set up a better pairing station. This week I’m pairing with Michael Sofaer, and we finally have the space, equipment and opportunity to try it as an experiment. Here’s how it turned out:

tete-a-tete-1

You’re doing it wrong!
tete-a-tete-2

The breakthrough is having a second display that mirrors the built-in display on the iMac. The second display and both keyboards/mice are all connected to the main iMac, so it’s one Mac system that can be used by two developers in collaboration.

Michael and I are both really loving this setup. It’s a lot more comfortable, we both get a better view of the screen, and it’s great being able to see each other so easily while we are working together. We are seated close enough that it’s easy to hear each other without raising our voices at all. And after a day of working in this arrangement I feel a lot better and my neck doesn’t feel out of whack.

Everyone who sees this setup asks if it’s hard to point at the screen to talk about stuff on it. I was a bit worried about how that would work out, but it turns out that using the cursor works great and it took almost no time to adjust to that. The one thing that feels a bit more difficult is watching for the subtle cues that let you avoid keyboard clashing. Experienced pair programmers will watch their partner’s hands in peripheral vision for hints about when they want to start typing or mousing. That skill takes most people a while to pick up, and I expect it will take more than a day or two for us to adjust to learning how to do that best in the new setup. But I think that being able to see my partner in my front quadrant view will more than compensate, once I learn new cues to watch for.

Equipment notes:

  • 27″ iMac + 27″ Cinema Display (or an iMac in display mode)
  • 6′ display port cable
  • 2 IKEA GALANT desks
  • 2 keyboards and mice
  • 2 gym balls :)

You can see in the photos that the tables are staggered. This is necessary so that the pair is close enough to be able to talk in a normal tone of voice. Sitting all the way across the table would not be intimate enough to work effectively. Our tables are 63″ long and 31.5″ wide. We found that offsetting them by half the width is about perfect.

Here is a sketch I made of a floor arrangement of multiple pairing stations. It’s easier to see the staggering here. You can also see how each pair is sitting closer to each other than they are to people in other pairs. Also notice this layout is biased for right-handed people. Using the opposite symmetry would be pretty crowded for mousing up against the edge of the table.

sketch

There is definitely an increased cost to set up tete-a-tete pairing stations. You need an extra monitor of good enough quality it can be someone’s primary display. You need an extra table per row, since the end spots can’t be used. (For us that’s not a problem since that would leave room for PMs to sit nearby.) The biggest issue for our office is that you need a lot more floor space for this arrangement. It probably uses more than twice the floor space of the old arrangement for an equivalent number of pairs.

I’m glad we had a chance to try this experiment, and I already consider it a success in terms of improved ergonomics and having a better view of your partner. Whether we’ll be able to use this setup long-term is a good question, one that I expect depends a lot on how much activity there is in the office. But I’m hoping…

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

RSpec 2 Gotcha with polymorphic_path

Pivotal Labs
Wednesday, December 8, 2010

A quick gotcha we ran into when using polymorphic path and rspec2 today.

In a controller test we had an assertion:

response.should redirect_to(polymorphic_path(@some_object))

Which resulted in the following error

Failure/Error: Unable to find matching line from backtrace stack level too deep
# ~/.rvm/gems/ruby-1.9.2-p0@gemset/gems/rspec-expectations-2.1.0/lib/rspec/matchers/method_missing.rb:4

It turns out polymorphic path is not available in the controller test (but the usual object_path method is). As to why this throws a stack level too deep and not a method undefined looks like potentially another bug in rspec but the solution seemed to be to do the following in our spec_helper.b for Rails 3:

include Rails.application.routes.url_helpers

For Rails 2.x you’ll want to use:

include ActionController::UrlWriter

I’ve opened an issue for this on github as well https://github.com/rspec/rspec-expectations/issues/issue/46

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Tyler Schultz

Standup 12/08/2010: fo sho really?

Tyler Schultz
Wednesday, December 8, 2010

Interesting:

  • salesforce acquires heroku: http://blog.heroku.com/archives/2010/12/8/the_next_level
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

ActiveHash 0.9.0 released for Rails 3

Pivotal Labs
Tuesday, December 7, 2010

I recently released active_hash-0.9.0 which should work with Rails 3 / ActiveModel.

If you use previous versions of Rails (down to 2.2.2) it should continue to work as before. If you have any issues, with backward compatibility or otherwise, please report them on GitHub.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Tyler Schultz

Standup 12/07/2010: bundler & rspec 2 & rails 3 – I go out of my head And I just can't get enough, I just can't get…

Tyler Schultz
Tuesday, December 7, 2010

Interesting:

  • Tests won’t run if rspec is included in the test group. rspec must be included in the development group, or both. When a test run is started the RAILS_ENV is development. After some initialization the RAILS_ENV is changed to test – a point at which the Gemfile has already been evaluated.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Evan Farrar

FasterCSV, Ruby 1.8, and Character Encodings

Evan Farrar
Tuesday, December 7, 2010

We had a bit of a head scratcher this week at the New York City office while working on Red Rover, a social directory for engaging students with their colleges and employees with their employer. We were trying to allow a CSV to be uploaded to the application, when it mysteriously failed to parse the CSV. We narrowed it down to being caused by a certain row with strangely encoded international characters (but not every row with them was a problem):

Fuentes,Jesús,”Cribbage, Chess, and Bridge Club”,Treasurer

But another row with the same character with the same encoding would import fine:

Johnson,Lúisa,Dodgeball Club,President

It turned out that this was due a problem with how Ruby finds character boundaries in 1.8. If that miscalculated character boundary happens to be where a quote mark begins in your CSV file, FasterCSV will hurl:

1.8.7> 'Jesús,"'.split(//)
=> ["J","e","s","349s,""]
1.9   > 'Jesús,"'.split(//)
=> ["J","e","s","ú","s",",","""]

This is not a problem in Ruby 1.9 with FasterCSV or in the old fashioned CSV class included with Ruby’s standard library in 1.8.6. Hopefully I can help others who have got this error staring them in the face despite having a perfectly valid CSV in every regard:

FasterCSV::MalformedCSVError: FasterCSV::MalformedCSVError
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1623:in `shift'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1614:in `each'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1614:in `shift'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1581:in `loop'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1581:in `shift'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1526:in `each'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1537:in `to_a'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1537:in `read'
    from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/faster_csv.rb:1229:in `parse'
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Will Read

Standup 2010-12-06:No Limit Gradients

Will Read
Monday, December 6, 2010

Ask for Help

“How do I turn off auto-complete in RubyMine? It can be a road block on bigger code bases.”

You can crank up the delay so it doesn’t auto-complete as vigorously.

Interesting Things

  • When consuming the Twitter streaming API (aka “The Fire Hose”) if you’re not seeing any rate limiting response messages it means you’re getting all the tweets possible for your query. No limit!
  • Got IE6? Need gradient action? There’s a CSS gradient filter that’s been supported in IE since 1997.
  • Amazon just announced a DNS service, and who doesn’t love a good DNS with an API to boot?
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mike Gehard

Are Rails plugins still necessary?

Mike Gehard
Monday, December 6, 2010

Back in the day, plugins were an acceptable way to extend Rails because gems were hard to create and publish. It was easier to just put up a public repo and have people pull a plugin from there.

In Rails 3, I think that we’ve got a good solution to these problems. Bundler allows us to type bundle gem and quickly get the skeleton of a gem. Bundler also also allows us to easily pull in unpublished gems via the :git option from any public git repo. The new rubygems.org allows us to easily publish gems that are ready for prime time.

Yes plugin maintainers will need to take a little time to update their plugins to be gems but I think that time is outweighed by the benefits of less code in Rails (because the plugin architecture code will be removed), possibly increased startup time because less code is running and adhernace to a standard way of loading Ruby extensions via the gem mechanism.

What do people think?

A lot of hard work has gone into modularizing the Rails3 codebase to make it easier to work with and faster.

Do we continue the spring cleaning and get rid of other remnants from the past?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (778)
  • rails (113)
  • testing (86)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (53)
  • techtalk (44)
  • rspec (38)
  • activerecord (29)
  • productivity (29)
  • gogaruco (29)
  • ironblogger (29)
  • git (28)
  • nyc (27)
  • rubymine (25)
  • mobile (21)
  • cucumber (20)
  • bloggerdome (19)
  • process (19)
  • pivotal tracker (19)
  • design (18)
  • jasmine (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • gem (13)
  • bdd (13)
  • selenium (12)
  • css (12)
  • goruco (12)
  • bundler (12)
  • tdd (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • rubygems (9)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >