<?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>keza.net</title>
	<atom:link href="http://www.keza.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.keza.net</link>
	<description>Thoughts on Software</description>
	<lastBuildDate>Tue, 03 Apr 2012 01:26:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Three weeks of Python programming</title>
		<link>http://www.keza.net/2012/02/14/three-weeks-of-python-programming/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=three-weeks-of-python-programming</link>
		<comments>http://www.keza.net/2012/02/14/three-weeks-of-python-programming/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 21:00:39 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=356</guid>
		<description><![CDATA[<p>I recently discovered the 50apps challenge, a year long challenge that publishes weekly programming exercises.  I hope to be able to participate in as many of the exercises as my schedule permits. The first three weeks of the challenge were focused on exploring the Python programming language. These are my notes. Week 1 I wrote a web crawler in Python. <a href='http://www.keza.net/2012/02/14/three-weeks-of-python-programming/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>I recently discovered the <a href="http://50apps.org/" target="_blank">50apps</a> challenge, a year long challenge that publishes weekly programming exercises.  I hope to be able to participate in as many of the exercises as my schedule permits. The first three weeks of the challenge were focused on exploring the Python programming language. These are my notes.</p>
<p><strong>Week 1</strong></p>
<p>I wrote a <a href="https://github.com/kezakez/python-web-crawler" target="_blank">web crawler in Python</a>. It works by getting the contents of a web page, finding all the links and following them to a specified depth, while scanning for some search text.</p>
<p>I found <a href="http://python.org/" target="_blank">Python</a> pretty straightforward to work with despite not having used or even read it before. I was surprised that I managed to complete the exercise in two hours. The <a href="http://python.org/doc/" target="_blank">documentation</a> was good. Finding the regex method to use took the most time, and having to explicitly cast was annoying.</p>
<p><strong>Week 2</strong></p>
<p>I created a <a href="https://github.com/kezakez/python-django-web-crawler-webui" target="_blank">Django website</a> for the web crawler created the week before.</p>
<p>I used <a href="https://www.djangoproject.com/" target="_blank">Django</a>, which is a Python web framework. It was a larger framework than I was expecting, coming in over four megabytes, but it did seem to have a lot of features. It took a little longer than I wanted to get something going: I spent two hours getting a basic form and another two hours adding some more advanced features. I personally prefer <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a>-style frameworks like <a href="http://expressjs.com/" target="_blank">Express</a> as they seem to make more sense to me.</p>
<p>I made my application reuse the code I wrote the week before. I am wary that it could create a security hole, depending on how Django cleans form input data. The code to reuse the previous functionality was a little more complicated than it should have been because of the way I wrote the code from the week before, but I wanted to see if I could reuse it without changing it.</p>
<p>I spent over an hour trying to get Django working with Google app engine. I quit while I was ahead because the proposed solutions I found looked hacky or required another package to install. It seemed pretty painful compared to other hosting sites like <a href="https://no.de/" target="_blank">no.de</a> or <a href="http://www.heroku.com/" target="_blank">heroku</a>. To Google app engine&#8217;s credit, the logging was good.</p>
<p><strong>Week 3</strong></p>
<p>This week we explored Python&#8217;s functional programming side. I wrote a <a href="https://github.com/kezakez/python-functional-wordstats" target="_blank">website that graphs word statistics for a given page</a>. The logic for gathering the statistics was to be written without using looping constructs. I used a primitive form of TDD just by using the command line and the assert function in Python. Later I integrated the statistic logic into the web interface, this time I avoided trying to reuse previous code as it was rather different and I was running out of time.</p>
<p>It took about an hour to get a filtered list of words with a count and an hour to get rid of duplicates, limit the results to only ten words and find shortest and longest words. To hook it all up to the web interface was another hour. A lot of the time was spent re-reading the documentation and head scratching.</p>
<p>By the way I ran the tool over my blog and I use the word &#8216;I&#8217; a lot. <img src='http://www.keza.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2012/02/14/three-weeks-of-python-programming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Service Wait &#8211; servicewait.com</title>
		<link>http://www.keza.net/2012/02/07/service-wait-servicewait-com/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=service-wait-servicewait-com</link>
		<comments>http://www.keza.net/2012/02/07/service-wait-servicewait-com/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 21:00:11 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[servicewait]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=353</guid>
		<description><![CDATA[<p>Over the break I made Service Wait , a simple smart phone timer application with a start and stop button that sets values you can tweak later to get the elapsed time. It&#8217;s useful to see how much time you have wasted waiting for something, or for working out times for time sheets. I made it for <a href='http://www.keza.net/2012/02/07/service-wait-servicewait-com/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>Over the break I made <a href="http://www.servicewait.com/" target="_blank">Service Wait</a> , a simple smart phone timer application with a start and stop button that sets values you can tweak later to get the elapsed time. It&#8217;s useful to see how much time you have wasted waiting for something, or for working out times for time sheets. I made it for my mum for Christmas.</p>
<p style="text-align: center;"><a href="http://www.keza.net/wp-content/uploads/2012/02/servicewait.png"><img class="aligncenter" title="service wait" src="http://www.keza.net/wp-content/uploads/2012/02/servicewait.png" alt="" width="230" height="346" /></a></p>
<p><strong>JavaScript Models</strong></p>
<p>In other projects I have used <a href="http://knockoutjs.com/" target="_blank">knockout.js</a> to create view models. This time I just worked with <a href="http://jquery.com/" target="_blank">jQuery</a> and <a href="http://jquerymobile.com/" target="_blank">jQuery mobile</a> directly and for a simple problem I would recommend starting out by working this way. I prefer to add a framework or tool when it solves an issue.</p>
<p><strong>jsHint</strong></p>
<p>I used this project to experiment with <a href="http://www.jshint.com/" target="_blank">jsHint</a>, which does some static analysis of your JavaScript to help find problems. jsHint is a fork of jsLint that provides more flexibility around which rules should be enforced. I started off using it strictly but have since come up with my own set of options that I use on other projects to improve readability.</p>
<p><strong>Hack</strong></p>
<p>I built the site using jQuery mobile which has great support for most smart phones. However I was primarily concerned with optimising for use on iPhones/iOS. I found that on iOS you could show a time keyboard by specifying the type as a time like so.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;input type=&quot;time&quot; name=&quot;timestart&quot; id=&quot;starttime&quot; title=&quot;&quot; /&gt;
</pre>
<p>This will show the time input keyboard in iOS. However there seems to be an issue in iOS 5.1 where the value of a html input time field will not display when it is set via JavaScript. To get around this issue I wrote a hack where I float a span over the top of the field when I want to show a value and then hide it if the user enters something via the time keyboard.</p>
<p style="text-align: center;"><a href="http://www.keza.net/wp-content/uploads/2012/02/servicewaitkb.png"><img class="aligncenter  wp-image-369" title="servicewaitkb" src="http://www.keza.net/wp-content/uploads/2012/02/servicewaitkb.png" alt="" width="230" height="346" /></a><a href="http://www.keza.net/wp-content/uploads/2012/02/servicewait.png"><br />
</a></p>
<p><strong>TODO</strong></p>
<p>One idea I had that may come in the future is a tweet button, which basically allows you to whinge on twitter about how long you had to wait with a great deal of precision.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2012/02/07/service-wait-servicewait-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Releasing Software &#8211; Communication</title>
		<link>http://www.keza.net/2011/12/06/releasing-software-communication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=releasing-software-communication</link>
		<comments>http://www.keza.net/2011/12/06/releasing-software-communication/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 21:00:20 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Project Management]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=154</guid>
		<description><![CDATA[<p>You are skipper of a boat leaving the port trying to navigate the bay to some fantastic destination, out past the horizon. You have a chart, a compass and you can see some buoys. You plot a course that should take three hours. Three hours later you are a bit miffed when you have run aground on <a href='http://www.keza.net/2011/12/06/releasing-software-communication/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>You are skipper of a boat leaving the port trying to navigate the bay to some fantastic destination, out past the horizon. You have a chart, a compass and you can see some buoys. You plot a course that should take three hours.</p>
<p>Three hours later you are a bit miffed when you have run aground on a desert island.</p>
<p><a href="http://www.keza.net/wp-content/uploads/2011/08/gilligansisland.jpg"><img class="aligncenter size-full wp-image-216" title="Gilligan's Island" src="http://www.keza.net/wp-content/uploads/2011/08/gilligansisland.jpg" alt="" width="400" height="395" /></a></p>
<p>When you are cruising around on a boat, the wind, tides and currents affect where your boat ends up. You can&#8217;t just set a bearing and expect to end up precisely where you intended. Instead you need to recalculate where you are and refine your bearings. The more recalculations you do, the closer you stay on course.</p>
<p>Releasing software is similar but even the destination changes. It&#8217;s obvious when you&#8217;re in control of a boat, but when releasing software it&#8217;s easy to forget that getting regular user feedback is essential to staying on track.</p>
<p>Communication is surely an important piece among the many moving parts in the releasing software machine.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/12/06/releasing-software-communication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Contributing to WordPress Support Tickets</title>
		<link>http://www.keza.net/2011/11/29/contributing-to-wordpress-support-tickets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=contributing-to-wordpress-support-tickets</link>
		<comments>http://www.keza.net/2011/11/29/contributing-to-wordpress-support-tickets/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 21:00:51 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=309</guid>
		<description><![CDATA[<p>Recently I was working on a quick one-off project. I found a WordPress plugin called Support Tickets that pretty much did everything that the project required. The last time I touched php was nearly a decade ago so it&#8217;s not my usual bag, but it works, so why bother being snobby about the technology used? Late in the game a few <a href='http://www.keza.net/2011/11/29/contributing-to-wordpress-support-tickets/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a quick one-off project. I found a WordPress plugin called <a href="http://wordpress.org/extend/plugins/support-tickets/" target="_blank">Support Tickets</a> that pretty much did everything that the project required. The last time I touched php was nearly a decade ago so it&#8217;s not my usual bag, but it works, so why bother being snobby about the technology used?</p>
<p>Late in the game a few issues cropped up, I managed to figure them out and fix them. Looking on the support forum a few people are using it and suggesting all sorts of fixes.</p>
<p>I though I would share the open source love and contribute my fixes. So I got the <a href="https://twitter.com/#!/takayukister" target="_blank">original author&#8217;s</a> permission, and made <a href="https://github.com/kezakez/Support-Tickets" target="_blank">my own fork on github</a>.</p>
<p style="text-align: center;"><a href="http://en.wikipedia.org/wiki/File:Peace_button_large.png"><img class="size-full wp-image-335 aligncenter" title="Peace" src="http://www.keza.net/wp-content/uploads/2011/11/Peace.png" alt="" width="120" height="120" /></a></p>
<p>I hope it helps.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/11/29/contributing-to-wordpress-support-tickets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debug JavaScript in MVC</title>
		<link>http://www.keza.net/2011/11/25/debug-javascript-in-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debug-javascript-in-mvc</link>
		<comments>http://www.keza.net/2011/11/25/debug-javascript-in-mvc/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 05:57:03 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[ASP.net MVC]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=312</guid>
		<description><![CDATA[<p>Most JavaScript libraries come with a minified version that is quick to load, and a debug version that lets you debug issues. In ASP.net MVC you really want to be using the debug JavaScript while developing, and the minified Javascript when your site goes into production. I thought up this handy tip that gives a <a href='http://www.keza.net/2011/11/25/debug-javascript-in-mvc/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>Most JavaScript libraries come with a minified version that is quick to load, and a debug version that lets you debug issues. In ASP.net MVC you really want to be using the debug JavaScript while developing, and the minified Javascript when your site goes into production. I thought up this handy tip that gives a good return, for little investment.</p>
<p>Step 1: Change your layout pages to reference your JavaScript files via a UrlHelperExtensions class.</p>
<p>Step 2: In the UrlHelperExtensions class write some code like this:</p>
<pre class="brush: csharp; title: ; notranslate">
public static string Scripts(this UrlHelper helper, string fileName)
{
    return helper.Content(&quot;~/Content/Scripts/&quot; + fileName);
}
public static string knockout(this UrlHelper helper)
{
    if (System.Diagnostics.Debugger.IsAttached)
        return Scripts(helper, &quot;knockout-1.2.1.debug.js&quot;);
    return Scripts(helper, &quot;knockout-1.2.1.js&quot;);
}
public static string CDNjquery(this UrlHelper helper)
{
    if (System.Diagnostics.Debugger.IsAttached)
       return &quot;//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js&quot;;
    else
        return &quot;//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js&quot;;
}
</pre>
<p>The jQuery example here is using a CDN in the hopes that the visitor already has it in their browser cache.</p>
<p>Now your JavaScript will load quickly and you can still debug during development.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/11/25/debug-javascript-in-mvc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>beveragelog.com &#8211; social drinking</title>
		<link>http://www.keza.net/2011/11/22/beveragelog-com-social-drinking/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=beveragelog-com-social-drinking</link>
		<comments>http://www.keza.net/2011/11/22/beveragelog-com-social-drinking/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 21:00:35 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[beveragelog]]></category>
		<category><![CDATA[Geo.js]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[jQTouch]]></category>
		<category><![CDATA[jQuery mobile]]></category>
		<category><![CDATA[knockout.js]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=290</guid>
		<description><![CDATA[<p>Just in time for the silly season I give you beveragelog.com a mobile web application that allows you to track what and where you drink. I started working on it about a year ago in my spare time, today it has enough functionality to be released. The idea came to me when I worked for a <a href='http://www.keza.net/2011/11/22/beveragelog-com-social-drinking/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>Just in time for the silly season I give you <a href="http://beveragelog.com" target="_blank">beveragelog.com</a> a mobile web application that allows you to track what and where you drink. I started working on it about a year ago in my spare time, today it has enough functionality to be released.</p>
<p style="text-align: center;"><img class="size-full wp-image-329 aligncenter" title="beveragelog" src="http://www.keza.net/wp-content/uploads/2011/11/IMG_1134.png" alt="" width="213" height="320" /></p>
<p>The idea came to me when I worked for a large software company that had huge end of year parties. Last year, on the day of the end of year party when I was experimenting with Ruby, I thought it would be neat to use the set of templates that let you generate a basic application (called scaffolding) to write a web application to log the beverages that I would drink at the office Christmas party. It was pretty quick to get up and running.</p>
<p>I hosted my application at <a href="http://heroku.com" target="_blank">heroku</a> so I could use it that night. At the party I found it difficult to use on my phone, so I ported the interface to <a href="http://jqtouch.com/" target="_blank">jQTouch</a>. This made it mobile friendly and much easier to use.</p>
<p>A few months later I was showing some people the application and they wanted to be able to use it. So I decided to make it multi-user and integrate with services like Twitter and Facebook. I started this project using Ruby on Rails just after a new release, which made it frustrating trying to find stable packages. So I decided to rewrite what I had in <a href="http://nodejs.org/" target="_blank">node.js</a>.  As a bonus node.js made the serialising of ajax responses nice and easy.</p>
<p>A little while later I purchased the domain name and started hosting the application on my own VPS. At the time there were very few node.js hosts. It was an interesting learning exercise to host it myself. I made my own deploy script using ssh, git and upstart.</p>
<p>I wanted the UI to be responsive and not hit the server on every action, but the client side code quickly became out of control. I found that <a href="http://knockoutjs.com/" target="_blank">knockout.js</a> was a handy way to organise my code into models that bind to parts of the html document. These bound elements get automatically updated as changes are made. As the logic is encapsulated in a model,  I could potentially test complicated logic without the browsers DOM being required or being susceptible to changes to the structure of the document.</p>
<p>After battling with some bugs in the jQTouch framework I switched to <a href="http://jquerymobile.com/" target="_blank">jQuery Mobile</a>, it was easy to switch over and it works on a wider range of devices. As the project spanned the better part of a year it was interesting to see the landscape of dependencies that I was building on change beneath me.</p>
<p>Later I added the ability to use the browsers geolocation capabilities with Geo.js so that locations of drinks could be stored and mapped.</p>
<p>This project has been a great opportunity to learn about how to use stuff like google analytics, landing pages, logos and even outsourcing. One interesting anecdote I have relates to the logo, there is a cool site called <a href="http://fiverr.com/" target="_blank">fiverr.com</a> where people post work they will do for $5, I used the site to find a kid in the states who I hired to design my logo for a fiver.</p>
<p><img class="aligncenter size-full wp-image-330" title="beveragelog logo" src="http://www.keza.net/wp-content/uploads/2011/11/logo.png" alt="" width="198" height="70" /></p>
<p>Overall beveragelog.com has been a great learning experience, there is still a lot of scope for more enhancements and features but for now I am relieved to finally get it released. I have found starting something is hard and takes enthusiasm, but finishing something is harder and takes stamina.</p>
<p>I have already used some of the skill I gained in other work and hope that they continue to serve me well.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/11/22/beveragelog-com-social-drinking/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Skipping MVC web.config files with msdeploy</title>
		<link>http://www.keza.net/2011/11/15/skipping-mvc-web-config-files-with-msdeploy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=skipping-mvc-web-config-files-with-msdeploy</link>
		<comments>http://www.keza.net/2011/11/15/skipping-mvc-web-config-files-with-msdeploy/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 21:00:06 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[ASP.net MVC]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Deploy]]></category>
		<category><![CDATA[msdeploy]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=293</guid>
		<description><![CDATA[<p>This post describes how to deploy a ASP.net MVC web application with msdeploy, while skipping the overwriting of the root web.config file. Sounds easy, what could possiblie go wrong? Well, msdeploy can be a real pain to try and figure out, but at least it&#8217;s the sort of thing you write once and keep in <a href='http://www.keza.net/2011/11/15/skipping-mvc-web-config-files-with-msdeploy/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>This post describes how to deploy a <a href="http://www.asp.net/mvc" target="_blank">ASP.net MVC</a> web application with msdeploy, while skipping the overwriting of the root web.config file. Sounds easy, what could <a href="http://www.urbandictionary.com/define.php?term=possiblie" target="_blank">possiblie</a> go wrong? Well, msdeploy can be a real pain to try and figure out, but at least it&#8217;s the sort of thing you write once and keep in the back pocket.</p>
<p>This example deploys from an existing &#8216;last build&#8217; staging area to a &#8216;beta&#8217; staging area but doesn&#8217;t copy across the configuration or error files.</p>
<pre class="brush: powershell; title: ; notranslate">
&quot;c:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy.exe&quot; -verb:sync -source:iisApp=&quot;LastBuild&quot; -dest:iisApp=&quot;Beta&quot; -skip:objectName=dirPath,absolutePath=&quot;elmah&quot; -skip:objectName=filePath,absolutePath=&quot;^((?!Views).)*web\.config$&quot; -skip:objectName=filePath,absolutePath=&quot;settings-override.xml&quot;
pause
</pre>
<p>The tricky bit that this command is handling is that MVC doesn&#8217;t just have the one web.config file. Each view folder also contains a web.config file used by the view engine, so simply ignoring files name web.config will deploy a broken web application. The example above works because msdeploy allows <a href="http://en.wikipedia.org/wiki/Regular_expression" target="_blank">regular expressions</a>, this regular expression skips over the web.config in the root directory but still copies over the others that are in &#8216;Views&#8217;  folders.</p>
<p>You can see how the regular expression works at this <a href="http://regexpal.com/?flags=im&amp;regex=%5E((%3F!Views).)*web%5C.config%24&amp;input=c%3A%5CSomething.config%0Ac%3A%5CWeb.config%0Ac%3A%5Cinetpub%5CBeta%5CViews%5CWeb.config%0Ac%3A%5Cwhat%0Ac%3A%5CMyweb.config2%0Ac%3A%5Cinetpub%5CBeta%5CWeb.config%0Ac%3A%5CViews%5Cblah.config" target="_blank">handy site</a>.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/11/15/skipping-mvc-web-config-files-with-msdeploy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing Benchy</title>
		<link>http://www.keza.net/2011/10/25/introducing-benchy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introducing-benchy</link>
		<comments>http://www.keza.net/2011/10/25/introducing-benchy/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 21:00:14 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[Benchy]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[ASP.net MVC]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[flot]]></category>
		<category><![CDATA[Moq]]></category>
		<category><![CDATA[NuGet]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=169</guid>
		<description><![CDATA[<p>Benchy is an open source .net tool for benchmarking the execution speed of sections of code after each build. Benchmarks are graphed so that changes to performance characteristics in builds can be easily visualised. I created Benchy because I wanted to do some performance tuning, but I was reluctant to start without having a reliable <a href='http://www.keza.net/2011/10/25/introducing-benchy/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.keza.net/benchy/">Benchy</a> is an open source .net tool for benchmarking the execution speed of sections of code after each build. Benchmarks are graphed so that changes to performance characteristics in builds can be easily visualised.</p>
<p>I created Benchy because I wanted to do some performance tuning, but I was reluctant to start without having a reliable way to measure the results of my changes over time. I also wanted to be able to see when changes were introduced that had negative impacts on performance. Benchy is my first complete and released open source project. Starting things is hard, finishing things is even harder.</p>
<p>It was fun to be able to start a fresh green fields project that has potential to be useful. As Benchy is a simple system and a new project, I found it was pretty straightforward to write tests first and do Test Driven Development. (TDD with .net, it exists!) I often feel uneasy making things more complex than they need to be, so I was glad that I used <a href="http://code.google.com/p/moq/">Moq</a> for the tests. I really liked not having to add a whole bunch of extra cruft to mock out dependencies during testing.</p>
<p>I shamelessly stole most of the framework concepts from <a href="http://www.nunit.org/" target="_blank">nUnit</a>.</p>
<p>I used <a href="http://code.google.com/p/flot/" target="_blank">flot</a> for graphing the benchmark results.</p>
<p><a href="http://www.keza.net/wp-content/uploads/2011/10/benchyscreenshot.jpg"><img class="alignnone size-full wp-image-274" title="Benchy Results Screenshot" src="http://www.keza.net/wp-content/uploads/2011/10/benchyscreenshot.jpg" alt="" width="640" height="480" /></a></p>
<p>Read all about it on its dedicated page at <a href="http://www.keza.net/benchy/">http://www.keza.net/benchy/</a></p>
<p>Or have a look at the source at <a href="https://github.com/kezakez/Benchy">https://github.com/kezakez/Benchy</a></p>
<p>Thanks to the company I work at for supporting my ideas and open source.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/10/25/introducing-benchy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Client Side Validation of Dynamically Loaded Input Fields in MVC3</title>
		<link>http://www.keza.net/2011/09/12/client-side-validation-of-dynamically-loaded-input-fields-in-mvc3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=client-side-validation-of-dynamically-loaded-input-fields-in-mvc3</link>
		<comments>http://www.keza.net/2011/09/12/client-side-validation-of-dynamically-loaded-input-fields-in-mvc3/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 12:59:27 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[ASP.net MVC]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=146</guid>
		<description><![CDATA[<p>In MVC3 it&#8217;s possible to enable client side validation of dynamically loaded input fields by marking up the associated models with attributes via unobtrusive javascript. The result is validation code that is executed straight away on the client side to give the user feedback as well as on the server side to stop bad data <a href='http://www.keza.net/2011/09/12/client-side-validation-of-dynamically-loaded-input-fields-in-mvc3/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>In MVC3 it&#8217;s possible to enable client side validation of dynamically loaded input fields by marking up the associated models with attributes via unobtrusive javascript. The result is validation code that is executed straight away on the client side to give the user feedback as well as on the server side to stop bad data from being entered. This approach is a double edged sword, since on one hand you get client and server side code for free, but you&#8217;re also limited to a few different kinds of input validation. The other catch associated with <a href="http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html" target="_blank">this approach</a> is <strong>if you are dynamically loading form fields into your page that you want validated, it will not work automatically. </strong></p>
<p>To understand why, let me tell you a story that explores the depths of your model&#8217;s views and controllers as well as the life of your page.</p>
<p>First, your controller is accessed by the incoming request.</p>
<p>Then your controller will load up a model that has properties marked up with validation attributes.</p>
<p>The model is passed to the view.</p>
<p>When the view engine starts pumping out the resulting html it sees the attributes and the unobtrusive javascript settings and adds extra attributes to your html.</p>
<p>The request is fulfilled and the page content is loaded into the browser.</p>
<p>When the page is loaded the unobtrusive and validation javascript scripts are loaded and the validation script adds event handlers to the fields on the page.</p>
<p>It&#8217;s at this point that validation should work as expected.</p>
<p>However, if you make an AJAX request that gets a different form or more fields to show on the page, the new content will not run the client side validation.</p>
<p>This is because the content we loaded via the AJAX request is not hooked up like the fields that were there when the page first loaded.</p>
<p style="text-align: center;"><a href="http://www.keza.net/wp-content/uploads/2011/08/mvcvalidation.png"><img class="size-full wp-image-210 aligncenter" title="MVC Validation" src="http://www.keza.net/wp-content/uploads/2011/08/mvcvalidation.png" alt="" width="722" height="578" /></a></p>
<p>So to get around the issue, all we really need to do is hook up the fields that were dynamically loaded into the page. This can be achieved by adding a bit of javascript to where you are dynamically loading your new fields:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#contentid&quot;).load(&quot;/ContentUrl&quot;, postData, function (responseText, textStatus, xmlhttpRequest) {
  if (textStatus == &quot;success&quot;) {
    jQuery.validator.unobtrusive.parse(&quot;#contentid&quot;);
  } else if (textStatus == &quot;error&quot;) {
    $(&quot;#contentid&quot;).html(responseText);
  }
});
</pre>
<p>The important bit in this code snippet is where we call jQuery.validator.unobtrusive.parse, this hooks up the validation functions to the control events that are required for unobtrusive validation. Now that you can validate input, don&#8217;t be a <a href="http://haacked.com/archive/2007/08/26/dont-be-a-validation-nazi.aspx" target="_blank">validation nazi</a>.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/09/12/client-side-validation-of-dynamically-loaded-input-fields-in-mvc3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Game of Life in NodeJS</title>
		<link>http://www.keza.net/2011/09/07/game-of-life-in-nodejs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=game-of-life-in-nodejs</link>
		<comments>http://www.keza.net/2011/09/07/game-of-life-in-nodejs/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 12:42:26 +0000</pubDate>
		<dc:creator>Keiran McDonald</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[jCanvas]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[Socket.io]]></category>

		<guid isPermaLink="false">http://www.keza.net/?p=234</guid>
		<description><![CDATA[<p>Last weekend I went to Brisbane coding event called code smash. It coincided with node knockout. The event was provided us with a space to work, people to work with and pizza. What we did at the event was up to us. In the spirit of node knockout I was keen to do some serious team coding <a href='http://www.keza.net/2011/09/07/game-of-life-in-nodejs/' class='excerpt-more'>[...]</a></p><p><a href="http://www.keza.net">keza.net</a></p>]]></description>
			<content:encoded><![CDATA[<p>Last weekend I went to Brisbane coding event called <a href="http://www.codesmash.com.au/" target="_blank">code smash</a>. It coincided with <a href="http://nodeknockout.com/" target="_blank">node knockout</a>. The event was provided us with a space to work, people to work with and pizza. What we did at the event was up to us. In the spirit of node knockout I was keen to do some serious team coding and get results. Luckily I managed to team up with Andrew who had similar goals. Andrew works with <a href="http://rubyonrails.org/" target="_blank">ruby on rails</a> full time and I work on <a href="http://www.asp.net/mvc" target="_blank">asp.net mvc</a> full time. So clearly the sensible thing to do was to write a <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life" target="_blank">Game of Life</a> in <a href="http://nodejs.org/" target="_blank">NodeJS</a>. Just to keep us on our toes.</p>
<p style="text-align: center;"><a href="http://gol.no.de"><img class="aligncenter size-full wp-image-237" title="Game of Life" src="http://www.keza.net/wp-content/uploads/2011/09/gol.png" alt="" width="626" height="491" /></a></p>
<p>We had slightly less than 5 hours. So we decided to take a client side<a href="http://apps.gamejs.org/gameoflife/2opt/" target="_blank"> javascript version of the game of life</a> that was already written and make it shared from the server side. We got it running on the server first. That was pretty straightforward as the client side javascript was well-written. Then we got the game displaying as quickly as possible by having clients poll the server. Then we added the ability for formations of cells to be added to the game, so it would be more interesting. Andrew seemed to know a bit about the Game of Life, and was aware of interesting formations that would travel. So we added some of these as possible formations that could be added to the game. We got it working and had something to show; we were happy with the day.</p>
<p>This weekend I was still energetic about the project. So I</p>
<ul>
<li>Changed the polling to push based sockets using <a href="http://socket.io/" target="_blank">socket.io</a>;</li>
<li>Made the packets a smaller;</li>
<li>Made the field size as big as I could;</li>
<li>Switched out the heavy duty game library and did the painting with <a href="http://calebevans.me/projects/jcanvas/" target="_blank">jCanvas</a>; and</li>
<li>Gave our <a href="http://gol.no.de" target="_blank">Game of Life</a> a home.</li>
</ul>
<p>I&#8217;m not usually a big fan of games like I used to be back in the day. This is probably because I lack the time. This game is a set-and-forget sort of game, there&#8217;s no big time investment required. I&#8217;m still thinking about how to make it more interesting by adding to the multi-player aspect of the game.</p>
<p>The game suffers from <a href="http://en.wikipedia.org/wiki/Entropy" target="_blank">entropy</a> over time and relies on people visiting to add cells to make the result dynamic and interesting.</p>
<p>I have though of a few other interesting possibilities, that could still be explored:</p>
<ul>
<li>Calculate a big field and be able to zoom and scroll around parts of it.</li>
<li>Be able generate a still image of a big field frame of the game. Maybe keep some cell history and heat map the image if it&#8217;s sparse.</li>
<li>Introduce colours to the cells that mix as cells reproduce.</li>
<li>Introduce a multi-player aspect where each player can add spawn points that emit predetermined cell formations.</li>
<li>Make the server send only the unpredictable state updates, and get the clients to do the other predictable calculations related to display.</li>
<li>Be able to have an infinite sized field that scales as servers are added to calculate more of the field.</li>
</ul>
<p>The code is on <a href="https://github.com/newmana/sharedlife" target="_blank">github</a>.</p>
<p><a href="http://www.keza.net">keza.net</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.keza.net/2011/09/07/game-of-life-in-nodejs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

