<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
  <channel>
    <title>Clear Lines Blog</title>
    <description>Mathias Brandewinder on quantitative analysis, .NET applications, Excel, decision making, and a whole lot of other random things.</description>
    <link>http://www.clear-lines.com/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://www.clear-lines.com/blog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Mathias Brandewinder, Clear Lines Consulting</dc:creator>
    <dc:title>Clear Lines Blog</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ClearLinesBlog" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">ClearLinesBlog</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
      <title>Dysfunctional team</title>
      <description>&lt;p&gt;While shopping at PetCo the other day, I saw this scene, and couldn’t get enough of it. It’s a great illustration of what happens when teamwork goes wrong. If I saw this in real life, I would feel sorry for the team, but the mice don’t seem to be suffering (besides some confusion), so sit back and enjoy the show, guilt-free.&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:4c4d54d5-c0e5-4e1c-8e89-78dd34f6838b" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/MEjX9anEAyQ&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;border=1&amp;amp;hl=en"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/MEjX9anEAyQ&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;border=1&amp;amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hZM4Kx8WyOK-iaRPEaVNIifuOAM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hZM4Kx8WyOK-iaRPEaVNIifuOAM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hZM4Kx8WyOK-iaRPEaVNIifuOAM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hZM4Kx8WyOK-iaRPEaVNIifuOAM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Dysfunctional-team.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Dysfunctional-team.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=f12585b4-5167-4540-94df-539d45dbdcba</guid>
      <pubDate>Tue, 14 Jul 2009 06:58:09 -1300</pubDate>
      <category>Management</category>
      <category>Random</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=f12585b4-5167-4540-94df-539d45dbdcba</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=f12585b4-5167-4540-94df-539d45dbdcba</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Dysfunctional-team.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=f12585b4-5167-4540-94df-539d45dbdcba</wfw:commentRss>
    </item>
    <item>
      <title>Regularity, cohesion, balance</title>
      <description>&lt;p&gt;I was going through my digital camera today when I came across this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/Regularitycohesionbalance/4B076E2C/SeattleLibrary.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SeattleLibrary" border="0" alt="SeattleLibrary" src="http://www.clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/Regularitycohesionbalance/4DCD231F/SeattleLibrary_thumb.jpg" width="184" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I took this picture in the &lt;a href="http://www.spl.org/default.asp?pageID=branch_central&amp;amp;branchID=1"&gt;Seattle public library&lt;/a&gt; elevator. It’s a &lt;a href="http://www.greatbuildings.com/buildings/Seattle_Public_Library.html"&gt;great building&lt;/a&gt;, with lots of unusual features.&lt;/p&gt;  &lt;p&gt;Why did I take it? Because I thought the design was interesting. The typical elevator button panels has a series of buttons, each of them the same size, ordered with the corresponding floor elevation. This panel has buttons of various sizes, and given what I saw in the building, I guess the size corresponds to the frequentation of each floor, or, if you prefer, the relative likelihood that you want to go to each floor.&lt;/p&gt;  &lt;p&gt;In my opinion, there are some flaws in the design (for instance, the buttons are very far from the labels saying what is on the floor, which slows down figuring out which button you really want to push), but I thought the idea of various button sizes was smart, and bizarrely under-utilized in computer user interfaces. If you are going to expose different functionalities to your user, chances are, some will be used more often than others, and giving them a larger button should make the user’s navigation easier.&lt;/p&gt;  &lt;p&gt;I found an example of this on &lt;a href="http://www.netflix.com"&gt;Netflix&lt;/a&gt;’s website, for instance:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/Regularitycohesionbalance/3B182968/NetflixMenu.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="NetflixMenu" border="0" alt="NetflixMenu" src="http://www.clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/Regularitycohesionbalance/28632FB1/NetflixMenu_thumb.png" width="244" height="68" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Note how the 2 right-most elements of the tab are smaller than the rest?&lt;/p&gt;  &lt;p&gt;So why is this design style rare? I guess it has to do with the fact that regularity looks good, without much effort. Give your buttons the same size and font, and everything looks organized, and easy on the eye. Once you start playing with elements of various sizes, it is much harder to achieve balance and cohesion. Usability might be improved, but chances are, you will need someone with a sense of visual design to help you make it look good – whereas even the most lacking in aesthetic sense can align buttons.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VbqRmHSNo_6xL9QUsJQyB91g0DI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VbqRmHSNo_6xL9QUsJQyB91g0DI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VbqRmHSNo_6xL9QUsJQyB91g0DI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VbqRmHSNo_6xL9QUsJQyB91g0DI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Regularity-cohesion-balance.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Regularity-cohesion-balance.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=54a2d411-a187-4493-a298-a33a3ed905e0</guid>
      <pubDate>Tue, 07 Jul 2009 11:25:17 -1300</pubDate>
      <category>Design and Patterns</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=54a2d411-a187-4493-a298-a33a3ed905e0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=54a2d411-a187-4493-a298-a33a3ed905e0</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Regularity-cohesion-balance.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=54a2d411-a187-4493-a298-a33a3ed905e0</wfw:commentRss>
    </item>
    <item>
      <title>Illustrative Programming</title>
      <description>&lt;p&gt;Very interesting piece by Martin Fowler; he discusses spreadsheets as a programming language, and coins the term “&lt;a href="http://martinfowler.com/bliki/IllustrativeProgramming.html"&gt;Illustrative Programming&lt;/a&gt;” to describe the corresponding development style. I quote liberally here:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;One property of spreadsheets, that I think is important, is its ability to fuse the execution of the program together with its definition. When you look at a spreadsheet, the formulae of the spreadsheet are not immediately apparent, instead what you see is the calculated numbers - an illustration of what the program does.&lt;/p&gt;    &lt;p&gt;Using examples as a first class element of a programming environment crops up in other places - UI designers also have this. Providing a concrete illustration of the program output helps people understand what the program definition does, so they can more easily reason about behavior.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;I don't think that illustrative programming is all goodness. One problem I've seen with spreadsheets and with GUI designers is that they do a good job of revealing what a program does, but de-emphasizes program structure. As a result complicated spreadsheets and UI panels are often difficult to understand and modify. They are often riven with uncontrolled copy-and-paste programming.&lt;/p&gt;    &lt;p&gt;This strikes me as a consequence of the fact that the program is de-emphasized in favor of the illustrations. As a result the programmers don't think to take care of it. We suffer enough from a lack of care of programs even in regular programming, so it's hardly shocking that this occurs with illustrative programs written by lay programmers. But this problem leads us to create programs that quickly become unmaintainable as they grow.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This piece is worth reading, if only to see such a highly respected developer as Fowler defend Excel as a programming language. Given how Excel is usually dissed by “serious programmers”, it’s refreshing.&lt;/p&gt;  &lt;p&gt;His analysis rings true, too – spreadsheets and UI tools are very similar in their benefits (immediate focus on the end result desired by the user) and drawbacks (possible lack of structure, lack of testability…). I am not sure how to describe the “other” style, maybe “Axiomatic Programming” - first establish the principles, then useful consequences can be derived? In a way, the term “Illustrative Programming” marks one extreme on the scale of development styles: don’t program if you can’t see it – whereas the other extreme would be developing a framework– creating programs which can’t be seen until someone decides to illustrate its use.&lt;/p&gt;  &lt;p&gt;Another way to view the trade-off is to see Illustrative Programming as focused on a specific instance, whereas Axiomatic Programming emphasized the Class. An Excel speadsheet, or a User Interface, is typically one isolated instance, focused on one unique particular illustration of a problem, and as a result, doesn’t promote thinking about generalization and abstraction, whereas the risk in framework design is to embrace generality to the point where abstractions lose connection to specific usage… &lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ypWlVJxKLbagTMXpL0TTs5HDPO4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ypWlVJxKLbagTMXpL0TTs5HDPO4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ypWlVJxKLbagTMXpL0TTs5HDPO4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ypWlVJxKLbagTMXpL0TTs5HDPO4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Illustrative-Programming.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Illustrative-Programming.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=a9c1c1ba-63eb-4aed-8e6b-6ba32bb0fc45</guid>
      <pubDate>Tue, 30 Jun 2009 15:39:27 -1300</pubDate>
      <category>Design and Patterns</category>
      <category>Software development</category>
      <category>Excel</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=a9c1c1ba-63eb-4aed-8e6b-6ba32bb0fc45</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=a9c1c1ba-63eb-4aed-8e6b-6ba32bb0fc45</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Illustrative-Programming.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=a9c1c1ba-63eb-4aed-8e6b-6ba32bb0fc45</wfw:commentRss>
    </item>
    <item>
      <title>The Drunkard’s Walk</title>
      <description>&lt;p&gt;I finished “&lt;a href="http://www.amazon.com/Drunkards-Walk-Randomness-Rules-Lives/dp/0375424040"&gt;The Drunkard’s Walk&lt;/a&gt; – how randomness rules our lives”, by Leonard Mlodinow, a few days after &lt;a href="http://clear-lines.com/blog/post.aspx?id=331493bd-3b07-4c0a-a279-fb3c92e79f38"&gt;Sway&lt;/a&gt;; I have postponed writing about it, because a minor storm of work has hit my parts – but I really loved this book, and thought I should say a few words about it.&lt;/p&gt;  &lt;p&gt;The book’s point is that humans are very bad at drawing conclusions from observations of random phenomena. They routinely make gross mistakes when dealing with conditional probability (92% of Americans, some of them with pretty solid mathematical credentials, get the &lt;a href="http://www.codinghorror.com/blog/archives/001278.html"&gt;Monty Hall&lt;/a&gt; problem wrong), and fall prey to the Law of Small Numbers, seeing patterns where there is none, and refusing to admit the importance of randomness in shaping our fates. In the end, the message is pretty upbeat – I loved this quote from Thomas Watson: &lt;/p&gt;  &lt;blockquote&gt;If you want to succeed, double your failure rate. &lt;/blockquote&gt;  &lt;p&gt;I really enjoyed how the book builds up following the history of probability and statistics; some of the individuals who contributed to its development are truly remarkable (just lookup &lt;a href="http://en.wikipedia.org/wiki/Gerolamo_Cardano"&gt;Cardano&lt;/a&gt; for instance), and the book contains a fair share of &lt;a href="http://clear-lines.com/blog/post/It-takes-one-to-know-one.aspx"&gt;anecdotes&lt;/a&gt; about them. If anything, it gave me my first introduction to &lt;a href="http://mathworld.wolfram.com/BenfordsLaw.html"&gt;Benford’s law&lt;/a&gt;, which I am still digesting – and which has been weirdly prominent in the news, via the &lt;a href="http://www.fivethirtyeight.com/2009/06/karroubis-unlucky-7s.html"&gt;Iran election&lt;/a&gt; issue.&lt;/p&gt;  &lt;p&gt;In short, I strongly recommend this book if you are interested in either history of sciences, probability, or decision making.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jYjkI9GDjf5JjMzTQkGjXSSI49U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jYjkI9GDjf5JjMzTQkGjXSSI49U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jYjkI9GDjf5JjMzTQkGjXSSI49U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jYjkI9GDjf5JjMzTQkGjXSSI49U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/The-Drunkarde28099s-Walk.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/The-Drunkarde28099s-Walk.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=37503e2c-c79e-42e7-a09c-630847f11ead</guid>
      <pubDate>Sun, 28 Jun 2009 12:41:42 -1300</pubDate>
      <category>Reviews</category>
      <category>Math</category>
      <category>quantitative modeling</category>
      <category>Decision analysis</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=37503e2c-c79e-42e7-a09c-630847f11ead</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=37503e2c-c79e-42e7-a09c-630847f11ead</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/The-Drunkarde28099s-Walk.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=37503e2c-c79e-42e7-a09c-630847f11ead</wfw:commentRss>
    </item>
    <item>
      <title>San Francisco .NET user group</title>
      <description>&lt;p&gt;Since the longest time, I have been a member of &lt;a href="http://baynetug.org"&gt;Bay.Net&lt;/a&gt;, the San Francisco Bay Area .NET user group. It’s one of the largest user groups in the country (north of 4,000 members), very active, with four chapters in the Bay – and first and foremost, it’s a fantastic way to keep up with what is going on in the ever-changing .NET world, and meet fellow developers and fun people.&lt;/p&gt;  &lt;p&gt;I initially came to attend the meetings, started to get more involved and volunteering in organizing events (if you are interested in volunteering, drop me a line!) – and I was very honored to be offered to co-chair the San Francisco chapter. The current chair, &lt;a href="http://www.linkedin.com/pub/kim-greenlee/1/476/407"&gt;Kim Greenlee&lt;/a&gt;, has been doing an amazing job at lining up great speaker after another, and making the meetings fun to attend, but she wants to dedicate her energy to another Bay.Net related project, and can’t be full-time chair anymore, so… the pressure is on – I’ll do my best to keep it up!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ncoT68RS_UeF6Xcj5g1YcGzg1ro/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ncoT68RS_UeF6Xcj5g1YcGzg1ro/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ncoT68RS_UeF6Xcj5g1YcGzg1ro/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ncoT68RS_UeF6Xcj5g1YcGzg1ro/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/San-Francisco-NET-user-group.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/San-Francisco-NET-user-group.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=3b5d44c4-a7cb-4e2e-8859-cd33f69a00a0</guid>
      <pubDate>Wed, 24 Jun 2009 12:43:19 -1300</pubDate>
      <category>.NET</category>
      <category>News</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=3b5d44c4-a7cb-4e2e-8859-cd33f69a00a0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=3b5d44c4-a7cb-4e2e-8859-cd33f69a00a0</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/San-Francisco-NET-user-group.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=3b5d44c4-a7cb-4e2e-8859-cd33f69a00a0</wfw:commentRss>
    </item>
    <item>
      <title>It takes one to know one</title>
      <description>&lt;p&gt;Mark Twain famously said “There are three kinds of lies: lies, damned lies and statistics”; in that light, I found the following anecdote – from “&lt;a href="http://www.amazon.com/Drunkards-Walk-Randomness-Rules-Lives/dp/0375424040"&gt;The Drunkard’s Walk&lt;/a&gt;”, a thoroughly enjoyable book so far - pretty funny. &lt;/p&gt;  &lt;p&gt;Like most of his compatriots, Jules Henri &lt;a href="http://en.wikipedia.org/wiki/Henri_Poincar&amp;eacute;"&gt;Poincaré&lt;/a&gt;, the legendary French mathematician, took his bread seriously, and purchased a fresh loaf daily. Suspecting his baker was a cheat, he weights his loaves every day, and finds out the average weight is 950g instead of the 1000g advertised. He complains to the authorities – and his daily baguette suddenly becomes larger.&lt;/p&gt;  &lt;p&gt;But now, instead of enjoying his good life, Poincaré still suspects his baker is a cheat, and keeps on measuring his bread for an entire year, and finds out that he now got mostly larger than 1000g loaves, and too few light ones. For him it’s great; but from a statistics standpoint, this doesn’t sound right: he should have roughly as many small and large loaves. Poincaré concludes that the baker is still cheating, but gives him the biggest loaf of his inventory every day to pacify him. He calls the authorities in again, who confirm he is right, and slam the baker.&lt;/p&gt;  &lt;p&gt;The moral of the story: &lt;a href="http://www.fivethirtyeight.com/2009/06/karroubis-unlucky-7s.html"&gt;don’t lie to statisticians&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DV_gbeyVDiIgB-4_3T2uEfflIyM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DV_gbeyVDiIgB-4_3T2uEfflIyM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DV_gbeyVDiIgB-4_3T2uEfflIyM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DV_gbeyVDiIgB-4_3T2uEfflIyM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/It-takes-one-to-know-one.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/It-takes-one-to-know-one.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=68970ffa-7d1c-4845-884f-50ad023d81bb</guid>
      <pubDate>Thu, 18 Jun 2009 06:40:14 -1300</pubDate>
      <category>Math</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=68970ffa-7d1c-4845-884f-50ad023d81bb</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=68970ffa-7d1c-4845-884f-50ad023d81bb</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/It-takes-one-to-know-one.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=68970ffa-7d1c-4845-884f-50ad023d81bb</wfw:commentRss>
    </item>
    <item>
      <title>Sway</title>
      <description>&lt;p&gt;While travelling to Seattle, I went shopping to the bookstore and purchased “&lt;a href="http://www.swaybook.com/"&gt;Sway&lt;/a&gt; – the irresistible pull of irrational behavior”, by Ori and Rom Brafman. Each of the book’s chapter illustrates a specific bias which leads individuals to make poor decisions, through multiple experiments or real-life stories.&lt;/p&gt;  &lt;p&gt;If you are familiar with decision theory, and specifically with decision biases – the way our brain plays tricks with us and processes information poorly, misleading our judgment – you will probably not learn much from the book. Even then, it’s a pretty entertaining read; the style is light, and the anecdotes and cases funny and very clearly explained. If you are not familiar with the topic, I recommend the book: it is a good primer to recognize traps and make better decisions!&lt;/p&gt;  &lt;p&gt;The part which was new to me was the chapter “Compensation and Cocaine”. It seems that monetary decisions and altruism are processed in completely different parts of the brain (no surprise so far), but also that when one is active, it shuts down the other. Furthermore, the monetary decision brain is processed in the same place as the center of pleasure derived from sex, drugs or gambling (not sure what this says about the financial sector…), which has very practical implication in designing incentives. From what I gather, altruism provides a stronger motivation than money – but surprisingly, mixing both doesn’t add up: the pleasure center will completely override altruistic motivation, which is then ignored – and reduces overall motivation.&lt;/p&gt;  &lt;p&gt;Overall, fun read – recommended!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2fsoVakFLE2ghtyb7hHjVxREFng/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2fsoVakFLE2ghtyb7hHjVxREFng/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2fsoVakFLE2ghtyb7hHjVxREFng/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2fsoVakFLE2ghtyb7hHjVxREFng/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Sway.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Sway.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=331493bd-3b07-4c0a-a279-fb3c92e79f38</guid>
      <pubDate>Sun, 14 Jun 2009 16:44:44 -1300</pubDate>
      <category>Decision analysis</category>
      <category>Economics</category>
      <category>Reviews</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=331493bd-3b07-4c0a-a279-fb3c92e79f38</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=331493bd-3b07-4c0a-a279-fb3c92e79f38</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Sway.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=331493bd-3b07-4c0a-a279-fb3c92e79f38</wfw:commentRss>
    </item>
    <item>
      <title>Dude, where is my log?</title>
      <description>&lt;p&gt;No matter how much you think you have your bases covered, users will do unexpected things with your application. Writing good unit tests: &lt;a href="http://www.youtube.com/watch?v=0v7D_SirqTc"&gt;priceless&lt;/a&gt;. For everything else, there is logging. So I decided to add exception logging to &lt;a href="http://www.clear-lines.com/akin.aspx"&gt;Akin&lt;/a&gt;, and opted for &lt;a href="http://www.nlog-project.org/"&gt;NLog&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;NLog rocks. It is very easy to configure: basically, add the NLog dll to your project, a configuration file defining what you want to log, and where it should go, and you are set. My configuration file looks something like that:&lt;/p&gt;  &lt;pre class="xml" name="code"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;
