Posts from iBrasten...
Posted by brasten 261 days ago
So, web clips are much much cooler than I anticipated. You can change up your dashboard weekly or daily based on interests at the time. For example, clipping out a little Flash object yesterday gave me quick access to a particular fund-raising effort I wanted to track:
Just one thing I can't figure out though... is there any way to package a web clip into a widget that can be uploaded or otherwise transfered to another computer? If you know how to do that, leave a comment!
Posted by brasten 274 days ago
Heavily modified, but based on the RubyRobot theme for TextMate (worth checking out).
HTML/XML colors are intentionally higher contrast than normal since, in my experience, I'm often looking for specific attributes/values or Ruby code.
Slight differences between NetBeans and TextMate versions, obviously, due to different syntax colorization rules. NetBeans pictured below:
Posted by brasten 275 days ago
The top three things Ruby developers SHOULD be paying attention to:
-
JRuby
I have to admit, this one has surprised me. I was a big fan of JRuby a while back, but not as a general-purpose Ruby runtime. It was showing some promise as a niche integration project, but nobody was actually going to run Rails applications on it, right?
Oops.
Turns out, running a Rails application on JRuby is becoming more reasonable every day (more on that later). JRuby is making huge leaps in performance and compatibility and, I believe, Ruby-to-bytecode compilation has the potential to be a game-changer.
-
NetBeans
I'm as big of a TextMate fan as the next guy. One of my favorite side-effects of switching to Ruby was leaving my old Java IDEs behind. Well, time has changed, and as of NetBeans 6 Beta 1 I've pretty much left TextMate behind.
I'm not necessarily saying that you should switch to NetBeans TODAY... but at the pace they're going, it's definitely something to keep your eye on in the near future.
-
GlassFish
The fact is, current production Ruby/Rails options kind of suck. Yes, it's as "easy" as "mongrel_rails start", at first. But then you need to set up a cluster of, let's say, 3 mongrels. Then you need to proxy requests from Apache in some kind of load-balanced fashion which -- in many installations -- requires a separate application. Then you REALLY need to set up monit because, honestly, Mongrel doesn't stay up 24x7x52.
Then what if one of them gets slashdotted (literally or figuratively)? I had to run 8 Mongrels on one particular application just to keep it running during a traffic spike. Now, the application's developers had NOT designed it for high-traffic, but regardless, it still took frantic manual intervention to keep it running.
... now imagine a Rails server that requires only one instance running... performant enough to bypass Apache in many cases... capable of scaling up or down the number of Rails threads running based on traffic levels, automatically... can do all of this for any number of Rails applications you wish to deploy, and comes with a pretty nifty web console to administrate it all (if desired).
That's the promise of Rails on GlassFish v3. It's still a ways off, but you'd be doing yourself a favor to start thinking about it now.
Posted by brasten 321 days ago
Switched hosts, went down for a couple days, but I’m back up.
The site should feel snappier, too. Not that anyone spends time clicking through my blog, but still… it’s an ego thing.
Posted by brasten 370 days ago
Has anyone else noticed that AAPL is dangerously close to surpassing HPQ? $121 billion to $126 billion as of this morning.
Posted by brasten 401 days ago
I knew all along that using with_scope outside my models was a bad idea, but I did it anyway. So once this little change came through, I had to rethink some of my code…
Just to throw this out there – let’s call it peer-review – my new method of encapsulating with_scope usages sort of piggy-backs on finder encapsulation.
Take, for example, the following code:
1
2
3
4
5
6
7
8
9
10
11
12
|
class Post < ActiveRecord::Base
def self.find_active
# ... some finder code to return all active posts
end
end
class PostsController < ApplicationController
def index
@posts = Post::find_active
end
end
|
… despite my habit of encapsulating finders, I still found myself doing this:
1
2
3
4
5
|
# In around-filter or action
Post::with_scope( ... conditions ... ) do
# ... yield or something
end
|
– Obviously, BAD. So the alternative is to do something like Post::scope_by_active or something. What about adding a fairly simple block_given? condition to the existing find_active method? Use your imagination on the implementation of that, but the usage would now look something like this:
1
2
3
4
5
6
7
8
|
# No block, returns all active
@posts = Post::find_active
# block, scopes to active, returns result of block.
@my_posts = Post::find_active do
Post::find_by_user( user )
end
|
Soooo… peer-review away!
Posted by brasten 414 days ago
Impressive campaign – I put together a little Yahoo Maps illustration with the location and amounts of most of the contributions to NutsOnline.com’s Save Jericho campaign. The live version can be seen here.
Well done everyone!

