Posts from 2008

µTorrent Mac Beta

µTorrent, my absolute favorite torrent client when I was using Windows, recently released a beta for Macs. I’ve played around with it a bit so far, and I’m really impressed, though Transmission is still an awesome choice as well.

Posted on November 30, 2008 Leave a Comment
Tagged with: , , ,

TextMate Productivity Tips

Some great TextMate power tips from Roger Johansson.

Posted on November 30, 2008 Leave a Comment
Tagged with: , , ,

Apple Bends to Studios, Adds Copyright Protection to MacBooks

Apparently, Apple has added HDCP to the new MacBooks, making it impossible to play videos purchased from iTunes on unauthorized external displays. This is really disappointing, to say the least. Instead of spending time locking down their content, movie companies should be looking for new avenues of distribution, like sites similar to Hulu. Make it easy to legally watch content, and people will do it! Make it difficult to watch content you paid for, and people will pirate even more.

Posted on November 23, 2008 Leave a Comment
Tagged with: , , , ,

Defensive design: Magnetic zones on the unibody MacBook

Sam, of 37signals notices a great feature on the new MacBooks: when installing new RAM, there’s a magnet that catches any screws you might accidentally drop. Brilliant!

Posted on November 20, 2008 Leave a Comment
Tagged with: , , ,

Five Physics Lessons for Obama

A great piece on facts regarding nuclear energy, alternative fuels, and several other topics. I’m not sure I agree with #4, that we shouldn’t be sending more humans into space, but I can certainly see where the author’s coming from. The nuclear energy section, however, is right on the money.

Reblogged from: Jason Kottke
Posted on November 19, 2008 1 Comment
Tagged with: , , , , , ,

Red/Redshift Demo App

A 30-minute video of Red/Redshift, a “compiler” for Ruby to Javascript. Essentially, you write all of your AJAX, etc. in Ruby, and Red converts it to Javascript to you. I’m not sure how I feel about the extra step, but it’s definitely an intriguing idea, since it’s much nicer to write Ruby than JS.

Posted on November 17, 2008 Leave a Comment
Tagged with: , , , , ,

Why I won't be buying Versions

Today, Versions, a Subversion app for OS X, moved to version 1.0, marking the end of its free beta period. While many people will be shelling out the €39 (~$49) for a license, I won’t be doing the same. Having used Versions for a couple months now, it just isn’t for me.

I don’t need a fancy UI.

When I loaded Versions for the first time, I was impressed by the amount of work that went into the UI. It looked nice, and it worked pretty well too. However, I found myself working harder to accomplish simple tasks than when I used the command line. For me, it’s a lot easier to cd to the directory in the Terminal and do a svn stat rather than take the time to load up Versions and do a similar command. Even though it might be nicer to look at, Versions was just never quite as quick or intuitive as the terminal commands I had grown used to. In addition, I almost always have the Terminal open, as I’m constantly running commands during development. Having to open up another app just got in the way of my workflow.

I already use TextMate.

TextMate is the center of my coding world. It is quite simply the greatest text editor I have ever used, and it’s where I spend the vast majority of my time when I’m coding. Built into TextMate is a great SVN plugin that really makes Versions unnecessary. Without changing applications, I just hit CTRL+SHIFT+A and I’m greeted with a list of SVN commands. I tap 5, and I see a dialog where I can set my SVN commit message and choose exactly which items I want to commit from a list of changed files. Why would I need anything more sophisticated than that? If I wanted to go ahead and commit a few files with Versions, I’d have to fire up the application, locate the files I want, and hit commit. The worst part is, at least in the beta version I used, there’s no good way to select multiple files in Versions without resorting to holding the command key and clicking each file. In TextMate, it’s as simple as checking boxes.

Git is the future.

My biggest problem with spending close to $50 on a Subversion app is that I really don’t want to use SVN any more. I’ve fallen in love with Git, a distributed version control system that puts Subversion to shame. Just about every new personal project I start will be using Git, so there’s really no point in buying a program just to manage my older projects. If Versions supported Git as well, I’d definitely be considering adding it to my arsenal.

A Grain of Salt

Now, just because Versions hasn’t worked its way into my routine doesn’t mean it can’t be part of yours. I personally know several people that really enjoy Versions, and it has really improved their workflow. It’s definitely a well-made product, it just doesn’t work for me.

Also, if you’re in the market for an OS X client for SVN, definitely check out Cornerstone as well. While I haven’t used it personally, I’ve heard good things about it.

Posted on November 17, 2008 5 Comments
Tagged with: , , , , , , ,