&amp;lt;nlog xmlns=&amp;quot;http://www.nlog-project.org/schemas/NLog.xsd&amp;quot;
      xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;
  &amp;lt;targets&amp;gt;
    &amp;lt;target name=&amp;quot;file&amp;quot; xsi:type=&amp;quot;File&amp;quot;
        layout=&amp;quot;${longdate} ${stacktrace} ${message} ${exception:format=message,type,method,stacktrace}&amp;quot;
        fileName=&amp;quot;${basedir}/logs/${shortdate}.log&amp;quot;
        concurrentWrites=&amp;quot;true&amp;quot; /&amp;gt;
  &amp;lt;/targets&amp;gt;
  &amp;lt;rules&amp;gt;
    &amp;lt;logger name=&amp;quot;*&amp;quot; minlevel=&amp;quot;Trace&amp;quot; writeTo=&amp;quot;file&amp;quot; /&amp;gt;
  &amp;lt;/rules&amp;gt;
&amp;lt;/nlog&amp;gt;&lt;/pre&gt;
Which I use then to log exceptions this way:

&lt;pre class="c#" name="code"&gt;try
{
    // try to open a file
}
catch(Exception e)
{
    logger.TraceException(string.Format(&amp;quot;Failed to open {0}.&amp;quot;, path), e);
}&lt;/pre&gt;