Posted by brasten 420 days ago
So, if you’ve tried RSpec, you know it let’s you write test code that’s easy to understand. There are other reasons for BDD, but that is probably the first one you’ll notice. Describe this, it should do that, this should not have five of those, etc etc. It’s great for less assertive people like myself.
Occasionally, you’ll run into situations that are not easily described with the stock RSpec API. The RSpec guys have done a fantastic job putting together an API that is easy to manipulate, so don’t be afraid to do that!
Let’s look at an example:
1
2
3
4
5
6
7
8
9
|
describe TicketsController, "with unauthenticated visitor" do
it "should require login to access /index" do
get 'index'
# This is the line I'll be picking on.
response.should redirect_to( :controller => 'account', :action => 'login' )
end
end
|
Pretty basic, right? But here’s the part that bugs me: it “should require login to access /index” vs. response.should redirect_to( :controller => ‘account’, :action => ‘login’ ).
The expectation I’ve described in english is not the same as the expectation I’ve described in code. Redirecting to a login page is a function of the before_filter handling your app’s security, not of the TicketsController itself.
In english, my expectation is pretty clear: ‘it should require login’. So let’s make the code match.
1
2
3
4
5
6
7
8
9
|
describe TicketsController, "with unauthenticated visitor" do
it "should require login to access /index" do
get 'index'
# Doesn't this make a lot more sense??
response.should require_login
end
end
|
Turns out, this is shockingly easy to accomplish:
1
2
3
4
5
6
7
|
# Add this to your spec_helper.rb or another required file
module Spec::Rails::Matchers
def require_login
RedirectTo.new(request, { :controller => 'account', :action => 'login' })
end
end
|
And there you go. Requiring a login is now an expectation on the same level as all others. It’s really very cool!
Additionally, this ALMOST gets us the negative expectation ( “response.should_not require_login” ). There’s a very minor tweak needed to get that working, but that’s an exercise I’ll leave to you.
If you don’t want to figure it out, I can be bribed with gift cards to Caffe Ladro for as little as $5. =)
Posted by brasten 425 days ago
The Fremont office-mates contributed $30 to the NutsOnline Jericho pool. NutsOnline is shipping packaged nuts to CBS in a fan-organized effort to save Jericho. Some 20,000 pounds have been shipped thus far. If you’re a Jericho fan, why not pitch in??
Though I’m very much a fan of this show, it does need to be kept in perspective. If you’re considering donating to the Jericho pool and haven’t yet contributed to one of the RailsConf charities, please donate there first.
Posted by brasten 431 days ago
… moreso than RailsConf has been. The issues with RailsConf have been and will continue to be well documented, but the RejectConf guys kicked ass!
I had to jet afterwards, but those of you wanting to chat, catch me at the conference tomorrow.
On a final note, after weeks of attempting to find a Nintendo Wii in Seattle, I was able to track one down here in Portland!! Awesome machine!! It’s hooked up in the hotel room now, and in fact, this entire post was created from the Wii’s browser. =)
Posted by brasten 434 days ago
Jericho canceled. Unbelievable.
I think I’m done watching TV. Good shows don’t stand a chance anymore.
Posted by brasten 435 days ago
I’ll be heading on down to Portland in a little over a day for RailsConf!
If you’re there, track me down and say hi! If there are any hacking sessions planned, maybe I’ll take the opportunity to hack on Scruffy.
I also plan on picking up a new MacBook while I’m there! So, a lot of stuff to fit into a few days. Should be fun!
Posted by brasten 456 days ago
I've been getting this question a lot, lately. Turns out -- I hadn't been paying attention -- that traffic to the Scruffy site is at it's highest level ever, not including the first month it was released. Scruffy's getting around, and I didn't even know it!
So is Scruffy dead? Short answer: NO! But it's been on hold.
The last 6 months have been intense, but I want to get back to Scruffy as soon as possible!
On that note, I'm finishing up my last scheduled project soon, so feel free to contact me if you need any Ruby development. Bonus points for any projects that would involve Scruffy work. ;)
Posted by brasten 460 days ago
Forgive me readers, for I have neglected you. It’s been 90 days since my last post.
The last three months have been insanely busy, but things are finally cooling off a little. Now that I’ve been able to transition the site to Mephisto, I hope to start posting more regularly.
Please bear with me while I fix the various links and images that are not yet working.
Posted by admin 559 days ago

