TJ Singleton Software Engineer, Baptist Preacher

1Jul/100

Optimize Legibility with CSS

Love the new support for text-rendering. Cross-browser kerning-pairs & ligatures

Filed under: Clips No Comments
1Jul/100

MountainWest RubyConf 2010 Videos

Confreaks has been releasing videos of the MountainWest RubyConf. I love me some Confreaks.

Filed under: Clips No Comments
1Jul/104

Regex Result Access Benchmark

The question came on forrst.com about which of the following two styles of accessing the results of a regex match were preferred:

"qqq100601.txt"[/\A([a-z]+)/, 1]
"qqq100601.txt".match(/\A([a-z]+)/)[0]

So I benchmarked it and was surprised that there was such a difference in the performance. Except on jruby, the array style access is the clear winner.

Benchmark and Raw Results

Update I went ahead and ran this through RubyProf in 1.8.7. It turns out that #[/REGEXP/] is optimized to one method call and doesn't instantiate the MatchData object. String#match is delegated to Regexp which instantiates MatchData and then accesses the result for a total of 3 method calls. So the real savings is less object churn and method calls.

Filed under: Ruby 4 Comments
30Jun/100

Lisp-like Ruby

Gregory Brown had an fun tweet demonstrating a SICP example in both clojure and ruby.

The code

Filed under: Clips No Comments
28Jun/100

Your first app ui

This stings a bit, but only because you know it's true. Simplicity

Filed under: Clips No Comments