This has got to be the best thing ever… I mean seriously, take 2 of my favorite games of all time… and mix them together.
What to think...
From an organization that states that “homosexual conduct is inconsistent with the traditional values espoused in the Scout Oath and Law” (ala the Boy Scouts of America)… it sure does seem strange that this year, for fundraising…
that they are selling flowers.
Now, I’m not suggesting that the act of selling flowers is in any way homosexual… but I’d be damned if the BSA wouldn’t kick little Johnny out of the troupe if he came to all the meetings wearing one of the flowers he sold in his hair… or at least had something to say about it.
Ironic?
To help tide you over
I miss The Office… returning on April 5th btw and yes, this was put up legally by NBC to get us drooling for the return…
Wasabi Fusion Cuisine
Hit up Wasabi Fusion Cuisine (located 903 Washington Av S in Minneapolis)…
scrumptuous! great atmosphere and great tasting sushi.
Check out this custom sushi and sashimi plate that the head chef did for us:
El Gaucho Grill
One thing I like about the dating game is that you can branch out and discover new places to eat and drink.
Last night happened to be one of those branching out scenarios. We hit up El Gaucho Grill on East Lake street 2401 E Franklin Avenue in Minneapolis.
It was an intriguing Argentinean restaurant that came through as a suggestion for a good place to eat.
We had the Parrillada (Table Top Grill) with asado, vacio, chorizo molleja y morcilla (short ribs, flap meat, sausage, beef sweetbread, and Argentinean black sausage)
Wow… it was interesting to say the least, but not appetizing or fulfilling. The salad was great but the random assortment of what we originally thought was all flesh meat, ended up not being so good. There was actually a piece of something that looked like grilled chicken, that I tried… and it had the consistency of what I thought was an internal organ. Found out that molleja is actually a gizzard. Could have been worse…
Yeah, so be careful if you’re feeling adventurous and want to try it out… There are some other menu items that sounded good… like a spinach and cheese stuffed New York Strip Steak… but I’d stay away from the table top grill.
:: shrugs :: Good times
cruisecontrol.rb
Holy Hell I think I’m in love:
cruisecontrol.rb from the “thought workers” at ThoughtWorks.
Finally… a bearable CI solution for Rails projects, from the guys who brought you CruiseControl.Net.
Seriously HOT.
Rails Conditional Fragment Cache
There have been lots of caching articles coming out for Rails recently… especially when things heat up and more Rails based sites are hitting digg and slashdot. There was even a recent PeepCode episode…
And yet, when I’m caching things on my site… there are certain situations where I don’t have the right tools to do what I want.
Ignoring page and action caching, you have fragment caching left… and one of the drawbacks of using a memcache fragment cache is that you can’t use regular expressions to delete cache entries.
So imagine you have an inbox and you want to cache the pages of the inbox. Think about it, doing expensive queries on messages takes up a lot of resources… if there are a lot of users involved.
you have something like this setup: http://localhost:3000/inbox … and it’s paginated http://localhost:3000/inbox/page/1
it’s all going back to the same action/view no matter what page it’s on… you’ll end up fragment caching each page…
Well in the case of a message inbox, I had two problems:
Users pay most attention to the first page of their inbox… If you have pagination of 25 messages, you’ll rarely go back.
Since we’re caching pages, we’ll want to clear those caches when things happen (deletes, adds, etc)… but we can’t clear out N number of pages due to memcache not allowing regex deletions…
We have a few solutions:
Guess and/or calculate the number of pages that could be in the cache… and brute force the deletion of the cache. That can get expensive.
We could use a conditional cache and only cache the first page of the inbox (where I’m guessing the user will spend most of their time).
Conditionally cache? Well shit… how do I do that? The default fragment caching is a block structure.
Here’s something I played around with and found useful
With normal caching:
<% cache @my_cache_key do %>
# some very expensive or useless rhtml
<% end %>
But with a conditional cache, we can reuse the same HTML whether we’re paged or not.
<% cache_if @at_first_page, @my_cache_key do %>
# some very expensive or useless rhtml
<% end %>
Look cool? Here’s how I did it…
Crack open application_helper.rb and put in:
def cache_if(condition, name = {}, &block)
if condition
@controller.cache_erb_fragment(block, name)
else
block.call
end
end
Now there’s probably some nifty ruby syntactic sugar I could take advantage of here, but this will do!
Kinda nice… to be able to cache only one condition of a page… there you have it, my addition to the Rails caching extravaganza