Commuting across the floating bridges gives one plenty of time to think up stupid things like that. That’d be a good DellRumors story actually. Except I’d have to rewrite it as a Dell product. Not really worth the effect.
Anyway, I’ll be making the Mephisto leap shortly, so consider this a heads-up. Some feed urls may brake, though the most heavily used ones will still work.
I hope to get back to blogging regularly once I make the switch, as I’ve had some fun potential posts floating around my brain about Ruby / Dialogue Driven Development / Java & JRuby / etc.
Posted by admin 561 days ago
... Again. Nothing like the dreaded trace-to-1/4” of snow. Normally I don’t try writing blog posts on I405, but it isn’t very dangerous when you aren’t moving…
Posted by admin 596 days ago
Well, better late than never! We were finally given the keys to the new office late last week! After a week of painting and moving and cleaning, we’re finally in.
The building is turning out to be a fun collection of businesses. So far I’ve run into a few artists, a socially-conscious investment firm, several independent software developers (C# and Delphi), clothing designers, acupuncturists, and on and on…
Anyway, swing on by the Fremont Space building if you want to meet the Nagilum gang (me).
Posted by admin 604 days ago
It’s already been noted by some, but Seattle has no idea how to handle snow.
The Fremont office was supposed to be completed a week ago, but it’s been delayed until later this week. It’s hard to skip work due to snow when you work from home!
Anyway, here’s a picture I snapped last night of Jess next to the fountain!
Posted by admin 612 days ago
In his latest article, Joel Spolsky reacts to Dmitri Zimine’s hypothetical story on developer multitasking by concluding that Agile development should allow for those interruptions and the manager in the hypothetical story isn’t doing his job if he doesn’t consider both sides of the situation. I agree with the concept Joel’s trying to portray, but I believe he’s misunderstanding Dmitri’s point and the role of Agile in the story.
Joel states, “Agile is not supposed to be about swapping out one set of bureaucratic, rigid procedures for another equally rigid set of procedures that still doesn’t take customer’s needs into account.” Technically that’s true, but if you’re really talking about Agile development - not cowboy coding - then Agile does enforce various rules and procedures on the development process. Situations such as that being discussed by Joel are explicitly discouraged in Agile development precisely because of the harm it causes to the project timeline and ultimately the very customers we may be trying to help. Joel himself acknowledges the harmful nature of context switches on a developer and project, but then suggests we should be willing to do it anyway—within the scope of an iteration (perhaps by pushing back completion of the iteration). This nullifies one of the greatest advantages of iterative development, namely that customers notice missed deadlines before they notice missed features. It is largely for these reasons that Agile strongly protects the scope-cap and end-dates of in-process iterations.
But the spirit behind Joel’s article is valid. Agile should not be so rigid that it cannot handle these types of deviations. If you read Dmitri’s article closely, you’ll see he provides for an appropriate solution to this situation: implode the iteration. Remove the developer and the developer’s tasks from the iteration goals, allowing them to focus on the new tasks you’ve requested. The developer’s original tasks are then pushed off until the next iteration.
It’s very important to notice that Dmitri DOES provide that option to his managers—no doubt causing a lot of discomfort in the process. But if you miss the importance of that, then you’ve missed the point of his whole story. Dmitri isn’t saying that Agile won’t allow these things to happen, he’s merely saying that when they do it’s the development manager’s job to accurately convey the options. Context switching the developer likely will cause them to miss the iteration deadline. In that case, the best option (the only option the development manager will accept) is removing the developer’s tasks from the iteration goals (for all the reasons stated earlier). If the business feels the potential customer is worth making that choice, they are absolutely capable of doing so.
So, let me attempt to restate all of that in a sentence of two. Dmitri isn’t suggesting we ignore the potential needs of a customer, he’s simply correcting the business/sales manager’s beliefs on the ramifications of their request. By doing this, he’s simultaneously protecting his developer and his managers from unrealistic expectations. And Agile’s entire role in this whole thing is simply to provide the guidelines for making course corrections with the least amount of impact to team and project.
In this case, the development manager is doing his job very well.
Posted by admin 643 days ago
I’ve been told frequently that reading iBrasten is extremely painful.
Turns out they weren’t saying what I thought they were saying.
I recently stumbled across a study concerning website readability and discovered that iBrasten uses one of the worst combinations of foreground color, background color and font face. I’m so sorry.
Fortunately the situation can be resolved fairly easily, so I will be doing that soon. Thanks for bearing with the current theme for so long!