<?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>out &#62;&#62; m_Conscientia; &#187; Alex Peck</title>
	<atom:link href="http://blog.hypercomplex.co.uk/index.php/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hypercomplex.co.uk</link>
	<description>a multidimensional braindump</description>
	<lastBuildDate>Sat, 27 Aug 2011 19:16:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>fatal error C1859</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2011/08/fatal-error-c1859/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2011/08/fatal-error-c1859/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 22:14:24 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[precompiled header]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1647</guid>
		<description><![CDATA[Once, a friend of mine set the welcome message on his Nokia 5110 to &#8216;fatal error&#8217;. This totally baffled the salesmen in Carphone Warehouse. I was equally baffled when I returned to an old C++ project and tried to compile it in a freshly installed Visual Studio 2008 SP1. I was greeted with a series [...]]]></description>
			<content:encoded><![CDATA[<p>Once, a friend of mine set the welcome message on his <a href="http://en.wikipedia.org/wiki/Nokia_5110">Nokia 5110</a> to &#8216;fatal error&#8217;. This totally baffled the salesmen in Carphone Warehouse.</p>
<p>I was equally baffled when I returned to an old C++ project and tried to compile it in a freshly installed Visual Studio 2008 SP1. I was greeted with a series of these errors:</p>
<blockquote><p>
fatal error C1859: &#8216;Debug\blah.pch&#8217; unexpected precompiled header error, simply rerunning the compiler might fix this problem
</p></blockquote>
<p>Not surprisingly, simply rerunning the compiler did not fix the problem. In fact, this is caused by address space layout randomization on Windows7/Server2008, as noted <a href="http://blogs.msdn.com/b/vcblog/archive/2009/11/12/visual-c-precompiled-header-errors-on-windows-7.aspx">here</a>.</p>
<p>The hotfix is available here: <a href="http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=25785">Fix for Visual C++ 2008 SP1 compiler error C1859</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2011/08/fatal-error-c1859/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do unit test reviews</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2011/07/how-to-do-unit-test-reviews/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2011/07/how-to-do-unit-test-reviews/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 23:39:11 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[code review]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1578</guid>
		<description><![CDATA[At work we have begun to push unit testing and even TDD. Consequently code reviews now include more unit tests. Often, reviewers are very focused on product code, and neglect to review tests in detail. Letting poor quality test code slip in is a big problem. Fragile tests erode confidence in unit testing as a [...]]]></description>
			<content:encoded><![CDATA[<p>At work we have begun to push unit testing and even TDD. Consequently code reviews now include more unit tests. Often, reviewers are very focused on product code, and neglect to review tests in detail. </p>
<p>Letting poor quality test code slip in is a big problem. Fragile tests erode confidence in unit testing as a valuable exercise, and tests which are hard to maintain just slow you down when the <a href="http://dilbert.com/strips/comic/1994-09-22/">inevitable changes</a> are required.</p>
<p>When I review unit test code, I consider the following:</p>
<ul>
<li>Unit tests must favour <strong>readability</strong>. They must be compact, have a clear relationship between cause and effect, and use descriptive and meaningful phrases (<a href="http://blog.jayfields.com/2006/05/dry-code-damp-dsls.html">DAMP</a>).</li>
<li>Unit tests should <strong>assert once</strong>. There must be a clear relationship between test case method name and the assertion(s). This way, it is easy to determine the purpose of the test at a glance, and it is obvious what it means if the test fails.</li>
<li>Prefer <a href="http://xunitpatterns.com/State%20Verification.html">state verification</a> to <a href="http://xunitpatterns.com/Behavior%20Verification.html">behaviour verification</a>. If you must verify behaviour (because there is no state, or it is unreasonably difficult to test state), be very careful not to over specify expectations.</li>
<li>Unit tests must be based on the <strong>public interface</strong> of a class. Testing internals makes your tests fragile. This is related to behaviour verification, sometimes you need to verify internal interactions, but this is not the same as invoking private methods in order to test them.</li>
<li>Unit tests must not contain (or contain very little) <a href="http://xunitpatterns.com/Conditional%20Test%20Logic.html">conditional logic</a>, such as branches or loops. Conditional logic makes code harder to read.</li>
<li>Unit tests must be <strong>easy to maintain</strong>. As far as possible, <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a> by applying the following techniques: use test setup/tear down methods to execute code common to all tests; implement custom verification functions or classes; use framework features like <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.collectionassert%28v=VS.100%29.aspx">CollectionAssert</a>, <a href="http://msdn.microsoft.com/en-us/library/ms132151.aspx">IEqualityComparer</a> or <a href="http://msdn.microsoft.com/en-us/library/8ehhxeaf.aspx">IComparer</a>.</li>
</ul>
<p>Further reading/viewing:</p>
<p><a href="http://xunitpatterns.com/index.html">xUnit Test Patterns</a><br />
<a href="http://msdn.microsoft.com/en-us/magazine/cc163665.aspx">Write Maintainable Unit Tests That Will Save You Time And Tears &#8211; Roy Osherove</a><br />
<a href="http://vimeo.com/19431001">How to do test reviews &#8211; Roy Osherove</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2011/07/how-to-do-unit-test-reviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Steven Sinofsky’s D9 Interview</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2011/06/steven-sinofsky%e2%80%99s-d9-interview/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2011/06/steven-sinofsky%e2%80%99s-d9-interview/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 22:48:14 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[D9]]></category>
		<category><![CDATA[metro]]></category>
		<category><![CDATA[Sinofsky]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1585</guid>
		<description><![CDATA[Sinofsky seems overly defensive to me. I like the Metro UI, and I think it will work well for tablets. I&#8217;m less convinced with replacing the start menu with a Metro hub.]]></description>
			<content:encoded><![CDATA[<p><object id="wsj_fp" width="408" height="270"><param name="movie" value="http://s.wsj.net/media/swf/microPlayer.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="flashvars" value="videoGUID={D1D75DF9-EC94-4C94-B35A-3FAE93F643CB}&#038;playerid=4001&#038;plyMediaEnabled=1&#038;configURL=http://wsj.vo.llnwd.net/o28/players/&#038;autoStart=false" base="rtmpt://wsj.fcod.llnwd.net/a1318/o28/video"name="microflashPlayer"></param><embed src="http://s.wsj.net/media/swf/microPlayer.swf" bgcolor="#FFFFFF"flashVars="videoGUID={D1D75DF9-EC94-4C94-B35A-3FAE93F643CB}&#038;playerid=4001&#038;plyMediaEnabled=1&#038;configURL=http://wsj.vo.llnwd.net/o28/players/&#038;autoStart=false" base="rtmpt://wsj.fcod.llnwd.net/a1318/o28/video" name="microflashPlayer" width="408" height="270" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p>Sinofsky seems overly defensive to me. I like the Metro UI, and I think it will work well for tablets. I&#8217;m less convinced with replacing the start menu with a Metro hub.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2011/06/steven-sinofsky%e2%80%99s-d9-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extension method to compute standard deviation of IEnumerable&lt;TimeSpan&gt;</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2011/06/extension-method-to-compute-standard-deviation-of-ienumerabletimespan/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2011/06/extension-method-to-compute-standard-deviation-of-ienumerabletimespan/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 18:24:27 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[extension method]]></category>
		<category><![CDATA[ienumerable]]></category>
		<category><![CDATA[TimeSpan]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1591</guid>
		<description><![CDATA[Recently, I have been writing some quick and dirty performance tests. I repeat each test scenario a few times and take an average of the execution time. In order to verify that I have a reasonably stable measurement, I wanted to also display the coefficient of variation, which is defined as the ratio of the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been writing some <a href="http://blogs.msdn.com/b/ricom/archive/2010/04/26/a-few-words-about-micro-benchmarks.aspx">quick and dirty performance tests</a>. I repeat each test scenario a few times and take an average of the execution time. In order to verify that I have a reasonably stable measurement, I wanted to also display the <a href="http://en.wikipedia.org/wiki/Coefficient_of_variation">coefficient of variation</a>, which is defined as the ratio of the <a href="http://en.wikipedia.org/wiki/Standard_deviation">standard deviation</a> to the mean.</p>
<p>Given a set of TimeSpan values, I want to get the standard deviation as a TimeSpan. I implemented this based on the extension method I found <a href="http://stackoverflow.com/questions/2253874/linq-equivalent-for-standard-deviation">here</a> on StackOverflow. I implemented both sample (with <a href="http://en.wikipedia.org/wiki/Bessel%27s_correction">Bessel&#8217;s correction</a>) and population standard deviation.</p>

<div class="wp_codebox"><table><tr id="p15913"><td class="code" id="p1591code3"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> StandardDeviationExtensions
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">double</span> SampleStandardDeviation<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&gt;</span> values<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #6666cc; font-weight: bold;">int</span> count <span style="color: #008000;">=</span> values<span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>count <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">double</span> average <span style="color: #008000;">=</span> values<span style="color: #008000;">.</span><span style="color: #0000FF;">Average</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #6666cc; font-weight: bold;">double</span> sumOfSquaredDifferences <span style="color: #008000;">=</span> values<span style="color: #008000;">.</span><span style="color: #0000FF;">Sum</span><span style="color: #008000;">&#40;</span>v <span style="color: #008000;">=&gt;</span> Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Pow</span><span style="color: #008000;">&#40;</span>v <span style="color: #008000;">-</span> average, <span style="color: #FF0000;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Sqrt</span><span style="color: #008000;">&#40;</span>sumOfSquaredDifferences <span style="color: #008000;">/</span> <span style="color: #008000;">&#40;</span>count <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #FF0000;">0.0</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">double</span> PopulationStandardDeviation<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&gt;</span> values<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>values<span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">double</span> average <span style="color: #008000;">=</span> values<span style="color: #008000;">.</span><span style="color: #0000FF;">Average</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Sqrt</span><span style="color: #008000;">&#40;</span>values<span style="color: #008000;">.</span><span style="color: #0000FF;">Average</span><span style="color: #008000;">&#40;</span>v <span style="color: #008000;">=&gt;</span> Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Pow</span><span style="color: #008000;">&#40;</span>v <span style="color: #008000;">-</span> average, <span style="color: #FF0000;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #FF0000;">0.0</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> TimeSpan SampleStandardDeviation<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> IEnumerable<span style="color: #008000;">&lt;</span>TimeSpan<span style="color: #008000;">&gt;</span> values<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> TimeSpan<span style="color: #008000;">&#40;</span>
            <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">long</span><span style="color: #008000;">&#41;</span>values
                <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Select</span><span style="color: #008000;">&#40;</span>v <span style="color: #008000;">=&gt;</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#41;</span>v<span style="color: #008000;">.</span><span style="color: #0000FF;">Ticks</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">.</span><span style="color: #0000FF;">SampleStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> TimeSpan PopulationStandardDeviation<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> IEnumerable<span style="color: #008000;">&lt;</span>TimeSpan<span style="color: #008000;">&gt;</span> values<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> TimeSpan<span style="color: #008000;">&#40;</span>
            <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">long</span><span style="color: #008000;">&#41;</span>values
                <span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Select</span><span style="color: #008000;">&#40;</span>v <span style="color: #008000;">=&gt;</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#41;</span>v<span style="color: #008000;">.</span><span style="color: #0000FF;">Ticks</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">.</span><span style="color: #0000FF;">PopulationStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>And here are the tests:</p>

<div class="wp_codebox"><table><tr id="p15914"><td class="code" id="p1591code4"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>TestClass<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> StandardDeviationTest
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> EmptySet <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> SingleValue <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> <span style="color: #FF0000;">1.0</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> SameValues <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> <span style="color: #FF0000;">5.0</span>, <span style="color: #FF0000;">5.0</span>, <span style="color: #FF0000;">5.0</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> ScenarioValues <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span> <span style="color: #FF0000;">2.0</span>, <span style="color: #FF0000;">4.0</span>, <span style="color: #FF0000;">4.0</span>, <span style="color: #FF0000;">4.0</span>, <span style="color: #FF0000;">5.0</span>, <span style="color: #FF0000;">5.0</span>, <span style="color: #FF0000;">7.0</span>, <span style="color: #FF0000;">9.0</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">double</span> ScenarioValuesSampleDeviation <span style="color: #008000;">=</span> <span style="color: #FF0000;">2.13809</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">double</span> ScenarioValuesPopulationDeviation <span style="color: #008000;">=</span> <span style="color: #FF0000;">2.0</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SampleStandardDeviation_EmptySet_HasZeroDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0.0</span>, EmptySet<span style="color: #008000;">.</span><span style="color: #0000FF;">SampleStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SampleStandardDeviation_SingleValue_HasZeroDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0.0</span>, SingleValue<span style="color: #008000;">.</span><span style="color: #0000FF;">SampleStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SampleStandardDeviation_SetOfSameValues_HasZeroDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0.0</span>, SameValues<span style="color: #008000;">.</span><span style="color: #0000FF;">SampleStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SampleStandardDeviation_ScenarioValues_HaveExpectedDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span>ScenarioValuesSampleDeviation, Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Round</span><span style="color: #008000;">&#40;</span>ScenarioValues<span style="color: #008000;">.</span><span style="color: #0000FF;">SampleStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #FF0000;">5</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SampleStandardDeviation_TimeSpanScenarioValues_HaveExpectedDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        var timeSpanValues <span style="color: #008000;">=</span> ScenarioValues<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Select</span><span style="color: #008000;">&#40;</span>seconds <span style="color: #008000;">=&gt;</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> TimeSpan<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span>, <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">&#41;</span>seconds<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        var result <span style="color: #008000;">=</span> timeSpanValues<span style="color: #008000;">.</span><span style="color: #0000FF;">SampleStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">TotalSeconds</span><span style="color: #008000;">;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span>ScenarioValuesSampleDeviation, Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Round</span><span style="color: #008000;">&#40;</span>result, <span style="color: #FF0000;">5</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> PopulationStandardDeviation_EmptySet_HasZeroDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0.0</span>, EmptySet<span style="color: #008000;">.</span><span style="color: #0000FF;">PopulationStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> PopulationStandardDeviation_SingleValue_HasZeroDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0.0</span>, SingleValue<span style="color: #008000;">.</span><span style="color: #0000FF;">PopulationStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> PopulationStandardDeviation_SetOfSameValues_HasZeroDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0.0</span>, SameValues<span style="color: #008000;">.</span><span style="color: #0000FF;">PopulationStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> PopulationStandardDeviation_ScenarioValues_HaveExpectedDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span>ScenarioValuesPopulationDeviation, Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Round</span><span style="color: #008000;">&#40;</span>ScenarioValues<span style="color: #008000;">.</span><span style="color: #0000FF;">PopulationStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #FF0000;">5</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>TestMethod<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> PopulationStandardDeviation_TimeSpanScenarioValues_HaveExpectedDeviation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        var timeSpanValues <span style="color: #008000;">=</span> ScenarioValues<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Select</span><span style="color: #008000;">&#40;</span>seconds <span style="color: #008000;">=&gt;</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> TimeSpan<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span>, <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">&#41;</span>seconds<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        var result <span style="color: #008000;">=</span> timeSpanValues<span style="color: #008000;">.</span><span style="color: #0000FF;">PopulationStandardDeviation</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">TotalSeconds</span><span style="color: #008000;">;</span>
        Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span>ScenarioValuesPopulationDeviation, Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Round</span><span style="color: #008000;">&#40;</span>result, <span style="color: #FF0000;">5</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2011/06/extension-method-to-compute-standard-deviation-of-ienumerabletimespan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Battlefield 3: Thunder Run</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2011/06/battlefield-3-thunder-run/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2011/06/battlefield-3-thunder-run/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 10:02:43 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[battlefield]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1641</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe width="540" height="339" src="http://www.youtube.com/embed/9UwOrl036_A" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2011/06/battlefield-3-thunder-run/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Battlefield 3</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2011/03/battlefield-3/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2011/03/battlefield-3/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 19:29:07 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[battlefield]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1565</guid>
		<description><![CDATA[I cannot wait.]]></description>
			<content:encoded><![CDATA[<p><iframe title="YouTube video player" width="540" height="338" src="http://www.youtube.com/embed/CsfTksi_kHs?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>I cannot wait.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2011/03/battlefield-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 OneNote SkyDrive synchronization</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2010/11/windows-phone-7-onenote-skydrive-synchronization/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2010/11/windows-phone-7-onenote-skydrive-synchronization/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 10:12:42 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1558</guid>
		<description><![CDATA[This would appear to be a straightforward process, as described here. However, when I did it, I persistently received Error 8007002: synchronization failure. My workaround was as follows: 1. Using a PC, create a new notebook in SkyDrive. Open the new notebook and the Personal (Web) notebook in seperate tabs. Copy the contents from the [...]]]></description>
			<content:encoded><![CDATA[<p>This would appear to be a straightforward process, as described <a href="http://www.microsoft.com/windowsphone/en-sg/howto/wp7/office/use-office-onenote-mobile.aspx">here</a>. However, when I did it, I persistently received <strong>Error 8007002</strong>: synchronization failure.</p>
<p>My workaround was as follows:</p>
<ul>
<ol>1. Using a PC, create a new notebook in SkyDrive. Open the new notebook and the Personal (Web) notebook in seperate tabs. Copy the contents from the old to teh new (the tedious part).</ol>
<ol>2. Using your phone, go to <a href="http://office.live.com">office.live.com</a> and log in. Open the new notebook in OneNote.</ol>
<ol>3. Using your phone, set the new notebook as default and remove Personal (Web).</ol>
<ol>4. Using a PC, delete the Personal (Web) notebook from skydrive</ol>
</ul>
<p>I later got <strong>Error 8007002</strong> after renaming a section (which is a bug), and had to repeat the process yet again. So, don&#8217;t rename sections!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2010/11/windows-phone-7-onenote-skydrive-synchronization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Programming Windows Phone 7</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2010/11/programming-windows-phone-7/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2010/11/programming-windows-phone-7/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 11:45:23 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1580</guid>
		<description><![CDATA[Programming Windows Phone 7 by Charles Petzold is available for free here.]]></description>
			<content:encoded><![CDATA[<p>Programming Windows Phone 7 by Charles Petzold is available for <em>free</em> <a href="http://www.charlespetzold.com/phone/index.html">here</a>.</p>
<div class="wp-caption alignnone" style="width: 449px"><img alt="" src="http://www.charlespetzold.com/PetzoldTattoo.jpg" title="Petzold Tattoo" width="219" height="260" /><p class="wp-caption-text">Charles Petzold: Branded</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2010/11/programming-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Natural User Interface TechTalk</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2010/10/natural-user-interface-techtalk/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2010/10/natural-user-interface-techtalk/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 16:43:01 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[nui]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1540</guid>
		<description><![CDATA[Bill Buxton gives a great historical perspective on user interfaces and the pace of innovation.]]></description>
			<content:encoded><![CDATA[<p><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="512" height="288"><param name="source" value="http://channel9.msdn.com/scripts/VideoPlayer.xap?v=3.1" /><param name="initParams" value="deferredLoad=true,duration=0,m=http://ecn.channel9.msdn.com/o9/ch9/1911/4dafd9dd-b996-45c4-a3cd-9e0e006b1911/MDCCTechTalkBillBuxton_ch9.wmv,autostart=false,autohide=true,showembed=true, thumbnail=http://ecn.channel9.msdn.com/o9/ch9/1911/4dafd9dd-b996-45c4-a3cd-9e0e006b1911/MDCCTechTalkBillBuxton_512_ch9.jpg, postid=0" /><param name="background" value="#00FFFFFF" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><br />
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
</a><br />
</object></p>
<p>Bill Buxton gives a great historical perspective on user interfaces and the pace of innovation. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2010/10/natural-user-interface-techtalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://ecn.channel9.msdn.com/o9/ch9/1911/4dafd9dd-b996-45c4-a3cd-9e0e006b1911/MDCCTechTalkBillBuxton_ch9.wmv" length="296949957" type="video/asf" />
		</item>
		<item>
		<title>Ken Block Gymkhana 3 Part 2</title>
		<link>http://blog.hypercomplex.co.uk/index.php/2010/09/ken-block-gymkhana-3-part-2/</link>
		<comments>http://blog.hypercomplex.co.uk/index.php/2010/09/ken-block-gymkhana-3-part-2/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 17:09:57 +0000</pubDate>
		<dc:creator>Alex Peck</dc:creator>
				<category><![CDATA[Petrol]]></category>
		<category><![CDATA[Gymkhana]]></category>

		<guid isPermaLink="false">http://blog.hypercomplex.co.uk/?p=1364</guid>
		<description><![CDATA[Not sure I&#8217;m a big fan of the Fiesta.]]></description>
			<content:encoded><![CDATA[<p><object width="520" height="293" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" style="width:520px; height:293px;"><param name="movie" value="http://www.bilmagasinettv.dk/v.swf"></param><param name="FlashVars" value="photo%5fid=824267"></param><param name="allowfullscreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.bilmagasinettv.dk/v.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="520" height="293" FlashVars="photo%5fid=824267"></embed></object></p>
<p>Not sure I&#8217;m a big fan of the Fiesta.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hypercomplex.co.uk/index.php/2010/09/ken-block-gymkhana-3-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

