A couple weeks ago Davis wrote about using pseudo-classical inheritance to make your JavaScript more object-oriented. I agree with a number of his points about the goal of well-structured code. However, based on my just-over-a-month experience in JavaScript, I personally don't like to shoehorn the language into object-orientation via pseudo-classical inheritance.
For the sake of examples consider the following class hierarchy: Athlete, Footballer, and Defender.
Donkey & Goat Winery in Berkeley is having an open house Saturday March 20 2010. I'm personally a big fan of their wine. I'm enjoying a glass of their 2006 Syrah, The Recluse right now. Jared, one of the owners, has been kind enough to let us at Pivotal sample his wines on a few occasions. I'd heartily recommend going along to sample their wine, eat some food and learn about their wine making.
DONKEY & GOAT SPRING OPEN HOUSE PARTY SAT 3/20 1-5PM, AT THE WINERY IN BERKELEY 7 NEW WINES, EATS FROM BERKELEY'S SOON TO OPEN LOCANDA DA EVA AND THE MICHAEL LAMACCHIO TRIO, OUR FAVORITE BRAZILIAN JAZZ TRIO IS BACK! SAVE $10 WITH ADVANCE TICKETS
At Pivotal Labs, one of the services we provide our clients is helping them interview and hire. This is an excellent opportunity for you to learn Extreme Programming by working side-by-side with Pivotal's talented and experienced developers while at the same time joining a small and dynamic product team.
Pivotal Labs and our clients place a strong emphasis on Agile development and its many aspects: Pair Programming, Test-Driven Development, rapid iterations, and frequent refactoring. General technical requirements include serious web development experience, and a significant subset of Ruby, Rails, CSS, JavaScript, or MySQL.
A current Fortune 100 client is looking for experienced Rails developers to join their team. The preferred location is San Diego, but candidates from throughout California are encouraged to apply.
Job Description:
- Develop and maintain multiple Ruby on Rails applications for a Fortune 100 company
- Work directly with management to improve the product and the development process
- Test Driven Development with tools like RSpec, Test::Unit, JUnit, Jasmine and Selenium
- Pair Programming
- Aggressive Refactoring
Additional Skills desired:
- Ability to communicate and coordinate with technical and non-technical management
- Extend and improve the Continuous Integration, Build, and Deployment environments
- JavaScript, including experience with Javascript testing frameworks
- SQL
Please email your resume and cover letter to railsgig@gmail.com. Compensation commensurate with experience.
It's been a quiet week in New York City, my hometown. Let's do the round-up.
Ask for Help
Ian Z. asked, "Given a
<select>input element, how do I select an option by its name and not its value using jQuery?"The answer? You can't. Or you couldn't. But the very act of observation changes the phenomenon which is observed), and by lunch, you could. Pat's just crazy like that.
$.fn.chooseis available in chewable Gist form.
And that's it. I'll see you back here next week.
Help
"What's the best way to test that an array contains another array?"
A custom matcher using array - other_array was suggested.
Interesting
The team that was having problems with Prototype response codes found a partial solution.
They sometimes call abort() on the request which triggers the callbacks with a 0 response code. They found that if they set transport.onreadystatechange = function() {}; before calling abort() they could skip the callbacks, and manually call whatever clean-up they needed. That Prototype interprets 0 as a success still sounds strange.
Version 1.5 has been submitted and should be in the App Catalog soon.
Bugs
- Load More showing gaps in home timeline ( see below)
- Links causing app to freeze
- Notifications not clearing on loading the timeline
- Wrong (and really big) notification counts in dashboard
Forward Gesture/Compose is still broken -- seems to be problem in webOS 1.4 update. (This seems broken in web browser application as well)
Features and Changes
- basic/beta TwitVid integration for uploading video
Load More
Before 1.3, some users had gaps in their home timelines when clicking "Load More". We tried to fix this in 1.3 and probably made things worse.
We are going back to the previous methods we had in 1.2. While users may still see gaps, the problem seems to on the Twitter side. In more expansive testing, it seems that the Twitter API occasionally return the wrong tweets for Load More. We are trying to find out more from Twitter
While we think the Load More behavior will be better, we don't think this is fully resolved and might be outside our control.
Opening Links and Frozen App
This is a bit complicated. We thought our update to 1.3 fixed this. It did, for some users, it didn't for others.
Apparently there are some bugs in Palm's installer that have led to some files not being overridden, even though they changed. Upon testing, we've discovered version 1.3 installations that still have some of the 1.2 files.
We are hoping this update forces an overwrite of the files in question, but it may not for everyone. For those that still have trouble with links freezing the app:
- try deleting Tweed first, then re-install -- this should clear out old files
- if it still doesn't work, please email us at tweed-support@pivotallabs.com
Video Beta
We have integrated TwitVid uploads with Tweed. We consider this a beta and expect users to experience some problems. Honestly we wanted to let people experiment sooner than later.
The largest problem is upload stability -- video files can be sizable and the upload may fail, especially over cell. We suggest using video with wifi only.
There are some webOS challenges unfortunately to making this integration more robust. The file upload mechanism in webOS doesn't allow for resuming a failed upload: it is all or nothing. For larger files (like video), this is a bit fragile.
We are hoping Palm will provide other upload mechanisms that will allow us to make this more robust, but honestly, we are a bit stuck unless they make these changes.
We plan to make add features to Tweed to provide better feedback about progress and help make retries easier.
Free Version
As we announced some time ago, we are no longer continuing development on the free version of Tweed. We haven't the resources to continue developing two versions of the application.
Unfortunately, webOS 1.4 has broken Tweed and this is something we weren't expecting. However, we still aren't in a position to support both versions (free version is no longer in US catalog), so users of 0.9.x won't be getting an update. We are sorry for this and understand it will make Tweed unusable for many/most users of this version.
To make it easier for free users to upgrade to the paid version, we are going to reduce the price of Tweed from $2.99 to $0.99 for the next few weeks. As with all Palm apps, updates are free.

