Interesting

December 25th, 2008

Made this up tonight (Christmas)… kind of like it:

1 shot gin (Citadel)

1/2 shot Batavia Arak

1/2 shot Maraschino (Luxardo)

splash (1/4 ounce?) Green Chartreuse

splash Sweet Vermouth

dash Peychaud’s Bitters

Stirred on ice, strained into “my cocktail glass” (stemless goblet) and served (to myself) with a lime twist. Yummy.

You Got Yer Merb in my Rails

December 23rd, 2008

So, the Rails blogosphere is all abuzz with the news that Merb will be merged into Rails for the 3.0 release.

Now, I haven’t done much more that a few minutes of messing with Merb here and there… and that was quite a while ago. However, Merb’s philosophy struck me as much more “no set way to do it” rather than “convention over configuration”. Seems like that would make for a potential culture clash.

It sounds like the parties involved are determined to work it out though. And really, I think that would be a good thing for the Rails world, to become a little less insistent about the conventions. Ok, maybe “insistent” isn’t the right word. But Merb has definitely pushed the reconfigurability angle.

But all that philosophy shit aside, there is one burning question this raises for me: what will happen with “render”?

This may seem silly but one of the things that most excited me about Merb was that it just renders the last thing you tell it to render… no more DoubleRenderErrors. It would be awesome if Rails switched to that approach. Uh, though there’ll be a lot of gutting of if/else blocks to do. :-)

Bad Blogger

December 20th, 2008

Sigh, this is why I went so long without creating another blog after I killed my old one six years ago… I just never seem to get around to posting anything. And then when I do, it’s this silly “boy I suck at blogging” kind of post.

Ahn, whateva. Here’s something I did recently:

Last weekend was the House Spirits Holiday Booze Bazaar and my two brothers and a whole platoon of their Seattle cocktail friends came down for it. Ironically I was only at House Spirits for about a half hour. I was starving and talked some of the crew into going to get food. That wound up taking a while and we didn’t make it back to the party. I think the guys I was with were jonesing to get to Uptown Liquors and Specialty Liquors anyway.

I did get a chance to sample the brand-spanking-new Ouzo that House has released under their Apothecary line. Also tried Ransom’s new Old Tom Gin, which was really nice. Then there was House’s eagerly anticipated (at least by me) Rum. That was quite nice too, but I think it still needs a bit more time. Also had some Marteau Absinthe. That was nice, as was having several long conversations with it’s creator, Gwydion Stone, over the weekend.

There was also some flavored caramels, several locally made cheeses, and I think some other stuff, but my memory fails me. That was a whole week ago! Anyway, I wasn’t at the Bazaar long but I got to try a lot of good stuff. I actually don’t think I needed much more time there than I had.

My liquor store purchases that day included a bottle of Batavia Arak, my new favorite base spirit. It’s distilled from sugarcane and fermented red rice and has a really interesting flavor. I think that’s from the rice, but I can’t say for certain. It’s often called “rum-like” because it’s distilled from sugar cane. But it doesn’t taste like rum to me. It just tastes totally different.

Our carousing that night included visits to Secret Society, Mint, Clyde Common, 1001, 50 Plates, and of course, Teardrop (we closed the place).  Secret Society has expanded their cocktail menu to include a lot more esoteric, classic recipes. I think a couple people in our party had some gripes… don’t think the bartender was on the top of his game that night. Still, I got to try a couple classic cocktails that I hadn’t heard of (don’t ask me what, cuz I don’t remember).

I went to Mint mostly to see if they’d gotten over their vodka obsession. Last time I was there, a year and a half ago, their cocktail menu was about 70-80% vodka and fruit drinks. I think they’re down to about 50% now, but still, that’s just too many vodka drinks, in my opinion. Several of the Seattle folks wanted to go to Mint just cuz they hadn’t been. But I don’t think anyone was remotely impressed.

Later that night, Teardrop provided a nice bookend to that Mint experience: they have a vodka drink on their cocktail menu now! It’s tongue in cheek though, including house-made Red Bull bitters… heh. I didn’t have the balls to try it, but did get a taste of the bitters… one of the most horrifying gustatory experiences of my life! :-)

All in all, it was a very fun and educational day. A friend of my brothers’, his jaw loosened by nearly twelve hours of drinking, strongly encouraged me to increase my participation in the Munat Brothers’ endeavors. I told him that I’m game, but not sure what shape my help will take. Stay tuned — er, or at least check back once or twice a year to see if I’ve actually managed to post something — to find out.

