Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

NYC Standup Round-up for Mar 15th – Mar 19th

Spring is just around the corner, and it has been a beautiful week here in sunny NYC. We’ve learned a lot this week, as you’ll see as we do the Round-up!

Ask For Help

  • Kevin and I are having a heck of a time using Web Driver to drive an app that uses Google Maps. Whenever we click on or type into anything displayed on the map, the contents of the map (including the Google logo and the zoom control) move about 20 pixels up. Our tests seem to still work, it just looks like it’s broken. Anyone else seen this or know what might cause it?

Interesting Things

  • Kevin and I discovered that Capybara’s page.execute_script doesn’t like to execute multiple statements. It really wants to evaluate a single expression. The upside of this is that it’s really good at casting Javascript values into Ruby; it seems to work well with strings, numbers, and even arrays. If you really want to execute multiple statements, you can do this:

      page.execute_script <<-JS
          return someValue;
  • Todd found out the hard way that Ruby’s String#sprintf (also seen as the String#%) will cast your string numbers to octal if you’re not careful. Behold:

      >> "%d" % "010"
      => "8"
      >> "%d" % "08"
      ArgumentError: invalid value for Integer: "08"
        from (irb):2:in `%'
        from (irb):2

    Make sure you don’t feed sprintf a string number that starts with a 0 unless you mean it to be octal.

  • Rachel tells us that there’s an upcoming Rails workshop for women in NYC. Rumor has it that Pivotal’s own Sarah Mei is behind it. She’s been known to do such things before. Details as they become available.

  • Pat’s improv show is tonight! Check him out at the Magnet Theater.

  1. Mark Wilden says:

    010 is octal – it’s got nothing to do with #sprintf.

    >> 010
    => 8

  2. Peter Jaros says:

    Right, you expect `010` to be octal. You don’t necessarily expect `”010″` to be taken as octal. In fact, `”010″.to_i == 10`”. But when it’s interpolated with `#sprintf`, it *is* taken as octal.

    This occurred when we were doing data conversion from a legacy system which stored numeric identifiers as zero-padded strings, so we weren’t really thinking about it until it blew up.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *