Sat 28 June, 2008

Wednesday’s Refactor was great. I want to thank Ray Neimeir and Brian Shandler for their terrific presentations.
Ray’s talk was filled with special insights; I was really struck by his observations on bubbles, and looking for The Fizz.
Brian did a great job explaining how to work with CS3 and AIR, and there was a ton of useful info on getting rolling, and especially with using a local database. Check out the code for the talk here.
At the end of the meeting we did another round of Lean Introductions, and this time the tag was to offer up a current trend and a topic for future Refactor.
Here’s what came up (trends and topics mixed together):
- JavaScript applications (e.g., in browsers or browser derivatives)
- Mobile computing
- Virtualization
- Spore creatures and the ideas underlying their creation and behavior
- Cloud computing
- Game programming
- Rhino
- Social computing & networking
- Scalability
- The realm of add-ons and “social media” sites
- Open Social
Mike Wolfson has offered to give a talk on mobile computing; that’s slated for August. Thanks, Mike!
If you have something you can give a talk or demo on, please step up. It needn’t be long; 10-15 minutes works fine. It needn’t be formal; a walk through of a project or some code would be great.
And be sure to keep the last Wednesday of each month free to catch the Valley’s tech talent sharing their insights and know-how.
add to del.icio.us. look up in del.icio.us.
add to furlFri 27 June, 2008

add to del.icio.us. look up in del.icio.us.
add to furlThu 26 June, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
Welcome to the second edition of This Week in Rails, a weekly report with highlights from the Rails community.
Ruby Vulnerabilities
As previously reported by Jeremy Kemper, serious vulnerabilities have been discovered for the main Ruby implementations. The official advisory suggests an upgrade path, but there have been several reports of segmentation faults when using Rails with the patched Ruby 1.8.5 and 1.8.6 versions. The Phusion team has published a patch for Ruby 1.8.6-p111, but as things stand now, it hasn’t been included by the Ruby core team (yet).
If you are using Rails 2.1, Ruby 1.8.7-p22 seems the way to go. Unfortunately, Ruby 1.8.7 is not compatible with previous versions of Rails. If you decide that it’s time to upgrade your applications to Rails 2.1, this article features some handy tips, while this other one warns you about a few gotchas.
Those of you who’re running a version of Ruby that shipped with Mac OS X should wait for the next Apple’s Software Update.
Ajax
Rails is opinionated software, but its support for plugins clearly demonstrates a certain openness to diverging opinions on non-core issues. So while most of us mainly use Protoype, it is fairly common to see folks adopting other JavaScript frameworks as well, particularly jQuery.
Last week Jim Neath published a nice overview which compares jQuery with Prototype, and provides information about using jQuery with Rails through the jRails plugin.
Whatever your Ajax framework of choice is, you may be interested in the new Google Ajax Library API to improve the performance of your applications. Thanks to the tutorial Using Google Ajax Libraries API with Ruby on Rails (soon to be incorporated into a plugin) you can start adopting the API with Rails right now.
MVC
Rails 2.1 adds named scopes, which greatly simplify writing “find logic” within your Active Record models. It’s an extremely useful feature which is well explained in this write-up aptly titled, Named Scopes Are Awesome (we agree). Checkout also Ryan Bates’ railscasts on the subject: named_scope and Anonymous Scopes. You may also be interested in this week’s railscast about Caching in Rails 2.1.
Three other compelling Active Record related posts were, Smart Model, Dumb Controller, Bulk insertion of data with ActiveRecord and Timestamped Migrations on how to make “classic migrations” an available option (see ticket).
Michael Bleigh published a tutorial about dealing with subdomains in Rails applications through the SubdomainFu plugin (which appears to be flexible and very straightforward to use).
XP programming practices such as Test-Driven Development are very popular within the Rails community, but there are still many developers who see testing as a chore. Josh Nichols wrote an overview called A walk through of test-driven development with shoulda that shows you how easy it is to apply TDD to your Rails projects. In this specific case, he adopted the Shoulda plugin which seamlessly adds some assertions, helpers and macros on top of the Test::Unit framework.
Documentation
Aside from api.rubyonrails.org there are many alternatives for quickly visualizing the documentation of the Rails’ API. Last week a new one was launched: rails-doc.org. The current version features rapid searches and user annotations. This last feature in particular has the potential to become truly useful.
Deployment
If you are using Apache and mod_rails, you may want to read this article which provides information about a newly released module called apache-upload-progress.
Finally, Jason Crystal wrote a tutorial for packaging Rails applications for offline use on Mac OS X 10.5.
We’re done for this week. If you’d like to read more updates from the Ruby side of things, please head over to This Week in Ruby.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
The first Living on the Edge covered some of the API changes since Rails 2.1, and this time round, I’m going to cover the performance improvements as promised.
Jumping right in…
Faster Erb templates
Jeremy Kemper has made the Erb processing more efficient, especially the concat and capture helper methods.
The “special” Erb_erbout has been replaced with an instance variable, which allows for:
- better (memory) performance because bindings are no longer being passed around,
- fewer eval
s which are usually expensive, - there’s no need to slice the
_erboutvariable when you can swap in a new (string) buffer, and - the buffer is actually available via a
output_bufferreader and writer methods (so you can override it if you want).
Relevant changesets: 933697a - 0bdb7d3 - 4d4c8e2
Faster partials and JavaScript helpers
Partial template initialization and JavaScript helpers have been refactored and optimized for speed and efficiency by Jeremy Kemper. These are but a few of the optimizations Jeremy has been committing recently. Be sure to check out some of the commits to Rails (or for that matter, any quality Open Source project) – you could learn something!
Relevant changesets: partials – JavaScript helpers
RecordIdentifier methods speedup
The RecordIdentifier has been sped up by some simple use of memo-ization, thus reducing the number of inflections performed, among other things. The RecordIdentifier is used widely in cache keys, partial template paths, and in most places where you identify an ActiveRecord model without caring about its actual id.
Relevant changesets by Jeremy Kemper: c1a9820 – 566d717
Lazy load cache and session stores
Update: Oops my bad, this change was later reverted in 6573f6a.
The various cache stores in the ActiveSupport::Cache module are now lazy loaded – this means that they are only required when you actually start using them.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlWed 25 June, 2008