Another quick Rails lifesaver

October 3rd, 2008

It’s always driven me crazy that the Rails validation macros don’t allow you to override the field name in the error message.

validates_length_of :summary, :maximum => 1500, :too_long => "can not exceed 1,500 characters"

will result in “Summary cannot exceed 1,500 characters”. But the label on the form is Description and the stakeholder wants the message to match the form. Argh.

Well, courtesy of Rails wizard and co-worker Duncan:

# alias attr to the name it has on the form allows us to validate using the form label name and make the message correct
alias_attribute :description, :summary
validates_length_of :description, :maximum => 1500, :too_long => "can not exceed 1,500 characters"

Short, sweet and super-easy. And the Rails docs on validation don’t appear to mention this. I should submit a documentation patch.

Belated MusicFest NW Wrap-Up

September 14th, 2008

I’d meant to put down some thoughts on Portland’s MusicFest NW last weekend, but a few days of recovery ran right into a nasty flu, which has put me down now for several days and is still kicking my butt.

Basically, I mostly had a blast. There were times when I tried to go between too many shows and wound up seeing more of the street between clubs than the actual bands.

The worst of these situations was the midnight slot on Friday: I was at Ash St. with some old friends and figured I should stay to see a bit of Witchcraft before heading over to Monotonix at Satyricon. Well, at quarter after, Witchcraft still had not taken the stage. I bailed and ran towards Satyricon, but was slowed by a couple “hellos” along the way. Got to Satyricon to find it completely empty. Monotonix had only played about 20 minutes… I had completely missed it. The crowd reportedly even carried the band and its gear — still playing — out onto the street!

So anyway, that was one of my regrets. However, it was great to see SF’s legendary Steel Pole Bath Tub play on Thursday night. They thoroughly rocked the house. It was great to carouse with old friends, singing along with the chorus: “These are my friends now…”. Red Fang was a pleasant surprise that night: kind of doing the stoner sludge thing, but with lots of unexpected little nuances. It was also great to see the recently reformed Iommi Stubbs, now with Rob Wrong of Witch Mountain on guitar and vocals.

Seaweed and Supernova were also a bit of nostalgic fun at Dante’s on Saturday night… fun, but not really the sort of stuff to make me ecstatic. I’ve always had an appreciation for power pop, but could never work up a lot of enthusiasm for it. Trevor Solomon, the workaholic who booked the festival, certainly has a sweet spot for Seaweed though… he did a stage dive halfway into their first song!

Les Savvy Fav’s frontman lived up to his reputation as a crazy man, and he was very entertaining to watch. However, musically, it was also just pop punk… I just can’t work up too much enthusiasm for that stuff anymore. On the other hand Ratatat was the opener at Wonder that afternoon and even though I like them a lot, they left me a bit cold too. At least their set came off flawlessly, as opposed to their show back in early July at Holocene when the royally screwed up a few songs.

Now, all this stuff in the last couple paragraphs was on Saturday and I was definitely dragging ass by Saturday. Maybe I’m just too old for four consecutive nights of rocking. It’s possible that approaching Saturday’s line-up completely fresh, I would have gotten much more enjoyment out of it.

And actually, I got a pretty good kick out of No Age on Thursday evening. They’re a somewhat scrappy guitar/drums duo that plays what one might describe as pop punk. So it would seem that part of why I enjoyed that more was that I was still pretty fresh on Thursday.

On the other hand, I may have just been in a particularly good mood durning No Age knowing that Battles was coming up next. And actually, seeing Battles on Thursday evening definitely left me with a ridiculously high, high-water mark that no other band would touch.

Battles was better than I imagined they would be. I had thought that a lot of the odd elements on their album was studio trickery. However, they pretty much recreated the songs off the album, but with enough variance to let you know that they were doing it all live.

The result was nothing short of amazing. I have very rarely seen such tight virtuosity… and it never degenerates into wanking. Their parts are all essential, no one ever really commands the lead, and it’s all beautifully orchestrated. They rely heavily on loops — captured live — and they play flawlessly against them. The result is music that feels strongly improvised, but always holds together… and follows the studio recordings remarkably closely.

I guess I’d have to say that my main regret about the festival was that there weren’t more eclectic acts like Battles. On the other hand, there was obviously a lot of stuff that I didn’t see. I really wanted to catch Dan Deacon, but it was way out at the Hawthorne Theater and I was happy to stick to foot travel in Old Town. I also went for the old names — Seaweed, Supernova, Steel Pole, etc. — for a bit of nostalgic joy, but perhaps I should have just skipped that. Well, I *had* to see Steel Pole, but I probably should have gone for Dan Deacon instead of Seaweed/Supernova.

