<?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>Circles and Crosses</title>
	<atom:link href="http://ox.no/feed" rel="self" type="application/rss+xml" />
	<link>http://ox.no</link>
	<description>Håvard Stranden&#039;s website</description>
	<lastBuildDate>Sun, 22 Apr 2012 22:21:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>OpenID for Node.js v0.4.2 released</title>
		<link>http://ox.no/posts/openid-for-node-js-v0-4-2-released</link>
		<comments>http://ox.no/posts/openid-for-node-js-v0-4-2-released#comments</comments>
		<pubDate>Sun, 22 Apr 2012 22:21:33 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://ox.no/?p=468</guid>
		<description><![CDATA[The v0.4.2 release of OpenID for Node.js fixes a bug in DH response decoding and signature calculation which caused (seemingly random) failures in the shared secret computation. This again caused some valid authentications to be rejected as invalid by OpenID &#8230; <a href="http://ox.no/posts/openid-for-node-js-v0-4-2-released">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The v0.4.2 release of OpenID for Node.js fixes a bug in DH response decoding and signature calculation which caused (seemingly random) failures in the shared secret computation. This again caused some valid authentications to be rejected as invalid by OpenID for Node.js. <strong>Please upgrade to the latest version of OpenID for Node.js to avoid potentially rejecting valid authentications for your users.</strong></p>

<h2>Details</h2>

<p>The bug revealed two issues in the OpenID for Node.js library:
* The <code>unbtwoc</code> routine which converts a received binary two&#8217;s complement number was flawed
* The computed shared secret was not converted to binary two&#8217;s complement form before it was used to compute the signature</p>

<p>These two issues together caused some authentication attempts to be rejected.</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/openid-for-node-js-v0-4-2-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Binding a DOM element to an observable using Knockout.js</title>
		<link>http://ox.no/posts/binding-a-dom-element-to-an-observable-using-knockout-js</link>
		<comments>http://ox.no/posts/binding-a-dom-element-to-an-observable-using-knockout-js#comments</comments>
		<pubDate>Tue, 17 Apr 2012 19:32:36 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://ox.no/?p=462</guid>
		<description><![CDATA[I&#8217;ve been doing a bit of experimenting with Knockout.js recently. Having written quite a bit of .NET code over the years, I am very used to thinking in (and I prefer thinking in) the MVVM pattern when it comes to &#8230; <a href="http://ox.no/posts/binding-a-dom-element-to-an-observable-using-knockout-js">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a bit of experimenting with <a href="http://knockoutjs.com">Knockout.js</a> recently. Having written quite a bit of .NET code over the years, I am very used to thinking in (and I prefer thinking in) the MVVM pattern when it comes to UIs, and so Knockout.js is nice.</p>

<p>And, as always, when writing code and living in the real world you sometimes need to do things that do not quite fit the pattern. In this case, I needed to draw on a canvas from my view model whenever some observables on it changed. The pragmatic thing to do when you need to draw on a canvas is to just grab the canvas by ID or whatever, but since this canvas lived in a template, identifying it through selectors quickly got messy (and hard).</p>

<p>Binding to it seemed like a much better idea, so I created the simple <code>element</code> Knockout.js binding. This is a one-way-to-source binding (.NET guys will be familiar with this terminology), meaning that the binding only writes to the view model from the view. In addition, the binding only does this once (when it is initialized), as the element will stay for the lifespan of the page.</p>

<p>So, in all its glory, here is my Knockout.js <code>element</code> binding:</p>

<pre><code>ko.bindingHandlers.element = {
    init: function(element, valueAccessor) {
      var value = valueAccessor();
      value(element);
    }
};
</code></pre>

<p>Use it as you would any other binding:</p>

<pre><code>&lt;canvas width="100" height="60" data-bind="element: yourObservable"&gt;&lt;/canvas&gt;
</code></pre>

<p>Simple as that. Now go use it!</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/binding-a-dom-element-to-an-observable-using-knockout-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Continuous Testing, bling, and the quest for immediate feedback</title>
		<link>http://ox.no/posts/on-continuous-testing-bling-and-the-quest-for-immediate-feedback</link>
		<comments>http://ox.no/posts/on-continuous-testing-bling-and-the-quest-for-immediate-feedback#comments</comments>
		<pubDate>Tue, 28 Feb 2012 17:49:44 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Continuous Testing]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://ox.no/?p=402</guid>
		<description><![CDATA[My usual MO is not to engage in debates such as the recent heated HerdingCode/NCrunch vs Mighty Moose debate, but I can&#8217;t resist sharing my view regarding the issue at hand, as it concerns a tool I wrote called Continuous &#8230; <a href="http://ox.no/posts/on-continuous-testing-bling-and-the-quest-for-immediate-feedback">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My usual MO is not to engage in debates such as the recent <a href="https://twitter.com/#!/gregyoung/status/174380303580798976">heated</a> <a href="http://herdingcode.com/?p=403">HerdingCode/NCrunch</a> vs <a href="http://goodenoughsoftware.net/2012/02/28/risk-management-and-continuous-testing/">Mighty Moose debate</a>, but I can&#8217;t resist sharing my view regarding the issue at hand, as it concerns a tool I wrote called <a href="http://ox.no/software/continuoustesting">Continuous Testing for Visual Studio</a>.</p>

<p>First of all, I want to emphasize that I think both of the aforementioned tools are great efforts, and most certainly provide value to those using them.</p>

<p>Second, the reason for being a passive listener is that I believe debates of this kind are utterly meaningless and provide no value whatsoever; making and improving the tools at hand is what provides value. I will make an exception this time as this debate (among other things) discusses a (if not <em>the</em>) fundamental motivation for writing Continuous Testing for Visual Studio, and highlights one of the significantly differentiating aspects of the approach it takes.</p>

<p>Third, and most importantly, the statement from the Herding Code podcast is objectively true. Put in even clearer words: <strong><em>It is impossible for a Continuous Testing tool to do static analysis and achieve perfect and correct test minimization.</em></strong> Even near perfect test minimization is impossible. The only generally possible thing is simple dependency resolution. Don&#8217;t let anyone tell you otherwise.</p>

<p>That is why <strong>Continuous Testing for Visual Studio does not do static analysis<sup>1</sup>, but relies purely on statistical heuristics</strong> to prioritize and give as <strong>immediate</strong> feedback as it possibly can, <strong>while</strong> still guaranteeing you the <strong>correct</strong> feedback.</p>

<p>Note the highlit words in the previous sentence. Immediate while correct. That is the core philosophy of Continuous Testing for Visual Studio. <strong><em>In the end, correct feedback matters infinitely much more than fast feedback when it comes to testing.</em></strong> Continuous Testing for Visual Studio tries to give you as immediate feedback as it can, while still giving you correct feedback.</p>

<p>It is up to you, dear reader, to try out the tools and find out which works best for you in your real world project. <a href="http://ox.no/software/continuoustesting">Try Continuous Testing for Visual Studio</a>. While you do that, I&#8217;ll continue improving it.</p>

<p>&#8211;</p>

<p><small><sup>1</sup> We obviously do static analysis to resolve dependencies etc., but not for optimizing away tests.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/on-continuous-testing-bling-and-the-quest-for-immediate-feedback/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Testing 2.0 is here</title>
		<link>http://ox.no/posts/continuous-testing-2-0-is-here</link>
		<comments>http://ox.no/posts/continuous-testing-2-0-is-here#comments</comments>
		<pubDate>Thu, 23 Feb 2012 22:07:22 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Continuous Testing]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://ox.no/?p=350</guid>
		<description><![CDATA[I am happy to announce the immediate availability of Continuous Testing 2.0 for Visual Studio 2010 and 2008. From now on, Continuous Testing for Visual Studio will be available in two flavors: A full-featured Professional version and a free version &#8230; <a href="http://ox.no/posts/continuous-testing-2-0-is-here">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am happy to announce the immediate availability of Continuous Testing 2.0 for Visual Studio 2010 and 2008.</p>

<p>From now on, Continuous Testing for Visual Studio will be available in two flavors: A full-featured Professional version and a free version staying more or less as it is today.</p>

<table><tr>
<td><img src="http://ox.no/files/ContinuousTesting.png" height="50" /></td>
<td style="vertical-align: middle"><span style="font-weight: bold">Continuous Testing 2.0</span></td>
<td style="vertical-align: middle"><a href="https://secure.avangate.com/order/checkout.php?PRODS=4544613&#038;QTY=1&#038;CART=2">Buy Professional</a></td>
<td style="vertical-align: middle"><a href="http://visualstudiogallery.msdn.microsoft.com/en-us/c074d3c6-71e2-4628-9e7c-7690e706aef4">Download for VS2010</a></td>
<td style="vertical-align: middle"><a href="/downloads/Continuous+Testing+for+Visual+Studio+2008">Download for VS 2008</a></td>
</tr></table>

<p>The new Professional version features a number of improvements over the free version:</p>

<ul>
<li><strong>Smart Test Run Prioritization</strong> records the outcome of each of your tests, and orders the next test runs to minimize your wait for feedback even further. Smart Test Run Prioritization will run your tests in order of <em>most recently failing</em> and <em>most often failing</em>. This provides a significant speed-up for larger projects.</li>
<li><strong>Abort on first failing test</strong>: You can choose to have Continuous Testing abort as soon as a test fails. This is useful for freeing up resources acquired by the test run as soon as feedback is available. This is another must-have feature in real world software development on large projects.</li>
<li><strong>Priority support</strong>: Send an e-mail and get a response within 24 hours.</li>
</ul>

<p>The combined features of Continous Testing Professional make for a very powerful and efficient TDD workflow.</p>

<p><strong><em>Ensuring the last failing test runs first and aborting as soon as a test fails enables you to do as much as possible of what you are supposed to do: Write code.</em></strong></p>

<p>The free version will continue to stay free with at least the current features. Here are the most notable new features of the free version:</p>

<ul>
<li>A <strong>new integrated version of the test runners for MSTest and NUnit</strong> speeds up test runs. The executable test runners are still available. If you experience problems with running your tests using the integrated runners, try running your tests using the executable test runners instead.</li>
<li>Continuous Testing can be told to <strong>ignore specific projects when scanning for tests</strong>. This is useful if you are working on a solution with many test projects, and only want to run some of those projects.</li>
<li>Continuous Testing now has its <strong>own Output Window pane</strong>. Watch this pane to see what Continuous Testing is doing.</li>
</ul>

<p>In addition, many improvements and bug fixes have made it into the release, ensuring a more stable and productive experience than before.</p>

<p>Happy testing and TDD-ing!</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/continuous-testing-2-0-is-here/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing JSUT &#8211; Cross-platform JavaScript Unit Testing</title>
		<link>http://ox.no/posts/introducing-jsut-cross-platform-javascript-unit-testing</link>
		<comments>http://ox.no/posts/introducing-jsut-cross-platform-javascript-unit-testing#comments</comments>
		<pubDate>Mon, 06 Feb 2012 11:09:44 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://ox.no/?p=336</guid>
		<description><![CDATA[I write quite a bit of JavaScript these days, and one observation I have made with regards to Line-of-Business apps is that platforms like Node.js makes me lean more towards sharing business logic between the server and client side (meaning &#8230; <a href="http://ox.no/posts/introducing-jsut-cross-platform-javascript-unit-testing">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I write quite a bit of JavaScript these days, and one observation I have made with regards to Line-of-Business apps is that platforms like Node.js makes me lean more towards sharing business logic between the server and client side (meaning Node.js and the browsers, in practice). This creates an immediate need to unit test &#8220;universally&#8221; (across all platforms and environments), and I couldn&#8217;t find a single tool that quite did it for me.</p>

<p>JSUT (JavaScript Unit Testing) is an attempt at making such a tool for fun and profit (non-monetary).</p>

<p>JSUT stems from me growing tired of the hurdles of unit testing my JavaScript code. There are tons of alternative unit testing tools and libraries readily available, but my experience was that they all exhibited one or more of the following shortcomings:</p>

<ul>
<li>Imposing a &#8220;framework&#8221; or &#8220;philosophy&#8221; or &#8220;style&#8221; on my tests</li>
<li>Bringing me additional dependencies to worry about</li>
<li>Working only in the browser or inside Node.js</li>
</ul>

<p>In addition, I feel that many of the available tools and libraries are either undermaintained or overly featureful, and buggy and/or painful to use as a result of one or both of those. I can&#8217;t and won&#8217;t claim that this will be different in the case of JSUT, so it&#8217;s not really an argument, but more a motivation for me.</p>

<h1>Goals</h1>

<p>I sat down and wrote a few goals for JSUT:</p>

<ul>
<li>Universal, cross-platform</li>
<li>Minimalistic, simple, non-constraining</li>
<li>Accessible</li>
</ul>

<p>I then took to writing code and brushing up my rather rusty shell scripting skills, and a few hours later I wound up with what I present to you now.</p>

<h1>JSUT &#8211; JavaScript Unit Testing &#8211; An introduction</h1>

<p>Writing a test in JSUT is about as simple as it can get. You write a function:</p>

<pre><code>function myTest(test) {
  // JSUTs only requirement:
  // Call test.done() when the test is done
  test.done(); 
}
</code></pre>

<p>Now, let&#8217;s say you save this function to a file called <code>test.js</code>. You can then move to your preferred shell and write the following:</p>

<pre><code>jsut -b chrome test.js
</code></pre>

<p>This will run your test in Chrome. To run your test in Node.js, do:</p>

<pre><code>jsut -n test.js
</code></pre>

<p>You can combine the <code>-b</code> and <code>-n</code> flags any way you like, of course.</p>

<h2>Getting JSUT</h2>

<p>Getting JSUT is very simple. Assuming you have <code>npm</code>, just do:</p>

<pre><code>npm install jsut
</code></pre>

<p>Which will install jsut locally. If you want a global installation, issue:</p>

<pre><code>npm install jsut -g
</code></pre>

<p>Of course, with the goals for JSUT, you can also just download and copy deploy JSUT. Visit <a href="http://github.com/havard/jsut">http://github.com/havard/jsut</a> for source code and further instructions.</p>

<h2>Requirements</h2>

<p>As mentioned in the above sample, the only requirement JSUT imposes on you is to call <code>test.done()</code> when your test is done. Obviously, this seems redundant for the simple case of a synchronously executing function, but since most JavaScript functions these days are asynchronous at some level, there has to be a way to tell JSUT that a test is done. I am actively considering easing this requirement for simple cases, but this has not been a priority so far.</p>

<p>For Node.js, you are required to add the functions you want to test to the <code>exports</code> of each test file. Building on the example above, you can maintain cross-platform compatibility by doing the following:</p>

<pre><code>if (typeof(exports) !== 'undefined') {
  exports.myTest = myTest;
}
</code></pre>

<p>This will add exports only if the <code>exports</code> variable is defined. Now, if you wanted to run your test in Node.js, you simply do:</p>

<pre><code>jsut -n test.js
</code></pre>

<p>This will run your test in Node.js. You are free to combine the <code>-n</code> and <code>-b</code> flags any way you like, so that you can target all required platforms with a single command.</p>

<h2>Assertions</h2>

<p>JSUT automatically injects a CommonJS compatible assert module in your browser tests, so you can write stuff like <code>assert.ok(true);</code> anywhere in your test.</p>

<h2>Planned features</h2>

<p>JSUT currently only runs browser tests on OS X. I plan to support Linux and Windows as soon as possible. Follow <a href="http://github.com/havard">me</a> and <a href="http://github.com/havard/jsut">JSUT</a> on GitHub!</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/introducing-jsut-cross-platform-javascript-unit-testing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to combine Git, Windows, and non-ASCII letters</title>
		<link>http://ox.no/posts/how-to-combine-git-windows-and-non-ascii-letters</link>
		<comments>http://ox.no/posts/how-to-combine-git-windows-and-non-ascii-letters#comments</comments>
		<pubDate>Fri, 19 Aug 2011 21:56:13 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://ox.no/?p=324</guid>
		<description><![CDATA[The default Git installation in Windows works really bad if you&#8217;re using cmd.exe and have non-ASCII letters in your commit information and/or code. Thankfully, Git is highly configurable, and the fix is rather easy: Set i18n.commitencoding to the codepage you&#8217;re &#8230; <a href="http://ox.no/posts/how-to-combine-git-windows-and-non-ascii-letters">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The default Git installation in Windows works really bad if you&#8217;re using <code>cmd.exe</code> and have non-ASCII letters in your commit information and/or code.</p>

<p>Thankfully, Git is highly configurable, and the fix is rather easy:</p>

<ol>
<li>Set <code>i18n.commitencoding</code> to the codepage you&#8217;re on in <code>cmd.exe</code> (I&#8217;m on <code>windows-1252</code>)</li>
<li>Set <code>i18n.logoutputencoding</code> to the same codepage.</li>
<li>Set the <code>LESSCHARSET</code> environment variable to a proper name for the code page you&#8217;re on (I&#8217;m on <code>latin1</code>), either by:

<ul>
<li>Adding a user environment variable in <code>Control Panel &gt; System and Security &gt; System &gt; Advanced System Settings &gt; Advanced &gt; Environment Variables...</code>, or&#8230;</li>
<li>Setting it your <code>cmd.exe</code> session (e.g. <code>set LESSCHARSET=latin1</code>)</li>
</ul></li>
</ol>

<p>Boilerplate version for your copy-paste convenience (replace encodings as necessary):</p>

<pre><code>git config --global i18n.commitencodig windows-1252
git config --global i18n.logoutputencoding windows-1252
set LESSCHARSET=latin1
</code></pre>

<p>The first setting tells Git how your commit messages, including your author information, are encoded. The second tells Git what encoding it should use when writing output from a command like <code>git log</code>. The third and final setting tells <code>less</code>, the pager that Git runs <code>git log</code> output through, what encoding to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/how-to-combine-git-windows-and-non-ascii-letters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID for Node.js v0.2.0 released</title>
		<link>http://ox.no/posts/openid-for-node-js-v0-2-0-released</link>
		<comments>http://ox.no/posts/openid-for-node-js-v0-2-0-released#comments</comments>
		<pubDate>Tue, 21 Jun 2011 19:58:21 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://ox.no/?p=315</guid>
		<description><![CDATA[I am pleased to announce the release of OpenID for Node.js v0.2.0. It deserves a blog post since the new version is a bump of the minor version number. What does this mean to the users of the library? API &#8230; <a href="http://ox.no/posts/openid-for-node-js-v0-2-0-released">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce the release of OpenID for Node.js v0.2.0. It deserves a blog post since the new version is a bump of the minor version number. What does this mean to the users of the library?</p>

<h2>API changes</h2>

<p>The API of the entire thing has changed. All callbacks exposed and used by the library are now on the form <code>callback(error, args)</code>. This convention is familiar to Node.js developers, and gives us the advantage of simpler integration with other libraries, as well as a slight increase in the fidelity of error messages.</p>

<h3>What has changed?</h3>

<ul>
<li><code>authenticate</code> now expects a callback which will be called with <code>(error, authUrl)</code>. Existing code which expects <code>(authUrl)</code> will not get an authUrl (but possibly an error instead), and so authentication won&#8217;t work after upgrade until you change your code.</li>
<li><code>verifyAssertion</code> also expects a callback of the same form, which will be called with <code>(error, result)</code>. Again, existing code depends on receiving a <code>(result)</code> call, and will break.</li>
<li><code>loadAssociation</code> and <code>saveAssociation</code> must now accept a callback on the form <code>(error, result)</code> as an additional parameter. Previously, these functions were synchronous, so existing implementations will have to adapt so they call the callback rather than return.</li>
</ul>

<h2>What is new?</h2>

<p>As usual, we have fixed several bugs. The library is gaining a community, and there have been several contributions along the 0.1 release path leading up to 0.2.0. Thank you all for your participation!</p>

<p>Apart from the changes above, 0.2.0 also introduces a discovery cache for caching discovered information. This cache is used to avoid additional HTTP requests when verifying assertions from the OpenID providers. The default cache is an in-memory cache, but you can implement your own by overloading two functions:</p>

<ul>
<li><code>loadDiscoveredInformation(claimedIdentifier, callback)</code> is expected to look for and load a cached <code>provider</code> for the given <code>claimedIdentifier</code>. It is expected to call <code>callback(error, provider)</code> when finished, with either an error or a provider (duh).</li>
<li><code>saveDiscoveredInformation(provider, callback)</code> is expected to cache the given <code>provider</code>. The key for this object is <code>provider.claimedIdentifier</code>, which <code>loadDiscoveredInformation</code> uses for lookup. After saving, the function is expected to call <code>callback(error)</code> with an error if something failed, or nothing if all went well. </li>
</ul>

<p>I have been very reluctant to make these significant API changes, but the recent development, reported issues, and feature requests have convinced me that a unified API, and a more familiar API for Node.js developers, is the right way. Also, adapting to the new API is a pretty easy process. I hope you agree with me that the introduction of these changes is best in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/openid-for-node-js-v0-2-0-released/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Diffie-Hellman support in Node.js</title>
		<link>http://ox.no/posts/diffie-hellman-support-in-node-js</link>
		<comments>http://ox.no/posts/diffie-hellman-support-in-node-js#comments</comments>
		<pubDate>Tue, 10 May 2011 11:43:07 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ox.no/?p=302</guid>
		<description><![CDATA[Yay! My patch implementing support for Diffie-Hellman key exchange in Node.js has finally been merged into the Node.js master branch. This will simplify the OpenID for Node.js codebase a lot. It will also make the OpenID association phase run a &#8230; <a href="http://ox.no/posts/diffie-hellman-support-in-node-js">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yay! My patch implementing support for Diffie-Hellman key exchange in Node.js has finally been <a href="https://github.com/joyent/node/commit/9f0b1a9bc60f70b7c5c014743eb1edd69c36db76">merged into the Node.js master branch</a>. This will simplify the <a href="https://github.com/havard/node-openid">OpenID for Node.js</a> codebase a lot. It will also make the OpenID association phase run a lot faster, since the current code does Diffie-Hellman in Javascript while the Node.js crypto version does it all in native code using OpenSSL.</p>

<p>A brief API overview:</p>

<ul>
<li><code>crypto.createDiffieHellman(prime_length)</code>

<ul>
<li>Creates a Diffie-Hellman key exchange object and generates a prime of the given bit length. The generator used is <code>2</code>.</li>
</ul></li>
<li><code>crypto.createDiffieHellman(prime, encoding='binary')</code>

<ul>
<li>Creates a Diffie-Hellman key exchange object using the supplied prime. The generator used is <code>2</code>. Encoding can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.generateKeys(encoding='binary')</code>

<ul>
<li>Generates private and public Diffie-Hellman key values, and returns the public key in the specified encoding. This key should be transferred to the other party. Encoding can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.computeSecret(other_public_key, input_encoding='binary', output_encoding=input_encoding)</code>

<ul>
<li>Computes the shared secret using <code>other_public_key</code> as the other party&#8217;s public key and returns the computed shared secret. Supplied key is interpreted using specified <code>input_encoding</code>, and secret is encoded using specified <code>output_encoding</code>. Encodings can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>. If no output encoding is given, the input encoding is used as output encoding.</li>
</ul></li>
<li><code>diffieHellman.getPrime(encoding='binary')</code>

<ul>
<li>Returns the Diffie-Hellman prime in the specified encoding, which can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.getGenerator(encoding='binary')</code>

<ul>
<li>Returns the Diffie-Hellman prime in the specified encoding, which can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.getPublicKey(encoding='binary')</code>

<ul>
<li>Returns the Diffie-Hellman public key in the specified encoding, which can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.getPrivateKey(encoding='binary')</code>

<ul>
<li>Returns the Diffie-Hellman private key in the specified encoding, which can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.setPublicKey(public_key, encoding='binary')</code>

<ul>
<li>Sets the Diffie-Hellman public key. Key encoding can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
<li><code>diffieHellman.setPrivateKey(public_key, encoding='binary')</code>

<ul>
<li>Sets the Diffie-Hellman private key. Key encoding can be <code>'binary'</code>, <code>'hex'</code>, or <code>'base64'</code>.</li>
</ul></li>
</ul>

<p><strong>NOTE</strong>: The API is still subject to change.</p>

<p>I would appreciate getting a note if you actually do something useful with it. <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Play around with it and let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/diffie-hellman-support-in-node-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID for node.js</title>
		<link>http://ox.no/posts/openid-for-node-js</link>
		<comments>http://ox.no/posts/openid-for-node-js#comments</comments>
		<pubDate>Sat, 08 Jan 2011 22:16:09 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[node.js nodejs openid software library client javascript code]]></category>

		<guid isPermaLink="false">http://ox.no/?p=275</guid>
		<description><![CDATA[I am happy to announce the immediate availability of my implementation of OpenID for node.js. I&#8217;ve spent a few nights working on this, which is my first node.js library, and I finally got to the point where the library was &#8230; <a href="http://ox.no/posts/openid-for-node-js">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am happy to announce the immediate availability of my implementation of <strong>OpenID for node.js</strong>. I&#8217;ve spent a few nights working on this, which is my first node.js library, and I finally got to the point where the library was complete enough for a first public release.</p>

<h2>Installation</h2>

<p>Installing is very simple using <a href="http://npmjs.org"><code>npm</code></a>:</p>

<pre><code>npm install openid 
</code></pre>

<p>If you don&#8217;t use npm, you can of course just download and <code>require</code>. Remember dependencies from the <code>lib</code> folder, and remember adding paths to <code>require.paths</code> if necessary.</p>

<h2>Usage</h2>

<p>One of the main design goals for the library has been simplicity. Using OpenID for node.js is pretty simple, here&#8217;s a minimal sample server:</p>

<pre><code>var openid = require('openid');
var url = require('url');
var server = require('http').createServer(
    function(req, res)
    {
        var parsedUrl = url.parse(req.url, true);
        if(parsedUrl.pathname == '/verify')
        {
            // Verify identity assertion
            var result = openid.verifyAssertion(req); // or req.url
            res.writeHead(200);
            res.end(result.authenticated ? 'Success <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ' : 'Failure <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ');
        }
        else if(parsedUrl.pathname == '/authenticate')
        {
            // Resolve identifier, associate, build authentication URL
            openid.authenticate(
                parsedUrl.query.openid_identifier, // user supplied identifier
                'http://example.com/verify', // our callback URL
                null, // realm (optional)
                false, // attempt immediate authentication first?
                function(authUrl)
                {
                    res.writeHead(302, { Location: authUrl });
                    res.end();
                });
        }
        else
        {
            // Deliver an OpenID form on all other URLs
            res.writeHead(200);
            res.end('&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;'
                + '&lt;form method="get" action="/authenticate"&gt;'
                + '&lt;p&gt;Login using OpenID&lt;/p&gt;'
                + '&lt;input name="openid_identifier" /&gt;'
                + '&lt;input type="submit" value="Login" /&gt;'
                + '&lt;/form&gt;&lt;/body&gt;&lt;/html&gt;');
        }
    });
server.listen(80);
</code></pre>

<h2>Source</h2>

<p>I use GitHub for source control, so you can follow <a href="http://github.com/havard">me</a> and the <a href="http://github.com/havard/node-openid">node-openid</a> repository there.</p>

<h2>Licensing</h2>

<p>OpenID for node.js is licensed under the MIT license. Details can be found in the <a href="http://github.com/havard/node-openid/raw/master/LICENSE"><code>LICENSE</code></a> file on GitHub. The library includes third-party code released under the MIT and BSD licenses, see <a href="http://github.com/havard/node-openid/raw/master/README.md">README</a> for details.</p>

<h2>Wishes for node.js</h2>

<p>I&#8217;ve come across a couple of missing features which I&#8217;d love to see in node.js in the near future:</p>

<ul>
<li>The <code>crypto</code> module should support Diffie-Hellman key exchange (OpenSSL supports it, so please provide bindings)</li>
<li>A big integer library should be available alongside the <code>crypto</code> module, and preferably seamlessly integrated with the <code>crypto</code> module &#8211; perhaps bindings to the <a href="http://gmplib.org/">GMP</a> library could suffice?</li>
<li>More seamless unit testing libraries would be good</li>
</ul>

<p>In addition, I would love to see a tailored IDE for node.js applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/openid-for-node-js/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problems running .NET 4.0 tests using NUnit 2.5 with (or without) Continuous Testing?</title>
		<link>http://ox.no/posts/problems-running-net-4-0-tests-using-nunit-2-5-with-or-without-continuous-testing</link>
		<comments>http://ox.no/posts/problems-running-net-4-0-tests-using-nunit-2-5-with-or-without-continuous-testing#comments</comments>
		<pubDate>Wed, 11 Aug 2010 09:11:08 +0000</pubDate>
		<dc:creator>Håvard</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Continuous Testing]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[continuous testing]]></category>
		<category><![CDATA[nunit]]></category>

		<guid isPermaLink="false">http://ox.no/?p=222</guid>
		<description><![CDATA[NUnit 2.5 up to and including 2.5.4 fails to properly detect certain revisions of .NET 4.0, causing it to crash. The issue is documented in this bug report on LaunchPad. The bug has been fixed in 2.5.5 and later, so &#8230; <a href="http://ox.no/posts/problems-running-net-4-0-tests-using-nunit-2-5-with-or-without-continuous-testing">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>NUnit 2.5 up to and including 2.5.4 fails to properly detect certain revisions of .NET 4.0, causing it to crash. The issue is documented in <a href="https://bugs.launchpad.net/nunitv2/+bug/561487">this bug report on LaunchPad</a>. The bug has been fixed in 2.5.5 and later, so <a href="http://www.nunit.org">go grab the latest version of NUnit 2.5</a> and run your tests smoothly again, preferably on each build using <a href="http://ox.no/software/continuoustesting">Continuous Testing</a>, of course. <img src='http://ox.no/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ox.no/posts/problems-running-net-4-0-tests-using-nunit-2-5-with-or-without-continuous-testing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