&lt;p&gt;The exception gets appended to a file like 2009-06-08.log, in the logs folder located in the application folder, in that case, C:\Program Files\Akin; if the file or folder do not exist, it gets automatically created. This worked like a charm, once I realized I also needed to add the config file to the installer. &lt;/p&gt;

&lt;p&gt;And then I deployed on a Vista machine. Everything looked fine (I checked that logging to a message box worked), except that… there was no log file to be found. Damn.&lt;/p&gt;

&lt;p&gt;After much anxiety and help of &lt;a href="http://stackoverflow.com/questions/966669/nlog-does-not-write-to-file-on-vista-deployment"&gt;StackOverflow&lt;/a&gt;, I found my logs. Turns out, there was a log file, but not where I expected it to be. Vista uses &lt;a href="http://thelazyadmin.com/blogs/thelazyadmin/archive/2007/04/26/file-system-virtualization.aspx"&gt;File System Virtualization&lt;/a&gt;, and writes the log to another location – in my case,&lt;/p&gt;

&lt;p&gt;C:/Users/JohnDoe/AppData/Local/VirtualStore/Program Files (x86)/Akin/Logs/&lt;/p&gt;

&lt;p&gt;So if you can’t find your log files, no worries. It’s just Vista playing hide-and-seek with you…&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/G0G980zaK-y4XM5yWJb5Lla78_Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G0G980zaK-y4XM5yWJb5Lla78_Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/G0G980zaK-y4XM5yWJb5Lla78_Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G0G980zaK-y4XM5yWJb5Lla78_Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Dude-where-is-my-log.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Dude-where-is-my-log.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=fe7237fa-dfdb-4529-840f-f1e55819d29c</guid>
      <pubDate>Mon, 08 Jun 2009 08:53:44 -1300</pubDate>
      <category>.NET</category>
      <category>Software development</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=fe7237fa-dfdb-4529-840f-f1e55819d29c</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=fe7237fa-dfdb-4529-840f-f1e55819d29c</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Dude-where-is-my-log.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=fe7237fa-dfdb-4529-840f-f1e55819d29c</wfw:commentRss>
    </item>
    <item>
      <title>Ars Mathematica</title>
      <description>&lt;p&gt;Via &lt;a href="http://www.stat.columbia.edu/~cook/movabletype/archives/2009/06/nylanders_art_o.html"&gt;Aleks Jakulin&lt;/a&gt;, amazingly beautiful surfaces generated by &lt;a href="http://nylander.wordpress.com/"&gt;Paul Nylander&lt;/a&gt; using Mathematica:&lt;/p&gt;  &lt;p&gt;&lt;img height="180" src="http://bugman123.com/MinimalSurfaces/Scherk-Collins-large.jpg" width="240" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;img height="180" src="http://bugman123.com/MinimalSurfaces/Jorge-Meeks5-large.jpg" width="240" /&gt; &lt;a href="http://bugman123.com/MinimalSurfaces/Scherk-Collins.m1v"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1Mr1Y4vMht42QFZ6nRyuKaGaEX4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1Mr1Y4vMht42QFZ6nRyuKaGaEX4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1Mr1Y4vMht42QFZ6nRyuKaGaEX4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1Mr1Y4vMht42QFZ6nRyuKaGaEX4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Ars-Mathematica.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Ars-Mathematica.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=da8c0ac8-0fdd-4053-a87c-0432d757fba0</guid>
      <pubDate>Mon, 01 Jun 2009 07:23:30 -1300</pubDate>
      <category>Math</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=da8c0ac8-0fdd-4053-a87c-0432d757fba0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=da8c0ac8-0fdd-4053-a87c-0432d757fba0</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Ars-Mathematica.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=da8c0ac8-0fdd-4053-a87c-0432d757fba0</wfw:commentRss>
    </item>
    <item>
      <title>#warning: the power of in-your-face</title>
      <description>&lt;p&gt;The iterative nature of writing code inevitably involves adding code which is good enough for now, but should be refactored later. The problem is that unless you have some system in place, later, you will just forget about it. Personally, I have been trying 3 approaches to address this: bug-tracking systems, the good old-fashion text to-do list, and its variant, the task list built in Visual Studio, and finally, comments embedded in the code.&lt;/p&gt;  &lt;p&gt;Each have their pros and cons. Bug tracking systems are great for systematically managing work items in a team (prioritization, assignment to various members...), but work best for items at the level of a feature: in my experience, smaller code changes don't fit well. I am a big fan of the bare-bones &lt;a href="http://www.tobinharris.com/past/2008/10/22/how-do-you-manage-your-todos/"&gt;text file to-do list&lt;/a&gt;; I tried, but never took to the Visual Studio to-do list (no clear reason there). I hardly embed comments in code anymore (like 'To-do: change this later'): on the plus side, the comment is literally tacked to the code that needs changing, but the comments cannot be displayed all as one list, which makes them too easy to forget.&lt;/p&gt;  &lt;p&gt;Today I found a cool alternative via Donn Felker’s blog: &lt;a href="http://blog.donnfelker.com/post/Code-Review-Tip-Using-the-e28098warninge28099-Preprocessor-Directive.aspx"&gt;#warning&lt;/a&gt;. You use it essentially like a comment, but preface it with #warning, like this:&lt;/p&gt;  &lt;pre class="brush: vb;"&gt;#warning The tag name should not be hardcoded