Ironically, part of why I stayed downtown on Saturday was to go to the VIP after party… never want to miss out on a free party, don’t ya know. Well, I lasted about 20 minutes… it was just packed full of obnoxious twits. Oh well, live and learn.

My hope for future festivals is that it would broaden it’s eclectic/electronic/DJ-oriented choices. I did a lot of running around, seeing a lot more than is mentioned above, and I saw plenty of bands that I think were just “adequate”. I suspect that they were picked to fill out a line-up of like-minded bands. On the other hand, I imagine it’s possible that a lot of electronic or eclectic acts just wouldn’t even try to get accepted to MFNW.

On the other, other hand… I don’t really know what I’m talking about. I wasn’t involved in the selection process at all, and I would expect that it was an extremely difficult task. Basically I found myself wishing for more of the sort of stuff that I like to hear, but that doesn’t mean that the breakdown of acts didn’t actually represent the general breakdown of styles that the Portland scene likes.

All in all, it was a fun, crazy four days. I would probably do it again… but I definitely need plenty of time to recover.

Rails Gotcha

August 29th, 2008

This is another sort of “reminder” post, mostly for myself, but maybe it’ll save someone else’s butt.

Rails offers lots and lots of nifty, terse bits of helpful code… like validations and named scopes. The gotcha is that you have to be careful to distinguish between code that gets read — and cached — at class load-time and code that will be evaluated at runtime.

To be more specific, yesterday at work, we were having problems with newly-deployed code not behaving as it had on the test server. We had added a “silencing” feature to prevent trouble makers from posting or chatting on our site. The silencings expire after a while, but we were seeing them fail to expire once we deployed to production.

Well, I tracked the problem down to this named scope to find the active silencings:

named_scope :active, :conditions => ['scheduled_end > ?', Time.now]

The problem, of course, is that the named_scope is evaluated when the class is loaded, which means that the time used in the query will be the time the class was loaded… and stay that way until the class is reloaded again.

The solution is to give named_scope a lambda:

named_scope :active, lambda {
    {  :conditions =>  ['scheduled_end > ?', Time.now] }
}

That way the lambda is evaluated at runtime and Time.now does the right thing.

I remember back when I was starting out with Ruby that lambda was one of the concepts that it was hard for me to internalize. But this example makes it really clear: it’s just a chunk of logic passed around like data. And when the time comes its executed.

Now, this is all really pretty basic stuff; if you’ve used named scopes a lot, you probably already know all this. However, this bug slipped past us until it was actually on production. Why? Because we test on testing servers, to which all the devs are constantly deploying. So, the server gets restarted frequently, causing the time in the scope to get updated and the old silencings get expired. The code looks fine and appears to run fine. It’s an easy bug to creep in.

Actually, I found it fairly quickly because I just got burnt by a similar thing last week. I had a validation that built a regex using an array of terms loaded from the db. We had an admin page for adding terms, but the regex in the validation wouldn’t change until the class was reloaded. And then as well, the test server was being reloaded often, so the bug slipped by for a while. (Note that you can’t pass lambdas to the validation macros… had to define a method and give the macro the name of the method.)

This seems like it would be a good thing to put in a Lint for Rails. It’s strange that there still isn’t such a beast… that I’ve been able to find anyway.

Distillers Festival

August 26th, 2008

I went to the Great American Distillers Festival last weekend, and what a weekend it was. Not only was it a lot of fun, but I learned a great deal and got to sample some wonderful liquors and cocktails.

I went largely because my two brothers are big on the NW cocktail scene, going by the name Munat Brothers. And, well, I’m a Munat Brother too. I was actually included in the logo on the assumption that I’d get more involved eventually… and it looks like that expectation is coming true.

Charles and Ted put together a cocktail book called Left Coast Libations to give out at Tales of the Cocktail. It features witty banter and drink recipes from some of the hottest bartenders on the West Coast. Ted is also the fertile mind behind a blog called Le Mixeur, which revels in everything cocktail and liquor… often bathed in faux French.

They also put on cocktail parties called, of course, Le Mixeur. The fifth of these takes place on October 4th and I have promised to attend… my first Le Mixeur. I’m looking forward to it.

