Our 15 seconds of fame continues
Lisa was on the news last night!
We were in the Seahawks store buying yet more goodies, when a KOMO crew stopped and asked Lisa some questions. They were doing a story on how fast the gear was going. They interviewed a bunch of people, but only Lisa’s interview was used in the piece.
I’m in print, Lisa’s on the telly. How cool is that?
Update
It looks like the 11pm KOMO news used a different clip, but kept Lisa’s name in the caption! The 5 and 6:30 newscasts were the real Lisa.
We have our Superbowl tickets
When we went to pick up our superbowl tickets yesterday, the Seahawks had the NFC champions trophy and were taking pictures of people with the trophy. Here’s us!
At least Rich thinks I'm funny
I sent an email to Rich Eisen at the NFL Network (The most watched NFL Network owned by the NFL). Actually, I sent two emails. He printed them both in his weekly column!
http://www.nfl.com/nflnetwork/story/9185588
Here’s the relevant chunk, in case the article goes away in the far distant future.
This one could be my favorite one of all because in chastising me for getting Jackson’s name wrong, John got wrong the wrong name by which I called Jackson. Not to pick nits, John, but I called Jackson “Dexter” not “Derrick.” But, then, three hours later, this email hit the inbox.
Rich, Rich, Rich… Dexter Jackson? I didn’t believe it when you said it once, but then you said it again. Even my wife was shouting abuse at the Telly (I’m British, so I have that foreign angle covered). I know he’s been missing for most of the season, but his name is Darryl Jackson.
Tom Fakes
Good ol’ chap, that Tom. Puts Jackson’s correct name in bold with neat little asterisks on each side and yet…it’s misspelled. Then, about four hours later, Tom wrote back.
Oops—it’s Darrell.
Nothing more to see here, move along. Love your show!
Now, that’s hilarious. Thanks for realizing it’s easy to get something wrong even when you think you’re right, Tom. To be honest, calling Darryl, I mean, Darrell Jackson “Dexter” is what we in the business call, for the lack of a better phrase, a brain fart.
We're going to Detroit!
At the halftime of the best football game I’ve ever been to, I’m heading to the fridge in the suite to get a beer, when I bump into two guys I recognize. Bill Gates and Steve Ballmer turned up to say hello to Dinarte!
They chat for about 10 minutes, drawing a crowd at the stairs that go past our suite, and then head back up to Paul’s suite to watch the second half.
We did get our pictures with them – I think my hat is the difference maker this year.

Now we’re going to Detroit in two weeks. Our trip is planned, the tickets are reserved.
Rails named routes make refactoring a cinch
I have some code that needed to be refactored. I had a controller with actions that should have been somewhere else. Here’s how the refactoring went.
- Make a new controller for my rogue actions
- Move the actions from the old controller into the new one
- Create a folder for the views
- Moved the views for the actions that were transferred to the new controller.
- Change two named routes in my routes.rb file to use the new controller.
The key part here is the way Rails’ Named Routes make this so easy. Not a line of view code was changed.
Almost all examples of URLs in Rails code I’ve seen use regular routes, but this makes for hard to read code:
routes.rbmap.connect ':controller/:action/:id'link_to :controller => 'foo', :action => 'bar', :id => 'baz'If you use a named route, the code becomes easier to read, and easier to refactor
routes.rbmap.edit_page 'page/edit/:id',
:controller => 'page',
:action => 'edit'link_to edit_page_url(:id => 'baz')I can now change where the edit_page_url controller and action are without changing all the functionality that uses them. In addition, my view code is a lot more readable.
I may have too many named routes in my code, but I find it easier to have a larger number of more specific routes than a smaller number of generic routes that I can’t get my head around!
Rails Action Cache now available as a plugin
I’ve packaged my Active Cache upgrade as a Rails plugin.
script/plugin discover gets craz8.com into your plugin server list
script/plugin install action_cache will install the code
update I’ve added two new features to this code today.
- Ability to change the fragment_key method to customize your caching
- Addition of a ‘time_to_live’ property to have your cache items expire on a timer as well as through the regular expiry mechanism.
OutputCompression filter now available as a Rails plugin
I’ve taken the OutputCompression filter and made it into a Rails plugin. I’ve added it to the Rails plugin page (towards the botom) and have a publically available subversion repository containing the code.
This code includes the fixes by Sebastian for handling Component rendering correctly.
Bug in my memcache usage post
I found a bug in my setup of memcache code in a previous post. Here’s the update:
cache_params = *([memcache_servers, memcache_options].flatten)
CACHE = MemCache.new *cache_paramsThe Seahawks Rock!
On Saturday the Seahawks won their first playoff game in forever – woot!
Before the game, we attended a large breakfast with the CEO Tod Leiweke and President of Football Operations Tim Ruskell. Steve Raible was there too.
In addition, they had three of the Seahawks Ring of Honor inductees there – Curt Warner, Jacob Green and Steve Largent. Lisa ran to get our Steve Largent Wheaties box and had Steve sign it for us!
80 of us managed to get into a group to do the flag ceremony before the game. We went down to the field just after 10:30, and then spent 20 minutes doing a run through of the whole flag thing. Then we had to wait around on the field for the next two hours before the game.
Doing the flag during the national anthem was a blast. We didn’t screw it up, and as we were leaving the field, 4 helicopters flew over in formation – Army, Air Force? I couldn’t tell, but that was cool too. 67000 of our closest friends is kind of loud on that field.
We managed to get back to our suite right at kickoff, although we missed the introductions, we didn’t miss any of the game.
Next week is the Carolina Panthers!
Rails using memcache for everything
The Rails documentation for using memcache is a little skimpy. I eventually worked out how to use it for a Session store by googling. The Fragment cache store was a little easier.
Here’s the relevant parts of my environment.rb file:
require 'memcache'
memcache_options = {
:compression => false,
:debug => false,
:namespace => "app-#{RAILS_ENV}",
:readonly => false,
:urlencode => false
}
memcache_servers = [ '192.168.1.150:2222', '192.168.1.150:2223' ]
Rails::Initializer.run do |config|
....
config.action_controller.session_store = :mem_cache_store
...
config.action_controller.fragment_cache_store = :mem_cache_store, memcache_servers, memcache_options
...
end
...
cache_params = *([memcache_servers, memcache_options].flatten)
CACHE = MemCache.new *cache_params
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.merge!({ 'cache' => CACHE })The order of these things is important – the DEFAULT_SESSION_OPTIONS can’t be changed until after the Initializer has finished, for instance.
This configuration gives me:- Session store in Memcache
- Fragment cache in Memcache
- A global CACHE object I can use to cache Model objects
It’s annoying that the configuration for the Session store and Fragment cache aren’t the same – oh well.
Update: Fixed a bug in the passing of parameters to the setup of the CACHE object.