XmlNodeList atBatNodes = document.GetElementsByTagName(&amp;quot;atbat&amp;quot;);&lt;/pre&gt;

&lt;p&gt;Now, when you build, you will see something like this in Visual Studio:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/warningthepowerofinyourface_B127/warning_1.jpg"&gt;&lt;img title="warning" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="106" alt="warning" src="http://clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/warningthepowerofinyourface_B127/warning_thumb_1.jpg" width="586" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;It has all the benefits of the embedded comment – it’s close to the code that needs to be changed - but will also show up as a list which will be in-your-face every time you build. I’ll try that out, and see how that goes, and what stays in the todo.txt!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OulogDOU4RHDBoMAKpHgD_El-oU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OulogDOU4RHDBoMAKpHgD_El-oU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OulogDOU4RHDBoMAKpHgD_El-oU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OulogDOU4RHDBoMAKpHgD_El-oU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/warning-the-power-of-in-your-face.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/warning-the-power-of-in-your-face.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=90867620-5e27-4a80-b253-0af3f1e94950</guid>
      <pubDate>Wed, 27 May 2009 13:36:05 -1300</pubDate>
      <category>Software development</category>
      <category>.NET</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=90867620-5e27-4a80-b253-0af3f1e94950</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=90867620-5e27-4a80-b253-0af3f1e94950</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/warning-the-power-of-in-your-face.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=90867620-5e27-4a80-b253-0af3f1e94950</wfw:commentRss>
    </item>
    <item>
      <title>Data driven tests with NUnit 2.5</title>
      <description>&lt;p&gt;Another nice improvement coming with NUnit 2.5 is the mechanism for data-driven tests. NUnit 2.4.7 included an extension by &lt;a href="http://www.andreas-schlapsi.com/2008/03/31/nunit-247-includes-rowtest-extension/"&gt;andreas schlapsi&lt;/a&gt; which permitted to write &lt;a href="http://blog.donnfelker.com/post/NUnit-247-and-the-RowTest-Attribute-with-Example.aspx"&gt;row tests&lt;/a&gt;, using the [TestRow] attribute.&lt;/p&gt;  &lt;p&gt;NUnit 2.5 eases the process with the [TestCase] attribute. Unlike [TestRow], the [TestCase] attribute is available within the NUnit.Framework namespace, and doesn’t require including additional references.&lt;/p&gt;  &lt;p&gt;Why do Data-driven tests matter? They are not technically necessary: you can write the same tests as easily using the standard [Test] attribute. However, it comes handy when you are testing a feature where you want to verify the behavior for multiple combinations of input values. Using “classic” unit tests, you will end up duplicating test code, and you will have to find different name for tests method which are in essence the same test.&lt;/p&gt;  &lt;p&gt;Using [TestCase] instead, here is how it looks. Suppose your class MyClass has a method “Divide” like this one:&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;public class MyClass
{
    public double Divide(double numerator, double denominator)
    {
        if (denominator == 0)
        {
            throw new DivideByZeroException(&amp;quot;Cannot divide by zero.&amp;quot;); 
        }
        return numerator / denominator;
    }
}&lt;/pre&gt;