Anyway… the Distillers Festival. A good chunk of my time there was taken up with the mixology competition. On Saturday, this featured 20 local bartenders (2 were from Corvallis) making drink of their own devising. They had 5 minutes to set up and then 7 minutes to make enough drinks for the judges. They were judged on the drinks flavor and appearance, but also on the consistency. The competition was split into two rounds, with a different set of judges. Two finalists were picked from each of these rounds. Then, on Sunday, these four finalists were given a mystery ingredient and expected to make up a drink on the spot.

To cut to the chase, the first-place winner was Jamie MacBain from Park Kitchen and second place was Blair Reynolds from tradertiki.com. Jamie received a check for $1000 from the festival sponsors, Imbibe Magazine and Rogue Spirits. Just before the final round, the company that provided the mystery ingredient — Loft Liquers — announced that they would provide a $500 check to the first runner up. So Blair walked with that.

Well, we Munat Brothers didn’t want to be left out, so we cobbled together our meager resources and came up with a prize for the third place winner — which was Chris Churillo (sp?) from Cloud 9 in Corvallis — of $42.26 in cash. However, by the time we awarded that, we mananged to panhandle a bit more, bringing the final prize up to $77.77. I got to present the prize myself. It was great fun.

Sheesh. This is getting long and there’s so much more to talk about. Well, I’ll just quickly mention that there was much revelry and visiting of several great local bars (1001, Teardrop, Clyde Common) after the Festival on Saturday night.

Then, on Sunday afternoon before the final round of the competition, there were some talks by cocktail and liquor experts. “The History of the Cocktail” by Seattle’s well-known cocktail historian, Robert Hess, was fascinating. There was also a panel discussing the history and myths of Absinthe… short summary: all the bullshit about it being dangerous or a hallucinogen is just that: bullshit.

Sunday evening, there was a closing party at 50 Plates, with the incomparable Lance J Mayhew behind the bar. If you haven’t been to 50 Plates yet, definitely check it out; great food and great drinks.

All in all, a very fun, whirlwind of a weekend. And now, for better or worse (probably better for my taste buds and worse for my liver), I’ve been dragged into the Munat Brothers world.

Note to Self

August 5th, 2008

I don’t know why I always forget this little gotcha. This time it occurred to me, “hey, you have a blog now… stick it in your blog and then maybe you’ll find the answer faster next time”.

So here’s the deal: when you’re trying to use a Rails URL helper and you get the a NoMethodError for “nil.to_sym”, that means you’re using a plural where you should be using a singular… dummy.

Actually, I’ve always been annoyed with the pluralization crap in Rails. Computer programming was going along fine doing everything with singular nouns. But no, Rails had to make me remember yet more stuff. I think one of these days I’ll have to write a patch to Rails just to allow me to do MyModels.find :all… note the “s” there. I don’t know why my brain insists on doing this, but I do it over and over.

Oh well, I guess I shouldn’t blame Rails for my brain damage. Anyway, the above cryptic error is now recorded for posterity. Maybe it’ll help someone else out there too.

OSCON Craziness

July 27th, 2008

So, this past week in Portland saw the O’Reilly Open Source Convention come to town. I didn’t go to the convention — didn’t even set foot in the Convention Center the whole week — but I did partake of some evening activities.

On Tuesday, the PDXFUNC (Functional Programming group) met for dinner at Old Town Pizza. I’ve been on the pdxfunc list since it started, but have never made a meeting, so I thought it would be nice to finally meet some people from the group. Turned out that not too many people made it — and some were conference attendees from out of town — but we had a nice little conversation anyway. It also turned out that the Free Software Foundation was having a party upstairs at OTP, so I crashed that after a while and had some nice chit chat about various open source issues.

Wednesday night was FOSCON (Free OSCON), an annual meeting on one night of OSCON put on by the Portland Ruby Brigade. This featured — besides free beer and pizza — about a dozen lightning talks and then a coding competition. Most of the lightning talks were interesting… kind of super quick “hey, check this out” talks.

The coding competion pitted four teams using different web frameworks to build a simple cookbook website in 20 minutes. The teams were: Rails, PHP Symfony (actually one guy), Drupal, and Seaside. I volunteered to be a judge. The results were fairly predictable. The assignment was pretty Rails-friendly (the classic, early rails tutorial by Curt Hibbs was a cookbook site)… must have pretty urls, must have validations with error messages, must have this model and this controller, etc.

The Rails team pretty much fulfilled all the requirements in the allotted time. The Symfony team missed a requirement or two, but we cut him some slack because he was on his own.

