<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Rice</title>
	<atom:link href="http://davidjrice.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://davidjrice.net</link>
	<description>Software, hobbies and what not</description>
	<lastBuildDate>Wed, 16 Nov 2011 22:20:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Developers, abandon your headphones when in the office</title>
		<link>http://davidjrice.net/?p=92</link>
		<comments>http://davidjrice.net/?p=92#comments</comments>
		<pubDate>Wed, 16 Nov 2011 22:14:04 +0000</pubDate>
		<dc:creator>David Rice</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://davidjrice.net/?p=92</guid>
		<description><![CDATA[ThoughtWorks Studios in San Francisco is a typical agile dev shop. We all sit out in a common space, mostly working at pairing stations. We like music. We use Squeezebox Server to server up the tunes. The web interface provides a nice collaborative jukebox feel. We enjoy queueing up playlists for each other and ribbing [...]]]></description>
			<content:encoded><![CDATA[<p>ThoughtWorks Studios in San Francisco is a typical agile dev shop. We all sit out in a common space, mostly working at pairing stations. We like music. We use Squeezebox Server to server up the tunes. The web interface provides a nice collaborative jukebox feel. We enjoy queueing up playlists for each other and ribbing our colleagues a bit about an off selection every now and then. Nothing too unusual there. I&#8217;m sure many similar shops do the same. </p>
<p>What I want to call out is what I witnessed when I returned from leave this Monday. The music server was broken. (Is it me or is all the Squeezebox stuff less and less stable since the Logitech acquisition?) Everyone was wearing headphones. Nobody was talking. That&#8217;s not good. Nobody intentionally went into &#8220;loner&#8221; mode, but it happened. Anyway, Barrow fixed the server. Everyone&#8217;s headphones came off and we are all talking again. If you work at a shop where everyone is mostly wearing headphones all day (you know the scene i&#8217;m talking about here&#8230; we all to it more than we should), try setting up some sort of public jukebox. Communication will increase. Just watch. And don&#8217;t worry, you can still break out the headphones when you need 30 minutes to yourself or simply cannot stand Sherry&#8217;s death metal.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidjrice.net/?feed=rss2&#038;p=92</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using H2 Database with JRuby and Rails</title>
		<link>http://davidjrice.net/?p=87</link>
		<comments>http://davidjrice.net/?p=87#comments</comments>
		<pubDate>Thu, 10 Mar 2011 00:45:28 +0000</pubDate>
		<dc:creator>David Rice</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://davidjrice.net/?p=87</guid>
		<description><![CDATA[Often when starting a new Rails project, or knocking out a quick proof of concept, we use an embedded H2 database. (Ideally, the customer never asks for a &#8220;real&#8221; database and we go live with H2.) Anyway, we always hit the same problem: db:test:prepare does not work out of the box with the combination of [...]]]></description>
			<content:encoded><![CDATA[<p>Often when starting a new Rails project, or knocking out a quick proof of concept, we use an embedded H2 database. (Ideally, the customer never asks for a &#8220;real&#8221; database and we go live with H2.) Anyway, we always hit the same problem: db:test:prepare does not work out of the box with the combination of H2 + JDBC + JRuby + Rails.  We&#8217;re going to take a look to see if there are any patches that even make sense for a &#8220;proper&#8221; fix, but in the meantime&#8230; so that I never have to figure this out again&#8230; I&#8217;m writing it down here.</p>
<p>Given a db config that looks like this:</p>
<pre>
development:
  adapter: jdbch2
  database: db/development/database

test:
  adapter: jdbch2
  database: db/test/database

production:
  adapter: jdbch2
  database: db/production/database
</pre>
<p>Add the code below to your rake tasks and you&#8217;ll be good to go!</p>
<pre>
module Rake

  module TaskManager

    def redefine_task(task_class, *args, &#038;block)
      task_name, arg_names, deps = resolve_args(args)
      task_name = task_class.scope_name(@scope, task_name)
      deps = [deps] unless deps.respond_to?(:to_ary)
      deps = deps.collect {|d| d.to_s }
      task = @tasks[task_name.to_s] = task_class.new(task_name, self)
      task.set_arg_names(arg_names) unless arg_names.empty?
      task.add_description(@last_description)
      @last_description = nil
      task.enhance(deps, &#038;block)
      task
    end

  end

  class Task
    class << self
      def redefine_task(*args, &#038;block)
        Rake.application.redefine_task(self, *args, &#038;block)
      end
    end
  end

end

def redefine_task(*args, &#038;block)
  Rake::Task.redefine_task(*args, &#038;block)
end

# hack to make db:test:prepare work for h2-jdbc adapter
namespace :db do
  namespace :test do
    redefine_task :prepare => [:environment] do
      abc = ActiveRecord::Base.configurations["test"]
      if abc["adapter"] == 'jdbch2'
        rm_rf Dir.glob("#{abc['database']}*")
        ActiveRecord::Base.establish_connection(abc)
        ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
      else
        if defined?(ActiveRecord) &#038;&#038; !ActiveRecord::Base.configurations.blank?
          Rake::Task[{ :sql  => "db:test:clone_structure", :ruby => "db:test:load" }[ActiveRecord::Base.schema_format]].invoke
        end
      end
    end
  end
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidjrice.net/?feed=rss2&#038;p=87</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Working on a Clojure project in Intellij IDEA</title>
		<link>http://davidjrice.net/?p=73</link>
		<comments>http://davidjrice.net/?p=73#comments</comments>
		<pubDate>Sun, 27 Feb 2011 18:36:18 +0000</pubDate>
		<dc:creator>David Rice</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://davidjrice.net/?p=73</guid>
		<description><![CDATA[I&#8217;ve previously posted on how to get started with Emacs and Clojure. In the interim I&#8217;ve not been able to devote the necessary time to learning either Emacs or Clojure. Thus, when I do feel the urge to dip into Clojure, I prefer to just get on with it rather than spend the majority of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve previously posted on how to get started with Emacs and Clojure.  In the interim I&#8217;ve not been able to devote the necessary time to learning either Emacs or Clojure. Thus, when I do feel the urge to dip into Clojure, I prefer to just get on with it rather than spend the majority of my cycles restoring my rather rudimentary Emacs muscle memory.</p>
<p>Here&#8217;s what I&#8217;ve settled on for using Clojure in Intellij IDEA:</p>
<p>Install the <a href="http://plugins.intellij.net/plugin/?id=4050">La Clojure Plugin</a> for syntax support.</p>
<p>Install the <a href="http://plugins.intellij.net/plugin/?id=5029">Leiningen Plugin</a> if you are using leiningen for builds and wish to invoke tasks from within IDEA.  Mostly useful for running all your tests.</p>
<p>Define a custom run configuration (Java Application) to launch a REPL with your code loaded and in your namespace:</p>
<p><a href="http://davidjrice.net/dave_wp/wp-content/uploads/2011/02/Screen-shot-2011-02-27-at-10.35.04-AM.png"><img src="http://davidjrice.net/dave_wp/wp-content/uploads/2011/02/Screen-shot-2011-02-27-at-10.35.04-AM.png" alt="" title="REPL Run Config" width="558" height="380" class="alignnone size-full wp-image-81" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidjrice.net/?feed=rss2&#038;p=73</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Newbies Guide to Getting Started with Clojure and Emacs</title>
		<link>http://davidjrice.net/?p=57</link>
		<comments>http://davidjrice.net/?p=57#comments</comments>
		<pubDate>Fri, 13 Aug 2010 04:02:28 +0000</pubDate>
		<dc:creator>David Rice</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[getting started]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://davidjrice.net/?p=57</guid>
		<description><![CDATA[THIS ARTICLE IS VERY OLD AND YOU SHOULD NOT READ IT!! THIS INFORMATION IS ALL MASSIVELY OUT OF DATE AND OBSOLETE!! Like many of you I&#8217;ve spent some time learning Clojure over the last 1-2 years. When talking to fellow Clojure noobs, the almost always first topic to arise is &#8216;What editor are you using?&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>THIS ARTICLE IS VERY OLD AND YOU SHOULD NOT READ IT!!  THIS INFORMATION IS ALL MASSIVELY OUT OF DATE AND OBSOLETE!!</strong></p>
<p>Like many of you I&#8217;ve spent some time learning Clojure over the last 1-2 years. When talking to fellow Clojure noobs, the almost always first topic to arise is &#8216;What editor are you using?&#8217;  Outside of those already well versed in Emacs, <span class="caps">SLIME</span>, and <span class="caps">LISP</span>, the answers more often than not express dissatisfaction and dismay. And at some point that dissatisfaction will lead someone learning Clojure to wanting to try their hand at working with Clojure in Emacs. While there are indeed well-maintained, documented projects that enable working with Clojure in Emacs, I never found one place where I could find step-by-step instructions for getting started. I eventually cobbled together the knowledge I needed to get started and I figured I&#8217;d share. Here I present step-by-step instructions for working with a Leiningen-based Clojure project in Emacs.</p>
<p>These instructions assume you are working on <span class="caps">OS X</span>. Also, this post is not even remotely a recommendation of this setup when working with Clojure. I&#8217;m a complete noob when it comes to Emacs and next-to-complete noob when it comes to Clojure. Use this information in that context.</p>
<h3>Part 1: Install Leiningen, write function, run tests, run <span class="caps">REPL</span></h3>
<ul>
<li>Download <a href="http://github.com/technomancy/leiningen/raw/stable/bin/lein">the lein script</a> and put it on your <span class="caps">PATH</span>, making it executable</li>
<li>Install leiningen (into ~/.m2/repository/leiningen): <b><code>&gt;&gt; lein self-install</code></b></li>
<li>Create a project: <b><code>&gt;&gt; lein new my_first_clojure_project</code></b></li>
<li>Add your first function to my_first_clojure_project/src/my_first_clojure_project/core.clj:</li>
</ul>
<pre>
      (ns my_first_clojure_project.core)

      (defn my-add [a b]
        (+ a b))
</pre>
<ul>
<li>Add a test for that function to my_first_clojure_project/test/my_first_clojure_project/core.clj:</li>
</ul>
<pre>
      (ns my_first_clojure_project.test.core
        (:use [my_first_clojure_project.core] :reload-all)
        (:use [clojure.test]))

      (deftest test-my-add
        (is 5 (my-add 2 3)))
</pre>
<ul>
<li>Run the tests: <b><code>my_first_clojure_project&gt;&gt; lein test</code></b></li>
</ul>
<ul>
<li>For <span class="caps">REPL</span> to know in what namespace to start, update my_first_clojure_project/project.clj to specify :main:</li>
</ul>
<pre>
      (defproject my_first_clojure_project "1.0.0-SNAPSHOT"
        :description "Learning about leiningen"
        :dependencies [[org.clojure/clojure "1.2.0-beta1"]
                       [org.clojure/clojure-contrib "1.2.0-beta1"]]
        :main my_first_clojure_project.core)
</pre>
<ul>
<li>Start the <span class="caps">REPL</span>: <b><code>&gt;&gt; lein repl</code></b></li>
<li>Call your function: <b><code>my_first_clojure_project.core=&gt; (my-add 2 3)</code></b></li>
<li>Get a result: <b><code>5</code></b></li>
<li>Now, let&#8217;s jar it up for standard Java execution. To start, edit my_first_clojure_project/src/my_first_clojure_project/core.clj to add a &#8220;-main&#8221; function and a :gen-class directive:</li>
</ul>
<pre>
      (ns my_first_clojure_project.core
        (:gen-class))

      (defn my-add [a b]
        (+ a b))

      (defn -main []
        (println "Hello! The result of 7 + 3 via the my-add function is: " (my-add 7 3)))
</pre>
<ul>
<li>Next, build the standalone jar: <b><code>&gt;&gt; lein uberjar</code></b></li>
<li>Now run the main function via the java executable: <b><code>&gt;&gt;java -jar my_first_clojure_project-1.0.0-SNAPSHOT-standalone.jar</code></b></li>
<li>Get a result: <b><code>Hello! The result of 7 + 3 via the my-add function is:  10</code></b></li>
</ul>
<h3>Part 2: Working with a lein project in Emacs</h3>
<ul>
<li>Before you get started, I highly recommend that you spend 9 bucks and watch the peepcode <a href="http://peepcode.com/products/meet-emacs">Meet Emacs</a> screencast.  If you want to just jump in, perhaps my instructions that follow are good enough <img src='http://davidjrice.net/dave_wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Emacs commands are always a series of keystrokes, usually shortcuts, but sometimes function names. When you see a capital <b><code>C</code></b>, that means &#8216;Control&#8217; and when you see capital <b><code>M</code></b>, that means &#8216;Meta,&#8217; which on <span class="caps">OS X</span> is the &#8216;Apple&#8217; or &#8216;Command&#8217; or &#8216;Splat&#8217; key that is next to the space bar. <b><code>M-x b</code></b> would be &#8216;x with the command key, b on its own.&#8217;  You will quickly get the hang of it. Here&#8217;s a good summary of <a href="http://lpn.rnbhq.org/tools/xemacs/emacs_ref.html">Emacs Commands</a></li>
<li>As the screencast suggests, give your emacs setup a jumpstart by using <a href="http://github.com/technomancy/emacs-starter-kit">Phil Hagelberg&#8217;s Emacs Starter Kit</a>.  If you watched the video, you&#8217;ve likely already installed the starter kit, but if not, here are two examples of how to do the install:</li>
<li>To do a simple install into your home folder:</li>
</ul>
<pre>
      git clone http://github.com/technomancy/emacs-starter-kit.git ~/.emacs.d
</pre>
<ul>
<li>To share across all your machines and accounts using Dropbox:</li>
</ul>
<pre>
      git clone http://github.com/technomancy/emacs-starter-kit.git ~/Dropbox/emacs-starter-kit
      ln -s ~/Dropbox/emacs-starter-kit ~/.emacs.d
</pre>
<ul>
<li>Download, install, and start <a href="http://homepage.mac.com/zenitani/emacs-e.html">Carbon Emacs</a>.  When you first start Emacs you will see a bunch of compilation and associated errors flying by your eyes. I&#8217;m told this is normal (like I said, I know next to nothing about emacs beyond watching the movie and playing around with Clojure.) Once this activity stops you will see a split frame, the top window showing the scratch buffer, the bottom frame showing the compile log.</li>
<li>Before we get started, a couple of Emacs tips if you&#8217;re totally new to this:
<ul>
<li>Use the mouse if you must!  Don&#8217;t be afraid to click into a window and place the cursor where you want it. Eventually, you&#8217;ll get over this, but don&#8217;t worry about it.</li>
<li>That said, do play with windows early and often:
<ul>
<li><b><code>C-x 1</code></b> will make the current window the only window</li>
<li><b><code>C-x 2</code></b> split the current window vertically</li>
<li><b><code>C-x 0</code></b> close the current window</li>
<li><b><code>C-x o</code></b> place cursor in other window</li>
<li><b><code>C-x 3</code></b> split the current window horizontally</li>
<li><b><code>C-x b</code></b> to switch which buffer is shown in the current window.  This is <span class="caps">MASSIVELY</span> useful when you get stack traces and need to switch a window back to the <span class="caps">REPL</span> or your source. Once you&#8217;ve started the <span class="caps">REPL</span> and opened files, this command is your friend!!</li>
<li><b><code>Shift</code></b> with arrow keys will also navigate windows</li>
</ul>
</li>
</ul>
</li>
<li>Now it&#8217;s time to install some packages. Type <b><code>M-x package-list-packages</code></b> to show the currently installed and available packages. Note that the package list shows up in whatever window had the cursor when you typed the command.</li>
<li>First, install the <b><code>clojure-mode</code></b> package, by using the arrow keys to scroll to the <b><code>clojure-mode</code></b> package. With the cursor aligned to that package, type <b><code>i</code></b> to select it, and <b><code>x</code></b> to install. Again you&#8217;ll see some compile errors, but as with the initial emacs startup this is normal.</li>
<li>Now install the following packages in order, using the method described in the above point, one at a time: <b><code>slime, slime-repl, swank-clojure</code></b></li>
<li>It&#8217;s likely possible that the packages can be installed in a bulk manner, or perhaps installing <b><code>swank-clojure</code></b> would install some of its dependencies, but I could not find any install procedure, other than ordered one-by-one that worked reliably.</li>
<li>Now, go back to your lein project file and add the <b><code>swank-clojure</code></b> dependency:</li>
</ul>
<pre>
      (defproject my_first_clojure_project "1.0.0-SNAPSHOT"
        :description "Learning about leiningen"
        :dependencies [[org.clojure/clojure "1.2.0-beta1"]
                       [org.clojure/clojure-contrib "1.2.0-beta1"]]
        :dev-dependencies [[swank-clojure "1.2.1"]]
        :main my_first_clojure_project.core)
</pre>
<ul>
<li>In the console opened to your lein project directory (not in emacs), update dependencies:<b><code>&gt;&gt; lein deps</code></b></li>
<li>In the console opened to your lein project directory (not in emacs), start a swank server:<b><code>&gt;&gt; lein swank</code></b></li>
<li>Now, back in emacs, type <b><code>M-x slime-connect</code></b> to connect to the swank server you just started in your lein project console. Accept the default host and port by pressing <b><code>ENTER</code></b>.  You will likely see an error about a version mismatch of slime and swank. Type <b><code>y</code></b> to ignore this warning. (Digging around Google it looks like it&#8217;s possible to configure emacs to not warn you about the version issue. I&#8217;ll leave that as an exercise to the reader.)</li>
<li>At this point you likely have a frame with a couple of windows, if you&#8217;ve had luck up to this point, one of those windows should be showing a Clojure <span class="caps">REPL</span> in the &#8216;user&#8217; namespace. At this point you still cannot use the code you wrote earlier as it has not been loaded into the <span class="caps">REPL</span>.</li>
<li>Before getting your code loaded into the <span class="caps">REPL</span>, let&#8217;s first get your windows sorted (btw, in case your curious, what you&#8217;d normally call a &#8216;window&#8217; on your desktop, emacs calls a &#8216;frame,&#8217; and within the frame are any number of tiled windows.) To start you&#8217;ll likely just want 2 windows, 1 with the <span class="caps">REPL</span> and one with your core.clj source file. In an earlier bullet I listed useful window commands.</li>
<li>OK, so now you have at least one window with the <span class="caps">REPL</span> open.  Now, move the cursor to any window that is not the <span class="caps">REPL</span> window. In that window, type <b><code>C-x C-f</code></b> to load the <b><code>src/my_first_clojure_project/core.clj</code></b> file from disk. You can use the keyboard, <b><code>ENTER</code></b> key and <b><code>DELETE</code></b> key to navigate to the file in the mini-buffer. I&#8217;ll spare the long explanation, as it&#8217;s fairly intuitive to figure out the navigation. If at any point you feel you&#8217;ve screwed up and want to restart the command type <b><code>C-g</code></b> to reset.</li>
<li>Once <b><code>core.clj</code></b> is open in a window, load it into the <span class="caps">REPL</span> by typing <b><code>C-c C-k</code></b> while the cursor is in the <b><code>core.clj</code></b> window.</li>
<li>Now, still in the <b><code>core.clj</code></b> windows, type <b><code>C-c M-p</code></b> to switch the <span class="caps">REPL</span> to the namespace of the file open in the code window. This will make it easier to test drive your code.</li>
<li>Switch to the <span class="caps">REPL</span> window, and give your <b><code>my-add</code></b> function a whirl:<b><code>&gt;&gt; (my-add 4 6)</code></b></li>
<li>To run your tests:
<ul>
<li>In the code window, open the <b><code>test/my_first_clojure_project/core.clj</code></b> file and load into the buffer following the exact same instructions as with the <b><code>src/my_first_clojure_project/core.clj</code></b> file.</li>
<li>Run the tests in the <span class="caps">REPL</span>:<b><code>(clojure.test/run-tests 'my_first_clojure_project.test.core)</code></b></li>
</ul>
</li>
</ul>
<h3>A final note</h3>
<p>One of the more frustrating pieces of Emacs is feeling not fully in control of what&#8217;s showing in a particular window. Given that, I&#8217;ll relist the windows commands I earlier listed. I&#8217;m still not fully in command of avoiding a window inappropriate switching to another buffer, but these commands can help you recover:</p>
<ul>
<li><b><code>C-x 1</code></b> will make the current window the only window</li>
<li><b><code>C-x 2</code></b> split the current window vertically</li>
<li><b><code>C-x 0</code></b> close the current window</li>
<li><b><code>C-x o</code></b> place cursor in other window</li>
<li><b><code>C-x 3</code></b> split the current window horizontally</li>
<li><b><code>C-x b</code></b> to switch which buffer is shown in the current window.  This is <span class="caps">MASSIVELY</span> useful when you get stack traces and need to switch a window back to the <span class="caps">REPL</span> or your source. Once you&#8217;ve started the <span class="caps">REPL</span> and opened files, this command is your friend!!</li>
</ul>
<h3>Resources</h3>
<ul>
<li><a href="http://github.com/technomancy/leiningen">Leiningen Project</a></li>
<li><a href="http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md">Leiningen Tutorial</a></li>
<li><a href="http://github.com/jochu/swank-clojure">swank-clojure Project</a></li>
<li><a href="http://lpn.rnbhq.org/tools/xemacs/emacs_ref.html">Emacs Commands</a></li>
<li><a href="http://homepage.mac.com/zenitani/emacs-e.html">Carbon Emacs</a></li>
<li><a href="http://peepcode.com/products/meet-emacs">Peepcode Emacs Screencast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidjrice.net/?feed=rss2&#038;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OAuth Explained</title>
		<link>http://davidjrice.net/?p=26</link>
		<comments>http://davidjrice.net/?p=26#comments</comments>
		<pubDate>Thu, 29 Jul 2010 22:30:20 +0000</pubDate>
		<dc:creator>David Rice</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[ThoughtWorks Studios]]></category>

		<guid isPermaLink="false">http://davidjrice.net/?p=26</guid>
		<description><![CDATA[Something we&#8217;re busy with right now at ThoughtWorks Studios is introducing a gadget style of integration to our products. The plan is to support OpenSocial gadgets (focus on gadgets, not social for now), allowing our applications to show each others&#8217; data in its native form. As we do not have a notion of shared or [...]]]></description>
			<content:encoded><![CDATA[<p>Something we&#8217;re busy with right now at <a href="http://www.thoughtworks-studios.com/">ThoughtWorks Studios</a> is introducing a gadget style of integration to our products. The plan is to support OpenSocial gadgets (focus on gadgets, not social for now), allowing our applications to show each others&#8217; data in its native form. As we do not have a notion of shared or common users across the suite, one of the hurdles is how to handle authentication when, say, <a href="http://www.thoughtworks-studios.com/mingle-agile-project-management">Mingle</a> displays a Build Pipeline status gadget from <a href="http://www.thoughtworks-studios.com/go-agile-release-management">Go</a>. The Mingle user should only see what she&#8217;s allowed to see in Go, and Go should know that it&#8217;s showing something to that specific user. We are going to solve this issue by implementing <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-09">OAuth 2.0</a>. OAuth is a standard protocol that allows a user to share his private data between two sites without having to hand out his password to the site &#8220;borrowing&#8221; the data.</p>
<p>I&#8217;m proud to say that we&#8217;ve given something back and published not only an <a href="http://github.com/ThoughtWorksStudios/oauth2_provider">OAuth 2.0 Provider plugin for Rails</a> but also a <a href="http://www.youtube.com/view_play_list?p=675281900139F609">a series of Introductory videos</a> that might help you understand OAuth without having to spend a couple days attempting to read an IETF specification, continually wiping the drool from your mouth. I should also note that the plugin&#8217;s README contains a lot of relevant information and references and might be worth checking out even if didn&#8217;t want to use it.  </p>
<p>OAuth provides a nice, dare I say comforting, user experience. That&#8217;s the nice part of OAuth. The ease of use plus the growing adoption made it a no-brainer for us to use OAuth in our products.  However, implementation wise, it still feels like a lot of moving parts as you&#8217;ll see in part 4 of the videos. I like my security (well all my software, but particularly security) software to have as little complexity as possible. OAuth is getting there, but I would not call it simple.  </p>
<p>As to how OAuth 2.0 compares to 1.0, the Web Server flow in OAuth 2.0 is mostly similar to OAuth 1.0, less the nearly impossible to code correctly request signing. OAuth 2.0 simply states &#8220;Use SSL!&#8221; rather than ask client developers to code potentially buggy implementations of the request signature.  That&#8217;s a good thing.</p>
<p>Here is the set of videos, where I exlain how the fictitious parsley.com personal financial portal uses OAuth to lookup user account information at Acme Bank:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/p/675281900139F609&#038;hl=en_US&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/675281900139F609&#038;hl=en_US&#038;fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://davidjrice.net/?feed=rss2&#038;p=26</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