The Rails Myths

A great series of posts by David Heinemeier Hansson, creator of Ruby on Rails, debunking some common Rails myths. A must read for anyone considering using Rails (or anyone that uses it already, for that matter).

Posted on November 15, 2008 Leave a Comment
Tagged with: , , ,

Jade Ohlhauser Compares Versions and Cornerstone, Round 2

In July, Jade Ohlhauser compared Versions and Cornerstone, two OS X SVN clients, and he declared Versions the winner. Now, he revisited the two, and this time Cornerstone takes the prize. I’ve used Versions a bit myself, and while it’s pretty impressive, I still much prefer using TextMate’s built in SVN support and the command line. However, after reading this review, I’ll definitely have to try Cornerstone out.

Reblogged from: John Gruber
Posted on November 12, 2008 Leave a Comment
Tagged with: , , , ,

Resizing Rounded Rectangles in Photoshop

In the past, I’ve always dreaded working with rounded rectangles in Photoshop, because they’re just so annoying to resize. If you try to change the object’s height or width, it distorts the corners, making things look pretty bad. Today, I found a way to resize them using the direct selection tool, and it has already made my life a whole lot easier. Check out the screencast I put together to find out how.

Posted on November 11, 2008 12 Comments
Tagged with: , , ,

Finding Related Entries Using Tags with Ruby on Rails

One of the cool features that I built into my new site is the “related” sidebar box on every entry and link. Using a not-so-sophisticated algorithm, my site automatically picks out other entries that seem to be related to the current entry, which hopefully helps readers navigate to my other content. It really wasn’t too difficult to implement, so I figured I’d go through my thought process and the code that makes it happen.

The Not So Fancy Algorithm

It took me a little while to come up with a way to determine if an entry is “related” that was both accurate and relatively efficient–I could have used some complicated tool that parses the content of my entries, but instead I decided use something that’s a little simpler: tags. To understand how it works, pretend I have three entries:

  • Entry A - Tagged with: Turkey, Roast Beef, Cheese, Bread
  • Entry B - Tagged with: Bread, Baking
  • Entry C - Tagged with: Turkey, Cheese, Bread, Lettuce

Let’s say we’re looking for entries related to Entry A. From just looking at B and C, it’s clear that C should be closest, as they A and C both have something to do with sandwiches, whereas B only talks about bread. To rank the entriesprogramatically, I first do a query to find entries with any of the tags from Entry A. Then, once I have that list, I sort the entries by how many of Entry A’s tags are used. So, in the above example, Entry C would have 3 matched tags, and Entry B would have 2. It’s not a perfect system, but so far, it seems to be working pretty well.

The Code

So, here’s the code that’s performing all the magic:

class Post < ActiveRecord::Base
  def related(limit=5)
    @related ||=
      returning self.class.find_tagged_with(tag_list, :conditions => ['posts.id != ?', self.id], :limit => limit) do |posts|
        posts.sort_by do |p|
          matched_tags = p.tags.find_all {|t| self.tags.include?(t)}
          matched_tags.size
        end.reverse
      end
  end
end

The real meat of the method is in the returning block, so let’s take a look at that:

returning self.class.find_tagged_with(tag_list, :conditions => ['posts.id != ?', self.id], :limit => limit) do |posts|
  posts.sort_by do |p|
    matched_tags = p.tags.find_all {|t| self.tags.include?(t)}
    matched_tags.size
  end.reverse
end

What’s happening here is I’m first searching for any entries tagged with the current entry’s tags (I’m using acts_as_taggable_on_steroids), then, with the data that’s returned, I use Ruby to sort the entries by the number of “matched” tags, which then gets returned from the method. Conventional wisdom suggests moving the matched tags part into SQL, since MySQL is more efficient than Ruby at handling data. However, I’m using relatively small sets of information, and I haven’t run into any performance issues yet.

Overall, this method’s working pretty well for me, but I’m sure as I accumulate more posts, I’ll need to refine it some. I’d really like to incorporate some sort of popularity ranking, based on number of comments and views, but that’s not something I’m too worried about at the present.

Posted on November 11, 2008 2 Comments
Tagged with: , , , , , ,

Frustration-Free Packaging at Amazon

Amazon has released “frustration-free” packaging, which means that for certain products, you can get them in a standard cardboard box, rather than the hard-to-open plastic they’re usually in. Hopefully this will catch on, and more retailers will begin shipping their products this way. Check out their FAQ page for more info.

Reblogged from: SvN
Posted on November 3, 2008 Leave a Comment
Tagged with: , ,