Bundler see what updates are available

The command to see what gems have more recent versions and can be updated is bundle outdated. This will show you all gems that could be upgraded, but unlike bundle update, will not actually update your gems (changing Gemfile.lock and installing new gems.)

It will output something like:

$ bundle outdated          
Updating git://github.com/panozzaj/andand.git
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..

Outdated gems included in the bundle:
  * ZenTest (4.6.2 > 4.5.0)
  * activesupport (3.1.1 > 3.0.9)
  * builder (3.0.0 > 2.1.2)
  * i18n (0.6.0 > 0.5.0)
  * activemodel (3.1.1 > 3.0.9)
  * erubis (2.7.0 > 2.6.6)
  * rack (1.3.4 > 1.2.4)
  * rack-mount (0.8.3 > 0.6.14)
  * rack-test (0.6.1 > 0.5.7)
  * actionpack (3.1.1 > 3.0.9)
  * mail (2.3.0 > 2.2.19)
  * actionmailer (3.1.1 > 3.0.9)
  * arel (2.2.1 > 2.0.10)
  * activerecord (3.1.1 > 3.0.9)
  * activeresource (3.1.1 > 3.0.9)
  * devise (1.4.2 2a5ad46 > 1.4.2 e76ba05)
  * railties (3.1.1 > 3.0.9)
  * rails (3.1.1 > 3.0.9)
  * sequel (3.28.0 > 3.20.0)
  * sinatra (1.3.1 > 1.0)

To break it down, "sinatra (1.3.1 > 1.0)" means that I have version 1.0 and version 1.3.1 is available.

Read on →

Making Recommendations with Apache Mahout Presentation

Last month I gave a presentation about making recommendations with Apache Mahout. Since the presentation, Manning books has released the final version of their book, Mahout in Action, which should be an even better resource than the book that I was using for my slides and presentation. Here are the slides:

(Slides no longer available.)

Read on →

How I Patched Devise to Force Login for Twitter and Facebook

Here were some of the things that I had to do to Devise to get things working correctly with Twitter and Facebook. YMMV, as this was six months ago and I had some special requirements potentially.

# config/initializers/omniauth_patch.rb
# see http://stackoverflow.com/questions/1960957
module OmniAuth
  module Strategies
    # override authorize path to force user to login each time
    class Twitter < OmniAuth::Strategies::OAuth
      def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block;)
        client_options = {
          :site => 'https://api.twitter.com'
        }

        client_options[:authorize_path] = '/oauth/authorize'
        super(app, :twitter, consumer_key, consumer_secret, client_options, options)
      end
    end
  end
end
# config/environments.rb
config.omniauth :twitter, 'XXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

# Created multiple Facebook apps for testing because you can only have
# one per domain. One way to lessen these would be to set up staging.myapp.com, etc.
# since Facebook respects subdomains as being on the same domain. Would still need one for
# localhost testing though (unless I set up hosts file differently?)
# This seems simplest for now though.
id, secret = case ENV['RACK_ENV']
when 'production'
  ['XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']
when 'staging'
  ['XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']
else
  ['XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'] # localhost
end
config.omniauth :facebook, id, secret, { :display => :touch }

The last line ensures that we use the facebook touch view because I was only targeting mobile devices (iPhone). I'm not sure how we would easily do this at runtime besides further patching. Basically this limits us because we have to use the touch even though we want to use the web version on the web.

Read on →

How to Write Without Reservations

Here's a pep talk that I give to myself when thinking about not writing about something

The talk

You have a reasonably well founded position, you almost certainly have enough to write about. You have arguments and counterarguments for the major things people are going to say. You have experiences that no one else has. So just write them out. Who can argue with what you have experienced? You've already done the hard work of thinking about this problem, why not get the benefits of writing it out? If anything, this will help clarify the thoughts that you have.

The specific phrases don't matter, as long as you are getting out the main thoughts. You can always refine it over time–the great is the enemy of the good here. That's what the edit functionality is for. I know you would love to include a beautiful graph or venn diagram to illustrate something, but just say it now and add it later if you must.

Read on →