<?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>guysherman.com</title>
	<atom:link href="http://guysherman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://guysherman.com</link>
	<description>The ordered stream of Guy Sherman&#039;s fairly disorganised conscious</description>
	<lastBuildDate>Fri, 12 Apr 2013 05:09:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='guysherman.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>guysherman.com</title>
		<link>http://guysherman.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://guysherman.com/osd.xml" title="guysherman.com" />
	<atom:link rel='hub' href='http://guysherman.com/?pushpress=hub'/>
		<item>
		<title>ASP.NET MVC4 Binding to a List of Complex Types</title>
		<link>http://guysherman.com/2013/04/12/asp-net-mvc4-binding-to-a-list-of-complex-types/</link>
		<comments>http://guysherman.com/2013/04/12/asp-net-mvc4-binding-to-a-list-of-complex-types/#comments</comments>
		<pubDate>Fri, 12 Apr 2013 02:50:36 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://guysherman.com/?p=474</guid>
		<description><![CDATA[UPDATE: I have an idea how they might be doing it: Expression Trees! One of my colleagues and I ran into a little trouble with Model Binding in ASP.NET MVC 4 yesterday. We wanted a form to post back an IEnumberable &#8230; <a href="http://guysherman.com/2013/04/12/asp-net-mvc4-binding-to-a-list-of-complex-types/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=474&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>UPDATE:</strong> I have an idea how they might be doing it: Expression Trees!</p>
<p>One of my colleagues and I ran into a little trouble with Model Binding in ASP.NET MVC 4 yesterday. We wanted a form to post back an IEnumberable of a complex type, let&#8217;s call it IEnumberable. Doing this naively didn&#8217;t work. After a bit of googling, and experimentation we found out how to get what we wanted, but the answer was a bit quirky: you must use an array/collection index operator <em>inside</em> your Html.Whatever() lambda, otherwise the Html helper doesn&#8217;t know that it should put an array index at the front of the field names in your form. If it doesn&#8217;t put this index (in the form of &#8220;[0].&#8221;, &#8220;[1].&#8221;), then the MVC model binder can&#8217;t work out how to group your fields into instances of a complex type.</p>
<p><span id="more-474"></span></p>
<p>Our initial view looked something like this:</p>
<pre><code>
@model IEnumerable&lt;ComplexItem&gt;

@{
    ViewBag.Title = "ComplexList";
}

@using (Html.BeginForm())
{
    &lt;h2&gt;ComplexList&lt;/h2&gt;
    foreach(var item in Model)
    {
        @Html.HiddenFor(m =&gt; item.Id)
        @Html.TextBoxFor(m =&gt; item.Title)
        @Html.TextBoxFor(m =&gt; item.Price)
    }
    &lt;button type="submit"&gt;Submit&lt;/button&gt;
}
</code></pre>
<p>And the action method it was posting back to looked something like:</p>
<pre><code>
[HttpPost]
public ActionResult Index(IEnumerable model)
{
    return View(model);
}</code></pre>
<p>I went away to a meeting and came back to find that the problem had been solved, based on <a title="Model Binding to a List" href="http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx" target="_blank">this link</a>. Essentially, you can induce MVC to spit out a prefix on the field names (in the form of &#8220;[0].&#8221;, &#8220;[1].&#8221;, etc), which allows the model binder to group the fields together into a collection of complex types. Now, I still felt like we had unfinished business because I wanted to know how it works, so I conducted an experiment.</p>
<p>Referencing Phil Haack&#8217;s example, my example becomes something like this:</p>
<pre><code>
@model IList&lt;ComplexItem&gt;

@{
    ViewBag.Title = "ComplexList";
}

@using (Html.BeginForm())
{
    &lt;h2&gt;ComplexList&lt;/h2&gt;
    for (int i = 0; i &lt; 0; Model.Count; i++) 
    { 
        @Html.HiddenFor(m =&gt; Model[i].Id)
        @Html.TextBoxFor(m =&gt; Model[i].Title)
        @Html.TextBoxFor(m =&gt; Model[i].Price)
    }
    &lt;button type="submit"&gt;Submit&lt;/button&gt;
}</code></pre>
<p>And I also changed the action method to use IList instead of IEnumberable. This works, but I was trying to determine <em>how</em> it was emitting those prefixes (or at least what was causing it).</p>
<p>So, enter the scientific method:</p>
<p>Hypothesis 1: The collection must be a type that has an &#8220;IndexOf&#8221; or &#8220;FindIndex&#8221; method (hence Arrays and IList&lt;T&gt; working, and IEnumerable&lt;T&gt; not working).</p>
<p>To try this I went down the foreach route (ie the first example), but with IList&lt;ComplexType&gt;. No joy. To further test this I used an array as well, still no joy. Hypothesis 1 disproved.</p>
<p>Hypothesis 2: It is the act of calling the [] operator inside the lambda.</p>
<p>So, working backwards from the working code, I normalized out the &#8220;Model[i]&#8221; bit:</p>
<pre><code>
@model IList&lt;ComplexItem&gt;

@{
    ViewBag.Title = "ComplexList";
}

@using (Html.BeginForm())
{
    &lt;h2&gt;ComplexList&lt;/h2&gt;
    for (int i = 0; i &amp;lt; Model.Count; i++) 
    { 
        var item = Mode[i];        
        @Html.HiddenFor(m =&gt; item.Id)
        @Html.TextBoxFor(m =&gt; item.Title)
        @Html.TextBoxFor(m =&gt; item.Price)
    }
    &lt;button type="submit"&gt;Submit&lt;/button&gt;
}</code></pre>
<p>This did not work, which leads me to conclude that it has to do with the act of calling the [] operator in the lambda. Hypothesis 2 confirmed, for now.</p>
<p>I still don&#8217;t know how it works, but at least I know exactly what to do to get it to work. This also leaves me in awe of the power of lambdas, and the ability to break a lambda down into an expression tree, and deal with the result in wildly different ways, based on the form of the expression.</p>
<p><strong>UPDATE:</strong> I&#8217;ve found a feature of Lambdas that would facilitate the behavior we&#8217;re seeing here, Expression Trees. You&#8217;ll notice that the parameter for Html.TextBoxFor() etc is Expression&lt;Func&lt;&#8230;&gt;&gt;. By wrapping the lambda in an expression object, you get the ability to break it down into its components. When you do that you can detect things like whether there is an array index happening etc. I&#8217;ll show you what I mean below:</p>
<pre><code>
using System;
using System.Linq.Expressions;

namespace ExpressionTrees
{
    class Program
    {
        static void Main(string[] args)
        {
            var p = new Program();
            var data = new string[] { "one", "two", "three" };

            for (int i = 0; i &lt; data.Length; i++)
            {
                p.Investigate(() =&gt; data[i].ToLower());
            }
        }

        public void Investigate(Expression&lt;Action&gt; exp)
        {
            Console.WriteLine(exp.CanReduce);
        }
    } 
}
</code></pre>
<p>Stick a breakpoint on the &#8220;Console.WriteLine&#8221; line in Visual Studio, and then take a look at the magic!</p>
<div id="attachment_479" class="wp-caption aligncenter" style="width: 594px"><a href="http://guysherman.files.wordpress.com/2013/04/expression_debug_1.png"><img class="size-full wp-image-479" alt="The debug string for my expression" src="http://guysherman.files.wordpress.com/2013/04/expression_debug_1.png?w=584&#038;h=77" width="584" height="77" /></a><p class="wp-caption-text">The debug string for my expression</p></div>
<p>As you can see, there&#8217;s an object, and it knows that there&#8217;s a closure, of which the &#8220;data&#8221; object is a member, and another closure, of which the &#8220;i&#8221; array index is a member, and it seems to know the sequence of operations. Let&#8217;s dig further:</p>
<div id="attachment_480" class="wp-caption aligncenter" style="width: 594px"><a href="http://guysherman.files.wordpress.com/2013/04/expression_debug_2.png"><img class="size-full wp-image-480" alt="Inside the Expression" src="http://guysherman.files.wordpress.com/2013/04/expression_debug_2.png?w=584&#038;h=223" width="584" height="223" /></a><p class="wp-caption-text">Inside the Expression</p></div>
<p>We can see that at the top level we&#8217;ve got a <strong>NodeType</strong> of <em>Lambda</em>, which has a <strong>Body</strong>. That body is a <strong>Call</strong> of <em>Method</em> on an <em>Object.</em> Looking at the object:</p>
<div id="attachment_481" class="wp-caption aligncenter" style="width: 594px"><a href="http://guysherman.files.wordpress.com/2013/04/expression_debug_3.png"><img class="size-full wp-image-481" alt="How you detect an Array Access" src="http://guysherman.files.wordpress.com/2013/04/expression_debug_3.png?w=584&#038;h=387" width="584" height="387" /></a><p class="wp-caption-text">How you detect an Array Access</p></div>
<p>We can see that the Object is an <strong>ArrayIndex</strong>. You&#8217;ve got a <strong>Left</strong> which is the array ((ExpressionTrees.Program+&lt;&gt;c__DisplayClass0).data), and you&#8217;ve got a <strong>Right</strong> which is the index ((ExpressionTrees.Program+&lt;&gt;c__DisplayClass2).i).</p>
<p>Short of decompiling, or finding the source for Html.TextBoxFor, I would think they are analyzing the expression, much like this, and selecting a codepath to handle the result. The graphics geek in me has his propeller hat spinning really fast right now, because you could do some really interesting stuff with this for scene querying.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/474/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=474&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2013/04/12/asp-net-mvc4-binding-to-a-list-of-complex-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2013/04/expression_debug_1.png" medium="image">
			<media:title type="html">The debug string for my expression</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2013/04/expression_debug_2.png" medium="image">
			<media:title type="html">Inside the Expression</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2013/04/expression_debug_3.png" medium="image">
			<media:title type="html">How you detect an Array Access</media:title>
		</media:content>
	</item>
		<item>
		<title>Porting Open Asset Import Library (Assimp) to WinRT (4)</title>
		<link>http://guysherman.com/2012/12/23/porting-open-asset-import-library-assimp-to-winrt-4/</link>
		<comments>http://guysherman.com/2012/12/23/porting-open-asset-import-library-assimp-to-winrt-4/#comments</comments>
		<pubDate>Sun, 23 Dec 2012 09:00:58 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Assimp]]></category>
		<category><![CDATA[StorageFile]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://guysherman.com/?p=395</guid>
		<description><![CDATA[So, I changed my mind about the whole zlib vs System.IO.Compression, partly because the latter is not already a Windows Runtime accessible type (afaik), and secondly because the code would not be at all portable, and I&#8217;d like to be &#8230; <a href="http://guysherman.com/2012/12/23/porting-open-asset-import-library-assimp-to-winrt-4/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=395&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So, I changed my mind about the whole zlib vs System.IO.Compression, partly because the latter is not already a Windows Runtime accessible type (afaik), and secondly because the code would not be at all portable, and I&#8217;d like to be able to contribute my work back to the community if I can. I&#8217;ve run into a couple of other problems though, one to do with Microsoft&#8217;s war on Buffer Overrun exploits (fair enough, Windows XP was a real problem that way), and the other to do with the security constraints that come with Windows Store apps.</p>
<h2>Buffer Overrun / Overflow</h2>
<p>First, the whole <a title="Buffer overflow" href="http://en.wikipedia.org/wiki/Buffer_overflow" target="_blank">buffer overrun</a> thing: it seems that Microsoft have deprecated large portions of the C Runtime on windows (fopen, strcpy, pretty much anything that takes a potentially unsanitary char* as an argument, and writes the data contained therein to another unsanitary char* argument), in favour of the &#8216;safe&#8217; variants of these functions (which only exist on windows). The gist here is that you need to tell it how long the destination buffer is, so that the function will not overrun the buffer. I can understand why they did this, after the whole security shake-up they had during the Vista development cycle (rumoured to be the reason it took so long). Incidentally, we might see Apple making similar moves after <a title="Apple quietly hires security guru that may have saved vista" href="http://www.engadget.com/2012/12/06/apple-quietly-hires-security-guru-that-may-have-saved-vista/" target="_blank">this</a> little hiring.</p>
<p>Apparently these warnings have existed since Visual Studio 2005, but with Windows Store apps, the warnings about these functions have become errors. You can turn them off by defining _CRT_SECURE_NO_WARNINGS, but I&#8217;m not sure if I want to. On the one hand, it does concretely close a potential attack vector in any code I write. On the other hand, Microsoft&#8217;s series of _s functions (fopen_s, strcpy_s, wcstombs_s, etc) are not part of Standard C, and are thus not portable either. Some people have suggested that if one is re-writing C code to use these functions, they should just re-write it in C++ and use the iostream classes instead, which is great, except most OSS newbies like me don&#8217;t have the clout to get a C++ re-write of zlib accepted. So, I&#8217;m left with two options: write code that Microsoft have deemed they don&#8217;t want running on their OS, or write ugly, macro-heavy wrappers so that the code uses fopen_s on windows, and fopen elsewhere. I&#8217;m going to try the second option for now, and see how far that gets me. Don&#8217;t be surprised if I blog in the future about how ssimp core team won&#8217;t let me commit my code.</p>
<h2>Windows Store App Security Model</h2>
<p>The next issue that I&#8217;ve encountered is more interesting, and it has risen out of the unique space that Windows RT fills in the market, as more than a tablet, but a little bit less than a full-blown Windows PC. If we look at the iPad/iPhone, and Windows Phones as well (I&#8217;m, not even going to discuss Android, it&#8217;s just wrong to put Linux on a phone), each app is a completely walled garden, except for a few API&#8217;s which give access to things like, Pictures, Emails, Contacts &#8211; your personal data that apps can add value to. The thing about accessing this data is, as I mentioned before, it is done through and API, you don&#8217;t just go poking around the file system opening files as you please. Furthermore, when these apps do try to access the file system using direct, fairly low-level calls, like fopen, they can only see within their own little sandbox. This is fine on a device whose paradigm is that Apps only work on their own data, but Windows is a bit different. Windows is traditionally a desktop OS, I have a Documents Library, and a Pictures Library, and a Downloads Library, and my files are a thing in themselves which transcend my current set of Apps. So, you can access the file system, but it has to be through an API (<a title="MSDN Documentation for StorageFile class" href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefile.aspx" target="_blank">StoreageFile</a>) if it isn&#8217;t within your sandbox, and you can&#8217;t even ask for files outside your sandbox unless the paths have come from a FilePicker. I think this model is sound &#8211; an app can&#8217;t touch anything it didn&#8217;t create without your very explicit permission. My goal, however, is to write a Windows Store app version of <a title="AssimpView" href="http://assimp.sourceforge.net/main_viewer.html" target="_blank">Assimp Viewer</a>, and so I have a need to use fopen on files outside my sandbox, which was a bit of a conundrum. Luckily though, I&#8217;m not blazing a trail here, and I found <a title="fopen outside sandox on Windows Store App" href="http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/718fc649-bcec-4b87-85ee-51fa129d06d7" target="_blank">this</a> post which details a neat strategy which lets you use the StoreageFile API to bring the file into (and out of I presume) your sandbox, so that you can use your low-level C code on it. This shouldn&#8217;t be too hard for me to get into the app, because AssimpView is already a Windows only application.</p>
<p>So, my current status is that I&#8217;m testing out my build of zlib for a Windows Store App, and it seems to work thus far. I think building the assimp library itself might not be so complicated, because, today&#8217;s points aside, any ANSI C code should &#8220;just work&#8221; when compiled as a Windows Store App static (or dynamic) library.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/395/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=395&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/12/23/porting-open-asset-import-library-assimp-to-winrt-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
		<item>
		<title>Porting Open Asset Import Library (Assimp) to WinRT (3)</title>
		<link>http://guysherman.com/2012/12/17/porting-open-asset-import-library-assimp-to-winrt-3/</link>
		<comments>http://guysherman.com/2012/12/17/porting-open-asset-import-library-assimp-to-winrt-3/#comments</comments>
		<pubDate>Mon, 17 Dec 2012 09:36:11 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Assimp]]></category>
		<category><![CDATA[WinRT]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://guysherman.com/?p=393</guid>
		<description><![CDATA[So I&#8217;ve been doing a bit of digging about in the Assimp source, and it seems that, for the core library at least, the only dependency is on zlib &#8211; which it builds in your solution on Windows. My next &#8230; <a href="http://guysherman.com/2012/12/17/porting-open-asset-import-library-assimp-to-winrt-3/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=393&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So I&#8217;ve been doing a bit of digging about in the Assimp source, and it seems that, for the core library at least, the only dependency is on <a title="zLib Home Site" href="http://zlib.net" target="_blank">zlib</a> &#8211; which it builds in your solution on Windows. My next possible step, then, could be to move the code from this zlib project over to a Windows Runtime Component project. However, I&#8217;m a little reticent to do this, since the System.IO.Compression namespace can do all the compression stuff, and to an extent it depends on whether it is easier to port zlib, or modify Assimp so that it doesn&#8217;t use zlib. My hope is that I can keep my changes to Assimp isolated to a fairly low level in the codebase, so that it is reasonably easy to keep in harmony with their continuing efforts, and porting zlib seems more likely to achieve that goal.</p>
<p>Digging further, I have found that at present, the zlib functionality is only called by the &#8216;unzip&#8217; library that also comes with Assimp, which itself is currently only used by the Q3BSPZipArchive class. So, I think I might put in an alternate code-path in either the unzip code, or perhaps even the Q3BSPZipArchive to use the Windows Runtime code. I suspect that modifying unzip.c would be the best approach, because then anyone who writes a custom importer using the Q3BSP one as a template will be able to use my functionality.</p>
<p>It&#8217;s settled then, I&#8217;ll make an alternate unzip.c (or pre-compiler path therein) which uses the native Windows Runtime API to handle the unzipping. Not tonight though.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=393&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/12/17/porting-open-asset-import-library-assimp-to-winrt-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
		<item>
		<title>Porting Open Asset Import Library (Assimp) to WinRT (2)</title>
		<link>http://guysherman.com/2012/12/15/porting-open-asset-import-library-assimp-to-winrt-2/</link>
		<comments>http://guysherman.com/2012/12/15/porting-open-asset-import-library-assimp-to-winrt-2/#comments</comments>
		<pubDate>Sat, 15 Dec 2012 10:12:02 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Assimp]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://guysherman.com/?p=355</guid>
		<description><![CDATA[Last time I got to the point where I had found that I can&#8217;t build the code in Windows 8 because DirectX 11.1 has deprecated a bunch of DirectX 9 functionality, so I installed the Jun 2010 DirectX SDK to &#8230; <a href="http://guysherman.com/2012/12/15/porting-open-asset-import-library-assimp-to-winrt-2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=355&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Last time I got to the point where I had found that I can&#8217;t build the code in Windows 8 because DirectX 11.1 has deprecated a bunch of DirectX 9 functionality, so I installed the Jun 2010 DirectX SDK to get up and running. My plan is to get it building as a Windows 8 Desktop library, and then rip out the code that won&#8217;t e compatible with WinRT.</p>
<p>The next thing I discovered that the function object classes in the STL (std::plus, std::minus etc), were causing a bunch of errors in Vertex.h, the fix was to find AssimpPCH.h in the &#8220;Header Files&#8221; folder, and add an &#8220;#include &lt;functional&gt; to the list of STL includes.</p>
<p>Rebuilding from there gives me a a dirty ole&#8217; LNK2019 in the assimp_viewer project. I think the CMAKE files aren&#8217;t adding a -Ld3d9 directive, so I added an entry to &#8220;Additional Dependencies&#8221; under link settings to &#8220;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86\d3d9.lib&#8221;</p>
<p>Make sure you set a value for CMAKE_INSTALL_PREFIX, and build the &#8220;INSTALL&#8221; project. You&#8217;ll then need to add the CMAKE_INSTALL_PREFIX\lib folder to your path so that you can run the assimp_viewD.exe file.</p>
<p>So far, so good. My next step is to rip out the D3D9 stuff and upgrade it with D3D11 stuff, so that I can build it as a Desktop / Windows Pro assembly. After that I can work out how to make it into a Windows Store app/library, which will be more challenging because of the requirements of the WinRT platform (eg file access must be asynchronous).</p>
<p>See you next time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=355&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/12/15/porting-open-asset-import-library-assimp-to-winrt-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
		<item>
		<title>Porting Open Asset Import Library (Assimp) to WinRT</title>
		<link>http://guysherman.com/2012/12/08/porting-open-asset-import-library-assimp-to-winrt/</link>
		<comments>http://guysherman.com/2012/12/08/porting-open-asset-import-library-assimp-to-winrt/#comments</comments>
		<pubDate>Sat, 08 Dec 2012 03:55:38 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Assimp]]></category>
		<category><![CDATA[WinRT]]></category>

		<guid isPermaLink="false">http://guysherman.com/?p=338</guid>
		<description><![CDATA[With the advent of Microsoft&#8217;s Windows 8, and it&#8217;s ARM-compatible Windows RT variant, Microsoft have really jumped headlong into the mobile device arena. I think the fact that developers will now be able to develop a single code-base that works &#8230; <a href="http://guysherman.com/2012/12/08/porting-open-asset-import-library-assimp-to-winrt/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=338&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>With the advent of Microsoft&#8217;s Windows 8, and it&#8217;s ARM-compatible Windows RT variant, Microsoft have really jumped headlong into the mobile device arena. I think the fact that developers will now be able to develop a single code-base that works on Phones, Tablets, Laptops and Desktop computers, will be quite a big deal for their platform, but it comes with one particularly difficult challenge: the code must only be compiled against what is know as the WinRT stack. This is a subset of the full Windows 8 SDK which is common to all hardware platforms, and it presents a challenge because none of the libraries we&#8217;re used to using right now (libpng, libjpg, etc, etc, name your library here). So, I&#8217;ve decided, mainly for interest&#8217;s sake, to try and port the wonderful <a title="Open Asset Import Library Sourceforge" href="http://assimp.sourceforge.net/" target="_blank">Open Asset Import</a> library, commonly referred to as Assimp, to the WinRT platform. Now, I probably would use this in a toolchain more than a runtime engine, but it is still a good test case. I started on this project today, and I can see a few troubles ahead of me:</p>
<ol>
<li>They don&#8217;t currently support VS2012, but CMAKE should fix this</li>
<li>I have to do a &#8220;Boost Free&#8221; build, so I&#8217;ll have to see how that goes.</li>
<li>The library uses D3DX, which is deprecated from Windows 8 up, so I&#8217;ll have to build it agains the old DirectX SDK first, and then start there.</li>
</ol>
<p>Anyhow, I&#8217;m downloading the DirectX SDK now, so I&#8217;ll have to wait. More as it happens.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=338&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/12/08/porting-open-asset-import-library-assimp-to-winrt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
		<item>
		<title>Arduino and NMEA</title>
		<link>http://guysherman.com/2012/07/18/arduino-and-nmea/</link>
		<comments>http://guysherman.com/2012/07/18/arduino-and-nmea/#comments</comments>
		<pubDate>Wed, 18 Jul 2012 01:28:41 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[NMEA]]></category>
		<category><![CDATA[Yacht Performance]]></category>

		<guid isPermaLink="false">http://www.guysherman.com/?p=309</guid>
		<description><![CDATA[I do a fair bit of yacht racing, and something that becomes important for tactics in yacht racing is know how your boat performs in different conditions. You need to be able to answer questions like: &#8220;With apparent wind-speed of &#8230; <a href="http://guysherman.com/2012/07/18/arduino-and-nmea/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=309&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I do a fair bit of yacht racing, and something that becomes important for tactics in yacht racing is know how your boat performs in different conditions. You need to be able to answer questions like:</p>
<blockquote><p>&#8220;With apparent wind-speed of 15 knots, coming from 120° to port, what is my best sail choice, and what speed should I be doing.&#8221;</p></blockquote>
<p>The most important thing here is that you now have a target for the crew to sail for &#8211; you know that if you&#8217;re not within, say, 10% of your target speed something is wrong and you need to work on your trim, or you&#8217;ve got something dangling in the water, or stuck on your keel. Of course, as yachties we often think we have a gut-feel for these sorts of things, but a quantitative answer to the question above is very useful.</p>
<p>In the past I&#8217;ve sailed on yachts where the on-board instruments are connected to a laptop, and the it logs the data from the instruments, and presents all sorts of fancy graphs, and some of the more expensive software will certainly give you an answer to questions like the one I asked earlier. However, laptops and water (particularly salt water) don&#8217;t mix well at all, and they are not cheap to replace. What&#8217;s more, it will take the average weekend warrior an entire season, if not two, to get enough data to start producing useful answers to our questions, and having a laptop on board for all that time is just asking for it to get wet.</p>
<p><span id="more-309"></span>So, I&#8217;ve been thinking of alternate solutions to this problem and have decided to build a &#8220;little-black-box&#8221; for yachts. Somewhat like a flight data recorder for aircraft. The key difference being that it needs some sort of interface to capture changes in parameters, like which sails are up, and what the positions of various trimming devices are (such as jib cars).</p>
<h2>The first experiment</h2>
<p>Anyhow, I&#8217;ve made a very basic start on the system by using an <a title="Arduino - Home Page" href="http://arduino.cc" target="_blank">Arduino</a> prototyping board to read the NMEA 0183 data from my handheld GPS, and relay that data out through the serial port to my computer.</p>
<p style="text-align:center;"><img class=" wp-image-310  aligncenter" title="NMEA Logger Basic Prototype" src="http://guysherman.files.wordpress.com/2012/07/arduino_gps_web.jpg?w=584" alt="An Arduino wired up to a Garmin GPS 60" /></p>
<p>I plan on building a much more sophisticated bread-board prototype in the near future (have to buy a few more parts from <a title="Adafruit Industries" href="http://www.adafruit.com" target="_blank">Adafruit</a>), and then I&#8217;ll look at stuffing it all into some water-tight packaging and taking it out sailing.</p>
<p style="text-align:center;"><img class=" wp-image-311  aligncenter" title="NMEA 0183 Data" src="http://guysherman.files.wordpress.com/2012/07/arduino_nmea.png?w=808&#038;h=586" alt="A printout of the NMEA 0183 data as logged by my basic prototype" width="808" height="586" /></p>
<h2>The code</h2>
<p>My Arduino &#8220;Sketch&#8221; (the program which runs on the board) uses <a title="Maarten Lamers' NMEA library" href="http://www.maartenlamers.com/nmea/" target="_blank">Maarten Lamers&#8217; NMEA library</a> which needed a couple of modifications to work with the recent versions of the Arduino API:</p>
<p>In nmea.h, change the reference to WConstants.h to arduino.h:</p>
<pre>//#include "WConstants.h"
#include "arduino.h"</pre>
<p>In nmea.cpp, change the reference to WProgram.h to arduino.h:</p>
<pre>//#include "WProgram.h"
#include "arduino.h"</pre>
<p>The code for the actual sketch is very simple at this point, and is really just a matter of reading from one serial port, and writing into another, whilst funnelling the data through the NMEA library:</p>
<pre>// -- This borrows very heavily from one of Maarten Lamers' 
// examples on how to use his NMEA library.
#include &lt;SoftwareSerial.h&gt;
#include &lt;nmea.h&gt;
SoftwareSerial nmeaSourceA(13, 12);
NMEA nmeaDecoder(ALL);
void setup()
{
    // Set up serial connection to computer. Eventually we'll write
    // to an SD card instead 
    Serial.begin(57600);
    Serial.println("NMEA Logger... v0.1");

    // Set up serial connection to NMEA source.
    nmeaSourceA.begin(4800);
}

void loop()
{
    // If there's anything to read from the serial port
    if (nmeaSourceA.available())
    {
       // We pass the data into the nmea decoder by calling
       // decode(). This function accumulates the bytes until
       // a valid NMEA sentence has been read. If a sentence has 
       // been read it returns true.
       if (nmeaDecoder.decode(nmeaSourceA.read()))
       {
          // We then write out the sentence
          Serial.print("Sentence = ");
          Serial.print(nmeaDecoder.sentence());

          // The data type term
          Serial.print(" Datatype = ");
          Serial.print(nmeaDecoder.term(0));

          // And the number of terms
          Serial.print(" COUNT(Terms) = ");
          Serial.println(nmeaDecoder.terms());
       }
   }
}</pre>
<p>That&#8217;s all for today. I&#8217;ll keep you posted on how the device develops over time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=309&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/07/18/arduino-and-nmea/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2012/07/arduino_gps_web.jpg" medium="image">
			<media:title type="html">NMEA Logger Basic Prototype</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2012/07/arduino_nmea.png" medium="image">
			<media:title type="html">NMEA 0183 Data</media:title>
		</media:content>
	</item>
		<item>
		<title>TFS GUI for manipulating remote pending changes</title>
		<link>http://guysherman.com/2012/07/10/tfs-gui-for-manipulating-remote-pending-changes/</link>
		<comments>http://guysherman.com/2012/07/10/tfs-gui-for-manipulating-remote-pending-changes/#comments</comments>
		<pubDate>Tue, 10 Jul 2012 23:40:02 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TFS 2010]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.guysherman.com/?p=303</guid>
		<description><![CDATA[In the last 6 months or so at work I have picked up the dubious honour of being the friendly TFS administrator. In that time we&#8217;ve migrated from one server to another (in different domains), and we&#8217;ve had a couple &#8230; <a href="http://guysherman.com/2012/07/10/tfs-gui-for-manipulating-remote-pending-changes/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=303&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In the last 6 months or so at work I have picked up the dubious honour of being the friendly TFS administrator. In that time we&#8217;ve migrated from one server to another (in different domains), and we&#8217;ve had a couple of people leave. This has meant there are often situations where an account that nobody can log in as anymore has some files locked, preventing a check-in or merge, or other such operation.</p>
<p>Normally, I would use the &#8220;tf undo&#8221; command at the Visual Studio Command Prompt to sort this out, but yesterday I ran into an odd situation where I could not see the pending changes via the tf command, even though I could see them in Visual Studio. Anyhow, I accidentally found a menu item that lets me find pending changes on any part of the source tree, and gives me the opportunity to undo other users&#8217; checkouts on the server.</p>
<div id="attachment_304" class="wp-caption aligncenter" style="width: 287px"><a href="http://guysherman.files.wordpress.com/2012/07/findinsc.png"><img class="size-medium wp-image-304  " title="Find In Source Control Menu Item " src="http://guysherman.files.wordpress.com/2012/07/findinsc.png?w=277&#038;h=300" alt="" width="277" height="300" /></a><p class="wp-caption-text">The &#8220;Find In Source Control&#8221; menu item can be found in &#8220;Source Control Explorer&#8221;.</p></div>
<p>Fire up Source Control Explorer, and select an item in the main pane. Right-click it and you&#8217;ll find the &#8220;Find in Source Control&#8221; item. This has to sub-items but they take you to the same dialog, with a different set of options ticked.</p>
<div id="attachment_305" class="wp-caption aligncenter" style="width: 310px"><a href="http://guysherman.files.wordpress.com/2012/07/status.png"><img class=" wp-image-305 " title="Find In Source Control Dialog" src="http://guysherman.files.wordpress.com/2012/07/status.png?w=300&#038;h=184" alt="" width="300" height="184" /></a><p class="wp-caption-text">The &#8220;Find In Source Control&#8221; dialog, as shown when you select &#8220;Status&#8221; from the &#8220;Find In Source Control&#8221; menu.</p></div>
<p>After clicking &#8220;Find&#8221; you&#8217;ll be presented with the results of a source control query (much like searching through TFS, or comparing). You&#8217;ll notice up the top there&#8217;s a convenient &#8220;Undo&#8221; button.</p>
<div id="attachment_306" class="wp-caption aligncenter" style="width: 310px"><a href="http://guysherman.files.wordpress.com/2012/07/status.png"><img class=" wp-image-306 " title="Find in Source Control Results" src="http://guysherman.files.wordpress.com/2012/07/status.png?w=300&#038;h=191" alt="" width="300" height="191" /></a><p class="wp-caption-text">Notice the handy &#8220;Undo&#8221; button.</p></div>
<p>This will make it a lot easier to undo orphaned changes for people.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=303&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/07/10/tfs-gui-for-manipulating-remote-pending-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2012/07/findinsc.png" medium="image">
			<media:title type="html">Find In Source Control Menu Item </media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2012/07/status.png" medium="image">
			<media:title type="html">Find In Source Control Dialog</media:title>
		</media:content>

		<media:content url="http://guysherman.files.wordpress.com/2012/07/status.png" medium="image">
			<media:title type="html">Find in Source Control Results</media:title>
		</media:content>
	</item>
		<item>
		<title>Fun with BeagleBone&#8230;well soon.</title>
		<link>http://guysherman.com/2012/07/03/fun-with-beaglebone-well-soon/</link>
		<comments>http://guysherman.com/2012/07/03/fun-with-beaglebone-well-soon/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 06:13:46 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BeagleBone]]></category>

		<guid isPermaLink="false">http://www.guysherman.com/?p=290</guid>
		<description><![CDATA[So, I&#8217;ve got an interesting project coming up at work and I&#8217;ve decided to try something. It involves cross-compiling a rather complicated project for ARM, to run on the BB. I&#8217;ll keep everyone posted on how it goes.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=290&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So, I&#8217;ve got an interesting project coming up at work and I&#8217;ve decided to try something. It involves cross-compiling a rather complicated project for ARM, to run on the BB. I&#8217;ll keep everyone posted on how it goes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=290&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2012/07/03/fun-with-beaglebone-well-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
		<item>
		<title>Fun with Arduino!</title>
		<link>http://guysherman.com/2011/09/22/fun-with-arduino/</link>
		<comments>http://guysherman.com/2011/09/22/fun-with-arduino/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 05:28:52 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.guysherman.com/?p=292</guid>
		<description><![CDATA[So a couple of days ago my Adafruit Experiment Kit for Arduino (ARDX) arrived, and today I spent some time playing with it. I went through the first couple of experiments but decided to go off the range a little &#8230; <a href="http://guysherman.com/2011/09/22/fun-with-arduino/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=292&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So a couple of days ago my <a title="Adafruit Experimentation Kit for Arduino" href="http://www.adafruit.com/products/170" target="_blank">Adafruit Experiment Kit for Arduino (ARDX)</a> arrived, and today I spent some time playing with it.</p>
<p>I went through the first couple of experiments but decided to go off the range a little with the second one. Instead of writing a whole bunch of code which goes through and sets individual pins, I decided to try using the Port Registers to set a whole bunch of pins at once. So, what I decided to do was make an 8-bit binary display. I had to use some Bit Math to take the lower 6 bits of the number and put them onto one port register, and the upper two onto the other port register. Thanks to <a title="Cosine Kitty" href="http://arduino.cc/playground/Profiles/CosineKitty" target="_blank">Cosine Kitty</a> for the info on <a title="Port Registers" href="http://www.arduino.cc/playground/Code/BitMath#registers" target="_blank">Port Registers</a>.</p>
<p>Here&#8217;s a video of my first pass at the experiment, with scrolling LEDs.<br />
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='584' height='359' src='http://www.youtube.com/embed/2NBRtNDj3Zs?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>And here is the binary counter.<br />
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='584' height='359' src='http://www.youtube.com/embed/ZlyeH6TWnic?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>My next step will be to read bytes from the serial port and show them on the 8-bit display.</p>
<p>That&#8217;s all folks.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/292/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/292/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=292&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2011/09/22/fun-with-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
		<item>
		<title>No item should ever go un-processed</title>
		<link>http://guysherman.com/2011/09/16/no-item-should-ever-go-un-processed/</link>
		<comments>http://guysherman.com/2011/09/16/no-item-should-ever-go-un-processed/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 04:31:39 +0000</pubDate>
		<dc:creator>guysherman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.guysherman.com/?p=286</guid>
		<description><![CDATA[I have recently been fixing a support incident with a system of ours which processes data in the form of CSV files emailed to an exchange mailbox. Occasionally the producer of these CSVs doesn&#8217;t form them correctly and the whole &#8230; <a href="http://guysherman.com/2011/09/16/no-item-should-ever-go-un-processed/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=286&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have recently been fixing a support incident with a system of ours which processes data in the form of CSV files emailed to an exchange mailbox. Occasionally the producer of these CSVs doesn&#8217;t form them correctly and the whole thing packs up; the item stays in the mailbox, and somebody has to go digging to fix it, and get the whole thing up and running before the backlog of data to be processed gets rather large. This has brought to light two important points about data-processing in my mind:</p>
<ol>
<li>No item should ever go &#8220;un-processed&#8221; &#8211; if it fails to go down the normal handling path, it should go down an error handling path &#8211; either way it should leave the main queue.</li>
<li>There must always be a mechanism for a human to intervene, and correct (or choose to ignore) malformed data; this makes for nice error-handling path for point 1.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guysherman.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guysherman.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guysherman.com&#038;blog=38597928&#038;post=286&#038;subd=guysherman&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guysherman.com/2011/09/16/no-item-should-ever-go-un-processed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/fdb4e792e6677cd7786682ee86d82023?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guysherman</media:title>
		</media:content>
	</item>
	</channel>
</rss>
