<?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>The Public Void</title>
	<atom:link href="http://andrewtwest.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewtwest.com</link>
	<description>Andy West&#039;s Blog: Software Development and More</description>
	<lastBuildDate>Mon, 28 Nov 2011 17:20:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='andrewtwest.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/c0281a895b7e49563079e2f09831f4c2?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>The Public Void</title>
		<link>http://andrewtwest.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://andrewtwest.com/osd.xml" title="The Public Void" />
	<atom:link rel='hub' href='http://andrewtwest.com/?pushpress=hub'/>
		<item>
		<title>Ignoring ReSharper Code Issues in Your New ASP.NET MVC 3 Application</title>
		<link>http://andrewtwest.com/2011/07/22/ignoring-resharper-code-issues-in-your-new-asp-net-mvc-3-application/</link>
		<comments>http://andrewtwest.com/2011/07/22/ignoring-resharper-code-issues-in-your-new-asp-net-mvc-3-application/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 22:19:39 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[code issues]]></category>
		<category><![CDATA[resharper]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=446</guid>
		<description><![CDATA[ReSharper is a great tool for identifying problems with your code.  Simply right-click on any project in the Solution Explorer and select Find Code Issues.  After ReSharper analyzes all the files, you’ll see a window with several categories of issues including “Common Practices and Code Improvements”, “Constraint Violations”, and “Potential Code Quality Issues”. Unfortunately, when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=446&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">ReSharper is a great tool for identifying problems with your code.  Simply right-click on any project in the Solution Explorer and select <strong>Find Code Issues</strong>.  After ReSharper analyzes all the files, you’ll see a window with several categories of issues including “Common Practices and Code Improvements”, “Constraint Violations”, and “Potential Code Quality Issues”.</p>
<p>Unfortunately, when you create a new ASP.NET MVC 3 application in Visual Studio 2010, Resharper will find thousands of code issues before you even start coding.</p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/07/codeissues1.png"><img class="aligncenter size-full wp-image-447" title="2019 issues found" src="http://andrewtwest.files.wordpress.com/2011/07/codeissues1.png?w=497&#038;h=335" alt="2019 issues found" width="497" height="335" /></a></p>
<p>Most of these “issues” are in jQuery and Microsoft’s AJAX libraries, and your average developer is not going to go around adding semicolons all day when they have real work to do.  So we need to tell ReSharper to ignore these known issues somehow.</p>
<p>It would be nice if ReSharper allowed you to ignore files using file masks, but it doesn’t.  You must specify each file or folder individually.  Go to<strong> ReSharper-&gt;Options&#8230;-&gt;Code Inspection-&gt;Settings</strong>.  Click <strong>Edit Items to Skip</strong>.</p>
<p>My first instinct was to lasso or shift-click to select all the jQuery scripts, but this is not allowed!  I certainly wasn’t going to bounce back and forth between dialog windows a dozen times just to add each file.</p>
<p>Luckily this is ReSharper, and we can move all the script files into another directory and update references automatically.  Select all the jQuery scripts in the <strong>Scripts</strong> folder simultaneously, right-click, and go to <strong>Refactor-&gt;Move</strong>.  Create a new <strong>jquery</strong> folder under <strong>Scripts</strong> and click Next.</p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/07/codeissues2.png"><img class="aligncenter size-full wp-image-449" title="Move to Folder" src="http://andrewtwest.files.wordpress.com/2011/07/codeissues2.png?w=497&#038;h=432" alt="Move to Folder" width="497" height="432" /></a><a href="http://andrewtwest.files.wordpress.com/2011/07/codeissues1.png"><br />
</a><br />
Now you can go back into the ReSharper options and add this folder to the list of items to skip.</p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/07/codeissues3.png"><img class="aligncenter size-full wp-image-452" title="Skip jQuery folder" src="http://andrewtwest.files.wordpress.com/2011/07/codeissues3.png?w=308&#038;h=304" alt="Skip jQuery folder" width="308" height="304" /></a></p>
<p>Move Microsoft’s script files into their own folder, and tell ReSharper to ignore these as well.  I’m also using modernizr so I exluded the two modernizr scripts individually.</p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/07/codeissues4.png"><img class="aligncenter size-full wp-image-453" title="Skip Files and Folders" src="http://andrewtwest.files.wordpress.com/2011/07/codeissues4.png?w=308&#038;h=304" alt="Skip Files and Folders" width="308" height="304" /></a></p>
<p><strong>Find Code Issues</strong> again and things should look much better.  I’ve only got 25 issues now.</p>
<p style="text-align:left;"><a href="http://andrewtwest.files.wordpress.com/2011/07/codeissues5.png"><img class="aligncenter size-full wp-image-454" title="25 code issues" src="http://andrewtwest.files.wordpress.com/2011/07/codeissues5.png?w=467&#038;h=402" alt="25 code issues" width="467" height="402" /></a></p>
<p>With the help of ReSharper’s refactoring capabilities I was able to get this down to one issue in just a few minutes.  Now you can get on with your project without having to mentally filter out a bunch of noise in the Inspection Results window.</p>
<p>Happy coding!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/446/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/446/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/446/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=446&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/07/22/ignoring-resharper-code-issues-in-your-new-asp-net-mvc-3-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/07/codeissues1.png" medium="image">
			<media:title type="html">2019 issues found</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/07/codeissues2.png" medium="image">
			<media:title type="html">Move to Folder</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/07/codeissues3.png" medium="image">
			<media:title type="html">Skip jQuery folder</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/07/codeissues4.png" medium="image">
			<media:title type="html">Skip Files and Folders</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/07/codeissues5.png" medium="image">
			<media:title type="html">25 code issues</media:title>
		</media:content>
	</item>
		<item>
		<title>An HTML5 Music Visualizer for Dev:Unplugged</title>
		<link>http://andrewtwest.com/2011/04/30/an-html5-music-visualizer-for-devunplugged/</link>
		<comments>http://andrewtwest.com/2011/04/30/an-html5-music-visualizer-for-devunplugged/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 23:17:59 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pinned sites]]></category>
		<category><![CDATA[visualizer]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=426</guid>
		<description><![CDATA[HTML5 is Here Although HTML5 is still in development, the latest generation of popular browsers (those released within the past month or so) support a surprisingly consistent set of HTML5 features.  This allows developers to start seriously targeting the future standard and taking advantage of its many benefits. The Contest Microsoft is currently running a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=426&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>HTML5 is Here</h2>
<p>Although HTML5 is still in development, the latest generation of popular browsers (those released within the past month or so) support a surprisingly consistent set of HTML5 features.  This allows developers to start seriously targeting the future standard and taking advantage of its many benefits.</p>
<h2>The Contest</h2>
<p>Microsoft is currently running a contest called <a href="http://www.beautyoftheweb.com/#/unplugged/" target="_blank">{Dev:Unplugged}</a> that gives Web developers the opportunity to showcase their HTML5 skills.  Entrants have the option of creating a game or music-related site, and compete for some awesome prizes.  On May 9, an expert team of judges will start evaluating entries based on several criteria such as creativity, quality, and fit with the contest theme.</p>
<h2>My Entry: <a href="https://microsoft.promo.eprize.com/ie9app/gallery?id=202" target="_blank">html5beats.com</a></h2>
<div style="margin-top:20px;margin-bottom:20px;"><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='497' height='310' src='http://www.youtube.com/embed/laLWEgpXhKM?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span></div>
<h3>What it is</h3>
<p>html5beats is a music visualizer that generates real time animations that respond to the beat of the music.  In the past you had to use Flash or embedded media players to accomplish this.  With HTML5 you can do it with JavaScript and markup alone.</p>
<h3>How it works</h3>
<p>To synchronize audio and video, you must have access to the raw audio data.  Unfortunately, browsers don’t offer provide this access in a consistent way (and some don’t offer it at all).  I wrote a small C# program that preprocesses the sound files and I add the output (RMS amplitude) to a JavaScript file.  It doesn&#8217;t need to be high resolution (8 bit, 40Hz) so it works out to only about 20KB per song.  At first I thought I invented this method, but I Googled around and discovered that someone else <a href="http://gskinner.com/blog/archives/2011/03/music-visualizer-in-html5-js-with-source-code.html" target="_blank">beat me to it</a>.  Nevertheless, it works well in practice and provides interesting results.</p>
<h3>Features</h3>
<h4>Cross-browser compatibility</h4>
<p>The following browsers are officially supported:</p>
<ul>
<li><a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home" target="_blank">Internet Explorer 9</a> (recommended)</li>
<li><a href="http://www.google.com/chrome/index.html?hl=en&amp;brand=CHMA&amp;utm_campaign=en&amp;utm_source=en-ha-na-us-bk&amp;utm_medium=ha" target="_blank">Chrome 10</a></li>
<li><a href="http://www.opera.com/browser/" target="_blank">Opera 11</a></li>
<li><a href="http://www.mozilla.com/en-US/firefox/fx/" target="_blank">Firefox 4</a></li>
</ul>
<p>You can try other browsers with varying results.  Some will trigger a compatibility message, while others (like Firefox 3.6) will mostly work, but the site won’t look as good.</p>
<h4>Full screen mode</h4>
<p>The HTML5 canvas does not explicitly support full screen.  I solve this problem by using a second canvas that fills the entire page.  The image from the smaller main canvas is copied to the larger one every frame.  This may sound inefficient, but it performs well in all my tests.</p>
<h4>Lyrics</h4>
<p>This feature displays lyrics as the song plays, and can be turned on or off.  Although the canvas supports text directly, drawing straight to the canvas would interfere with some of the inter-frame effects I’m using.  Therefore, I position a div element over the canvas and change its inner text dynamically.</p>
<h4>Pinned site features</h4>
<p>Internet Explorer 9 offers a great new feature called “pinned sites” that provide Windows 7 desktop integration.  I’ve taken advantage of several pinned site features that enhance the user experience under IE9.</p>
<h5>Feature detection and discoverability</h5>
<p style="text-align:center;"><a href="http://andrewtwest.files.wordpress.com/2011/04/pinned_site_prompt1.png"><img class="aligncenter size-full wp-image-439" style="border:1px solid #d0d0d0;" title="Pinned site prompt" src="http://andrewtwest.files.wordpress.com/2011/04/pinned_site_prompt1.png?w=497&#038;h=183" alt="Pinned site prompt" width="497" height="183" /></a></p>
<p>If you’re browsing with IE9, html5beats will detect it and prompt you to try pinning the site.  If you don’t like seeing this prompt you can close it.  Pinning your site adds a high-quality icon to the taskbar and gives you access to additional functionality.</p>
<h5>Jump List</h5>
<p style="text-align:center;"><a href="http://andrewtwest.files.wordpress.com/2011/04/jump_list1.png"><img class="aligncenter size-full wp-image-440" style="border:1px solid #d0d0d0;" title="Jump List" src="http://andrewtwest.files.wordpress.com/2011/04/jump_list1.png?w=324&#038;h=374" alt="Jump List" width="324" height="374" /></a></p>
<p>Right-clicking the taskbar icon shows a Jump List with tasks that can take you directly to a specific page within the site, even if the browser isn’t currently open.</p>
<h5>Thumbnail Toolbar</h5>
<p style="text-align:center;"><a href="http://andrewtwest.files.wordpress.com/2011/04/thumbnail_toolbar1.png"><img class="aligncenter size-full wp-image-441" style="border:1px solid #d0d0d0;" title="Thumbnail toolbar" src="http://andrewtwest.files.wordpress.com/2011/04/thumbnail_toolbar1.png?w=281&#038;h=251" alt="Thumbnail toolbar" width="281" height="251" /></a></p>
<p>This is one of the coolest aspects of pinning the site.  Hovering over the taskbar reveals playback buttons so you can play, pause, and navigate songs even when the browser doesn’t have focus.</p>
<p><strong>Update</strong>: <em>Previous Track</em> and <em>Next Track</em> buttons have been added for additional control of the player.</p>
<h4>CSS3</h4>
<p>Until now, effects like rounded corners, shadows, and translucency were only available through browser-specific features, custom images, and elaborate CSS trickery.  CSS3 makes those techniques obsolete.  html5beats exploits CSS3 to improve the aesthetics of the main UI.</p>
<h2>Using the Code</h2>
<p>For now I’m disallowing use of the code, mainly to prevent someone from using it in a competing entry.  After the contest ends I plan on cleaning it up a bit and releasing it under an open-source license.</p>
<h2>Please Consider Supporting the Site with Your Vote</h2>
<p>In addition to a earning a high score from the judges, winning requires votes from the community.  If you like my entry, <a href="https://microsoft.promo.eprize.com/ie9app/gallery?id=202" target="_blank">please vote for it today</a>&#8230; there’s only one week left!  Also, look forward to new features and updates in the coming days &#8211; this is the home stretch.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=426&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/04/30/an-html5-music-visualizer-for-devunplugged/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/04/pinned_site_prompt1.png" medium="image">
			<media:title type="html">Pinned site prompt</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/04/jump_list1.png" medium="image">
			<media:title type="html">Jump List</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/04/thumbnail_toolbar1.png" medium="image">
			<media:title type="html">Thumbnail toolbar</media:title>
		</media:content>
	</item>
		<item>
		<title>Profiling Built-In JavaScript Functions with Firebug</title>
		<link>http://andrewtwest.com/2011/03/26/profiling-built-in-javascript-functions-with-firebug/</link>
		<comments>http://andrewtwest.com/2011/03/26/profiling-built-in-javascript-functions-with-firebug/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 19:27:01 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[profiling]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=401</guid>
		<description><![CDATA[Firebug is a Web development tool for Firefox.  Among other things, it lets you profile your JavaScript code to find performance bottlenecks. To get started, simply go to the Firebug Web site, install the plugin, load a page in Firefox and activate Firebug.  Click the Profile button under the Console tab once to start profiling, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=401&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Firebug  is a Web development tool for Firefox.  Among other things, it lets you  profile your JavaScript code to find performance bottlenecks.</p>
<p>To get started, simply go to the <a href="http://getfirebug.com/" target="_blank">Firebug Web site</a>, install the plugin, load a page in Firefox and activate Firebug.  Click the <strong>Profile </strong>button under the <strong>Console </strong>tab  once to start profiling, and again to stop it.  Firebug will display a  list of functions, the number of times they were called, and the time  spent in each one.</p>
<p>For example, here is a page that repeatedly draws a red rectangle and blue circle on the new HTML5 canvas:</p>
<p><pre class="brush: xml;">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;utf-8&quot; /&gt;
        &lt;title&gt;Profiling Example&lt;/title&gt;
    &lt;/head&gt;
    &lt;body onload=&quot;drawShapes();&quot;&gt;
        &lt;canvas id=&quot;canvasElement&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;
            Your browser does not support the HTML5 Canvas.
        &lt;/canvas&gt;
        &lt;script&gt;
            function drawShapes() {
                var canvasElement = document.getElementById('canvasElement');
                var context = canvasElement.getContext('2d');

                context.fillStyle = 'rgb(255, 0, 0)';

                // Draw a red rectangle many times.
                for (var i = 0; i &lt; 1000; i++)
                {
                    context.fillRect(30, 30, 50, 50);
                }

                context.fillStyle = 'rgb(0, 0, 255)';

                // Draw a blue circle many times.
                for (var i = 0; i &lt; 1000; i++)
                {
                    context.beginPath();
                    context.arc(70, 70, 15, Math.PI * 2, 0, true);
                    context.closePath();
                    context.fill();
                }
            }
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>Let’s assume your code is taking a long time to execute.  Running the profile produces these results:</p>
<div id="attachment_402" class="wp-caption aligncenter" style="width: 507px"><a href="http://andrewtwest.files.wordpress.com/2011/03/profiling1.jpg" target="_blank"><img class="size-full wp-image-402 " title="Profiling Results 1" src="http://andrewtwest.files.wordpress.com/2011/03/profiling1.jpg?w=497&#038;h=315" alt="Profiling Results 1" width="497" height="315" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<p>This  isn’t very useful because only user-defined functions show up.  There  is only one significant function here so there’s nothing to compare.  If  there were some way to profile built-in JavaScript functions, we might  get a better idea of which parts of the code are running slowly.</p>
<p><em>Note:  This is a contrived example written to illustrate a point.  It would be  just effective, and probably a better design overall, to extract two  methods named drawRectangle() and drawCircle().  See</em> <a href="http://www.refactoring.com/catalog/extractMethod.html" target="_blank">Extract Method</a><em>.</em></p>
<p>As a workaround, you could wrap some of the native functions and call the wrappers in your program code, like this:</p>
<p><pre class="brush: jscript;">
function drawShapes() {
    var canvasElement = document.getElementById('canvasElement');
    var context = canvasElement.getContext('2d');

    context.fillStyle = 'rgb(255, 0, 0)';

    // Draw a red rectangle many times.
    for (var i = 0; i &lt; 1000; i++)
    {
        fillRect(context, 30, 30, 50, 50);
    }

   context.fillStyle = 'rgb(0, 0, 255)';

    // Draw a blue circle many times.
    for (var i = 0; i &lt; 1000; i++)
    {
        context.beginPath();
        context.arc(70, 70, 15, Math.PI * 2, 0, true);
        context.closePath();
        fill(context);
    }
}

function fillRect(context, x, y, w, h) {
    context.fillRect(30, 30, 50, 50);
}

function fill(context) {
    context.fill();
}
</pre></p>
<p>But  that would impact your design and create unnecessary overhead.   Ideally, you’ll want a solution that’s only active during debugging and  doesn’t affect your production script.  One way to do this is to write  overrides for the native functions and store them in their own .js file (don&#8217;t forget to reference the script file in the HTML page):</p>
<p><pre class="brush: jscript;">
if (window.console.firebug !== undefined)
{
    var p = CanvasRenderingContext2D.prototype;

    p._fillRect = p.fillRect;
    p.fillRect = function (x, y, w, h) { this._fillRect(x, y, w, h) };

    p._fill = p.fill;
    p.fill = function () { this._fill() };
}
</pre></p>
<p>What  we’re doing here is saving the original function by assigning it to  another function with the same name, prefixed with an underscore.  Then  we’re writing over the original with our own function that does nothing  but wrap the old one.  This is enough to make it appear in the Firebug  profiling results.</p>
<div id="attachment_403" class="wp-caption aligncenter" style="width: 507px"><a href="http://andrewtwest.files.wordpress.com/2011/03/profiling2.jpg" target="_blank"><img class="size-full wp-image-403 " title="Profiling Results 2" src="http://andrewtwest.files.wordpress.com/2011/03/profiling2.jpg?w=497&#038;h=315" alt="Profiling Results 2" width="497" height="315" /></a><p class="wp-caption-text">Click to enlarge</p></div>
<p>The  beauty of this approach is that it only runs when the Firebug console  is turned on.  When it’s not, the conditional check fails and the code  block is not executed.  The check also fails in other browsers such as  IE9 and Chrome 11 beta, which is exactly what we want.</p>
<p>One  disadvantage is that you have to write a separate function for each  native function you want to override.  In the above example, a  significant amount of time is probably spent in context.arc(), but we  didn’t override it so there’s no way to tell.  It may be possible to  override and wrap every function in a specified object automatically,  but I haven’t tried that yet.  For now, I’ll leave it as an exercise for  the reader.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/401/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/401/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/401/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=401&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/03/26/profiling-built-in-javascript-functions-with-firebug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/03/profiling1.jpg" medium="image">
			<media:title type="html">Profiling Results 1</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/03/profiling2.jpg" medium="image">
			<media:title type="html">Profiling Results 2</media:title>
		</media:content>
	</item>
		<item>
		<title>Workaround for NullReferenceException in DBComparer</title>
		<link>http://andrewtwest.com/2011/02/25/workaround-for-nullreferenceexception-in-dbcomparer/</link>
		<comments>http://andrewtwest.com/2011/02/25/workaround-for-nullreferenceexception-in-dbcomparer/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 05:12:47 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DBComparer]]></category>
		<category><![CDATA[NullReferenceException]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=393</guid>
		<description><![CDATA[DBComparer 3.0 is a great tool if you want to synchronize your SQL Server database environments and don’t have hundreds of dollars to spend on Red Gate’s SQL Compare.  It’s simple to use and free. http://dbcomparer.com/ I used it for a couple of weeks without any problem until one day when I tried to compare [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=393&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>DBComparer  3.0 is a great tool if you want to synchronize your SQL Server database  environments and don’t have hundreds of dollars to spend on Red Gate’s  SQL Compare.  It’s simple to use and free.</p>
<p><a href="http://dbcomparer.com/">http://dbcomparer.com/</a></p>
<p>I  used it for a couple of weeks without any problem until one day when I  tried to compare with a particular server and it crashed:</p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/02/newcomparison.png"><img class="aligncenter size-full wp-image-394" title="DBComparer NullReferenceException" src="http://andrewtwest.files.wordpress.com/2011/02/newcomparison.png?w=454&#038;h=325" alt="DBComparer NullReferenceException" width="454" height="325" /></a></p>
<p>Looking  at the error message, we can deduce that the WriteRecentList() function  saves the names of the servers you have typed in the recent servers  list.  This is sort of like the recent files list found in some applications.</p>
<p>SettingsBase  is part of the .NET Framework, and this part of the code is probably  used to persist application settings.  A little digging around on the  MSDN library <a href="http://msdn.microsoft.com/en-us/library/system.configuration.localfilesettingsprovider.aspx">reveals this</a>:</p>
<blockquote><p>Specific  user data is stored in a file named user.config, stored under the  user&#8217;s home directory. If roaming profiles are enabled, two versions of  the user configuration file could exist. In such a case, the entries in  the roaming version take precedence over duplicated entries in the local  user configuration file.</p></blockquote>
<p>A  look in the user.config file confirms our theory that this is where the  list of recent servers are stored.  However, DBComparer is only  designed to support 10 recent server names (5 on each side of the  comparison).  Any more than that and it blows up.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;configuration&gt;
  &lt;userSettings&gt;
    &lt;DBCompare.Properties.Settings&gt;
      &lt;setting name=&quot;RecentServerName11&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server1&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName12&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server2&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName13&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server3&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName14&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server4&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName15&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server5&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName21&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server6&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName22&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server7&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName23&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server8&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName24&quot; serializeAs=&quot;String&quot;&gt;
         &lt;value&gt;server9&lt;/value&gt;
      &lt;/setting&gt;
      &lt;setting name=&quot;RecentServerName25&quot; serializeAs=&quot;String&quot;&gt;
        &lt;value&gt;server10&lt;/value&gt;
      &lt;/setting&gt;
    &lt;/DBCompare.Properties.Settings&gt;
  &lt;/userSettings&gt;
&lt;/configuration&gt;
</pre></p>
<p>As a workaround until this bug is fixed, you can delete some or all of the server names in the value tags to make room for more and prevent the error.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=393&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/02/25/workaround-for-nullreferenceexception-in-dbcomparer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/02/newcomparison.png" medium="image">
			<media:title type="html">DBComparer NullReferenceException</media:title>
		</media:content>
	</item>
		<item>
		<title>Same Markup, Same Browser, Different Results</title>
		<link>http://andrewtwest.com/2011/02/23/same-markup-same-browser-different-results/</link>
		<comments>http://andrewtwest.com/2011/02/23/same-markup-same-browser-different-results/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 05:34:17 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[compatibility view]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[intranet]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=376</guid>
		<description><![CDATA[Here is a simple HTML5 page I created: And here is that page rendered in Internet Explorer 8.  In one case it’s being served on my laptop, and the other on the local intranet. The markup, the Web servers, and the browser are all set up 100% the same.  These should be identical, shouldn’t they? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=376&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a simple HTML5 page I created:</p>
<p><pre class="brush: xml;">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
 &lt;meta charset=&quot;utf-8&quot; /&gt;
 &lt;title&gt;Inconsistent Rendering&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
 &lt;span style=&quot;height: 1px; overflow: visible; background-color: Green;&quot;&gt;
 &lt;h1&gt;This is a test.&lt;/h1&gt;
 &lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p>And  here is that page rendered in Internet Explorer 8.  In one case it’s  being served on my laptop, and the other on the local intranet.</p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/02/localhost.png"><img class="aligncenter size-full wp-image-379" title="Test file on localhost" src="http://andrewtwest.files.wordpress.com/2011/02/localhost.png?w=376&#038;h=276" alt="Test file on localhost" width="376" height="276" /></a></p>
<p><a href="http://andrewtwest.files.wordpress.com/2011/02/localhost.png"></a><a href="http://andrewtwest.files.wordpress.com/2011/02/intranet1.png"><img class="aligncenter size-full wp-image-383" title="Test file on intranet" src="http://andrewtwest.files.wordpress.com/2011/02/intranet1.png?w=376&#038;h=276" alt="Test file on intranet" width="376" height="276" /></a></p>
<p>The  markup, the Web servers, and the browser are all set up 100% the same.   These should be identical, shouldn’t they?  What’s the problem?  The  answer is Compatibility View.</p>
<p>Compatibility  View is a “feature” of Internet Explorer that causes it to ignore  modern Web standards.  That would be fine, except Compatibility View  settings vary by zone, and different zones have different defaults.   Also, the Compatibility View button in the address bar isn’t always  available, which means there’s no visual indicator as to what mode  you’re in, and you can’t change modes for the current page easily.</p>
<p>Compatibility  View settings can be accessed in the Tools &#8211;&gt; Compatibility View  Settings menu, but if you’ve developed a standards compliant intranet  site, you need a better fix than simply asking each individual user to  reconfigure their browser.  Group Policy is one option, but there is a  much simpler solution.  Just add the following meta tag to your pages,  and it will force IE 8 to use the !DOCTYPE declaration in the page to  determine the rendering mode.</p>
<p><pre class="brush: xml;">
&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE8&quot; /&gt;
</pre></p>
<p>If you&#8217;re experiencing rendering inconsistencies with the same markup being served from different environments, have a look into Compatibility View.  It just might be the culprit.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=376&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/02/23/same-markup-same-browser-different-results/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/02/localhost.png" medium="image">
			<media:title type="html">Test file on localhost</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/02/intranet1.png" medium="image">
			<media:title type="html">Test file on intranet</media:title>
		</media:content>
	</item>
		<item>
		<title>Mercurial HTTP Error 500: Access is denied on 00changelog.i</title>
		<link>http://andrewtwest.com/2011/01/13/mercurial-http-error-500-access-is-denied-on-00changelog-i/</link>
		<comments>http://andrewtwest.com/2011/01/13/mercurial-http-error-500-access-is-denied-on-00changelog-i/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 05:19:47 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[00changelog]]></category>
		<category><![CDATA[access is denied]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[http error 500]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[push]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=362</guid>
		<description><![CDATA[Today I created a new Mercurial repository on a Windows server.  I cloned it, made some changes, tried to push, and was greeted with this: C:\myapplication&#62;hg push pushing to http://servername/myapplication searching for changes abort: HTTP Error 500: .hg\store0changelog.i: Access is denied My user account had write permission to the myapplication folder on the server, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=362&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today  I created a new Mercurial repository on a Windows server.  I cloned it,  made some changes, tried to push, and was greeted with this:</p>
<p><code>C:\myapplication&gt;hg push<br />
pushing to http://servername/myapplication<br />
searching for changes<br />
abort: HTTP Error 500: .hg\store0changelog.i: Access is denied</code></p>
<p>My  user account had write permission to the <strong>myapplication </strong>folder on the  server, and the odd thing is that I’ve created repositories there before  and never had a problem pushing changes.  I compared <strong>00changelog.i</strong> to  the same file in another repository that was working.  Turns out I was using anonymous authentication and <strong>IUSR </strong>was missing write permission.  I gave full control to <strong>IUSR </strong>on <strong>hg\store</strong> folder and&#8230;</p>
<p><code>C:\myapplication&gt;hg push<br />
pushing to http://servername/myapplication<br />
searching for changes<br />
remote: adding changesets<br />
remote: adding manifests<br />
remote: adding file changes<br />
remote: added 1 changesets with 114 changes to 114 files</code></p>
<p>Success!</p>
<p>If  you’re having problems pushing to a central server with Mercurial, make  sure <del>the IIS anonymous authentication account (<strong>IUSR </strong>or  <strong>IUSR_<em>MachineName</em></strong>)</del> you have write permission to the <strong>hg\store</strong> folder and  subfolders in your repository.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=362&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/01/13/mercurial-http-error-500-access-is-denied-on-00changelog-i/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>
	</item>
		<item>
		<title>Conditional Validation with Data Annotations in ASP.NET MVC</title>
		<link>http://andrewtwest.com/2011/01/10/conditional-validation-with-data-annotations-in-asp-net-mvc/</link>
		<comments>http://andrewtwest.com/2011/01/10/conditional-validation-with-data-annotations-in-asp-net-mvc/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 04:54:54 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[data annotations]]></category>
		<category><![CDATA[model state]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=340</guid>
		<description><![CDATA[In the simple blog engine I’m building, I encountered a scenario where I wanted to display different UI elements depending on whether the user was logged in: &#160; &#160; When the user is authenticated, their name and email is known, so it’s unnecessary to display them on the comment input form.  While it would be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=340&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In  the <a href="https://bitbucket.org/andrewtwest/dotblog" target="_blank">simple blog engine</a> I’m building, I encountered a scenario where I  wanted to display different UI elements depending on whether the user  was logged in:</p>
<div id="attachment_346" class="wp-caption aligncenter" style="width: 303px"><a href="http://andrewtwest.files.wordpress.com/2011/01/leave_reply.png"><img class="size-full wp-image-346" style="border:1px solid #999999;" title="Comment Form" src="http://andrewtwest.files.wordpress.com/2011/01/leave_reply.png?w=293&#038;h=322" alt="Comment Form" width="293" height="322" /></a><p class="wp-caption-text">Not logged in</p></div>
<p>&nbsp;</p>
<div id="attachment_347" class="wp-caption aligncenter" style="width: 298px"><a href="http://andrewtwest.files.wordpress.com/2011/01/leave_reply_logged_in.png"><img class="size-full wp-image-347 " style="border:1px solid #999999;" title="Comment Form Logged In" src="http://andrewtwest.files.wordpress.com/2011/01/leave_reply_logged_in.png?w=288&#038;h=232" alt="Comment Form Logged In" width="288" height="232" /></a><p class="wp-caption-text">Logged in</p></div>
<p>&nbsp;</p>
<p>When  the user is authenticated, their name and email is known, so it’s  unnecessary to display them on the comment input form.  While it would  be possible to hide just those fields, I decided to make separate  partial views and display them in the Post view with the following code:</p>
<p><pre class="brush: csharp;">
&lt;%
    if (Model.AllowComments)
    {
        var commentControlName = Request.IsAuthenticated ? AuthenticatedCommentFormControl&quot; : &quot;CommentFormControl&quot;;
        Html.RenderPartial(commentControlName, new DotBlog.Models.ViewModels.CommentViewModel(Model.PostId));
    }
%&gt;
</pre></p>
<p>This is the view model I used for both partial views:</p>
<p><pre class="brush: csharp;">
public class CommentViewModel
{
    ...

    [Required]
    [StringLength(50)]
    [DisplayName(&quot;Name&quot;)]
    public string CommenterName { get; set; }

    public DateTime Date { get; set; }

    [Required]
    [StringLength(100)]
    public string Email { get; set; }

    [StringLength(100)]
    [DisplayName(&quot;Web Site&quot;)]
    public string WebSite { get; set; }

    [Required]
    [StringLength(1024)]
    [DisplayName(&quot;Comment&quot;)]
    public string CommentText { get; set; }

    ...
}
</pre></p>
<p>As  you can see, I’m using data annotations to enforce required fields and  string lengths.  The problem is, even though the name and email aren’t  always displayed, they are still required.  I needed a way to validate  certain fields conditionally.  Here are the options I came up with:</p>
<ul>
<li>Stop using data annotations and find a different solution for validation</li>
<li>Use two different view models: one for each partial view</li>
<li>Use actual conditional data annotations, like <a href="http://blogs.msdn.com/b/simonince/archive/2010/06/04/conditional-validation-in-mvc.aspx" target="_blank">the library built by Simon Ince</a>.</li>
<li>When the form is posted, remove the fields from the model state so they’re not validated.</li>
</ul>
<p>&nbsp;</p>
<p>Let’s look at each of these individually:</p>
<h2>Stop Using Data Annotations</h2>
<p>Data  annotations are not the only way to specify validation rules, but  they’re easy to implement.  xVal was fine for ASP.MVC 1.0, but is now  deprecated.  Custom validation code with ModelState.AddModelError() is  flexible, but requires extra work.</p>
<h2>Use Two Different View Models</h2>
<p>Since  I’m using two partial views for the comment form (one for authenticated  users and one for guests), I could use a dedicated view model for each.   One would omit the data annotations on name and email and therefore  not cause any validation problems.  This was my original implementation,  but lead to unnecessary code duplication and other design problems.</p>
<h2>Use Conditional Data Annotations</h2>
<p>Simon Ince has built <a href="http://blogs.msdn.com/b/simonince/archive/2010/06/04/conditional-validation-in-mvc.aspx" target="_blank">a cool library</a> for conditional annotations that allows you to write code like this:</p>
<p><pre class="brush: csharp;">
public class ValidationSample
{
    [RequiredIf(&quot;PropertyValidationDependsOn&quot;, true)]
    public string PropertyToValidate { get; set; }

    public bool PropertyValidationDependsOn { get; set; }
}
</pre></p>
<h2>Conditionally Remove Fields from the Model State in the Controller</h2>
<p>In the end, this is the solution I went with.  The controller executes this code when the form is posted:</p>
<p><pre class="brush: csharp;">
if (Request.IsAuthenticated)
{
    ...

    // We don't need to validate user fields if user is logged in.
    ModelState.Remove(&quot;CommenterName&quot;);
    ModelState.Remove(&quot;Email&quot;);
}
</pre></p>
<p>By  removing the fields from the model state, it won’t be invalid when they  are missing.  This method is simple and avoids adding additional  dependencies.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/340/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=340&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2011/01/10/conditional-validation-with-data-annotations-in-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/01/leave_reply.png" medium="image">
			<media:title type="html">Comment Form</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2011/01/leave_reply_logged_in.png" medium="image">
			<media:title type="html">Comment Form Logged In</media:title>
		</media:content>
	</item>
		<item>
		<title>Entity Framework StoreGeneratedPattern Bug Persists</title>
		<link>http://andrewtwest.com/2010/10/24/when-will-the-entity-framework-storegeneratedpattern-bug-go-away/</link>
		<comments>http://andrewtwest.com/2010/10/24/when-will-the-entity-framework-storegeneratedpattern-bug-go-away/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 02:54:00 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[entity framework]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[storegeneratedpattern]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=324</guid>
		<description><![CDATA[I’m using System.Data.SQLite v1.0.66.0 with Entity Framework 4.0 and Visual Studio 2010.  I designed some tables in SQLite and generated an Entity Data Model from those tables.  One of them (we’ll call it Person for the sake of argument) has an autogenerated integer primary key.  I manually set the StoreGeneratedPattern property to Identity in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=324&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’m  using System.Data.SQLite v1.0.66.0 with Entity Framework 4.0 and Visual  Studio 2010.  I designed some tables in SQLite and generated an Entity  Data Model from those tables.  One of them (we’ll call it <strong>Person </strong>for the sake of argument) has an autogenerated integer primary key.  I manually set the <strong>StoreGeneratedPattern </strong>property to <strong>Identity </strong>in the designer, but when I started creating new rows in the database I encountered a problem.</p>
<p>I create new <strong>Person </strong>entities with a dummy <strong>PersonID </strong>of  -1.  The first row inserts fine, but instead of generating a new ID it  uses the dummy value.  That means when I insert the second row, it  fails:</p>
<blockquote><p>Abort due to constraint violation<br />
PRIMARY KEY must be unique</p></blockquote>
<p>I did a little Googling and realized I’m not the only person experiencing this:</p>
<ul>
<li><a href="http://geeksharp.com/2010/05/27/ef4-bug-in-storegeneratedpattern-ssdl/" target="_blank">EF4: Bug in StoreGeneratedPattern SSDL | geek#</a></li>
<li><a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/404d3017-01b7-4129-8e05-f4aa48f15f08" target="_blank">edmx designer properties does not set StoreGeneratedPattern=&#8221;Computed&#8221; in SSDL</a></li>
<li><a href="http://stackoverflow.com/questions/2995086/storegeneratedpattern-in-entitiy-framework" target="_blank">StoreGeneratedPattern in Entitiy framework &#8211; Stack Overflow</a></li>
</ul>
<p>It seems there is a bug in which the <strong>StoragePattern </strong>property is not updated in the SSDL when you change it in the designer, even though the CSDL is.</p>
<p>The impact of this is that you have to open the .edmx file in the XML editor and manually add the <strong>StorageGeneratedPattern </strong>property to the definition for your entity in the <strong>StorageModels </strong>section:</p>
<p><pre class="brush: xml;">
&lt;EntityType Name=&quot;Person&quot;&gt;
    &lt;Key&gt;
        &lt;PropertyRef Name=&quot;PersonID&quot; /&gt;
    &lt;/Key&gt;
    &lt;Property Name=&quot;PersonID&quot; Type=&quot;integer&quot; Nullable=&quot;false&quot; StoreGeneratedPattern=&quot;Identity&quot; /&gt;
    &lt;Property Name=&quot;Name&quot; Type=&quot;nvarchar&quot; Nullable=&quot;false&quot; MaxLength=&quot;50&quot; /&gt;
    &lt;Property Name=&quot;Age&quot; Type=&quot;integer&quot; Nullable=&quot;false&quot; /&gt;
&lt;/EntityType&gt;
</pre></p>
<p>Even  worse, you’ll have to do this for every identity column every time you  update the model from the database because the property gets clobbered.   The workaround does work, technically, but it’s a major nuisance during  development when things change often.</p>
<p>Identity  columns are not uncommon, which means that this issue should have been  uncovered early during testing.  Why didn’t Microsoft fix it right away?   According to some claims, it’s been around since EF 1.0.  In a couple  of weeks I’m starting a new job where they use NHibernate.  It will be  interesting to compare it to EF 4.0 and see if I run into the same kind  of bugs.  Perhaps it will also help to wean me off graphical designers altogether.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=324&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2010/10/24/when-will-the-entity-framework-storegeneratedpattern-bug-go-away/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>
	</item>
		<item>
		<title>Multi-Column Unique Constraints in SQLite.NET</title>
		<link>http://andrewtwest.com/2010/10/17/multi-column-unique-constraints-in-sqlite-net/</link>
		<comments>http://andrewtwest.com/2010/10/17/multi-column-unique-constraints-in-sqlite-net/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 19:58:07 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[unique constraint]]></category>
		<category><![CDATA[unique index]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=315</guid>
		<description><![CDATA[While working on my blog engine project to learn ASP.NET MVC and Entity Framework, I encountered a common scenario.  I’m using SQLite on the back-end, and I needed a unique constraint across two columns.  As demonstrated in this stackoverflow question, you can specify a unique table constraint immediately after the column definitions when using the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=315&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While  working on my blog engine project to learn ASP.NET MVC and Entity  Framework, I encountered a common scenario.  I’m using SQLite on the  back-end, and I needed a unique constraint across two columns.  As  demonstrated in <a href="http://stackoverflow.com/questions/2701877/sqlite-table-constraint-unique-on-multiple-columns" target="_blank">this stackoverflow question</a>, you can specify a unique table constraint immediately after the  column definitions when using the CREATE TABLE command.  However, for  the purpose of rapid prototyping, I prefer using <a href="http://sqlite.phxsoftware.com/" target="_blank">SQLite.NET</a> and the graphical Server Explorer interface in Visual Studio rather than explicit DDL to define my tables.</p>
<p>The  problem is that the GUI-based designer is still in development and  doesn’t support unique table constraints.  One solution is to create a  unique index instead.  Right-click one of the row headers in the table  designer and select Indexes/Keys&#8230;</p>
<p><a href="http://andrewtwest.files.wordpress.com/2010/10/table_design_context_menu.png"><img class="aligncenter size-full wp-image-316" title="Table design context menu" src="http://andrewtwest.files.wordpress.com/2010/10/table_design_context_menu.png?w=281&#038;h=279" alt="Table design context menu" width="281" height="279" /></a></p>
<p>In  the Index Editor, add a new index.  Under the Misc category, set the  Unique property to True, and under the Source category, list the columns  you want in the index, separated by commas.</p>
<p><a href="http://andrewtwest.files.wordpress.com/2010/10/index_editor.png"><img class="aligncenter size-full wp-image-317" title="Index editor" src="http://andrewtwest.files.wordpress.com/2010/10/index_editor.png?w=497&#038;h=365" alt="Index editor" width="497" height="365" /></a></p>
<p>This works because, <a href="http://www.sqlite.org/lang_createtable.html" target="_blank">as stated in the SQLite documentation</a>:</p>
<blockquote><p><a href="http://www.sqlite.org/lang_createtable.html#rowid" target="_blank">INTEGER PRIMARY KEY</a> columns aside, both UNIQUE and PRIMARY KEY constraints are implemented  by creating an index in the database (in the same way as a<a href="http://www.sqlite.org/lang_createindex.html" target="_blank"> &#8220;CREATE UNIQUE INDEX&#8221;</a> statement would).</p></blockquote>
<p>Using  the Index Editor to create an index with Unique = True generates a  “CREATE UNIQUE INDEX” statement behind the scenes, which can be verified  by using the Generate Change Script&#8230; feature.</p>
<p>In  summary, if you’re thinking about using Server Explorer to create a  multi-column unique constraint in SQLite, just go with a unique index,  since that’s how it’s implemented anyway.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/315/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/315/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/315/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=315&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2010/10/17/multi-column-unique-constraints-in-sqlite-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2010/10/table_design_context_menu.png" medium="image">
			<media:title type="html">Table design context menu</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2010/10/index_editor.png" medium="image">
			<media:title type="html">Index editor</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Survive Your Technical Presentation</title>
		<link>http://andrewtwest.com/2010/09/12/how-to-survive-your-technical-presentation/</link>
		<comments>http://andrewtwest.com/2010/09/12/how-to-survive-your-technical-presentation/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 03:24:56 +0000</pubDate>
		<dc:creator>Andy West</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[public speaking]]></category>
		<category><![CDATA[user group]]></category>

		<guid isPermaLink="false">http://andrewtwest.com/?p=308</guid>
		<description><![CDATA[A few weeks ago I did a presentation on F# at a local user group meeting.  It was an opportunity to learn something new, network with other developers, and improve my communication skills.  Here are some of the things I learned from the experience. Know your subject well in advance Building slides, writing code snippets [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=308&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A  few weeks ago I did a presentation on F# at a local user group meeting.   It was an opportunity to learn something new, network with other  developers, and improve my communication skills.  Here are some of the  things I learned from the experience.</p>
<p style="text-align:center;"><a href="http://andrewtwest.files.wordpress.com/2010/09/fsharp_talk.jpg"><img class="aligncenter size-full wp-image-312" style="border:1px solid black;" title="My F# presentation" src="http://andrewtwest.files.wordpress.com/2010/09/fsharp_talk.jpg?w=455&#038;h=342" alt="My F# presentation" width="455" height="342" /></a></p>
<h2>Know your subject well in advance</h2>
<p>Building  slides, writing code snippets and demos, and coming up with talking  points are all difficult enough, not to mention the time it takes to  practice your presentation thoroughly.  Don’t complicate matters by  trying to learn a new language or technology from scratch.</p>
<h2>Make friends with the experts in the room</h2>
<p>Get  knowledgeable attendees on your side right away.  During my F# talk, I  turned to them when confronted with questions I couldn’t answer, and  they bailed me out a couple of times.</p>
<h2>Know your equipment inside and out</h2>
<p>Try  to keep things as simple as possible.  The fewer tools you have to  manage, the less chance something will go wrong.  Arrive early so you  can test your laptop, projector, and all your software.  Make sure to  have fresh batteries for your presentation remote and microphone.  If at  all possible, do a dry run with the actual equipment you’ll be using  during your talk.</p>
<h2>Don’t go over the allotted time</h2>
<p>At  one point while I was talking, a meeting attendee rose from his seat  and left.  It wasn’t until then that I realized I had gone several  minutes too long.  The room was packed, but everyone was too polite to  mention that it was time to leave.</p>
<p>Ironically,  I had worked very hard to fill that time with content.  But the  important thing to remember is that talking at a user group meeting  isn’t about filling dead air with noise; it’s about teaching and sharing  information.  Only say what is necessary and relevant, and then let  your audience go home.</p>
<h2>Don’t be boring</h2>
<p>This  is probably easier said than done, but if you want to hold your  audience’s attention, you can’t be dull and predictable.  Own your  presentation and make it unique.  Record a video of yourself speaking  and make sure you don’t look like a robot, with monotonous speech and  stiff movements.</p>
<h2>Read <a href="http://www.amazon.com/Confessions-Public-Speaker-Scott-Berkun/dp/0596801998" target="_blank"><em>Confessions of a Public Speaker</em></a> by Scott Berkun</h2>
<p>I  didn’t have to learn all these lessons on my own, and neither do you.   In his book, Scott captures years worth of public speaking wisdom in  two hundred brief and entertaining pages.  I only wish I had read it  earlier.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewtwest.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewtwest.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewtwest.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewtwest.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewtwest.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewtwest.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewtwest.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewtwest.wordpress.com/308/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewtwest.com&amp;blog=12038026&amp;post=308&amp;subd=andrewtwest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewtwest.com/2010/09/12/how-to-survive-your-technical-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/257794d1a5b0dbab1ecd6eeb33975693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andy West</media:title>
		</media:content>

		<media:content url="http://andrewtwest.files.wordpress.com/2010/09/fsharp_talk.jpg" medium="image">
			<media:title type="html">My F# presentation</media:title>
		</media:content>
	</item>
	</channel>
</rss>
