Justin Richard's blog



Justin RichardJustin Richard
Standup 12/8/11
edit Posted by Justin Richard on Thursday December 08, 2011 at 07:11PM

Interesting

The Pivotal Webstache Movember network cleared $40,000 raised to stop Dude Cancer

Joda-Time provides a quality replacement for the Java date and time classes. Months are not zero based!

EC2 is scheduling restarts for their physical machines and your instances. In some cases you can manage your own restart. Make sure you check your email and your EC2 console.

Help

Google Chrome seems to be caching and rendering the last resource served from a URL regardless of its content-type when you navigate via the back button to a page. Specifically, a client's site serves both HTML and JSON from the same URL. The JSON is the last request made because it's an async request on the page. When the user navigates away from this page then back the JSON data is rendered instead of the HTML resource. Any HTTP header change suggestions we can use to get Chrome to only render the HTML content?

Capybara seems to not allow #click on elements depending on how you call #find. What's up with this?

find('tr', :id => 'foo').click  #not clickable
find(:css, 'tr#foo').click      # is clickable

Justin RichardJustin Richard
Standup 12/6/2011
edit Posted by Justin Richard on Tuesday December 06, 2011 at 09:53PM

Interesting

A Ruby Class's default 'initialize' method takes zero or any number or arguments depending on the version of Ruby you use.

Given the Foo class:

class Foo
end

And then attempting to instantiate an instance of Foo with arguments like so:

Foo.new('any argument')

You get an invalid number of arguments error in 1.8.7 and 1.9.3.

However, 1.9.2 and 1.9.1 will just accept any number of arguments.

Ruby spec documents this behavior: https://github.com/rubyspec/rubyspec/blob/master/core/object/new_spec.rb

It appears that this difference between versions was introduced as a feature in 1.9.2 and back ported to 1.9.1 and then reverted in 1.9.3. Perhaps the reversion should be back ported now? http://redmine.ruby-lang.org/issues/2451

Help

Does anyone know of an API that provides a sales tax lookup service?