<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nathan Totten</title>
	<atom:link href="http://blog.ntotten.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ntotten.com</link>
	<description>Thoughts and Experiences with Software Development.</description>
	<lastBuildDate>Wed, 11 Apr 2012 14:12:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.ntotten.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/4467e37d91705aa956f90e6c2e16e118?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Nathan Totten</title>
		<link>http://blog.ntotten.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.ntotten.com/osd.xml" title="Nathan Totten" />
	<atom:link rel='hub' href='http://blog.ntotten.com/?pushpress=hub'/>
		<item>
		<title>Building Super Fast Web Apps with PJAX</title>
		<link>http://blog.ntotten.com/2012/04/09/building-super-fast-web-apps-with-pjax/</link>
		<comments>http://blog.ntotten.com/2012/04/09/building-super-fast-web-apps-with-pjax/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 18:35:46 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1176</guid>
		<description><![CDATA[There has been a great deal of interest recently in client side frameworks such as Knockout.js, Backbone.js, and Ember.js. These frameworks are great, but sometimes they are either overkill or simply too complicated for your particular purpose. Traditionally, the alternative &#8230; <a href="http://blog.ntotten.com/2012/04/09/building-super-fast-web-apps-with-pjax/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1176&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There has been a great deal of interest recently in client side frameworks such as <a href="http://knockoutjs.com/">Knockout.js</a>, <a href="http://documentcloud.github.com/backbone/">Backbone.js</a>, and <a href="http://emberjs.com/">Ember.js</a>. These frameworks are great, but sometimes they are either overkill or simply too complicated for your particular purpose. Traditionally, the alternative approach was to just use a pure server-side framework like Ruby on Rails or ASP.NET to build HTML and serve it to your users. However, there is a third approach that, while not new, has peeked my interest recently. This approach has been nicknamed PJAX. PJAX is a blend between client side and server side rendering of HTML.</p>
<p>The basic idea of PJAX is that you update only the parts of the page that change when the user navigates through your app. However, unlike a normal AJAX app that returns only data (JSON) from the server, a PJAX request actually contains normal HTML that has been generated on the server. This HTML is only a fragment of the full page and using Javascript on the client this fragment is substituted in for the last page&#8217;s content.</p>
<p>Below you see a diagram of how this works.</p>
<p><a href="http://nathantotten.files.wordpress.com/2012/04/pjax-requests.jpg"><img class="alignnone size-full wp-image-1187" title="pjax-requests" src="http://nathantotten.files.wordpress.com/2012/04/pjax-requests.jpg?w=584&#038;h=438" alt="" width="584" height="438" /></a></p>
<p>The first request to the server is a normal request <span style="color:#333333;font-style:normal;line-height:24px;">(1)</span>. The server then returns the page in the normal fashion (2). The difference with PJAX is with subsequent requests. For example, if a user clicks on a link that opens the /about page the client-side JavaScript makes a request for only the parts of the page that need to change <span style="color:#333333;font-style:normal;line-height:24px;">(3)</span>. The server then generates the html of the only the changed content and returns it in the response (4). The client-side JavaScript then replaces the old content with the new content.</p>
<p>You can see in the next image how the network traffic of the requests look. The first page is loaded along with all the supporting static content. You can see at the bottom the requests for the &#8216;about&#8217; and &#8216;contact&#8217; pages. When the user navigates to these pages, only the new content is requested from the server; in these cases partial HTML pages. You can see this technique results in far fewer HTTP requests to the server and less content being sent over the wire. This reduces the load time of the page and will also reduce load on your server and bandwidth usage.</p>
<p><img class="alignnone size-full wp-image-1189" title="pjaxrequests" src="http://nathantotten.files.wordpress.com/2012/04/pjaxrequests.png?w=584&#038;h=327" alt="" width="584" height="327" /></p>
<p>This technique has been implimented in a variety of ways. You may recall that ASP.NET actually ships with something like this called <a href="http://www.asp.net/web-forms/tutorials/aspnet-ajax/understanding-partial-page-updates-with-asp-net-ajax">partials</a>. The method I am using is a bit more do-it-yourself, but it is similar. So lets take a look at how this could be implimented using Node.js with <a href="http://expressjs.com/">Express</a>.</p>
<p>On the client I am using a great jQuery library called<a href="https://github.com/defunkt/jquery-pjax"> jQuery-pjax</a>. This library takes care of some of the lower-level code such as making the ajax request and replacing HTML content. By using this library you can impliment the pjax request with only a few lines of code.</p>
<p>The first thing we need to do is setup our links to be pjax links. We can do this by adding the data-pjax attribute to the link. This attribute is set to the container where the content will be loaded. In this case a div with the id set to &#8216;main&#8217;.</p>
<p><pre class="brush: xml;">
&lt;a href='/explore' data-pjax='#main'&gt;Explore&lt;/a&gt;
</pre></p>
<p>Next, we simply need to call the pjax extension on every element that contains the data attribute &#8216;data-pjax&#8217;. You can see how we do this in a single line of code below.</p>
<p><pre class="brush: jscript;">
$('a[data-pjax]').pjax()
</pre></p>
<p>That&#8217;s it for the client; now we need to modify the server. The trick with this library is that when a PJAX request is made an HTTP header named &#8216;X-PJAX&#8217; is added to the request. By looking for this request our server knows whether to return only the html fragment that applies to this specific content or to return the entire HTML document.</p>
<p>There is a node module called <a href="https://github.com/dakatsuka/express-pjax">express-pjax</a> that extends Express and actually takes care of handling these PJAX request for us. This module is very simple. All it does is look for the header and if the header is present it sets the request options to not use a layout page. This results in only the portion of our view that is page specific to be rendered and returned. If the PJAX header is not present then the page is rendered like normal with the full view. The code of this module is below.</p>
<p><pre class="brush: jscript; highlight: [3,4,5,10,13];">
module.exports = function() {
  return function(req, res, next) {
    if (req.header('X-PJAX')) {
      req.pjax = true;
    }

    res.renderPjax = function(view, options, fn) {
      if (req.pjax) {
        if (options) {
          options.layout = false;
        } else {
          options = {};
          options.layout = false;
        }
      }

      res.render(view, options, fn);
    };

    next();
  };
};
</pre></p>
<p>Since we are using the express-pjax module we only need to make a simple modification to our routes. Instead of calling render we need to call renderPjax.</p>
<p><pre class="brush: jscript; highlight: [4,8,12];">
module.exports = function(app) {

	app.get('/', function(req, res) {
		res.renderPjax('home/index', { title: 'SocialDrawing' });
	});

	app.get('/about', function(req, res) {
		res.renderPjax('home/about', { title: 'About' });
	});

	app.get('/contact', function(req, res) {
		res.renderPjax('home/contact', { title: 'Contact' });
	});

};
</pre></p>
<p>The beautify of this method is that it requires very little change to your application and you can share url routes with both the client and the server. Additionally, because jQuery-pjax uses the HTML5 history API you don&#8217;t have to use hashes in your urls. Lastly, any browser that is not compatible with this approach will just revert to normal requests which means you can support every browser back to IE6 (not that I recommend doing that).</p>
<h2 style="font-style:normal;line-height:24px;">Events</h2>
<p>A common issue with this method is executing Javascript when a PJAX page is loaded or unloaded. To handle this the jQuery-pjax library has a number of events you can subscribe.</p>
<p><pre class="brush: jscript;">
$('a.pjax').pjax('#main')
$('#main')
  .on('pjax:start', function() { $('#loading').show() })
  .on('pjax:end',   function() { $('#loading').hide() })
</pre></p>
<p>By subscribing to these events you can run code that you would normally run on $(document).ready(). In a future post I will show you how you can use these events to automatically handle loading and unloading views in a way that also works with normal page loads.</p>
<h2>Caching</h2>
<p>In order to further improve the performance of you PJAX page loads you should impliment server-side and client-side caching. By utilizing caching you can build an application that is extremely responsive and in most cases your uses will not be able to tell the difference between this style of application and a full client-side application. There is a <a href="http://37signals.com/svn/posts/3112-how-basecamp-next-got-to-be-so-damn-fast-without-using-much-client-side-ui">great article</a> written on the <a href="http://37signals.com/">37Signals</a>&#8216; blog about how they used this approach in their new version of <a href="http://basecamp.com">Basecamp</a>. The post goes into detail about how they use PJAX and caching to build a super fast app.</p>
<h2>Conclusion</h2>
<p>The biggest advantage of this approach is simplicity. I find that writing an application in a full client-side framework can result in a great app, but sometimes it is overly complicated. With great server-side tooling available for rendering views in frameworks like ExpressJS or ASP.NET MVC sometimes it is just easier to handle the view rendering on the server. The PJAX approach allows you to use the tools you are familiar with while still getting great client-side performance. As with most design choices, there are trade-offs. This approach isn&#8217;t for every app, but it is a great tool to have available and use when appropriate.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1176&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/04/09/building-super-fast-web-apps-with-pjax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/04/pjax-requests.jpg" medium="image">
			<media:title type="html">pjax-requests</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/04/pjaxrequests.png" medium="image">
			<media:title type="html">pjaxrequests</media:title>
		</media:content>
	</item>
		<item>
		<title>Facebook C# SDK Accepted as Outercurve Foundation Project</title>
		<link>http://blog.ntotten.com/2012/03/20/facebook-c-sdk-accepted-as-outercurve-foundation-project/</link>
		<comments>http://blog.ntotten.com/2012/03/20/facebook-c-sdk-accepted-as-outercurve-foundation-project/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 16:25:07 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Facebook C# SDK]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1180</guid>
		<description><![CDATA[We have some exciting news today regarding the Facebook C# SDK. Today The Outercurve Foundation has announced that the Facebook C# SDK has been accepted to the foundation as part of the Data, Language and Systems Interoperability (DLSI) Gallery. This is &#8230; <a href="http://blog.ntotten.com/2012/03/20/facebook-c-sdk-accepted-as-outercurve-foundation-project/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1180&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have some exciting news today regarding the Facebook C# SDK. Today <a href="http://outercurve.org">The Outercurve Foundation</a> has <a href="http://www.outercurve.org/News/articleType/ArticleView/articleId/54/Outercurve-Foundation-Accepts-Facebook-C-SDK-Project">announced </a>that the Facebook C# SDK has been accepted to the foundation as part of the<a href="http://www.outercurve.org/Galleries/DataLanguagesandSystemsInteroperability"> Data, Language and Systems Interoperability (DLSI) Gallery</a>. This is an important milestone for the Facebook C# SDK as it even further solidifies the project&#8217;s place in the Facebook and .Net ecosystem.</p>
<p>For those who have been following the Facebook C# SDK recently, you may have noticed some other big changes as well. In addition to moving the project to <a href="https://github.com/facebook-csharp-sdk">Github</a>, we have also completely rewritten our <a href="http://csharpsdk.org">documentation</a>. You can find the new documentation on our project&#8217;s website at <a href="http://csharpsdk.org">http://csharpsdk.org</a>. You can find the full source of the SDK at <a href="https://github.com/facebook-csharp-sdk">http://github.com/facebook-csharp-sdk</a>.</p>
<p>Additionally, we also just released another big update to the SDK with version 6.0.10. Version 6 has been primarily about cleaning up and simplifying the API for the SDK. While there are a few breaking changes in V6, we think you will find this version of the SDK to be much easier to work with. You can get started with V6 of the Facebook C# SDK by installing the <a href="http://nuget.org/packages/Facebook">Facebook Nuget package</a>.</p>
<p>The next change we have made is fairly minor, but important. We are now formally following <a href="http://semver.org">SemVer.org</a> versioning with the project. This should make it easier for developers to understand the impacts of new versions of the SDK. With this change any breaking changes will result it a major version number change, however with Facebook&#8217;s APIs becoming much more stable we hope to avoid breaking changes as much as possible.</p>
<p>The final bit of news regarding the Facebook C# SDK is that we also have released a few libraries that were build as part of the SDK as seperate projects. These libraries are <a href="https://github.com/facebook-csharp-sdk/http-helper">HttpHelper</a>, <a href="https://github.com/facebook-csharp-sdk/simple-json">SimpleJson</a>, and <a href="https://github.com/facebook-csharp-sdk/reflection-utils">ReflectionUtils</a>. These libraries simpilify the process of building cross-platform .Net/Windows libraries by abstracting some of the differences with HTTP requests and reflection in the platforms. SimpleJson is exactly what it sounds like and is a very simple JSON serializer. For more information on these libraries and how they fit into the Facebook C# SDK read Prabir&#8217;s post <a href="http://blog.prabir.me/post/Facebook-CSharp-SDK-Outercurve-Foundation-and-v6-RTW.aspx">here</a>.</p>
<p>Lots of great changes recently with the Facebook C# SDK. We are excited and honored to be a part of The Outercurve Foundation. We look forward to continually improving the Facbeook C# SDK and working with the community to give .Net and Windows developers the best tools for developing Facebook apps.</p>
<p>As always let me know if you have any questions or feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1180&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/03/20/facebook-c-sdk-accepted-as-outercurve-foundation-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Facebook jQuery Helper</title>
		<link>http://blog.ntotten.com/2012/03/14/facebook-jquery-helper/</link>
		<comments>http://blog.ntotten.com/2012/03/14/facebook-jquery-helper/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 00:22:29 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1173</guid>
		<description><![CDATA[I just published a simple jQuery plugin on github that makes it super easy to use the Facebook Javascript SDK on your website. It also allows you to to use jQuery events to run code before and after the Facebook&#8217;s &#8230; <a href="http://blog.ntotten.com/2012/03/14/facebook-jquery-helper/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1173&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just published a simple jQuery plugin on github that makes it super easy to use the Facebook Javascript SDK on your website. It also allows you to to use jQuery events to run code before and after the Facebook&#8217;s code is initialized.</p>
<p>You can find the full source for this plugin on Github at <a href="https://github.com/ntotten/jquery-fb">https://github.com/ntotten/jquery-fb</a>.</p>
<p>To add the Facebook Javascript SDK to your site simply call the following Javascript somewhere in your document:</p>
<p><pre class="brush: jscript;">
$(document).fb('youappid');
</pre></p>
<p>If you want to use the events simply add handles to either the fb:initializing or fb:initialized events.</p>
<p><pre class="brush: jscript;">
$(document).on('fb:initializing', function() {
  // Do something before FB.Init is called
});

$(document).on('fb:initialized', function() {
  // Do something after FB.Init is called
});
$(document).fb('youappid');
</pre></p>
<p>The benefit of this library is that it you can add the initialization code in a single place in your app (such as a layout or master page) and then use the jQuery events to run the appropriate code on specific pages. For example, on your login page you may want to do something like this:</p>
<p><pre class="brush: jscript;">
$(document).ready(function() {
  // Add the function to run after FB is initialized
    $(document).on('fb:initialized', function() {
      FB.getLoginStatus(fbAuthStatusChange);
    });
    $(document).fb('youappid');
});

function fbAuthStatusChange(request) {
    // Do something
}
</pre></p>
<p>It is a pretty simple plugin, but I think it is helpful. I have used something similar to this for a while and it has helped me out a lot. I have a few minor improvements I want to add to this, but it should be ready to use.</p>
<p><strong>Update:</strong> This package is now on Nuget. It is called &#8216;jQuery.fb&#8217;. You can find it here: <a href="https://nuget.org/packages/jQuery.fb">https://nuget.org/packages/jQuery.fb</a></p>
<p>Let me know if you have any questions or feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1173&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/03/14/facebook-jquery-helper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Node.js on Windows Azure News &amp; Updates (March 2012)</title>
		<link>http://blog.ntotten.com/2012/03/14/node-js-on-windows-azure-news-updates-march-2012/</link>
		<comments>http://blog.ntotten.com/2012/03/14/node-js-on-windows-azure-news-updates-march-2012/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 20:50:32 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1170</guid>
		<description><![CDATA[Node.js on Windows Azure continues to get better. The Windows Azure SDK  for Node.js is already on its third release in just a few short months, the PowerShell Cmdlets for Node.js makes deploying to Windows Azure super easy, and improvements &#8230; <a href="http://blog.ntotten.com/2012/03/14/node-js-on-windows-azure-news-updates-march-2012/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1170&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.windowsazure.com/en-us/develop/nodejs/">Node.js on Windows Azure</a> continues to get better. The <a href="https://github.com/WindowsAzure/azure-sdk-for-node">Windows Azure SDK  for Node.js</a> is already on its third release in just a few short months, the PowerShell Cmdlets for Node.js makes deploying to Windows Azure super easy, and improvements to Windows Azure continue to make the platform even more attractive to Node.js developers.</p>
<p>The post is a summary of some of the most recent news and updates around Node.js and Windows Azure.</p>
<h1>Windows Azure SDK for Node.js Version 0.5.2</h1>
<p>The Windows Azure SDK for Node.js continues to be updated rapidly. The most recent update, version 0.5.2, adds support for Windows Azure Service Bus in addition to numerous bug fixes.</p>
<p>The addition of Windows Azure Service Bus support to the Node.js SDK enables a whole new set of scenarios for Node.js developers on Windows Azure. The Service Bus enables  developers to build large decoupled systems though relays and pub/sub queues. For more information on version 0.5.2 of the SDK as well as some examples of using Service Bus with Node.js I would recommend reading <a href="http://codebetter.com/glennblock/2012/02/14/servicebus-support-in-azure-npm-0-5-2/">this </a>post by Glenn Block.</p>
<h1>Reduced Pricing for Windows Azure Compute and Storage</h1>
<p>This next bit of news isn&#8217;t explicitly for Node.js developers, but it is still big. Recently, we <a href="http://blogs.msdn.com/b/windowsazure/archive/2012/03/08/announcing-reduced-pricing-on-windows-azure-storage-and-compute.aspx">announced </a>that the price for Windows Azure Compute and Storage would be reduced. The most notable reduction is that the Extra-Small Compute instance is now priced at $0.02 per hour. This means that you can run two servers with a 99.95% SLA for only about $30 per month.</p>
<p>Combining two extra-small instances with the power of Node.js makes for some serious computing for a great price. I am working on a few demos that will show what you can do with only 2 extra-small instances using Node.js that I will post shortly, but for now I challenge you to build something and see how much you can accomplish for $30 a month.  Remember &#8211; if you are a startup you can also use <a href="http://www.microsoft.com/bizspark">BizSpark </a>to get even more Windows Azure for FREE.</p>
<h1>Using Windows Azure Access Control Services with Node.js</h1>
<p>The last bit of news is a great <a href="http://nodeblog.cloudapp.net/using-windows-azure-access-control-service-acs-from-a-node-app">post </a>that <a href="https://twitter.com/#!/woloski">Matias Woloski</a> did showing how you can use Windows Azure Access Control Services (ACS) with Node.js. The process is really straight forward so if you are building an application that requires multiple identity providers   I recommend giving that a read.</p>
<h1>Coming Soon</h1>
<p>Keep an eye out here for most posts like these. Additionally, I am starting a series of tutorials on Node.js and Windows Azure that you will see on my blog shortly.</p>
<p>Let me know if you have any questions or feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1170&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/03/14/node-js-on-windows-azure-news-updates-march-2012/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Github Pages with Jekyll &#8211; Local Development on Windows</title>
		<link>http://blog.ntotten.com/2012/03/02/github-pages-with-jekyll-local-development-on-windows/</link>
		<comments>http://blog.ntotten.com/2012/03/02/github-pages-with-jekyll-local-development-on-windows/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 23:36:47 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Github Pages]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1144</guid>
		<description><![CDATA[I love Github pages. They make writing simple sites, blogs, or even complex documentation super enjoyable. Github pages uses Jekyll to build your markdown or other site content into static HTML pages. While it is easy to push new content to &#8230; <a href="http://blog.ntotten.com/2012/03/02/github-pages-with-jekyll-local-development-on-windows/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1144&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I love <a href="http://pages.github.com">Github pages</a>. They make writing simple sites, blogs, or even <a href="http://csharpsdk.org">complex documentation</a> super enjoyable. Github pages uses <a href="https://github.com/mojombo/jekyll">Jekyll</a> to build your markdown or other site content into static HTML pages. While it is easy to push new content to Github and preview changes in your live site, sometimes you want to develop and test your site locally. In order to do this you will need to install Ruby and Jekyll on your local machine. Since I do much of my development on Windows 7 or Windows 8 I wanted to have Jekyll setup on these machines as well. Below you see how to install and use Jekyll on your Windows box.</p>
<p>First, you need to install Ruby. You download the Ruby installer for Windows <a href="http://rubyinstaller.org/downloads/">here</a>. Download the most recent version of Ruby and run the installer. When you install Ruby you will want to select a few options to make ruby easier to use.</p>
<p><img class="size-full wp-image-1147 alignnone" title="rubyinstall2" src="http://nathantotten.files.wordpress.com/2012/03/rubyinstall21.png?w=584" alt=""   /></p>
<p>After you have Ruby installed you will need to install the Ruby Development Kit. You can find this on the <a href="http://rubyinstaller.org/downloads/">Ruby downloads</a> page as well. Download and extract the development kit nto a directory of your choice. I recommend C:\DevKit, but anything will work. After the developer kit has been extracted you need run the installation. You can do that by executing the following commands.</p>
<pre>cd C:\DevKit
ruby dk.rb init
ruby dk.rb install</pre>
<p><img class="alignnone size-full wp-image-1149" title="devkitinstall" src="http://nathantotten.files.wordpress.com/2012/03/devkitinstall1.png?w=584&#038;h=294" alt="" width="584" height="294" /></p>
<p>Now you are ready to install Jekyll. You can do that by running the following command.</p>
<pre>gem install jekyll</pre>
<p><img class="alignnone size-full wp-image-1150" title="geminstalljekyll" src="http://nathantotten.files.wordpress.com/2012/03/geminstalljekyll.png?w=584&#038;h=295" alt="" width="584" height="295" /></p>
<p>Finally, if you are using the <a href="https://github.com/rtomayko/rdiscount">RDiscount</a> markdown engine, which is the one I prefer, you will need to install that as well.</p>
<pre>gem install rdiscount</pre>
<p><img class="alignnone size-full wp-image-1152" title="rdiscountinstall" src="http://nathantotten.files.wordpress.com/2012/03/rdiscountinstall.png?w=584&#038;h=295" alt="" width="584" height="295" /></p>
<p>Now, you are ready to build your site using Jekyll. In order to do this simply navigate to your site&#8217;s directory and run the following command.</p>
<pre>jekyll --server</pre>
<p><img class="alignnone size-full wp-image-1151" title="jekyllserver" src="http://nathantotten.files.wordpress.com/2012/03/jekyllserver.png?w=584&#038;h=292" alt="" width="584" height="292" /></p>
<p>As you can see, I ran Jekyll on the <a href="https://github.com/facebook-csharp-sdk/facebook-csharp-sdk.github.com">Facebook C# SDK documentation</a> and the output is placed in the _site directory.</p>
<p><img class="alignnone size-full wp-image-1153" title="sitedir" src="http://nathantotten.files.wordpress.com/2012/03/sitedir.png?w=584&#038;h=351" alt="" width="584" height="351" /></p>
<p>Since we used the -server option when running Jekyll a simple web server was started and is running at <a href="http://localhost:4000">http://localhost:4000</a>. You can now view your site in the browser. Generally, I like to just use Jekyll to build the site and then use IIS on my local machine to host the site. You can do this by simply creating a new site in IIS and pointing it to the _site folder. Either way you now have your Jekyll site up and running for local development. This should make it a little easier to build your site, then when you are ready you can do a push to Github to deploy your site publicly.</p>
<p>Let me know if you have any questions or feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1144&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/03/02/github-pages-with-jekyll-local-development-on-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:thumbnail url="http://nathantotten.files.wordpress.com/2012/03/sitedir.png?w=150" />
		<media:content url="http://nathantotten.files.wordpress.com/2012/03/sitedir.png?w=150" medium="image">
			<media:title type="html">sitedir</media:title>
		</media:content>

		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/03/rubyinstall21.png" medium="image">
			<media:title type="html">rubyinstall2</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/03/devkitinstall1.png" medium="image">
			<media:title type="html">devkitinstall</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/03/geminstalljekyll.png" medium="image">
			<media:title type="html">geminstalljekyll</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/03/rdiscountinstall.png" medium="image">
			<media:title type="html">rdiscountinstall</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/03/jekyllserver.png" medium="image">
			<media:title type="html">jekyllserver</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/03/sitedir.png" medium="image">
			<media:title type="html">sitedir</media:title>
		</media:content>
	</item>
		<item>
		<title>Facebook C# SDK Road Map</title>
		<link>http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/</link>
		<comments>http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 20:14:01 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Facebook C# SDK]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/?p=1111</guid>
		<description><![CDATA[Disclaimer &#8211; The Facebook C# SDK is not a Microsoft project. The Facebook C# SDK as well as this post are the work and opinions of myself and not those of Microsoft. It has been a while since I have &#8230; <a href="http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1111&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><em>Disclaimer &#8211; The Facebook C# SDK is not a Microsoft project. The Facebook C# SDK as well as this post are the work and opinions of myself and not those of Microsoft.</em></strong></p>
<p>It has been a while since I have written a post on the <a href="http://github.com/facebook-csharp-sdk">Facebook C# SDK</a>. For those that follow my blog and the sdk you probably know that since I have moved to Microsoft I have spent less time on the Facebook C# SDK and more time on Windows Azure. Fortunately, the Facebook C# SDK was left in the very capable hands of Prabir Shrestha and it has continued to thrive. While I haven&#8217;t been spending much time with the SDK, it is still a project I care about and as such I wanted to share our plans to keep the project moving forward.</p>
<p><strong>Moving to Github</strong></p>
<p><a href="http://github.com/facebook-csharp-sdk"><img class="size-thumbnail wp-image-1112 alignright" title="octocat" src="http://nathantotten.files.wordpress.com/2012/02/octocat.png?w=150&#038;h=150" alt="" width="150" height="150" /></a>In the past few days we have been in the process of moving the Facebook C# SDK project to Github. Since the project was founded nearly two years ago we have hosted the SDK on Codeplex. Codeplex has been a great place for our project and on Codeplex we have recieved nearly 120,000 downloads. However, since the project was founded we have seen more and more projects and developers migrated to Github. Github offers a great set of collaboration tools that make managing a project like the Facebook C# SDK a breeze. We believe Github will enable the community to more easily contribute back code to the SDK through forks and pull requests. As such, the new home for the Facebook C# SDK will be at <a href="http://github.com/facebook-csharp-sdk">http://github.com/facebook-csharp-sdk</a>.</p>
<h1>Platforms and Frameworks</h1>
<p>When the Facebook C# SDK was started we supported only .Net 4.0 Full Profile. This was primarily because the SDK relied heavily on dynamic objects and the reliance on objects found in ASP.NET libraries. Over time the SDK has evolved to support .Net 3.5, .Net 3.5 Client Profile, .Net 4.0 Client Profile, Silverlight 3, Silverlight 4, Silverlight 5, MVC 2, MVC 3, Windows Phone 7.0, Windows Phone 7.1, and most recently WinRT (Windows 8 Metro Style Apps). This is obviously a huge amount of code to write and maintain. If you have seen the code of the SDK you will notice there are lots of <a href="http://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx">preprocessor directives</a> that help us work around the differences in the various platforms. You can see an example of this in the code below.</p>
<p><pre class="brush: csharp;">
    request.ContentType = contentType;
    if (!string.IsNullOrEmpty(etag))
        request.Headers[HttpRequestHeader.IfNoneMatch] =
             string.Concat('&quot;', etag, '&quot;');
#if !(SILVERLIGHT || WINRT)
    request.AutomaticDecompression =
        DecompressionMethods.GZip | DecompressionMethods.Deflate;
#endif
#if WINRT
    request.Headers[HttpRequestHeader.AcceptEncoding] = &quot;gzip,deflate&quot;;
#endif
    if (input != null)
        request.TrySetContentLength(input.Length);
#if (!(SILVERLIGHT || WINRT) || WINDOWS_PHONE)
    request.UserAgent = &quot;Facebook C# SDK&quot;;
#endif
    return new HttpHelper(request);
</pre></p>
<p>As you can see this code can be difficult to maintain, test, and debug. The good news is that through Prabir&#8217;s excellent work of abstracting the most difficult portions of this code we have been able to keep these proprocessor directives to a minimum. I will go into more details about this later in the article. What this means though is that we will do our best to keep supporting all of the current and future .Net and Windows platforms.</p>
<p>However, the reason I wanted to discuss this is to note that with this support there is generally a trade-off. At times we must decided whether to implement the new features of a particular platforms or maintain compatibility. So as I said, we will try to maintain compatibility with the various platforms, but moving forward we will be focusing our efforts on a few areas.</p>
<p>We want to make sure developers have a great experience with the Facebook C# SDK when developing web apps, Windows Phone Apps, and Windows 8 Metro Style Apps. This means that we will focus our energies on ASP.NET, Windows Phone, and WinRT support. We will be building out high quality samples and writing better documentation primarily around these three platforms and frameworks. While we aren&#8217;t explicitly not supporting the other platforms, our efforts will be minimal. We definitely welcome community contributions so if you have a great Silverlight sample please form the repo and contribute it back.</p>
<h1>License</h1>
<p>We have also decided to redistribute the Facebook C# SDK under the Apache 2.0 license. This license is more popular than the Ms-Pl license and is consistent with the license for  Facebook&#8217;s official SDKs and samples. While I am no lawyer, my understanding is that the Apache 2.0 license is the same in nearly every respect to Ms-Pl so this shouldn&#8217;t require any change on your part. You are still free to redistribute the SDK, use it in commercial projects, etc.</p>
<h1>Facebook C# SDK and Web Apps</h1>
<p>For those that have used the Facebook C# SDK in the past to develop web apps you have probably used the Facebook.Web and Facebook.Web.Mvc libraries. These libraries provide helper methods that were designed to make it easier to perform tasks such as authentication with Facebook in ASP.NET WebForms and MVC apps. Unfortunately, with the many changes to the Facebook platform, the new versions of MVC, and the new features added to the core Facebook C# SDK these libraries evolved in a way that we believe made them no so easy to use.</p>
<p>Instead of trying to patch and fix these libraries once again, we decided that it was time to take a step back and reevaluate how we handle web apps with the Facebook C# SDK. As such, we have decided that going forward we will be removing the Facebook.Web and Facebook.Web.Mvc libraries from the SDK. This change will happen in the 6.0 release and will not effect developers still using the 5.0 release. I will discuss our version plans later in this post in more detail.</p>
<p>So with the removal of the Facebook.Web and Facebook.Web.Mvc libraries you are probably wondering how will you develop Facebook Apps using ASP.NET WebForms and MVC. First, we are moving some of the more critical parts of the Facebook.Web and Facebook.Web.Mvc libraries into the core Facebook.dll. Second, we are going to be providing much higher quality samples for ASP.NET WebForms and MVC developers. Last, we intend to ship various NuGet packages that contain smaller parts of the Facebook  web libraries.</p>
<p>We believe the approach of having only a single Facebook.dll library will greatly simplify the  process of getting started developing your app. It will reduce the API surface and thus reduce the complexity. Additionally, we have found that developers often tweak the code in the web libraries to fit their application. For this reason we believe that shipping the web code as samples, simple NuGet packages, and general guidance will better allow developers to integrate and understand Facebook development in ASP.NET.</p>
<p>Now, we do understand this change may be difficult for some people. Many apps have already been built with the Facebook C# SDK and breaking changes can be tough. We have always tried to avoid breaking changes and generally have done so except in the case where Facebook introduced breaking changes. To this end we will keep updating Version 5.X of the Facebook C# SDK. We won&#8217;t be adding new feature to version 5, but we will ensure that it keeps working for you in the foreseeable future. You can find the code for version 5.x on github in a branch called &#8216;v5&#8242;. You can see that branch here: <a href="https://github.com/facebook-csharp-sdk/facebook-csharp-sdk/tree/v5">https://github.com/facebook-csharp-sdk/facebook-csharp-sdk/tree/v5</a>.</p>
<h1>Version 6.0</h1>
<p>As mentioned earlier, we are starting work on version 6.0 of the Facebook C# SDK. Today, Prabir released Version 6.0 Alpha. This is a preview of where we are heading with the SDK. The overall goal of Version 6.0 is simplicity. We are reducing the API surface, improving the documentation, and building out better samples to make it even easier to build a Facebook app for .Net or any flavor of Windows.</p>
<p>Prabir has written an <a href="http://blog.prabir.me/post/Facebook-CSharp-SDK-Glimpse-into-the-Future.aspx">excellent post</a> that goes into more detail about the technical changes to version 6.0, but below are a few highlights.</p>
<ul>
<li>You can now use anonymous objects as parameters. Before you had to either create a Dictionary or ExpandoObject.</li>
<li>GZip/Deflate has been enabled for desktop client profiles.</li>
<li>We have introduced FacebookMediaStream to replace FacebookMediaObject. You can now work with this object like a normal stream rather than converting back and forth to a byte array.</li>
<li>You can now optimize your request to the graph with ETags.</li>
</ul>
<p>Version 6.0 is an exciting step forward for Facebook developers on the Microsoft stack. We hope version 6.0 will greatly simplify your experience and help you create great Facebook apps. As I mentioned, the currently release is only an alpha release so we look forward to your feedback.</p>
<h1>Documentation</h1>
<p>Documentation has always been one of the biggest complaints for our developers. Admittedly, we have not always been able to keep our documents up to date to the SDK. We are hoping to correct this problem moving forward. With Prabir taking over in the last months as the lead developer on the Facebook C# SDK this has left me free to focus on other areas. Moving forward my contributions to the Facebook C# SDK will be primarily on writing documentation, tutorials, and building samples. My hope is that we can get even more developers using the Facebook C# SDK to build great Facebook apps.</p>
<p>When moving to Github we evaluated the various options for documentation. We thought about using the Github wiki, but in the end it felt a bit too constrained. Additionally, we are starting to split the code of the Facebook C# SDK into a variety of Github repositories. However, we didn&#8217;t want to also split up the documentation. We thought there should be a high quality, customizable, and centralized space for documentation. We decided that Github pages would work nicely for our needs. Many other projects use Github pages to build out rich and high quality documentation. You can see our early efforts at <a href="http://docs.csharpsdk.org">http://docs.csharpsdk.org</a>. This is just an early start, but in the coming weeks expect to see this resource grow to provide lots of great content.</p>
<p><a href="http://docs.csharpsdk.org"><img class="alignleft size-full wp-image-1119" title="docspage" src="http://nathantotten.files.wordpress.com/2012/02/docspage.png?w=584&#038;h=441" alt="" width="584" height="441" /></a></p>
<h1>Issues and Discussions</h1>
<p>One thing you will notice on Github is that there is no discussions area. The old Codeplex project had a discussions area where many people asked questions and provided feedback. While we know that many of you liked that model we always have tried to discourage using Codeplex for discussions because of the problems associated with threaded conversations. First, information was quickly outdated. Often times you could find a discussion in a search that would seem like it solved your problem, but the answer would be outdated. Additionally, there is no way of noting which answer is the correct answer. You had to read the entire conversation to figure out the solution (if there was even one). For these reasons we have all come to know and love StackOverflow.</p>
<p>Recently, Facebook showed some love for StackOverflow and moved their developer forums to http://facebook.stackoverflow.com. We have decided to do the same. Going forward we will not offer a discussion area outside of Stackoverflow. We believe this will help keep questions and answered organized, relevant, and make it easier for developers to find the answers they are looking for. We will continue to monitor and answer questions on StackOverflow.</p>
<p>The one issue StackOverflow does not solve is bugs. The old Codeplex discussions were often the first place a bug was reported. This made it really difficult for us to keep track of these bugs. Going forward, we are going to be using Github issues for all bugs. If you find a bug or even think you have a bug file an issue. Users can then comment on issues, track issues, and we can tag issues, and mark them as fixed as appropriate. This will make our jobs easier and help ensure that your bug/issue gets fixed as soon as possible.</p>
<p>Also, issues are not just for bugs. Please add feature requests, documentation request/issues, sample requests/issues to the project issues as well. Don&#8217;t worry that your issues maybe isn&#8217;t really a bug or that your request might seem too specific. We love the feedback and want your help to improve the SDK.</p>
<h1>Utility Libraries</h1>
<p>As we built out the Facebook C# SDK we also created several utility libraries as well. The first of these libraries is <a href="https://github.com/facebook-csharp-sdk/simple-json">SimpleJson </a>which is a very robust yet very simple JSON serializer. Next is HttpHelper which simplifies making HTTP requests from various .Net/Windows platforms. <a href="https://github.com/facebook-csharp-sdk/ReflectionUtils">ReflectionUtils </a>which is a simple set of tools for performing reflection. Finally, there is <a href="https://github.com/facebook-csharp-sdk/CombinationStream">CombinationStream </a>which allows you to represent multiple streams as a single stream. We have moved these projects to repositories under the facebook-csharp-sdk organization on Github. Feel free to use these in your libraries or applications as well.</p>
<h1>Community Contributions</h1>
<p>Please fork our repositories. If you aren&#8217;t familiar with Github there are some awesome <a href="http://help.github.com/">documents </a>on their website. Additionally, Tekpub has a great video on getting started with Git <a href="http://tekpub.com/productions/git">here</a>. The video costs $15, but if you like learning through videos it is definitely worth it.</p>
<p>If you want to submit a patch, please send us a pull request. We would love help with bug fixes, documentation, samples, or anything else. With github these sort of contributions are really easy to manage so please feel free to jump in and help out.</p>
<h1>Wrapping Up</h1>
<p>This post ended up being a lot longer than I had planned, but I hope you are excited about where the Facebook C# SDK is heading. There were a lot of big announcements today and we have a few more exciting announcements in the next few weeks. As always, please feel free to leave feedback. We would love to hear from you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1111&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/02/07/facebook-c-sdk-road-map/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/02/octocat.png?w=150" medium="image">
			<media:title type="html">octocat</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/02/docspage.png" medium="image">
			<media:title type="html">docspage</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.2.2 Released</title>
		<link>http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/</link>
		<comments>http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 22:19:59 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://nathantotten.wordpress.com/?p=1093</guid>
		<description><![CDATA[Today, I released version 1.2.2 of the Windows Azure Toolkit for Social Games. You can download the self-extracting package here. This version does not add any new features compared to the last (Version 1.2.0 &#8211; Beta), but this release is &#8230; <a href="http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1093&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, I released version 1.2.2 of the <a href="https://github.com/WindowsAzure-Toolkits/wa-toolkit-games">Windows Azure Toolkit for Social Games</a>. You can download the self-extracting package <a href="https://github.com/downloads/WindowsAzure-Toolkits/wa-toolkit-games/WATGames-v1.2.2.exe">here</a>. This version does not add any new features compared to the last (Version 1.2.0 &#8211; Beta), but this release is considered stable. We added a number of performance enhancements as well as optimized the setup of the Autofac dependency injection. The big news with this release is that we have moved the project to <a href="https://github.com/WindowsAzure-Toolkits/wa-toolkit-games">Github</a>.</p>
<p>For those who haven&#8217;t downloaded or used the social gaming toolkit yet I would encourage you to check it out. There are a lot of common patterns and tons of reusable code in the toolkit that applies for many scenarios besides the gaming space. With more and more applications relying on real-time communication, sharing, and feedback the mechanisms that are used in games can be applied to many kinds of software.</p>
<h2>Github</h2>
<p>Since we started this project Github has become an increasingly popular place to host the open source projects. Additionally, the <a href="https://github.com/WindowsAzure">Windows Azure SDKs</a> are now open sourced and available on Github. We have seen a great deal of support from the community in this move and believe that Github is the right place to host this toolkit. Our hope is that with the amazing support Github offers for social coding such as forking, pull requests, etc. more users will be able to utilize and contribute to this project.</p>
<p>For those of you that have not used git or Github before I highly recommend watching the <a href="http://tekpub.com/productions/git">Mastering Git video</a> on <a href="http://tekpub.com">Tekpub</a>. It costs $15, but it is worth it if you like learning though videos. If you like learning by doing and reading the instructions Github has a great set of help documentation on there <a href="http://help.github.com/">site</a>.</p>
<h2>Cloning a Repository</h2>
<p>Rather than simply downloading the zip or self-extracting package of the Social Gaming Toolkit, you may want to clone the repository. Doing this will make it easier to pull in changes when we release future updates. It also allows you to make local changes to the toolkit and still update code that changes in future versions without loosing all your work.</p>
<p>In order to clone a repository first you must have git installed on your computer. You can download git <a href="http://git-scm.com/">here</a>. After you have git installed simply open the command prompt and clone the repository using the following command.</p>
<pre>git clone git@github.com:WindowsAzure-Toolkits/wa-toolkit-games.git</pre>
<h2>Forking a Project</h2>
<p>One of the best features of Github is that you can easily <a href="http://help.github.com/fork-a-repo/">fork projects</a> and make your own edits. If you use this toolkit and want to keep your own version simply create a fork and make your edits. Additionally, if you make a change that you think everyone would benefit from simply<a href="http://help.github.com/send-pull-requests/"> send a pull request</a> and request that we add your change to our fork.</p>
<p>Forking a repository is easy. Simply click the fork button and select where you want the fork to live.</p>
<p><img class="alignnone size-full wp-image-1102" title="forks" src="http://nathantotten.files.wordpress.com/2012/01/forks.png?w=584&#038;h=236" alt="" width="584" height="236" /></p>
<p>After you have forked the project, you can push changed to your own repository. If you have a change that you want to be added to the original repository all you have to do is send a pull request.</p>
<p><img class="alignnone size-full wp-image-1103" title="pullrequest" src="http://nathantotten.files.wordpress.com/2012/01/pullrequest.png?w=584" alt=""   /></p>
<p>If your pull request is accepted, your changes will be added to the original repository for everybody to use. Feel free to add features or fix any bugs you find and send us a pull request.</p>
<p>As always, feel free to leave comments, feedback, or suggestions. I would love to hear how you are using the toolkit and what you think about using Github.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1093/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1093/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1093/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1093&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/01/26/windows-azure-toolkit-for-social-games-version-1-2-2-released/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:thumbnail url="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play.png?w=150" />
		<media:content url="http://nathantotten.files.wordpress.com/2011/11/tankster-game-play.png?w=150" medium="image">
			<media:title type="html">tankster-game-play.png</media:title>
		</media:content>

		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/01/forks.png" medium="image">
			<media:title type="html">forks</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2012/01/pullrequest.png" medium="image">
			<media:title type="html">pullrequest</media:title>
		</media:content>
	</item>
		<item>
		<title>Unlocking files that are in use.</title>
		<link>http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/</link>
		<comments>http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 06:09:25 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/</guid>
		<description><![CDATA[<p><a href="http://www.microsoftnow.com/2008/10/unlocking-files-that-are-in-use.html" title="Unlocking files that are in use.">Unlocking files that are in use.</a></p>
This is more of a note to myself, but I thought other may find it useful. You can use the Process Explorer tool that is part of SysInternals to figure out which program is holding the lock on your file and kill it. Very handy. <a href="http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1080&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoftnow.com/2008/10/unlocking-files-that-are-in-use.html" title="Unlocking files that are in use.">Unlocking files that are in use.</a></p>
<p>This is more of a note to myself, but I thought others may find it useful. You can use the Process Explorer tool that is part of SysInternals to figure out which program is holding the lock on your file and kill it. Very handy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1080/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1080/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1080/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1080&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2012/01/18/unlocking-files-that-are-in-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.2.0 (beta) Released</title>
		<link>http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/</link>
		<comments>http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 19:46:42 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://ntotten.com/?p=1010</guid>
		<description><![CDATA[Today, I released version 1.2.0 (beta) of the Windows Azure Toolkit for Social Games. You can download the self-extracting exe here or get the source directly here. This release is primarily a maintenance release that includes bug fixes and enhancements &#8230; <a href="http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1010&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, I released version 1.2.0 (beta) of the <a href="http://go.microsoft.com/fwlink/?LinkID=234210">Windows Azure Toolkit for Social Games</a>. You can download the self-extracting exe <a href="http://go.microsoft.com/fwlink/?LinkID=234062">here</a> or get the source directly <a href="http://go.microsoft.com/fwlink/?LinkID=234213">here</a>. This release is primarily a maintenance release that includes bug fixes and enhancements to the code base. There aren’t any additional features in the release, but you should notice improved performance and stability. This is a ‘point’ release because there are a few breaking changes with the APIs that were made&nbsp;to clean up the overall code base.</p>
<p>This release is&nbsp;a ‘beta’ release because it did not go through our full QA process, but all the tests pass and it should be stable. I will be releasing a stable version of the 1.2.x branch shortly that has undergone the full QA tests to ensure the quality is up to par.</p>
<p>The biggest changes&nbsp;in this release is that we are now using dependency injection throughout the solution. The toolkit uses the great <a href="http://code.google.com/p/autofac/">Autofac</a> library for injection, but you could easily swap out another library if you prefer.</p>
<p>Below you will see how we setup MVC3 and the WCF Web APIs to use Autofac for DI.</p>
<p><pre class="brush: csharp;">// Setup AutoFac
var builder = new ContainerBuilder();
DependancySetup(builder);
var container = builder.Build();

DependencyResolver.SetResolver(
new AutofacDependencyResolver(container));

// Setup WCF Web API Config
var config = new WebApiConfiguration();
config.EnableTestClient = true;
config.CreateInstance = ((t, i, h) =&gt;
DependencyResolver.Current.GetService(t));
RouteTable.Routes.SetDefaultHttpConfiguration(config);</pre></p>
<p>Additionally, we updated all the Nuget packages to their most recent versions. This includes the <a href="http://wcf.codeplex.com">WCF Web APIs</a> to Preview 6 and jQuery to version 1.7.1. Finally, we fixed a few bugs. There was a memory leak that some people were seeing in the worker role that should be fixed.</p>
<p><a href="http://go.microsoft.com/fwlink/?LinkID=234062">Download</a> and deploy the toolkit to Windows Azure today. Let me know if you have any feedback, questions, or if you find any bugs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1010/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1010/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1010/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1010&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/12/07/windows-azure-toolkit-for-social-games-version-1-2-0-beta-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Azure Toolkit for Social Games Version 1.1.1</title>
		<link>http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/</link>
		<comments>http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 21:38:54 +0000</pubDate>
		<dc:creator>Nathan Totten</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Social Gaming Toolkit]]></category>

		<guid isPermaLink="false">http://ntotten.com/?p=1000</guid>
		<description><![CDATA[I just released a minor update to the Windows Azure Toolkit for Social Games Version 1.1. You can download this release here. This release updates the toolkit to use Windows Azure Tools and SDK Version 1.6. Additionally, this release includes a &#8230; <a href="http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1000&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just released a minor update to the <a href="http://go.microsoft.com/fwlink/?LinkID=234210">Windows Azure Toolkit for Social Games</a> Version 1.1. You can download this release <a href="http://go.microsoft.com/fwlink/?LinkID=234062">here</a>. This release updates the toolkit to use <a href="http://blogs.msdn.com/b/windowsazure/archive/2011/11/14/updated-windows-azure-sdk-amp-windows-azure-hpc-scheduler-sdk.aspx">Windows Azure Tools and SDK Version 1.6</a>. Additionally, this release includes a few minor, but significant, performance enhancements.</p>
<p><a href="http://blogs.msdn.com/b/benjguin/">Benjamin Guinebertière</a> discovered the performance issues and was kind enough to share the results. Benjamin noticed that the response time between when the server gets a request to the time when the response begins was about 4 seconds. You can see this below by measuring the difference between “ServerGotRequest” and “ServerBeginResponse”.</p>
<pre>Request Count:  1
Bytes Sent:     3 011	(headers:2938; body:73)
Bytes Received: 228	(headers:225; body:3)

ACTUAL PERFORMANCE
--------------
ClientConnected:    	16:33:24.848
ClientBeginRequest: 	16:33:45.247
ClientDoneRequest:   	16:33:45.247
Determine Gateway:  	0ms
DNS Lookup:           	0ms
TCP/IP Connect:      	1ms
HTTPS Handshake: 	0ms
ServerConnected:   	16:33:45.249
FiddlerBeginRequest:  	16:33:45.249
ServerGotRequest: 	16:33:45.249
ServerBeginResponse: 	16:33:49.973
ServerDoneResponse: 	16:33:49.973
ClientBeginResponse: 	16:33:49.973
ClientDoneResponse:   	16:33:49.973

Overall Elapsed:     	00:00:04.7260980

RESPONSE CODES
--------------
HTTP/200:		1

RESPONSE BYTES (by Content-Type)
--------------
       ~headers~:	225
application/json:	3</pre>
<p>Benjamin setup and ran some tests to investigate the bottleneck. You can see how he added the traces below.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://nathantotten.files.wordpress.com/2011/11/image_thumb.png?w=525&#038;h=665" alt="image" width="525" height="665" border="0" /></a></p>
<p>The results of this trace are show below. Notice that the action takes less than half a second to run. This meant that there was something outside of the action that was causing the problem.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://nathantotten.files.wordpress.com/2011/11/image_thumb1.png?w=648&#038;h=51" alt="image" width="648" height="51" border="0" /></a></p>
<p>After some investigation we discovered that we were calling the <code>EnsureExists()</code> method on every request in the game service. This was a mistake on our part and definitely not a best practice. You can see how the <code>EnsureExists()</code> method is called every time the repository is instantiated.</p>
<p><pre class="brush: csharp;">
public GameRepository(
    IAzureBlobContainer gameContainer,
    IAzureBlobContainer gameQueueContainer,
    IAzureQueue skirmishGameMessageQueue,
    IAzureQueue leaveGameMessageQueue,
    IAzureBlobContainer userContainer,
    IAzureQueue inviteQueue)
{
    this.skirmishGameQueue = skirmishGameMessageQueue;
    this.leaveGameQueue = leaveGameMessageQueue;

    this.gameContainer = gameContainer;
    this.gameContainer.EnsureExist(true);

    this.gameQueueContainer = gameQueueContainer;
    this.gameQueueContainer.EnsureExist(true);

    this.userContainer = userContainer;
    this.userContainer.EnsureExist(true);

    this.inviteQueue = inviteQueue;
    this.inviteQueue.EnsureExist();
}
</pre></p>
<p>To fix this issue we created an <code>EnsureExists()</code> method on the GameRepository and moved all the queue and storage initialization methods there.</p>
<p><pre class="brush: csharp;">
public void EnsureExist()
{
    this.gameContainer.EnsureExist(true);
    this.gameQueueContainer.EnsureExist(true);
    this.userContainer.EnsureExist(true);
    this.inviteQueue.EnsureExist();
    this.skirmishGameQueue.EnsureExist();
    this.leaveGameQueue.EnsureExist();
}
</pre></p>
<p>Next, we call this new method only once in our Global.asax Application_Startup. You can see that below.</p>
<p><pre class="brush: csharp;">
protected void Application_Start()
{
    CloudStorageAccount.SetConfigurationSettingPublisher(
       (configName, configSetter) =&gt;
    {
        string configuration = RoleEnvironment.IsAvailable ?
            RoleEnvironment
                 .GetConfigurationSettingValue(configName) :
            ConfigurationManager.AppSettings[configName];

        configSetter(configuration);
    });

    AreaRegistration.RegisterAllAreas();

    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);

    FederatedAuthentication.ServiceConfigurationCreated +=
        this.OnServiceConfigurationCreated;

    // initialize blob and queue resources
    new GameRepository().EnsureExist();
    new UserRepository().EnsureExist();
}
</pre></p>
<p>After these changes the time for a request went down to less than 2 seconds. You can see the request and response times below.</p>
<p><a href="http://nathantotten.files.wordpress.com/2011/11/clip_image0028.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="clip_image002[8]" src="http://nathantotten.files.wordpress.com/2011/11/clip_image0028_thumb.jpg?w=342&#038;h=308" alt="clip_image002[8]" width="342" height="308" border="0" /></a></p>
<p>This is a good improvement, but there are still several more changes like this we can do. I hope to release a new version in the next week or so that improves performance even more. Until then, give the updated version a try and let me know if you have any feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nathantotten.wordpress.com/1000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nathantotten.wordpress.com/1000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nathantotten.wordpress.com/1000/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.ntotten.com&amp;blog=30834763&amp;post=1000&amp;subd=nathantotten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.ntotten.com/2011/11/18/windows-azure-toolkit-for-social-games-version-1-1-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d48b998c2dce49ca309710eba498c562?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ntotten</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://nathantotten.files.wordpress.com/2011/11/clip_image0028_thumb.jpg" medium="image">
			<media:title type="html">clip_image002[8]</media:title>
		</media:content>
	</item>
	</channel>
</rss>