&lt;p&gt;One way to test that feature would be with a test like that one:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;[TestCase(2.5d, 2d, Result=1.25d)]
[TestCase(-2.5d, 1d, Result = -2.5d)]
public double ValidateDivision(double numerator, double denominator)
{
    var myClass = new MyClass();
    return myClass.Divide(numerator,denominator);
}&lt;/pre&gt;

&lt;p&gt;Each TestCase will match the arguments of the test method with the arguments provided in parenthesis (e.g. the first test will pass a numerator of 2.5 and a denominator of 2.0) and verify that the return value matches the value provided as “Result”.&lt;/p&gt;

&lt;p&gt;One feature I really like in the new implementation is that it also supports exceptions testing. If a certain combination of input values is expected to throw an exception, it can also be expressed as a test case, without writing a dedicated test method:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;[TestCase(2.5d, 2d, Result = 1.25d)]
[TestCase(-2.5d, 1d, Result = -2.5d)]
[TestCase(1d, 0d, ExpectedException = typeof(DivideByZeroException))]
public double ValidateDivision(double numerator, double denominator)
{
    var myClass = new MyClass();
    return myClass.Divide(numerator,denominator);
}&lt;/pre&gt;

&lt;p&gt;When you run this in the NUnit GUI, you will see something like this, displaying the “mother” test, and the result of each data set:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/DatadriventestswithNUnit2.5/6D840C5C/TestCase.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TestCase" border="0" alt="TestCase" src="http://www.clear-lines.com/blog/image.axd?picture=WindowsLiveWriter/DatadriventestswithNUnit2.5/75D7BBE6/TestCase_thumb.jpg" width="236" height="158" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As an aside, this post made me realize that dividing a double by zero was not throwing a “DivideByZeroException”, as I naively thought it would, but returns a double.PositiveInfinity (or NegativeInfinity, depending on the numerator). Goes to show that nothing beats &lt;a href="http://blog.goeran.no/PermaLink,guid,fe01bed3-c526-4b76-bb91-f82f4792aece.aspx"&gt;writing unit tests when trying to understand a feature&lt;/a&gt; of a language!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FJ6Wdrb_VIysEBuQCxf0HOBB2MQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FJ6Wdrb_VIysEBuQCxf0HOBB2MQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FJ6Wdrb_VIysEBuQCxf0HOBB2MQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FJ6Wdrb_VIysEBuQCxf0HOBB2MQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Data-driven-tests-with-NUnit-25.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Data-driven-tests-with-NUnit-25.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=2ccda092-5445-4c9b-8c59-3edb6a12b56c</guid>
      <pubDate>Sun, 17 May 2009 02:25:46 -1300</pubDate>
      <category>.NET</category>
      <category>Software development</category>
      <category>Design and Patterns</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=2ccda092-5445-4c9b-8c59-3edb6a12b56c</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=2ccda092-5445-4c9b-8c59-3edb6a12b56c</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Data-driven-tests-with-NUnit-25.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=2ccda092-5445-4c9b-8c59-3edb6a12b56c</wfw:commentRss>
    </item>
    <item>
      <title>Live Messenger Hackathon</title>
      <description>&lt;p&gt;Update: here is &lt;a href="http://hackathon.eventbrite.com/"&gt;the event page.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Microsoft is hosting a Windows Live Messenger Hackathon on the 27th May 2009 at Microsoft's offices on 835 Market St in San Francisco. The event starts at 5:30, there will be a discussion on social media, how to use the Windows Live API in your website, a coding contest, prizes, free beer and pizza… Sounds like fun! &lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i0xsK8iUgGMKy2wk1WQZdzJlRB0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i0xsK8iUgGMKy2wk1WQZdzJlRB0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i0xsK8iUgGMKy2wk1WQZdzJlRB0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i0xsK8iUgGMKy2wk1WQZdzJlRB0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Live-Messenger-Hackathon.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Live-Messenger-Hackathon.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=915726b1-096e-4c1e-b1ac-8cb09f3ef2f7</guid>
      <pubDate>Thu, 14 May 2009 01:10:58 -1300</pubDate>
      <category>News</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=915726b1-096e-4c1e-b1ac-8cb09f3ef2f7</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=915726b1-096e-4c1e-b1ac-8cb09f3ef2f7</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Live-Messenger-Hackathon.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=915726b1-096e-4c1e-b1ac-8cb09f3ef2f7</wfw:commentRss>
    </item>
    <item>
      <title>Testing for exceptions with NUnit 2.5</title>
      <description>&lt;p&gt;Compared to the recent releases, NUnit 2.5 contains quite a few significant changes. One notable change is in the area of exception testing – and it is for the better. &lt;/p&gt;  &lt;p&gt;Until NUnit 2.4.8, testing for exceptions was done by decorating tests with the [ExpectedException] attribute. NUnit 2.5 introduces a new assertion instead, Assert.Throws.&lt;/p&gt;  &lt;p&gt;Why is this better?&lt;/p&gt;  &lt;p&gt;I see at least 2 reasons: it makes it much easier to catch the exception precisely where it is expected to happen, and working with the exception itself is now a breeze.&lt;/p&gt;  &lt;p&gt;While the ExpectedException attribute is typically sufficient, it is a bit of a blunt tool. What it does verify is that the code under test throws the expected type of exception; what it&amp;#160; doesn’t tell you is where. The tests are not fully explicit, and sometimes, they can result in unexpected “false positives”.&lt;/p&gt;  &lt;p&gt;Consider the following situation: a class MyClass exposes a method that takes a positive int as argument, and throws an ArgumentException if a negative is passed. A test for this behavior would look something like this:&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;[Test]
