fhwang.net

Eve's to Keep
Saturday, September 27, 2008

This is possibly the most fanboy-ish thing I've ever done in my life. Hope you like it:

The Dark Bailout
Saturday, September 27, 2008

Nicely done:

(via the Filmmaker Magazine blog)

Tagged: funny

Talk at RubyConf 2008: Testing Heresies
Sunday, September 14, 2008

So, I’m speaking again at RubyConf this year. If I’m remembering correctly this will be the fourth RubyConf talk I give. I wonder where that ranks me? Someone really ought to maintain a leaderboard or something.

These days, my RubyConf proposal strategy is to submit the loopiest talk idea I can think of that is 1) interesting to me and 2) could possibly be worthy of talking about for an hour in front of more than a hundred people. Then if I get approved, I cobble the talk together with great effort, and tons of practicing. It works out, except for the fact that I’m sure my neighbors think I’m completely meshuggeneh by now, sitting in my apartment talking to myself about computers. People seemed to enjoy last year’s talk, at least.

This year’s talk is Testing Heresies. Obviously you’ve probably heard plenty of talks about testing but I hope to stir up the orthodoxy a little bit.

Now, the tricky thing about speaking at RubyConf these days is that there are multiple tracks, and there’s always a little competition for people to come see your presentation. You can see from the full agenda that I’m up against NeverBlock, trivial non-blocking IO for Ruby and Ruby Persistence in MagLev, both of which sound pretty great. But if I may indulge in a bit of cross-track smack talk: Yeah, those guys wrote some impressive code, but who’s gonna have funnier pictures?

Though I should offer a disclaimer, that so far, I have not yet thought of a way to have a slide involving the legal definition of “buttocks”. Working on it, though.

Tagged: ruby

Way down low where the streets are littered
Tuesday, July 22, 2008

Tagged: nyc

validates_with_block
Friday, July 18, 2008

In one of our Rails projects at Diversion Media, our models can get pretty big with validations -- one in particular has almost 20. It ends up being pretty noisy having all those repeated words:
class User < ActiveRecord::Base
  validates_presence_of   :login, :message => 'Please enter a login.'
  validates_uniqueness_of :login, :case_sensitive => false
  validates_format_of     :login, :with => /\A\w*\Z/
  validates_length_of     :login, :within => 4..15
end
So, we wrote validates_with_block, a Rails plugin that allows you to write a more readable set of validations for one model.
class User < ActiveRecord::Base
  validates_login do |login|
    login.present   :message => 'Please enter a login.'
    login.unique    :case_sensitive => false
    login.formatted :with => /\A\w*\Z/
    login.length    :within => 4..15
  end
end
These methods just call the same old validates_* methods; they don't do anything interesting with ActiveRecord beyond that. It's just for keeping things readable, but sometimes readability takes a little extra work.

Tagged: ruby

There are worse things than a coup -- right?
Friday, July 11, 2008

Scott McConnell, editor of The American Conservative, in “High Noon for the Republican Party”, Harper’s Magazine:

If the next president orders the military to invade or bomb Iran or some other country, I would probably welcome it if some key generals said, “No Mr. (or Madam) President, not this time,” and went over the head of the president for congressional and popular support. At this point I’d put as much trust in the judgment and patriotism of a high-ranking military officer as in that of a politician who has spent decades catering to the fabulously rich men who finance both major parties.

Tagged: politics

The audacity of eloquence
Sunday, July 6, 2008

Sam Anderson of New York Magazine, writing on Barack Obama as rhetorician:

The signature project of his candidacy—before health care or housing or Iraq—seems to be the reuniting of presidential discourse with actual, visible thought. It is not a trivial achievement. ... If you can think your way through a sentence, through the algorithms involved in condensing information verbally and pitching it to an audience, through the complexities of animating historical details into narrative, then you can think your way through a policy paper, or a diplomatic discussion, or a 3 A.M. phone call. Bush’s difficulty with basic units of syntax has not been trivial: It signals a wider habit of mind that has extended to every corner of governance. Hillary’s tendency to express herself in distant clichés very likely lost her the nomination—and, one might argue, rightfully so. Style tells us, in a second, what substance couldn’t tell us in a year. It’s silly to downplay the importance of verbal intelligence to a job that makes you the mouthpiece of arguably the most influential nation in the world. As Ezra Pound once wrote, “The mot juste is of public utility … We are governed by words, the laws are graven in words, and literature is the sole means of keeping these words living and accurate.”

Tagged: politics

Two great tastes that taste great together
Friday, July 4, 2008

“Hey, you got your hipster-nerd meme in my security hysteria!”

“No, you got your security hysteria in my hipster-nerd meme!”

School locked down after ‘ninja’ sighted in woods

(via Schneier)

Tagged: security, funny

Sometimes sincerity is the meanest form of irony
Thursday, June 19, 2008

Unfortunately for Microsoft, this is a headline from a genuine newspaper site, and not from The Onion:

“Man gets Windows Vista to work with printer”

(Thanks to Albert for the pointer.)

Tagged: tech

Yay!
Wednesday, June 18, 2008

The pessimist in me has qualms with the way in which gay marriage is becoming legalized piecemeal in this country. I worry that having a California court legalize gay marriage instead of having it voted on by the citizens of the state is going to cause a lot of trouble in the long-term. I wonder how this will affect the Presidential election, and if it’s no surprise that Obama won’t (or can’t) come out pro-gay-marriage, then it’s nothing to be happy about either. And I find William Saletan’s arguments that gay marriage will pave the way for polygamy and adult incest fairly convincing, too.

But that’s the nitpicking, and now is probably not the time for that. Better to gaze happily on a couple like Shelly Bailes and Ellen Pontac—together for 34 years, and only just married this Monday.

I love pictures like this. When you turn away from the cartoonish depictions of queer life on TV and in movies, of bulletproof drag queens and untouchable lipstick lesbians, you see that gays and lesbians are as boring and pedestrian as everyone else. And that’s why they deserve the right of marriage: not because they’re perfect, but because they’re not. Because their lives will bear as much disappointment and malaise as those of anyone else, and having a devoted mate, straight or otherwise, can help sweeten even the worst of moments.

Best wishes, Shelly and Ellen. Today California, tomorrow the country?

Tagged: sex