The Drupal guys just downloaded a bunch of tarballs and then set the whole thing up in the browser. They were actually “done” in about eight minutes. But it turned out that they had overlooked quite a few requirements and so, threw away what would have been a crushing victory. There’s no doubt that if you need a simple, database-backed website, you can throw it together ridiculously quickly with Drupal. If your requirements get too far into the realm of custom logic and what have you, then you’d be doing code customization… and I’d rather not do that in PHP, thank you.

The Seaside team spent the whole twenty minutes typing in the Smalltalk “code browser”, but did not have much to show at the end. They just didn’t have any generators or scripting help, and had plenty to type. However, Seaside still gets some points for coolness factor: it’s image based, so there is no database needed… you only deal with Objects. It is also continuation-based, so a site is just a tree of objects that know how to write themselves as HTML on an HTTP canvas and the current state of that tree is just remembered between requests. It’ll be interesting to see if anyone does this sort of thing for Ruby once Gemstone’s Maglev Ruby VM is released.

Anyway, the results of the competition wound up  being first to last place in the order I’ve mentioned them here. However, had the Drupal team paid closer attention to the requirements, they would have shredded. Also, had the Symfony representative had a pairing partner, it may well have been a tie between the two. All-in-all that was a great evening. It would have been interesting to have Python (maybe Django) and Java (maybe Stripes) represented… though we ran about an hour over time as it was.

The following night, I crashed the Beerforge party at Bossanova, which was put on by Open Source Labs.  That was pretty sweet… free food and booze for a couple hours. The name was a little ironic, since the beer selection was pretty lame… though it turned out to be safer than the consistently crappy cocktails. I had several nice conversations there, including chats with people from RightScale — a Rails-based deployment solution — and Jive Software, which is the local Java shop responsible for Openfire… the open source XMPP server which Kongregate uses for it’s in-game chat.

What a week… and I still got work done during the day!

Recent Shows

July 27th, 2008

Been slacking massively on posting… much as I expected I would. Well, here are some shows I’ve seen recently.

Caught the legendary Portland surf band Satan’s Pilgrims at the Clinton St. Block Party yesterday. Their drummer — and probably main motivator — moved to Memphis back in 2000, so they don’t play very often. It was great to hear them again… it’s been probably over 10 years since I last saw them play. The street party atmosphere was great too, with little kids running around and dancing. And I picked up a totally sweet Satan’s Pilgrims shirt.

Friday night, I caught the DJ Shadow/Cut Chemist show called The Hard Sell at the Roseland Theater. They do this entire show scratching, cutting, and looping 45 rpm records! That’s it other than some effects pedals. They had a cute, kitschy intro film — done somewhat in the style of a 50’s educational film — to explain what they were doing. They also had two big screens behind them that alternated between cameras catching their live action (including a camera mounted on Cut Chemist’s wrist) and more artsy type stuff… which was often amusing and/or trippy.

I was really impressed with the technical ability displayed and there were definitely fun moments, but unfortunately I was just really beat after a long week of partying at OSCON events. I think most people were really amped that they played over two hours. For me, it got really old. I have to say that I find it ironic that they are so popular, because a lot of what they do really isn’t very musical. Not that that’s a criteria for me liking something… there are plenty of whack, noisy things that I like.

Actually, the last notable, national act I saw before DJ Shadow was a fairly “whack” band. I saw Matmos at the Aladdin Theater on July 9 and was very, very impressed. I would definitely check them out again (wheras, I feel like I’ve “done” DJ Shadow and don’t have much interest in seeing him again). Even though they use some very weird sounds and noises, they are one of the most musical acts I’ve ever seen. This is really what so amazing about Matmos: they take all manner of strange squeaks, pops and burbles and weave it into a hypnotic musical tapestry. And what’s sad is that the theater wasn’t even full. DJ Shadow was packed.

Holocene was also packed, the night before Matmos, for Ratatat… and a packed Holocene can be quite exasperating. I really think they should punch a big whole between their two rooms… although I have to say that they at least had the sound from the band piped into the main room at the same level as in the stage room. This created a nice feeling of the sound of the band being all around you throughout the club.

Unfortunately, Ratatat had some sound issues that night… and they even had some plain old performance issues, having to actually start one song over again cuz they were off from each other. It was only the second or third show of the tour, so they were still working out the kinks. The crowd didn’t seem to care… much adulation was observed. And really, they were a lot of fun over all.