[ExpectedException(typeof(ArgumentException))]
public void FalsePositive()
{
    MyClass myClass = new MyClass();
    // This call is test setup, but will
    // throw an unwanted ArgumentException.
    myClass.SomeMethodThatThrows();
    // We want to check that this call throws.
    myClass.SomeMethodThatRequiresAPositiveArgument(-5);
}&lt;/pre&gt;

&lt;p&gt;Unfortunately, our setup contains a call to another method, which due to an error in our code, will throw an ArgumentException, too. The right type of exception is thrown, but absolutely not where we intend it – and the test will pass. Not good.&lt;/p&gt;

&lt;p&gt;Granted, the example is pretty contrived, but situations like these do happen. To avoid this, you need to catch the exception “red handed”, exactly where it is supposed to take place – which requires cumbersome code code like this:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;[Test]
[ExpectedException(typeof(ArgumentException))]
public void PainfulCorrectTest()
{
    MyClass myClass = new MyClass();
    try
    {
        // if the setup throws the test fails.
        myClass.SomeMethodThatThrows();
    }
    catch
    {
        Assert.Fail();
    }
    // We expect an exception in that portion of the code.
    myClass.SomeMethodThatRequiresAPositiveArgument(-5);
}&lt;/pre&gt;

&lt;p&gt;By wrapping the setup in a try/catch block, you can ensure that any exception that happens there will result in a failure of the test; the only “tolerated” exception has to occur after that block.&lt;/p&gt;