In order to post to our Campfire chat when the CI goes red, we threw the following script in script/campfire_post:
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'uri'
require 'json'
url = URI.parse('http://SUBDOMAIN.campfirenow.com/room/ROOM_ID/speak.json')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'API_KEY', 'X' # leave the X
req.body = JSON.dump({ :message => { :body => ARGV.first }})
req.content_type = 'application/json'
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# OK
else
res.error!
end
And then in cruise.rake:
desc "The task that cruisecontrol.rb runs"
task :cruise do
begin
rake "spec"
# etc
# etc
rescue
exclaim = ["Oh goodness, t", "OMG t", "Look sharp, t", "Attention everyone! T", "Ohnoes! T"][rand * 5]
system "ruby script/campfire_post '#{exclaim}he build just went red!'"
raise
end
end
And it's even cheeky!
A Palm project uses Prototype for their ajax calls. They noticed that Prototype casts low-level errors (network errors, etc.) to a response code of 0. Unfortunately, the rest of Prototype interprets 0 as "success". When they hacked Prototype to interpret 0 as a failure, another darker problem emerged. In some cases, for example if they send two requests in rapid succession, even if both responses have 200 in their headers, Prototype will report the second's response code as 0. So, 0 can indicate success or failure in different scenarios.
- Reminder: tonight we're hosting a workshop to help you polish your RailsConf presentation proposal. Sign up or just drop in. Thanks to our own Sarah Mei for coordinating and running the workshop.
- "Anyone familiar with the new RubyMine test runner? We'd like to integrate Jasmine tests, so we can run headless JS tests in the IDE."
When you kill a JRuby process (e.g. with a SIGINT) you can't bank on ensure blocks being executed. Of course, this is worrisome - file handles and other connections won't be closed. The problem boils down to this example:
$ cat kill_me.rb
begin
sleep
ensure
puts 'executed ensure'
end
$
$ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
$
$ ruby kill_me.rb
^Cexecuted ensure
kill_me.rb:2:in `sleep': Interrupt
from kill_me.rb:2
$
$ jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_13) [x86_64-java]
$
$ jruby kill_me.rb
^C$