Brian Shaler has stepped to and offered to give a talk/demo on an Adobe AIR desktop application at Wednesday’s Refactor Phoenix.
Brian knows his stuff; AIR looks quite cool (though this Kubunu dev is saddened by this set of sys requirements ); Boulders has beer and pool. So you have no reason not to attend.
In unrelated news, James feels partial shame at occasional outbursts of frustration concerning perceived geek lethargy.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
“ Because we’ve won, we have no choice. ”
Barack Obama
add to del.icio.us. look up in del.icio.us.
add to furl

- 说明
- 互联网域名市场进入了又一次巨大的商业机遇。谁都可以获得更为简单的顶级域名(top-level domains,TLD)。顶级域名将可以是任何语言的文字内容。“.com”或者“.cn”的时代将会过去了,一个以“.商业”或者“.中国”的新顶级域名时代即将开始了。下面的链接是ICANN的一个可用的测试链接,请将下面的域名输入到Firefox 3.0的地址栏,在该栏中将会看到该地址的全中文显示。
http://例子.测试/首页
- 互联网域名市场进入了又一次巨大的商业机遇。谁都可以获得更为简单的顶级域名(top-level domains,TLD)。顶级域名将可以是任何语言的文字内容。“.com”或者“.cn”的时代将会过去了,一个以“.商业”或者“.中国”的新顶级域名时代即将开始了。下面的链接是ICANN的一个可用的测试链接,请将下面的域名输入到Firefox 3.0的地址栏,在该栏中将会看到该地址的全中文显示。
- 参考资料
add to del.icio.us. look up in del.icio.us.
add to furlTue 24 June, 2008

The next Refactor meeting is this Wednesday, June 25. No one has offered to give a talk or demo or anything, and I don’t particularly want to have to whip up yet another talk, so there will be nothing formal that night.
The last time there was no particular presentation it ended up being me and five other people. Two of those others never (that I could tell) came back for another Refactor. Hooray for casual conversation.
It is, of course, disappointing to think that the only way to get deveopers together after work is to offer up some pre-planned “edutainment.” It’s even more disappointing to think that maintaining a reliable stream of worthwhile presentations will be tedious monthly chore of either goading people into giving a talk or assembling one myself.
I can assure you that the latter just ain’t gonna to happen, and I’m not fond of pestering people, either.
An interesting related phenomenon is the turn out for the Tempe Nerds lunches. Clearly folks are up for socializing, just not so much when it’s after work. (Side note: As best I can tell, Refresh Phoenix still gets a good crowd. I’ve stopped going since it become overly focused on Break Out Of Your Cube! and How To Be Entrepreneur 2.0! I have a completely unproven conjecture about the different social needs of Web designers and marketeers vs. developers and hackers.)
A primary goal of Refactor was the social element. I was really hoping to get together people who would otherwise not meet. A second goal was to get people introduced to technical topics that might be a bit outside their day-to-day endeavors. I think I’ve failed on that one, while Tempe Nerds appears to fulfill the first goal (though the mix seems more Refresh-y than hacker; however, there were actual developers at the lunches). So, all in all, the cost/benefit ratio for Refactor is questionable.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlMon 23 June, 2008

add to del.icio.us. look up in del.icio.us.
add to furlSun 22 June, 2008

Ignite Phoenix is open for submissions
Drop by the submissions page and think about what you would do with your five minutes.
Please be sure to check out the presentation guidelines as well.
add to del.icio.us. look up in del.icio.us.
add to furlSat 21 June, 2008

add to del.icio.us. look up in del.icio.us.
add to furl
Drew Yao at Apple uncovered a handful of nasty security vulnerabilities affecting all current versions of Ruby. The details are still under wraps because an attacker can DoS you or possibly execute arbitrary code—holy crap! Better upgrade sooner than later.
According to the official Ruby security advisory, the vulnerable Rubies are:- 1.8.4 and earlier
- 1.8.5-p230 and earlier
- 1.8.6-p229 and earlier
- 1.8.7-p21 and earlier
Those of us running Ruby 1.8.4 or earlier must upgrade to 1.8.5 or later for a fix. Those on 1.8.5-7 can grab the latest patchlevel release for a fix.
(Please note: Ruby 1.8.7 breaks backward compatibility and is only compatible with Rails 2.1 and later, so don’t go overboard!)
add to del.icio.us. look up in del.icio.us.
add to furl