&lt;p&gt;With NUnit 2.5, this problem disappears. The [ExpectedException] attribute is gone, and replaced by an assertion that verifies if a specific method call throws an exception:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;[Test]
public void DelegateBasedTest()
{
    MyClass myClass = new MyClass();
    // We don't need to do anything about the setup.
    myClass.SomeMethodThatThrows();
    // The exception is expected here.
    Assert.Throws&amp;lt;ArgumentException&amp;gt;(
        delegate { myClass.SomeMethodThatRequiresAPositiveArgument(-5); });
}&lt;/pre&gt;

&lt;p&gt;This is really nice: the test pinpoints what exception is expected, AND exactly where it is supposed to happen. And with the “special” [ExpectedException] attribute gone, the syntax is more consistent.&lt;/p&gt;

&lt;p&gt;The cherry on the cake is that Assert.Throws returns the actual exception that is thrown; it is totally straightforward to validate the state of the exception itself:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;[Test]
public void RetrieveException()
{
    MyClass myClass = new MyClass();
    ArgumentException exception = Assert.Throws&amp;lt;ArgumentException&amp;gt;(delegate { myClass.SomeMethodThatRequiresAPositiveArgument(-5); });
    Assert.AreEqual(&amp;quot;The Message.&amp;quot;, exception.Message);
}&lt;/pre&gt;

