<?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>gaskell.org</title>
	<atom:link href="http://gaskell.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://gaskell.org</link>
	<description>picking up where teh rest leave off</description>
	<lastBuildDate>Tue, 07 Jun 2011 16:38:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Unobtrusive deleting with Rails and jQuery</title>
		<link>http://gaskell.org/unobtrusive-deleting-with-rails-and-jquery/</link>
		<comments>http://gaskell.org/unobtrusive-deleting-with-rails-and-jquery/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 07:33:18 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=194</guid>
		<description><![CDATA[I&#8217;m going to cover creating a sample Rails application, taking a look at how destroy works by default and how we can improve accessibility by writing unobtrusive JavaScript using the jQuery library. First let&#8217;s create a new Rails application. We&#8217;ll call it ajaxstore. Now let&#8217;s create some scaffolding and take a look at how it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to cover creating a sample Rails application, taking a look at how destroy works by default and how we can improve accessibility by writing unobtrusive JavaScript using the jQuery library.</p>
<p>First let&#8217;s create a new Rails application. We&#8217;ll call it ajaxstore.</p>
<p><script src="http://gist.github.com/234977.js"></script></p>
<p>Now let&#8217;s create some scaffolding and take a look at how it works.</p>
<p><script src="http://gist.github.com/234978.js"></script></p>
<p>Launch your favorite toob surfer to <a href="http://localhost:3000/products">http://localhost:3000/products</a> and create a few products to use. Back at the <a href="http://localhost:3000/products">products list</a> let&#8217;s take a look at the Destroy links. From a user&#8217;s perspective if you have JavaScript enabled you&#8217;ll get a confirmation dialog. If the user has JavaScript disabled he will be brought to the show action, and probably feel a little lost. From a developer standpoint there&#8217;s a lot of unnecessary repeated JavaScript on the Destroy links. Let&#8217;s get this fixed.</p>
<p>Let&#8217;s remove the default JavaScript that Rails adds to our project since we&#8217;re going to use jQuery.</p>
<p><script src="http://gist.github.com/234979.js"></script></p>
<p>Now let&#8217;s download jQuery. </p>
<p><script src="http://gist.github.com/234980.js"></script></p>
<p>Open up routes.rb &#8211; we need to add an option to the products resource route. I&#8217;m using delete as my option. You could overload destroy but in my opinion that makes the destroy action less cohesive.</p>
<p><script src="http://gist.github.com/234983.js"></script></p>
<p>We now need to add a view for our new action. Create a new file named &#8216;delete.html.erb&#8217; in your product views directory. We&#8217;ll keep it fairly simple, and ask the user to confirm the destroy.</p>
<p><script src="http://gist.github.com/235046.js"></script></p>
<p>At this point we need to do some refactoring. Open up the Products controller and look at all the places we’re calling Product.find(params[:id]). We’re going to refactor that into a <a href="http://api.rubyonrails.org/classes/ActionController/Filters/ClassMethods.html">before filter</a> and simplify the controller a bit. Here’s the entire controller.</p>
<p><script src="http://gist.github.com/235051.js"></script></p>
<p>Here we removed the edit and show actions, removed the first line from the update and destroy actions, created a method to load the product, and finally setup the filter. Now lets change how we generate our destroy links in the index and show views. First open up the Product index view and change the destroy link (should be around line 15) to this.</p>
<p><script src="http://gist.github.com/235052.js"></script></p>
<p>We&#8217;ll use the delete class in our JavaScript to handle delete clicks. For the show view, just remove the destroy link altogether. Browse to <a href="http://localhost:3000/products">http://localhost:3000/products</a> and create a product if need be, and now if you click on the &#8220;Delete&#8221; link we are brought to our delete view and our non-JavaScripting friends want to give us high fives. For the rest of our users, navigating to a new page is a bit much for deleting a product. Open up the layout file and add this under the stylesheet_link_tag.</p>
<p><script src="http://gist.github.com/235055.js"></script></p>
<p>We&#8217;re creating a AUTH_TOKEN variable so that when we make a POST, PUT or DELETE via ajax we can pass along the <a href="http://guides.rubyonrails.org/security.html#csrf-countermeasures">authentication token</a>. Let’s add some jQuery code to application.js to handle deletions. This JavaScript has been pulled from a larger application so some parts of are maybe a little too industrial strength for a blog post, but I’m going to focus on the Rails side and less on the jQuery. If there’s enough demand to go into details on the jQuery we’ll talk more about it &#8211; the main points are the ajaxSend handler and the a.delete click handler.</p>
<p><script src="http://gist.github.com/235056.js"></script></p>
<p>We also need to make some changes to our CSS file – here are the styles we need to add.</p>
<p><script src="http://gist.github.com/235061.js"></script></p>
<p>Let’s get Rails setup to do some ajax&#8217;n. There are a couple changes you need to make to every application. Add these lines under the protect_from_forgery line in your application controller.</p>
<p><script src="http://gist.github.com/235065.js"></script></p>
<p>And under those lines add the corresponding methods:</p>
<p><script src="http://gist.github.com/235067.js"></script></p>
<p>The set_xhr_flash method removes the flash if the current request is an ajax request. If we don&#8217;t clear the flash on an ajax request the next time the user makes a full http request the user will see the flash message. The other method is for safari and IE browsers – we&#8217;re correcting some headers for ajax requests. One last change to our destroy action in our Products controller and we’re good to go.</p>
<p><script src="http://gist.github.com/235070.js"></script></p>
<p>Start up your browser and server if need be. We are now fully web 2.0. JavaScripters and NonJavaScripters can use our app equally and that makes us totally rad web folks. You can <a href="http://github.com/agaskell/ajaxstore/">download the full project over at github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/unobtrusive-deleting-with-rails-and-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Determining if a checkbox is checked with jQuery</title>
		<link>http://gaskell.org/determining-if-a-checkbox-is-checked-with-jquery/</link>
		<comments>http://gaskell.org/determining-if-a-checkbox-is-checked-with-jquery/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 23:07:32 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=148</guid>
		<description><![CDATA[This one comes up quite often on the Stack Overflow, so I&#8217;ll give my shot at answering. If you have a single checkbox that you&#8217;d like to check I like this style: if($('#your_checkbox_id').is(':checked')) { alert('checked!'); } else { alert('not checked!'); } Here&#8217;s another way of determining of a checkbox is checked: if($('#your_checkbox_id:checked').length) { alert('checked!'); } [...]]]></description>
			<content:encoded><![CDATA[<p>This one comes up quite often on the <a href="http://stackoverflow.com/search?q=jquery+checkbox">Stack Overflow</a>, so I&#8217;ll give my shot at answering.</p>
<p>If you have a single checkbox that you&#8217;d like to check I like this style:</p>
<pre>
<code>    if($('#your_checkbox_id').is(':checked')) {
      alert('checked!');
    } else {
      alert('not checked!');
    }</code>
</pre>
<p>Here&#8217;s another way of determining of a checkbox is checked:</p>
<pre>
<code>    if($('#your_checkbox_id:checked').length) {
      alert('checked!');
    } else {
      alert('not checked!');
    }</code>
</pre>
<p>Here&#8217;s more jQuery checkbox selector goodness.</p>
<p>This selector will get all of the checkboxes (checked or unchecked) in the DOM:</p>
<pre>
<code>    $(':checkbox');</code>
</pre>
<p>All of the checked checkboxes:</p>
<pre>
<code>    $(':checkbox:checked');</code>
</pre>
<p>All of the unchecked checkboxes:</p>
<pre>
<code>    $(':checkbox').not(':checked');</code>
</pre>
<p>Here&#8217;s all of the checkboxes within a form:</p>
<pre>
<code>    $('form :checkbox');</code>
</pre>
<p>How to check all checkboxes:</p>
<pre>
<code>    $(':checkbox').attr('checked', 'checked');</code>
</pre>
<p>Unchecking all checkboxes:</p>
<pre>
<code>    $(':checkbox').removeAttr('checked');</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/determining-if-a-checkbox-is-checked-with-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery plugins and the importance of learning JavaScript basics</title>
		<link>http://gaskell.org/jquery-plugins-and-the-importance-of-learning-javascript-basics/</link>
		<comments>http://gaskell.org/jquery-plugins-and-the-importance-of-learning-javascript-basics/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 01:15:18 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=126</guid>
		<description><![CDATA[With jQuery increasing in popularity choosing to use jQuery in your application is probably a smart move. However if you&#8217;re new to jQuery and more importantly new to JavaScript you need to learn the basics. jQuery makes writing plugins ridiculously easy and even easier to search for. Before you run off to the googs in [...]]]></description>
			<content:encoded><![CDATA[<p>With jQuery <a href="http://www.google.com/trends?q=jquery%2C+Prototype+Javascript%2C+mootools%2C+dojo&#038;ctab=0&#038;geo=all&#038;date=ytd&#038;sort=0">increasing in popularity</a> choosing to use jQuery in your application is probably a smart move. However if you&#8217;re new to jQuery and more importantly new to JavaScript you need to learn the basics. jQuery makes writing plugins ridiculously easy and even easier to <a href="http://www.google.com/#hl=en&#038;q=jquery+plugin+sum">search for</a>.  Before you run off to the googs in search of a plugin to add numbers together, take the time to learn the very basics of JavaScript. </p>
<p><img src="http://gaskell.org/wp-content/uploads/2009/08/little_one.jpg" alt="Little One is disappointed in your lack of JavaScript basics!" title="Little One is disappointed in your lack of JavaScript basics!" width="270" height="360" class="size-full wp-image-129" style="float:left;margin-right:10px;" /></p>
<p>Following the <a href="http://www.w3schools.com/jsref/default.asp">w3schools tutorial</a> and glancing over the <a href="http://www.w3schools.com/JS/default.asp">reference</a> of built in functions is going to help a lot when starting out with jQuery. With a solid foundation of JavaScript the next thing to learn is how <a href="http://docs.jquery.com/Selectors">selectors</a> work. Armed with JavaScript and selector knowledge most problems you come across probably will not need plugins. Plugins do have their place &#8211; if your application is Form intensive, by all means use the <a href="http://malsup.com/jquery/form/">Forms plugin</a> &#8211; just don&#8217;t have your entire client side experience be a bunch of plugins kludged together.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/jquery-plugins-and-the-importance-of-learning-javascript-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>undefined method &#8216;guard_condition&#8217; when using subdomain_fu on Rails 2.2</title>
		<link>http://gaskell.org/undefined-method-guard_condition-when-using-subdomain_fu-on-rails-22/</link>
		<comments>http://gaskell.org/undefined-method-guard_condition-when-using-subdomain_fu-on-rails-22/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 05:06:40 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[subdomain_fu]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=110</guid>
		<description><![CDATA[While working with subdomain_fu I was having some issues with routes and it was suggested in the railscasts comments that installing from the plugin was different than the gem. keyJ says: I found that I makes a difference whether you install it as a plugin (from github) or a gem. With the gem I could [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://gaskell.org/wp-content/uploads/2008/12/charlie.jpg" alt="frank and charlie" title="frank and charlie" width="220" height="300" style="margin: 1em 2em; float: left;" />While working with <a href="http://github.com/mbleigh/subdomain-fu/tree/master">subdomain_fu</a> I was having some issues with routes and it was suggested in the <a href="http://railscasts.com/episodes/123-subdomains">railscasts comments</a> that installing from the plugin was different than the gem.</p>
<p><a href="http://blog.keyj.de/">keyJ</a> says:</p>
<blockquote><p>
I found that I makes a difference whether you install it as a plugin (from github) or a gem. With the gem I could not get the route to accept the :subdomain-condition correctly. But then I installed the plugin with ./script/plugin install&#8230;<br />
and all of a sudden it worked fine.
</p></blockquote>
<p style="clear:both">
This got me a step closer. When I restarted Apache I got this error message: <br /><code>undefined method `guard_condition' for class `ActionController::Routing::Optimisation::PositionalArgumentsWithAdditionalParams'</code>
</p>
<p>I eventually figured out that <a href="http://www.portallabs.com/blog/2008/10/22/fixing-subdomain_fu-with-named-routes/">this code</a> was added a couple months ago &#8211; I removed the code referenced in the blog post and now my routing issues are resolved.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/undefined-method-guard_condition-when-using-subdomain_fu-on-rails-22/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rails helper distance_of_time_in_words ported to C#</title>
		<link>http://gaskell.org/rails-helper-distance_of_time_in_words-ported-to-c/</link>
		<comments>http://gaskell.org/rails-helper-distance_of_time_in_words-ported-to-c/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 06:31:10 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[asp.net MVC]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=85</guid>
		<description><![CDATA[While learning rails I came across a very cool helper method called distance_of_time_in_words. You&#8217;ve probably seen this method in action if you&#8217;ve used Twitter &#8211; no guessing about time zones and as a user I think it&#8217;s a nice touch. So on to the port itself&#8230; The Good C# is automatically faster because everyone knows [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float:right;margin: 1em 2em;" src="/upload/kabouter-can-scale.jpg" alt="kabouter can scale." title="kabouter can scale." />While learning rails I came across a very cool helper method called <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001712">distance_of_time_in_words</a>. You&#8217;ve probably seen this method in action if you&#8217;ve used Twitter &#8211; no guessing about time zones and as a user I think it&#8217;s a nice touch. So on to the port itself&#8230;</p>
<p><strong>The Good</strong><br />
C# is automatically faster because everyone knows Ruby is slow and that <a href="http://canrailsscale.com">rails can&#8217;t scale</a>.<br />
Seriously though, the port to C# uses resource files so internationalization is handled by simply adding a translated resource file to your project. </p>
<p><strong>The Bad</strong><br />
C# doesn&#8217;t have the concept of static extension methods. To me DateTime.DistanceOfTimeInWords would be much nicer than DateHelper.DistanceOfTimeInWords.<br />
Range support in the language is hokey at best. No ranges in switch statements. bleh.</p>
<p><strong>The Ugly</strong><br />
The code! If you compare the C# version to the Ruby version it&#8217;s a little ahhhhhhhhhhh&#8230; inelegant? The Ruby version weighs in at 28 lines of <em>readable</em> code. The C# version is a b-e-a-s-t with 55 lines of code including 2 helper methods. I&#8217;m open to any suggestions in making the C# code shorter or more readable.</p>
<p><strong>The Rest</strong><br />
The method <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001713">time_ago_in_words</a> has also been ported. Altogether the helper code is 74 lines &#8211; also included is over 250 lines of test code. All examples listed on the Rails page were also included in the test.</p>
<p>You can grab the code <a href="http://gaskell.org/upload/Helpers.zip">here</a> or at the subversion repository <a href="http://svn.gaskell.org/helpers">http://svn.gaskell.org/helpers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/rails-helper-distance_of_time_in_words-ported-to-c/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bulletproof Ajax with ASP.NET MVC (this time with jQuery)</title>
		<link>http://gaskell.org/bulletproof-ajax-with-aspnet-mvc-this-time-with-jquery/</link>
		<comments>http://gaskell.org/bulletproof-ajax-with-aspnet-mvc-this-time-with-jquery/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 22:11:11 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=81</guid>
		<description><![CDATA[As a follow up a recent post about using unobtrusive javascript and Ajax in your ASP.NET MVC applications, I ported the Bulletproof Ajax bookstore application to use jQuery instead of Hijax. This led to more terse code &#8211; lines of javascript were reduced from 178 to 41. If you&#8217;ve spent at least few hours jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow up a <a href="/bulletproof-ajax-with-aspnet-mvc/">recent post</a> about using <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript" target="_blank">unobtrusive javascript</a> and Ajax in your ASP.NET MVC applications, I ported the <a href="http://www.amazon.com/Bulletproof-Ajax-Jeremy-Keith/dp/0321472667&amp;tag=9182-20">Bulletproof Ajax</a> bookstore application to use jQuery instead of <a href="http://bulletproofajax.com/shop/javascript/hijax.js">Hijax</a>. This led to more terse code &#8211; lines of javascript were reduced from 178 to 41. If you&#8217;ve spent at least few hours jQuery then you should find that the new code is also more readable. No server side code changes were necessary.
<p>jQuery is also really easy to extend &#8211; I wrote a couple of extensions that would be usable throughout an application. Here&#8217;s the extension I wrote to produce the ubiquitous <a href="http://www.37signals.com/svn/archives/000558.php">yellow fade effect</a>: </p>
<pre class="code">(<span style="color: blue">function</span>($) {
   $.fn.yellowFade = <span style="color: blue">function</span>() {
    <span style="color: blue">return this</span>.css({backgroundColor: <span style="color: #a31515">&quot;#ffffcc&quot;</span>})
    .animate({backgroundColor: <span style="color: #a31515">&quot;#ffffff&quot;</span>}, 1500, <span style="color: #a31515">&quot;linear&quot;</span>);
   }
 })(jQuery);</pre>
<p>Calling this method flows with the rest of jQuery style chaining of methods:</p>
<pre class="code"><span style="color: blue">function</span>(data) { $(<span style="color: #a31515">&quot;div#basket&quot;</span>).html(data).yellowFade(); });</pre>
<p>This one liner is a callback from our http post to the /Cart/AddProduct. The data parameter contains the response from the server. $(<span style="color: #a31515">&quot;div#basket&quot;</span>) is getting the container div from our shopping cart. Then we replace the html within the shopping cart div with the response from the server and follow it up with a yellow fade to provide user feedback.</p>
<p>Code is downloadable <a href="http://gaskell.org/upload/jShop.zip" target="_blank">here</a>. The <a href="http://jshop.gaskell.org" target="_blank">demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/bulletproof-ajax-with-aspnet-mvc-this-time-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft&#8217;s Ajax Support for ASP.NET MVC Fails (for now)</title>
		<link>http://gaskell.org/microsofts-ajax-support-for-aspnet-mvc-fails-for-now/</link>
		<comments>http://gaskell.org/microsofts-ajax-support-for-aspnet-mvc-fails-for-now/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 04:10:22 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=73</guid>
		<description><![CDATA[But it&#8217;s not an epic fail (for now). It&#8217;s important that my sites function without javascript or Ajax support. Ajax should be used enhance usability and is not a requirement to access my content. I was checking out Hanselman&#8217;s Ajax example (the truly lazy can download the code here) and I was pretty bummed when [...]]]></description>
			<content:encoded><![CDATA[<p>But it&#8217;s not an epic fail (for now). It&#8217;s important that my sites function <em>without</em> javascript or Ajax support. Ajax should be used enhance usability and is not a requirement to access my content.</p>
<p>I was checking out <a href="http://www.hanselman.com/blog/ASPNETMVCPreview4UsingAjaxAndAjaxForm.aspx">Hanselman&#8217;s Ajax example</a> (the truly lazy can download the code <a href="/upload/MvcApplication1.zip">here</a>) and I was pretty bummed when I disabled javascript and saw this:</p>
<div style="margin:10px;">
<img src="/upload/failure-to-ajaxing.jpg" alt="failure on the ajax front" />
</div>
<p>Oops. That&#8217;s probably not what the user expected. Maybe there&#8217;s some way to get the AjaxHelper to save us but none of the 10 overloads for the ActionLink or Form methods stood out to me. Until I get around to really learning jQuery, I&#8217;ll stick with writing Ajax by hand. This allows me to request different urls based on whether or not javascript is enabled. And writing your own javascript really isn&#8217;t that hard &#8211; go grab a <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FJavaScript-Definitive-Guide-David-Flanagan%2Fdp%2F0596101996%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1217909078%26sr%3D8-1&#038;tag=9182-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">good</a><img src="http://www.assoc-amazon.com/e/ir?t=9182-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FHead-First-JavaScript%2Fdp%2F0596527748%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1217909078%26sr%3D8-3&#038;tag=9182-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">book</a><img src="http://www.assoc-amazon.com/e/ir?t=9182-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/microsofts-ajax-support-for-aspnet-mvc-fails-for-now/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bulletproof Ajax with ASP.NET MVC</title>
		<link>http://gaskell.org/bulletproof-ajax-with-aspnet-mvc/</link>
		<comments>http://gaskell.org/bulletproof-ajax-with-aspnet-mvc/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 03:26:26 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=59</guid>
		<description><![CDATA[After reading the excellent Bulletproof Ajax by Jeremy Keith, I thought porting the Bulletproof Books sample application to ASP.NET MVC would be a great first attempt at building an ASP.NET MVC application. One of the main points of Bulletproof Ajax is that Ajax should be used to enhance usability and not to make Ajax a [...]]]></description>
			<content:encoded><![CDATA[<p>After reading the excellent <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FBulletproof-Ajax-Jeremy-Keith%2Fdp%2F0321472667&#038;tag=9182-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Bulletproof Ajax</a><img src="http://www.assoc-amazon.com/e/ir?t=9182-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> by Jeremy Keith, I thought porting the Bulletproof Books sample application to ASP.NET MVC would be a great first attempt at building an ASP.NET MVC application. One of the main points of Bulletproof Ajax is that Ajax should be used to enhance usability and not to make Ajax a requirement to access your content. <a href="http://dotnet.gaskell.org">My version</a> of the <a href="http://bulletproofajax.com/shop/">Bulletproof Books Shop</a> also makes Javascript and XMLHttpRequest support optional.</p>
<div style="margin-bottom:10px;margin-top:10px">
Keeping the site accessible to most web browsers took some extra work and consideration when building the Controllers. I decided that any HomeController actions would render html for the entire page. </div>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20         \cf3 public\cf0  \cf4 ActionResult\cf0  Index()\par ??        \{\par ??            ViewData.Model = \cf4 Product\cf0 .Products;\par ??            \cf3 return\cf0  View(\cf5 "Index"\cf0 );\par ??        \}\par ??\par ??        \cf3 public\cf0  \cf4 ActionResult\cf0  AddProductToCart(\cf3 string\cf0  productID, \cf3 int\cf0  quantity)\par ??        \{\par ??            \cf4 CartController\cf0  cartController = \cf3 new\cf0  \cf4 CartController\cf0 ();\par ??            cartController.AddProduct(productID, quantity);\par ??            \cf3 return\cf0  Index();\par ??        \}\par ??\par ??        \cf3 public\cf0  \cf4 ActionResult\cf0  RateProduct(\cf3 string\cf0  productID, \cf3 string\cf0  rating)\par ??        \{\par ??            \cf4 RatingController\cf0  ratingController = \cf3 new\cf0  \cf4 RatingController\cf0 ();\par ??            ratingController.RateProduct(productID, rating);\par ??            \cf3 return\cf0  Index();\par ??        \}}<br />
--></p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;13</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">ActionResult</span> Index()</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;14</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;15</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ViewData.Model = <span style="color: #2b91af;">Product</span>.Products;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;16</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> View(<span style="color: #a31515;">&#8220;Index&#8221;</span>);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;17</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;18</span>&nbsp;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;19</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">ActionResult</span> AddProductToCart(<span style="color: blue;">string</span> productID, <span style="color: blue;">int</span> quantity)</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;20</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;21</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">CartController</span> cartController = <span style="color: blue;">new</span> <span style="color: #2b91af;">CartController</span>();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;22</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cartController.AddProduct(productID, quantity);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;23</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> Index();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;24</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;25</span>&nbsp;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;26</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">ActionResult</span> RateProduct(<span style="color: blue;">string</span> productID, <span style="color: blue;">string</span> rating)</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;27</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;28</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">RatingController</span> ratingController = <span style="color: blue;">new</span> <span style="color: #2b91af;">RatingController</span>();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;29</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ratingController.RateProduct(productID, rating);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;30</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> Index();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;31</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
<div style="margin-bottom:10px;margin-top:10px;">Controllers that refresh partial chunks of html will know how to respond to actions (add product to cart, rate a product) and render views mapped to MVC user controls. The client will make http requests to different urls based on javascript support in the browser. For example to add a product to a cart with javascript enabled, the javascript will make a post to /Cart.mvc/AddProduct and the server will response with a chunk of html. To add a product with javascript disabled the client will post to /Home.mvc/AddProductToCart and the server will respond with an entire page. The HomeController ends up forwarding the call to the appropriate controller so we&#8217;re able to avoid duplicating logic.</div>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20         \cf3 public\cf0  \cf4 ActionResult\cf0  DisplayCart()\par ??        \{\par ??            \cf4 Cart\cf0  cart = GetCart();\par ??            \cf3 return\cf0  View(\cf5 "Cart"\cf0 , cart);\par ??        \}\par ??\par ??        \cf3 public\cf0  \cf4 ActionResult\cf0  AddProduct(\cf3 string\cf0  productID, \cf3 int\cf0  quantity)\par ??        \{\par ??            \cf4 Cart\cf0  cart = GetCart();\par ??            \cf4 Product\cf0  product = \cf4 Product\cf0 .Products.Find(s =&gt; s.ID == productID);\par ??            cart.AddProduct(product, quantity);\par ??            SetCart(cart);\par ??            \cf3 return\cf0  View(\cf5 "Cart"\cf0 , cart);\par ??        \}}<br />
--></p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;28</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">ActionResult</span> DisplayCart()</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;29</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;30</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Cart</span> cart = GetCart();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;31</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> View(<span style="color: #a31515;">&#8220;Cart&#8221;</span>, cart);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;32</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;33</span>&nbsp;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;34</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: #2b91af;">ActionResult</span> AddProduct(<span style="color: blue;">string</span> productID, <span style="color: blue;">int</span> quantity)</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;35</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;36</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Cart</span> cart = GetCart();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;37</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Product</span> product = <span style="color: #2b91af;">Product</span>.Products.Find(s =&gt; s.ID == productID);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;38</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cart.AddProduct(product, quantity);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;39</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SetCart(cart);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;40</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> View(<span style="color: #a31515;">&#8220;Cart&#8221;</span>, cart);</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;41</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
<div style="margin-bottom:10px;margin-top:10px">One thing I&#8217;m not sure about is state management in ASP.NET MVC, so I&#8217;m currently storing the cart and ratings in session.</div>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20         \cf3 private\cf0  \cf4 Rating\cf0  GetRatings()\par ??        \{\par ??            \cf4 Rating\cf0  rating = System.Web.\cf4 HttpContext\cf0 .Current.Session[\cf5 "Rating"\cf0 ] \cf3 as\cf0  \cf4 Rating\cf0 ;\par ??            \cf3 if\cf0  (rating == \cf3 null\cf0 )\par ??            \{\par ??                rating = \cf3 new\cf0  \cf4 Rating\cf0 ();\par ??            \}\par ??            \cf3 return\cf0  rating;\par ??        \}\par ??\par ??        \cf3 private\cf0  \cf3 void\cf0  SetRating(\cf4 Rating\cf0  rating)\par ??        \{\par ??            System.Web.\cf4 HttpContext\cf0 .Current.Session[\cf5 "Rating"\cf0 ] = rating;\par ??        \}}<br />
--></p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;22</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: #2b91af;">Rating</span> GetRatings()</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;23</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;24</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Rating</span> rating = System.Web.<span style="color: #2b91af;">HttpContext</span>.Current.Session[<span style="color: #a31515;">"Rating"</span>] <span style="color: blue;">as</span> <span style="color: #2b91af;">Rating</span>;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;25</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (rating == <span style="color: blue;">null</span>)</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;26</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;27</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rating = <span style="color: blue;">new</span> <span style="color: #2b91af;">Rating</span>();</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;28</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;29</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> rating;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;30</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;31</span>&nbsp;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;32</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">void</span> SetRating(<span style="color: #2b91af;">Rating</span> rating)</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;33</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;34</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.Web.<span style="color: #2b91af;">HttpContext</span>.Current.Session[<span style="color: #a31515;">"Rating"</span>] = rating;</p>
<p style="margin: 0px;"><span style="color: #2b91af;">&nbsp;&nbsp;&nbsp;35</span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
</div>
<div style="margin-bottom:10px;margin-top:10px">
You can download the source <a href="http://gaskell.org/upload/BulletproofShop.zip">here</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/bulletproof-ajax-with-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Getting access to MSDN downloads with the Empower ISV program</title>
		<link>http://gaskell.org/getting-access-to-msdn-downloads-with-the-empower-isv-program/</link>
		<comments>http://gaskell.org/getting-access-to-msdn-downloads-with-the-empower-isv-program/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 06:50:04 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[Empower]]></category>
		<category><![CDATA[ISV]]></category>
		<category><![CDATA[MSDN]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=58</guid>
		<description><![CDATA[Ok, so like 99% of my blog entries are about things not working quite the way I think they should and here&#8217;s another example. When linking your Passport account to your MSDN Subscription you&#8217;re asked to provide your Benefit Access Number. The number they&#8217;re looking for is your Technical ID available on Microsoft Parter Program [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so like 99% of my blog entries are about things not working quite the way I think they should and here&#8217;s another example. When linking your Passport account to your MSDN Subscription you&#8217;re asked to provide your Benefit Access Number. The number they&#8217;re looking for is your <em>Technical ID</em> available on <a target="_blank" href="https://partners.microsoft.com/partnerprogram/PartnerMembershipCenter.aspx">Microsoft Parter Program</a> site. <strong>Under Requirements &#038; Assets</strong> click <strong>Assign Contact Roles</strong>.</p>
<p>This method didn&#8217;t work for me on the day I received my MSDN shipment &#8211; I had to wait a couple days for it to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/getting-access-to-msdn-downloads-with-the-empower-isv-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing pymedia on Ubuntu</title>
		<link>http://gaskell.org/installing-pymedia-on-ubuntu/</link>
		<comments>http://gaskell.org/installing-pymedia-on-ubuntu/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 03:51:37 +0000</pubDate>
		<dc:creator>andy gaskell</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[pymedia]]></category>

		<guid isPermaLink="false">http://gaskell.org/?p=57</guid>
		<description><![CDATA[I&#8217;ve been trying to install pymedia on a clean install of Ubuntu Hardy Heron and I was wasn&#8217;t able to get it to build using the official docs. Fortunately I found a couple of great blog posts. I ended up having to make a couple of changes: To install the dependencies I used: sudo apt-get [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to install pymedia on a clean install of Ubuntu Hardy Heron and I was wasn&#8217;t able to get it to build using the official docs. Fortunately I found a <a target="_blank" href="http://pythonide.blogspot.com/2007/10/how-to-install-pymedia-on-ubuntu-gutsy.html">couple</a> of <a target="_blank" href="http://jhcore.com/2008/06/18/pymedia-on-ubuntu-hardy-heron/">great</a> blog posts. I ended up having to make a couple of changes:</p>
<p>To install the dependencies I used:</p>
<pre class="code">
<code>sudo apt-get install python-dev libogg-dev libvorbis-dev liblame-dev <strong>libfaad-dev</strong> libasound2-dev python-pygame</code>
</pre>
<p>I had to go to /usr/bin and run this as <a target="_blank" href="http://jhcore.com/2008/06/18/pymedia-on-ubuntu-hardy-heron/#comments">Michael</a> suggests:</p>
<pre class="code">
<code>ln -s g++-3.4 g++</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gaskell.org/installing-pymedia-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.745 seconds -->