&lt;p&gt;I really like this change in NUnit 2.5. The syntax does look a bit more intimidating, but the tests gain in clarity – which is crucial in a test suite. Tests are your best specification, and anything which reduces ambiguity there is a good thing!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GVtNFV0KDdp7tsaZiGhEwu5udTc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GVtNFV0KDdp7tsaZiGhEwu5udTc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GVtNFV0KDdp7tsaZiGhEwu5udTc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GVtNFV0KDdp7tsaZiGhEwu5udTc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Testing-for-exceptions-with-NUnit-25.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Testing-for-exceptions-with-NUnit-25.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=7d9ac829-27c0-4403-a5fc-cdd0b4339cfa</guid>
      <pubDate>Sun, 10 May 2009 23:24:44 -1300</pubDate>
      <category>.NET</category>
      <category>Software development</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=7d9ac829-27c0-4403-a5fc-cdd0b4339cfa</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=7d9ac829-27c0-4403-a5fc-cdd0b4339cfa</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Testing-for-exceptions-with-NUnit-25.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=7d9ac829-27c0-4403-a5fc-cdd0b4339cfa</wfw:commentRss>
    </item>
    <item>
      <title>Website spring clean-up</title>
      <description>&lt;p&gt;After much postponing, I finally cleaned up the layout of Clear Lines. I had cobbled together the previous design over a few days when I started, and, because it's not a crucial aspect of my activities, I left it at that until now. I like my new design better (I hope you do, too!), it feels much cleaner than the previous one. The main motivation was not the looks, though, but rather flexibility. I will add a few pages soon, and need to easily integrate them into the site navigation, so I finally replaced my hard-coded links by an ASP.NET menu. And while I was at it, I got inspired by &lt;a href="http://peterkellner.net/2009/03/27/codecampwebsiteseries6-cssfriendly-adapters-aspnet-menu/"&gt;Peter Kellner&lt;/a&gt;'s beautiful menu for the &lt;a href="http://www.siliconvalley-codecamp.com"&gt;Silicon Valley Code Camp&lt;/a&gt; site, and started looking into &lt;a href="http://www.codeplex.com/cssfriendly"&gt;Css Friendly Control Adapters&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;I like the fact that the whole menu layout is pure css, instead of tables, but I struggled quite a bit with getting css to play nice. Not the adapter's fault, rather my own limitations with css... In the end, I managed to get roughly the look I was after. That being said, if you open the page in IE7, it will render differently than in any other browser I tried: for some reason, I couldn't get IE to change the background color of the menu links on hover, or to render properly a border-bottom. If anyone has an idea what's wrong with my css, I would love to hear it!&lt;/p&gt; &lt;p&gt;Next step: upgrade the blog to BlogEngine 1.5, and probably add a sub-menu to the pages, similar to the Code Camp site.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YvtuPLELkNP8cdhqeVMTJ5KWQtc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YvtuPLELkNP8cdhqeVMTJ5KWQtc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YvtuPLELkNP8cdhqeVMTJ5KWQtc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YvtuPLELkNP8cdhqeVMTJ5KWQtc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Website-spring-clean-up.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Website-spring-clean-up.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=b8574651-8e18-4080-9194-82da6a655bf1</guid>
      <pubDate>Thu, 30 Apr 2009 17:35:14 -1300</pubDate>
      <category>News</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=b8574651-8e18-4080-9194-82da6a655bf1</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=b8574651-8e18-4080-9194-82da6a655bf1</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Website-spring-clean-up.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=b8574651-8e18-4080-9194-82da6a655bf1</wfw:commentRss>
    </item>
    <item>
      <title>Times a-changin'</title>
      <description>&lt;p&gt;You know times are changing when such a venerable institution as the Victorinox &lt;a href="http://www.swissarmy.com"&gt;Swiss Army Knife&lt;/a&gt; publishes an ad asking:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;"how impressed would you be to see a Swiss Army Knife running a PowerPoint presentation?"&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;img height="204" src="http://www.blogcdn.com/www.engadget.com/media/2009/01/victorinox_ces0013-600.jpg" width="305"&gt; &lt;/p&gt; &lt;p&gt;(Picture from &lt;a href="http://www.engadget.com/2009/01/09/victorinox-presentation-pro-floated-by-the-swiss-army/"&gt;Engadget&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/j-TJW_4PIswmvaTpKK8dktIDmO4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j-TJW_4PIswmvaTpKK8dktIDmO4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/j-TJW_4PIswmvaTpKK8dktIDmO4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j-TJW_4PIswmvaTpKK8dktIDmO4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.clear-lines.com/blog/post/Times-a-changin.aspx</link>
      <author>mathias.brandewinder.nospam@nospam.clear-lines.com (mathias)</author>
      <comments>http://www.clear-lines.com/blog/post/Times-a-changin.aspx#comment</comments>
      <guid>http://www.clear-lines.com/blog/post.aspx?id=40b77cff-3f53-4200-a6c2-4d4de6af0004</guid>
      <pubDate>Tue, 28 Apr 2009 16:23:10 -1300</pubDate>
      <category>Random</category>
      <category>Technology</category>
      <dc:publisher>mathias</dc:publisher>
      <pingback:server>http://www.clear-lines.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.clear-lines.com/blog/post.aspx?id=40b77cff-3f53-4200-a6c2-4d4de6af0004</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.clear-lines.com/blog/trackback.axd?id=40b77cff-3f53-4200-a6c2-4d4de6af0004</trackback:ping>
      <wfw:comment>http://www.clear-lines.com/blog/post/Times-a-changin.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.clear-lines.com/blog/syndication.axd?post=40b77cff-3f53-4200-a6c2-4d4de6af0004</wfw:commentRss>
    </item>
  </channel>
</rss>
