<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.atalasoft.de/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Atalasoft Community</title><link>http://www.atalasoft.de/cs/blogs/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>F# Discoveries This Week 09/03/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx</link><pubDate>Fri, 03 Sep 2010 22:12:19 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20991</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;div align="left"&gt;   &lt;p&gt;One of the greatest things about running this blog, other than having a structured way to read all of the F# community content, is that I’ve been able to watch the community grow in a very concrete way.&amp;#160; &lt;a href="http://www.atalasoft.com/cs/blogs/rickm/archive/2009/08/31/f-discoveries-this-week-08-31-2009.aspx"&gt;Looking back to a year ago&lt;/a&gt; there was only six posts on F# over the course of a week, now we have well over twenty.&amp;#160; It’s truly amazing to see.&lt;/p&gt; &lt;/div&gt;  &lt;div align="left"&gt;Now, on to the links.&lt;/div&gt;  &lt;div align="left"&gt;&amp;#160;&lt;/div&gt;  &lt;h1 align="center"&gt;Audio and Video&lt;/h1&gt;  &lt;h3 align="left"&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/C9-Lectures-Dr-Ralf-Lmmel-Advanced-Functional-Programming-Type-Classes/"&gt;Dr. Ralf Lämmel's C9 Lectures: Advanced Functional Programming - Type Classes&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p align="left"&gt;&lt;em&gt;“In this second lecture in the series, Ralf digs into Type Classes, which are type system constructs that were originally introduced to provide a form of ad hoc polymorphism (i.e., an advanced form of overloading).”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3 align="left"&gt;&lt;a href="http://vimeo.com/14531763"&gt;Rick Minerich's Functional Language Paradigms with F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p align="left"&gt;&lt;em&gt;“I've got great news. F# is here and is poised to increase your productivity and reduce your suffering.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3 align="left"&gt;&lt;a href="http://channel9.msdn.com/posts/martinesmann/Teaching-programming-language-concepts-with-F-part-1/"&gt;Peter Sestoft's Teaching programming language concepts with F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p align="left"&gt;&lt;em&gt;“Peter introduces the curriculum, lecture plan and lecture notes for the course &amp;quot;Programs as data&amp;quot; that uses the functional programming concepts in F# to teach students language concepts and implementation details.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Tools&lt;/h1&gt;  &lt;h3 align="left"&gt;&lt;a href="http://refcardz.dzone.com/refcardz/essential-f?oid=hom27717"&gt;Essential F# | Refcardz&lt;/a&gt;&lt;/h3&gt;  &lt;div align="left"&gt;   &lt;blockquote&gt;     &lt;p&gt;&lt;em&gt;“This DZone Refcard will lead you through the basic essentials so that you can quickly move on to using this Functional Programming Language for creating some mind-bending code.”&lt;/em&gt;&lt;/p&gt;   &lt;/blockquote&gt;    &lt;h3&gt;&lt;a href="http://fsxplat.codeplex.com/releases/view/51797"&gt;fsxplat - Released: FSharp packages 1.2&lt;/a&gt;&lt;/h3&gt;    &lt;blockquote&gt;     &lt;p&gt;&lt;em&gt;“F# packages and samples for use across platforms”&lt;/em&gt;&lt;/p&gt;   &lt;/blockquote&gt;    &lt;h3&gt;&lt;a href="http://www.trelford.com/blog/post/TickSpec.aspx"&gt;Phillip Trelford's TickSpec: An F# BDD Framework&lt;/a&gt;&lt;/h3&gt;    &lt;blockquote&gt;     &lt;p&gt;&lt;em&gt;“Right now TickSpec is intended as a lightweight framework to get you started with BDD using F#. It is standards based, supporting a subset of the Gherkin language, so should be easy to change to another Gherkin based framework like Cucumber, SpecFlow or StorEvil.”&lt;/em&gt;&lt;/p&gt;   &lt;/blockquote&gt; &lt;/div&gt;  &lt;div align="left"&gt;&amp;#160;&lt;/div&gt;  &lt;div align="left"&gt;&amp;#160;&lt;/div&gt;  &lt;h1 align="center"&gt;General&lt;/h1&gt;  &lt;h3&gt;   &lt;blockquote&gt;     &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;   &lt;/blockquote&gt; &lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://v2matveev.blogspot.com/2010/08/f-building-compiler-from-sources.html"&gt;Vladimir Matveev's F#: Building compiler from sources.&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“Of course, compiling them sources and observing all internal compiler activities, so to say “in action’.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;   &lt;blockquote&gt;     &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;   &lt;/blockquote&gt;   &lt;a href="http://blogs.msdn.com/b/ashleyf/archive/2010/09/01/fixing-decades-old-bugs-in-the-hp-35.aspx"&gt;Ashley Feniello's Fixing Decades-old Bugs in the HP-35&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“To make an assembler, I just parse with a series of regular expressions. F#’s active patterns came in super handy for this! In fact, the assembler turned out to be fewer lines of code than the disassembler.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/ashleyf/archive/2010/08/27/microcode-level-hp-35-emulator-in-javascript.aspx"&gt;Ashley Feniello's Microcode-level HP-35 Emulator (in JavaScript!)&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“I had the (silly) idea of building a JavaScript-based emulator. Looking at Peter Monta’s Python-based disassembler and his object code listing, it looked simple enough to automatically generate script from David Cochran’s original bits. I wrote my own little straight forward 100-line disassembler in F#, producting an array of JavaScript functions”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!2144.entry"&gt;Brian McNamara's F# for puzzles (Morse code decoder)&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“The idea is simple; the computer works out all the possibilities for the next 3 letters, and then the human selects which prefixes “look promising” to investigate further.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/09/fuzzy-logic-f-reference-module-fuzzy0.html"&gt;Neil Carrier's TechNeilogy: Fuzzy Logic F# Reference Module: Fuzzy0&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“Below is the fuzzy logic reference code for module Fuzzy0. Tomorrow I’ll post an example of its use that explores some extensions of earlier techniques.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://fdatamining.blogspot.com/2010/09/wekasharp-tutorial-for-running-weka-in.html"&gt;Yin Zhu's F# and Data Mining: WekaSharp: Tutorial for using Weka in F#/.Net&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“The minimal wrapper in F# for Weka.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://www.whattofix.com/blog/archives/2010/09/structuring-lar.php"&gt;Daniel Markham's Structuring Larger F# Functional Projects&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“So here's a suggested structure outline for those larger functional projects”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://www.ademiller.com/blogs/tech/2010/08/f-samples-for-parallel-programming-with-microsoft-net/"&gt;Ade Miller's F# Samples for Parallel Programming with Microsoft .NET&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“We’ve been working with the F# Team to get the samples for Parallel Programming with Microsoft .NET ported to F#.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/f-fuzzy-logic-wpf-and-tomatoes.html"&gt;Neil Carrier's TechNeilogy: F#, Fuzzy Logic, WPF, and Tomatoes!&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“This is my 100th blog post, and to celebrate, I’m pulling out all the stops. This example will combine F#, fuzzy logic, WPF, and tomatoes!”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/conjunctive-fuzzy-logic-rules-in-f.html"&gt;Neil Carrier's TechNeilogy: Conjunctive Fuzzy Logic Rules in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“It shows how to make multipart conjunctive rules by storing the input sets in a list and using the “min” operator to combine the results into a truncation height. To do this, it adds vector versions of the fire and fire all functions.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;   &lt;blockquote&gt;     &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;   &lt;/blockquote&gt;   &lt;a href="http://justinangel.net/WindowsPhone7VBnetAndFSharp#BlogPost=WindowsPhone7VBnetAndFSharp"&gt;Justin Angel's Windows Phone 7 supports VB.Net and F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“In this article we’ll review Windows Phone 7 support for the Visual Basic .Net and F# programming languages. Our goal is to demonstrate that Windows Phone 7 can indeed support F# and VisualBasic.Net code libraries and user controls.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://fsai.codeplex.com/documentation?version=11"&gt;F# Artificial Intelligence Library Tutorial&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“This step-by-step tutorial describes how to use the library in fsx script and C# project.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://chrismarinos.com/5-reasons-to-use-f-interactive-in-visual-studio-2010/"&gt;Chris Marinos's 5 Reasons to use F# Interactive in Visual Studio 2010&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“I find that I use F# Interactive more for performance analysis, learning F#, and verifying Base Class Library behavior than for spiking or scripting.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Community&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://stackoverflow.com/questions/3630349/calling-f-net-dll-code-from-php"&gt;Stack Overflow - Calling F# (.Net dll) code from php&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“Yes you can, by using PHP COM class but it works only on Windows version of PHP5+ and needs no separate installation.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://stackoverflow.com/questions/3596718/scrap-your-boilerplate-in-f"&gt;Stack Overflow - Scrap Your Boilerplate in f#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“I've used the Scrap Your Boilerplate and Uniplate libraries in the Haskell programming language, and I would find that form of generic programming over discriminated unions to be really useful. Is there an equivalent library in the f# programming language?”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://stackoverflow.com/questions/3628031/path-to-become-a-better-f-programmer"&gt;Stack Overflow - Path to Become a Better F# Programmer&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“What should be my steps from now on to become a better/professional F# programmer?”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Teaching and Basics&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.dotnetconvo.com/post/view/2010/9/1/learning-f-for-c-developers-scope-workflow-and-lists"&gt;Bill Morrissey's Learning F# for C# developers: Scope, Workflow and Lists&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“This post is part two of a series of posts looking at syntactical examples of F# and C#. This post will supply you with easy to understand F# coding examples.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://www.winsoft.se/2010/08/type-inference-in-f/"&gt;Anders Hesselbom's Type inference in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“I have recently been to a short F# presentation at HiQ in Arboga. One of the things that got mentioned was type inference.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://www.reydacoco.blogspot.com/2010/09/webbrowser-controlvisual-f-windows.html"&gt;Rey Dacoco's WebBrowser control (Visual F# Windows Forms Application)&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“WebBrowser control is a control used to display a web page or web document. To create a WebBrowser control in F#, use the following syntax:”&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+09%2f03%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+09%2f03%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+09%2f03%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+09%2f03%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+09%2f03%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/09/03/f-discoveries-this-week-09-03-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20991" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/AI/default.aspx">AI</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/assembler/default.aspx">assembler</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/compiler/default.aspx">compiler</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/disassembler/default.aspx">disassembler</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsxplat/default.aspx">fsxplat</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Fuzzy+Logic/default.aspx">Fuzzy Logic</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Refcardz/default.aspx">Refcardz</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/type+inference/default.aspx">type inference</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/video/default.aspx">video</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Weka/default.aspx">Weka</category></item><item><title>F# Discoveries This Week 08/27/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx</link><pubDate>Sat, 28 Aug 2010 00:04:06 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20986</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I’m back again with another edition of F# Discoveries this Week.&amp;#160; The most exciting announcement this week is the new F# August 2010 CTP which brings with it the ability to build your own VS2010 F# Express Edition with Visual Studio Shell and the prospect of building F# applications on Windows Phone 7.&amp;#160; Be sure to check out Daniel Mohl’s Windows Phone 7 template before getting started.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News and Upcoming Talks&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!2135.entry"&gt;F# (August 2010 CTP)&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/08/17/announcing-the-f-2-0-free-tools-for-net-4-0.aspx"&gt;Announcing the F# 2.0 Standalone Tools Update&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/08/17/a-standing-invitation-to-f-users-to-quot-get-in-touch-quot.aspx"&gt;A standing invitation to F# users to &amp;quot;get in touch&amp;quot;&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://fsharpnews.blogspot.com/2010/08/don-syme-lecturing-at-functional.html"&gt;Don Syme lecturing at the F#unctional Londoners Meetup (9/9)&lt;/a&gt; &lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Tools and Libraries&lt;/h1&gt;  &lt;p&gt;&lt;a href="http://fdatamining.blogspot.com/2010/08/wekasharp-f-wrapper-for-weka.html"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fdatamining.blogspot.com/2010/08/wekasharp-f-wrapper-for-weka.html"&gt;WekaSharp: An F# wrapper for Weka&lt;/a&gt; (Yin Zhu)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/52928c6e-f77f-4ebd-a2f9-9815111bfa33"&gt;F# and C# Win Phone List Template (Silverlight)&lt;/a&gt; (Daniel Mohl)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://fsai.codeplex.com/releases/view/51337&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1282930270:&amp;amp;cd=eti_CaoC4lg&amp;amp;usg=AFQjCNFE4CEYJxUJWQ3cDzIZJ6SMG8WhhQ"&gt;fsai Release &lt;b&gt;FSharp&lt;/b&gt; AI library 1.10.0&lt;/a&gt; (Lukáš Kouřil)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://feedproxy.google.com/~r/typepad/walmsleyk/through_the_interface/~3/UvCysIY6dYA/rockscroll-my-new-favourite-visual-studio-add-in.html"&gt;RockScroll: my new favourite Visual Studio Add-In&lt;/a&gt; (Kean Walmsley)&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Video, Audio and Slides&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.sturmnet.org/blog/2010/08/24/slides-and-samples-from-f-talk-in-manche"&gt;Slides and samples from F# talk in Manchester&lt;/a&gt; (Oliver Sturm)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.trelford.com/blog/post.aspx?id=aead0ae1-9be2-4a67-9b8b-8516ace8bd2e"&gt;F# Intro Talk at NextGenUG in So’ton&lt;/a&gt; (Phillip Trelford)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://strangelights.com/blog/archive/2010/08/15/slides-from.aspx"&gt;Slides from Combinators, DSLs, HTML, and F#&lt;/a&gt; (Robert Pickering)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.inetachamps.com/Live/Presentation/ViewVideo/119"&gt;Busy .NET Developer’s Guide to F#: Basics&lt;/a&gt; (Ted Neward)&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Technical Articles &lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://blog.ctaggart.com/2010/08/itunes-via-f-interactive.html"&gt;iTunes via F# Interactive&lt;/a&gt; (Cameron Taggart)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!2144.entry"&gt;F# for puzzles (Morse code decoder)&lt;/a&gt; (Brian McNamara)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://langexplr.blogspot.com/2010/08/extracting-elements-from-win32-resource.html"&gt;Extracting elements from Win32 resource files&lt;/a&gt; (Luis Diego Fallas)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://blogs.msdn.com/b/dsyme/archive/2010/08/16/a-variation-on-matt-moloney-s-undo-redo-quot-memento-quot-pattern.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281985290:&amp;amp;cd=3GxHEKpf1t0&amp;amp;usg=AFQjCNEKd2idQhny1fNIgHlmfdPez_kHFA"&gt;A variation on Matt Moloney's &amp;quot;Memento&amp;quot; pattern&lt;/a&gt;&lt;b&gt;&lt;/b&gt; (Don Syme)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/bound-variables-in-f-what-reflection.html"&gt;Bound Variables in F#: What Reflection Reveals&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.ademiller.com/blogs/tech/2010/08/getting-f-running-on-a-continuous-integration-server/"&gt;Getting F# Running on a Continuous Integration Server&lt;/a&gt; (Ade Miller)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://softwareobjects.net/technology/other/how-fs-async-really-works/&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282477894:&amp;amp;cd=k9CaH95wgpM&amp;amp;usg=AFQjCNE5hHs-c_JhaGAhddvysqJEh-kjRA"&gt;How F#'s async really works?&lt;/a&gt;&lt;b&gt;&lt;/b&gt; (George Cullen)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/segment-tree-in-f.html"&gt;Segment Tree in F#&lt;/a&gt;&lt;b&gt;&lt;/b&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/bound-variables-in-f-what-reflection.html"&gt;Bound Variables in F#: What Reflection Reveals&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/fuzzy-logic-experiments-in-f.html"&gt;Fuzzy Logic Experiments in F#&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/fuzzy-logic-in-f-example-1.html"&gt;Fuzzy Logic in F#, Example 1&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/fuzzy-logic-in-f-now-more-functional.html"&gt;Fuzzy Logic in F#, Now More Functional!&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;b&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://fadsworld.wordpress.com/2010/08/25/f-fun-with-windows-phone-7/&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282782072:&amp;amp;cd=XJ2ShkoVq68&amp;amp;usg=AFQjCNEVAt95lQVSqeKm0dXE8akP53iHFA"&gt;F# “fun” with Windows Phone 7&lt;/a&gt;&lt;/b&gt; (Fahad)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://www.ginktage.com/2010/08/getting-started-with-windows-phone-development-in-f/&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282782072:&amp;amp;cd=XJ2ShkoVq68&amp;amp;usg=AFQjCNFkiiIJ8A2z_FqyO80eFhZDFH3t6Q"&gt;Getting started with Windows Phone in F#&lt;/a&gt;&lt;b&gt;&lt;/b&gt; (Senthil Kumar)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://geekswithblogs.net/MarkPearl/archive/2010/08/10/f-ndash-euler-problem-10.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281458885:&amp;amp;cd=77K9bIUXzKc&amp;amp;usg=AFQjCNGYPsaDckXurAteHIDLK3HWbPTgsg"&gt;Euler Problem 10&lt;/a&gt; (Mark Pearl)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://geekswithblogs.net/MarkPearl/archive/2010/08/19/f-euler-problem-16.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282272232:&amp;amp;cd=iOkk_mPI5OU&amp;amp;usg=AFQjCNF2R_3U79eEDh20M9sCdzx8OTlFwQ"&gt;Euler Problem 16&lt;/a&gt; (Mark Pearl)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://stefanoricciardi.com/2010/08/25/project-euler-problem-9-in-f/&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282782072:&amp;amp;cd=XJ2ShkoVq68&amp;amp;usg=AFQjCNFTZJd0PBQ7zDbA5ChBQvwh4sHQaA"&gt;Project Euler Problem 9 in F#&lt;/a&gt; (Stefano Ricciardi)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://stefanoricciardi.com/2010/08/17/project-euler-problem-8-in-f/&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282093587:&amp;amp;cd=4z9k6saNi7w&amp;amp;usg=AFQjCNGx1unUptRzK4gbwfDu0QIHY2TlTQ"&gt;Project Euler Problem 8 in F#&lt;/a&gt; (Stefano Ricciardi)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://stefanoricciardi.com/2010/08/16/project-euler-problem-6-and-7-in-f/&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281985290:&amp;amp;cd=3GxHEKpf1t0&amp;amp;usg=AFQjCNGChfVG9VJJM1rEr-nmTW3PPpivxA"&gt;Project Euler Problem 6 and 7 in F#&lt;/a&gt; (Stefano Ricciardi)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://bugsquash.blogspot.com/2010/08/enumerableskip-vs-seqskip.html"&gt;Enumerable.Skip vs Seq.skip&lt;/a&gt; (Mauricio Scheffer)&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Getting Started and Evangelism Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.whattofix.com/blog/archives/2010/08/putting-the-fun.php"&gt;Putting the fun in functional programming&lt;/a&gt; (Daniel Markham)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://weblogs.asp.net/mehfuzh/archive/2010/08/13/back-to-school-getting-to-know-f.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281725004:&amp;amp;cd=nWaDOrnHOkg&amp;amp;usg=AFQjCNEt4SFUTNN2qHc898t8hQw9TMZaLg"&gt;Back to school : Getting to know F#&lt;/a&gt; (Mehfuz Hossain)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://blog.goblinfactory.co.uk/archive/2010/08/22/learning-f-by-writing-c.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282511650:&amp;amp;cd=rHNkQ7SbUSo&amp;amp;usg=AFQjCNF7jUd2cMmvStSryTOU7ARVIc_5dQ"&gt;Learning &lt;b&gt;F#&lt;/b&gt; by writing C#&lt;/a&gt; (Alan Hemmings)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://geekswithblogs.net/JoshReuben/archive/2010/08/25/f---sharper-than-c.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282782072:&amp;amp;cd=XJ2ShkoVq68&amp;amp;usg=AFQjCNFlk5Pxb8TN4YVtIJapTEywbtotBA"&gt;&lt;b&gt;F#&lt;/b&gt; - sharper than C#&lt;/a&gt; (Josh Reuben)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://www.dotnetconvo.com/post/view/2010/8/20/learning-f-for-c-developers&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1282587993:&amp;amp;cd=iP9qcob4U6w&amp;amp;usg=AFQjCNFDcRBEP_8LeeTOVfwtLMl0apMk3Q"&gt;Learning F# for C# developers&lt;/a&gt; (Bill Morrissey)&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;F# Community&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://arstechnica.com/civis/viewtopic.php%3Ff%3D20%26t%3D1120310&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1282806817:&amp;amp;cd=_I4tOE61sI8&amp;amp;usg=AFQjCNHpTr1EpLmR4n30m6hOCqbkAdSVjw"&gt;Ars Technica - What do you think of F# ?&lt;/a&gt; &lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://stackoverflow.com/questions/3484315/how-to-merge-sorted-sequences-in-f&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1281845656:&amp;amp;cd=flQlhVWmQLE&amp;amp;usg=AFQjCNEbMY53___uEv5A5iCUSMcI0TDRTA"&gt;SO - How to merge sorted sequences in F#.&lt;/a&gt; &lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://stackoverflow.com/questions/3544036/which-to-use-c-or-f-in-this-real-world-case&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1282544745:&amp;amp;cd=lj7VIHepRJM&amp;amp;usg=AFQjCNEdMuc-OKFR--h8n7QPnFZ8iQP5GA"&gt;SO - Which to use, C# or F#? In this &amp;quot;real world&amp;quot; case&lt;/a&gt; &lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://cs.hubfs.net/forums/thread/16387.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1282400235:&amp;amp;cd=9vIGwKe_esA&amp;amp;usg=AFQjCNG_8qM4_ZdJz-obcLL0IyBncv2hZg"&gt;hubFS: F# Databse Application Samples &amp;amp; Articles&lt;/a&gt; &lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://cs.hubfs.net/forums/thread/16425.aspx"&gt;hubFS: MailboxProcessor.TryScan paradigm&lt;/a&gt;&lt;/h3&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+08%2f27%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f27%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+08%2f27%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f27%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f27%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/27/f-discoveries-this-week-08-27-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20986" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/async/default.aspx">async</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/August+2010+CTP/default.aspx">August 2010 CTP</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/CI/default.aspx">CI</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Euler/default.aspx">Euler</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/FSAI/default.aspx">FSAI</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Fuzzy+Logic/default.aspx">Fuzzy Logic</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/iTunes/default.aspx">iTunes</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Memento/default.aspx">Memento</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/puzzles/default.aspx">puzzles</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/reflection/default.aspx">reflection</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/RockScroll/default.aspx">RockScroll</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Weka/default.aspx">Weka</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Win32+Resource/default.aspx">Win32 Resource</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/WP7/default.aspx">WP7</category></item><item><title>C# Porting Strategies</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx</link><pubDate>Wed, 25 Aug 2010 15:24:33 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20981</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This is going to be a quick guide for porting a C# codebase to different platforms.&lt;/p&gt;  &lt;p&gt;Wait, what?&lt;/p&gt;  &lt;p&gt;Isn’t C# portable on its own?&lt;/p&gt;  &lt;p&gt;No – there are two aspects to C# – the language itself and the target platform.&amp;#160; Even though .NET is ostensibly the target, the question is what flavor?&amp;#160; .NET running on a desktop machine or a server?&amp;#160; Windows Mobile?&amp;#160; Silverlight?&amp;#160; Mono?&lt;/p&gt;  &lt;p&gt;All of these are going to present some interesting issues on how to create a unified code base that is easy to maintain.&lt;/p&gt;  &lt;p&gt;Here’s a challenge: VisualStudo doesn’t support conditional assembly references.&amp;#160; Project files do, but the UI doesn’t this means that in order to work with different assembly references you need to have different projects for each target set of assemblies.&amp;#160; This can be confusing in that the same files will be a part of several different projects.&lt;/p&gt;  &lt;p&gt;To start, what you should do is create a project for each target platform and add the appropriate references.&amp;#160; Then you should create a set of conditional compilation symbols that represent your targets as well as symbols that represent certain features you want to expose (or not).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Strategy #1 – Use Preprocessor Symbols&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I don’t like doing this – it hurts readability, but it gets you going quickly.&amp;#160; If you find yourself doing something like this:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; HAS_SERIALIZABLE
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;[Serializable]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; HAS_FORMS
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Form GenerateForm()
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; AdaptedForm GenerateForm()
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   &lt;span style="color:#008000;"&gt;// ...&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;then you’re doing something wrong – you should make a goal to use the preprocessor symbols as little as possible – and when you do they should be around the largest unit of code that you can – hopefully an entire file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strategy #2 – Refactor Classes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can do this by putting as much platform-neutral functionality into a base class and then have each target platform define the actual concrete class for that platform:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; WidgetBase {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; WidgetBase() { }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; Weight { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; TARGET_SILVERLIGHT
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Widget : WidgetBase { }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; TARGET_DESKTOP
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;[Serializable]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Widget : WidgetBase, IDrawable {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Draw(Graphics g) { &lt;span style="color:#008000;"&gt;/*...*/&lt;/span&gt; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Strategy #3 – Partial Classes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Generally speaking, I don’t like partial classes.&amp;#160; I think that when I start dividing up my classes into partials, that the class is too big and needs to be refactored.&amp;#160; However, you can do some nice things in partial classes.&amp;#160; Partial classes merge all attributes from all classes as well as all interfaces, so we can revisit the sample in the first strategy and clean it up.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#008000;"&gt;// main file&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; partial &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; SomeUIElement
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   &lt;span style="color:#008000;"&gt;// ... implementation&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#008000;"&gt;// serializable file&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; HAS_SERIALIZATION
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Runtme.Serialization;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;[Serializable]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; partial &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; SomeUIElement
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;  &lt;span style="color:#008000;"&gt;// .... more implementation&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#008000;"&gt;// GDI file&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; HAS_GDI
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Drawing;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; partial &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; SomeUIElement
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(Graphics g) { &lt;span style="color:#008000;"&gt;/* ... */&lt;/span&gt; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(Bitmap bm) { &lt;span style="color:#008000;"&gt;/* ... */&lt;/span&gt; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Strategy #4 – Type Aliasing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is useful when you have a large establish code base and you are moving it to Silverlight where you discover that that you don’t have System.Drawing.Rectangle (at least not in the same form).&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; !SILVERLIGHT
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Drawing;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#&lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Windows;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; Rectangle = System.Windows.Rect;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;#endif
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;namespace&lt;/span&gt; MyNameSpace {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MyUIElement {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;      &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Rectangle CalculateBounds() { &lt;span style="color:#008000;"&gt;/* ... */&lt;/span&gt; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This now lets me use my existing Rectangle definitions as long as Rect is more or less compatible.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strategy #5 – Neutral Interfacing and Abstract Factories&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Abstract_factory_pattern"&gt;This is standard OOP practice&lt;/a&gt; – you define a neutral interface that defines how an object behaves and then use a factory to make the appropriate object.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx&amp;amp;;subject=C%23+Porting+Strategies" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx&amp;amp;;title=C%23+Porting+Strategies" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx&amp;amp;title=C%23+Porting+Strategies" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx&amp;amp;;title=C%23+Porting+Strategies" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx&amp;amp;;title=C%23+Porting+Strategies&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/25/c-porting-strategies.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20981" width="1" height="1"&gt;</description></item><item><title>F# Discoveries This Week 08/15/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx</link><pubDate>Mon, 16 Aug 2010 18:38:05 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20975</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p align="left"&gt;Tons of great links along with a brand new less cluttered format today.&amp;#160; Let me know what you think &lt;a href="http://twitter.com/rickasaurus"&gt;on twitter&lt;/a&gt;.&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News / Talks&lt;/h1&gt;  &lt;h3 align="left"&gt;&lt;a href="http://www.sfsharp.org/calendar/13860500/?from=list&amp;amp;eventId=13860500&amp;amp;action=detail&amp;amp;offset=0"&gt;Talbott Crowell at San Fancisco Bay Area F# Users Group (8/16)&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.communityforfsharp.net/august-2010-live-meeting"&gt;Don Syme at the Community for F# Online (8/17)&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://cufp.org/conference/sessions/2010/keynote-f-embracing-functional-programming-visual-"&gt;Luke Hoban will be giving a F# keynote at CUFP (10/2)&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://jaoo.dk/aarhus-2010/speaker/Joel+Pobar"&gt;Joel Pobar &amp;quot;Smart Software with F#&amp;quot; at JAOO (10/6)&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Podcasts / Screencasts / Videos&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://blogs.msdn.com/b/cdndevs/archive/2010/08/10/perspectives_2d00_on_2d00_clojure_2d00_and_2d00_f.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1281678291:&amp;amp;cd=EpH0wo1Ao6I&amp;amp;usg=AFQjCNFpXxdv6qi5-yznVTQ2RT-l3hBCRQ"&gt;Perspectives on Clojure and F# (with Rich Hickey and Joe Pamer)&lt;/a&gt;&lt;b&gt;&lt;/b&gt; (Joey deVilla)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/C9-Lectures-Dr-Ralf-Laemmel-Advanced-Functional-Programming-The-Expression-Problem/"&gt;Advanced Functional Programming - The Expression Problem&lt;/a&gt; (Dr. Ralf Lämmel)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://richardminerich.com/2010/08/the-language-matters-on-the-software-engineering-productivity-podcast/"&gt;The Language Matters on the Software Engineering Productivity Podcast&lt;/a&gt; (Rick Minerich)&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.mattssoftwareblog.com/?p=246"&gt;Undo / Redo using the Memento Pattern and Command Pattern in F#&lt;/a&gt; (Matt Moloney)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/08/16/a-variation-on-matt-moloney-s-undo-redo-quot-memento-quot-pattern.aspx"&gt;A variation on Matt Moloney's Undo/Redo &amp;quot;Memento&amp;quot; pattern&lt;/a&gt; (Don Syme)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://feedproxy.google.com/~r/FCode/~3/2Qjb2Xy4pQY/hindley-milner-type-inference-sample.html"&gt;Hindley Milner Type Inference Sample Implementation&lt;/a&gt; (Edmondo Pentangelo)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://feedproxy.google.com/~r/OccasionalNotes/~3/ykk3rXIf7nM/inotifypropertychanged-strikes-back.html"&gt;INotifyPropertyChanged strikes back&lt;/a&gt; (Vladimir Matveev)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://feedproxy.google.com/~r/OccasionalNotes/~3/-e9bUSYtS7A/websharper-part-2-webexcel.html"&gt;WebSharper, part 2: WebExcel&lt;/a&gt; (Vladimir Matveev)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/oop-virtualization-vs-f-discriminated.html"&gt;OOP Virtualization vs. F# Discriminated Unions&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/segment-tree-in-f.html"&gt;Segment Tree in &lt;b&gt;F#&lt;/b&gt;&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://feedproxy.google.com/~r/BloggemDano/~3/bGx2w8FgPwg/f-silverlight-template.html"&gt;A F# Silverlight Template&lt;/a&gt; (Daniel Mohl)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://fdatamining.blogspot.com/2010/08/reading-f-projects-part-i-common.html"&gt;Reading F# Projects, Part I: The Common Knowledge&lt;/a&gt; (Yin Zhu)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://fdatamining.blogspot.com/2010/08/reading-f-projects-part-ii-f-set.html"&gt;Reading F# Projects, Part II: F# Set&lt;/a&gt; (Yin Zhu)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://fdatamining.blogspot.com/2010/08/reading-f-projects-part-iii-f-math.html"&gt;Reading F# Projects, Part III: The F# math providers.&lt;/a&gt; (Yin Zhu)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blog.ctaggart.com/2010/08/query-zune-music-collection-with-f.html"&gt;Query Zune Music Collection with F#&lt;/a&gt; (Cameron Taggart)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://stackoverflow.com/questions/3484315/how-to-merge-sorted-sequences-in-f&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i1:lt:e0:p0:t1281845656:&amp;amp;cd=flQlhVWmQLE&amp;amp;usg=AFQjCNEbMY53___uEv5A5iCUSMcI0TDRTA"&gt;How to merge sorted sequences in F# - Stack Overflow&lt;/a&gt; (Neil Carrier)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://stackoverflow.com/questions/3459422/combine-memoization-and-tail-recursion"&gt;Combining memoization and tail-recursion – Stack Overflow&lt;/a&gt; (Ronald Wildenberg)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://flyingfrogblog.blogspot.com/2010/08/i-think-f-is-very-cool-rich-hickey.html"&gt;&amp;quot;I think F# is very cool&amp;quot; - Rich Hickey&lt;/a&gt; (Flying Frog Consultancy Ltd.)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://geekswithblogs.net/MarkPearl/archive/2010/08/10/f-ndash-euler-problem-10.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281458885:&amp;amp;cd=77K9bIUXzKc&amp;amp;usg=AFQjCNGYPsaDckXurAteHIDLK3HWbPTgsg"&gt;&lt;b&gt;F#&lt;/b&gt; – Euler Problem 10&lt;/a&gt; (Mark Pearl)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://bohdanszymanik.blogspot.com/2010/08/sequnfold.html"&gt;Seq.unfold&lt;/a&gt; (Bohdan Szymanik)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://weblogs.asp.net/mehfuzh/archive/2010/08/13/back-to-school-getting-to-know-f.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281725004:&amp;amp;cd=nWaDOrnHOkg&amp;amp;usg=AFQjCNEt4SFUTNN2qHc898t8hQw9TMZaLg"&gt;Back to school : Getting to know &lt;b&gt;F#&lt;/b&gt; - Mehfuz's WebLog&lt;/a&gt; (mehfuzh)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://strangelights.com/blog/archive/2010/08/15/slides-from.aspx"&gt;Slides from Combinators, DSLs, HTML, and F#&lt;/a&gt; (Robert Pickering)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.google.com/url?sa=X&amp;amp;q=http://www.atalasoft.com/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;ct=ga&amp;amp;cad=:s7:f1:v0:d2:i2:lt:e0:p0:t1281518982:&amp;amp;cd=Bisi4NtW5kk&amp;amp;usg=AFQjCNGbbS1TPm8BFpFpFfkXpmGyFG4VVg"&gt;Steve's Tech Talk : Using a Proxy Class to Fix &lt;b&gt;F#&lt;/b&gt; Protected Access &lt;b&gt;...&lt;/b&gt;&lt;/a&gt; (Steve Hawley)&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Tools&lt;a name="misc"&gt;&lt;/a&gt;&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/matt/archive/2010/08/08/fastsharp-2-0.aspx"&gt;FastSharp 2.0&lt;/a&gt; (Matt Manela)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/e2ed87b6-c717-4738-8e2c-5ef8c7830ef1"&gt;NDjango 0.9.8&lt;/a&gt; (Michael Feingold)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/9147de02-e031-40f8-a370-f69e7e20c11c"&gt;F# Project Extender 0.9.3&lt;/a&gt; (Michael Feingold)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/07/09/quantifa-f-open-source-project-for-quantitative-finance-and-risk-management.aspx"&gt;Quantifa: F# open-source project for quantitative finance and risk management&lt;/a&gt; (Don Syme)&lt;/h3&gt;  &lt;h3&gt;&lt;strong&gt;&lt;a href="http://github.com/jaredpar/VsVim"&gt;VsVim&lt;/a&gt; (Jared Parsons)&lt;/strong&gt;&lt;/h3&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+08%2f15%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f15%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+08%2f15%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f15%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f15%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/16/f-discoveries-this-week-08-15-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20975" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/clojure/default.aspx">clojure</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/cufp/default.aspx">cufp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/data+structures/default.aspx">data structures</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Expression+Problem/default.aspx">Expression Problem</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Memento/default.aspx">Memento</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/NDjango/default.aspx">NDjango</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/news/default.aspx">news</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/rich+hickey/default.aspx">rich hickey</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/seq/default.aspx">seq</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Vim/default.aspx">Vim</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/WebSharper/default.aspx">WebSharper</category></item><item><title>Solving the Expression Problem with OOP</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx</link><pubDate>Thu, 12 Aug 2010 14:03:48 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20969</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Yesterday I watched a presentation by Dr. Ralf Lämmel about The Expression Problem.&amp;#160; The problem is, in a nutshell, how do you build an extensible data model and an extensible operation model that meets three goals:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Code-level modularization &lt;/li&gt;    &lt;li&gt;Separate compilation &lt;/li&gt;    &lt;li&gt;Static type safety &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In watching his presentation, I was perturbed by his dismissal of OO approaches to solve this problem.&amp;#160; To my eyes he used strawman arguments by presenting several techniques which don’t work.&amp;#160; The reason that I found this upsetting is that I have worked on many large systems that were built in C that had all of these things.&amp;#160; One of the benefits of working at Adobe in the 1990’s was that I got to work on and look at four different modular extensibility models: PhotoShop, Acrobat, Premiere, and Illustrator.&amp;#160; Each of these presented fairly complicated data models and allowed the addition of extensions that manipulated existing objects, extended them, presented new objects, and new functionality.&amp;#160; All of this was done in a way that was type-safe and had to have modularization and separate compilation.&amp;#160; And while the extension model in PhotoShop was fairly primitive, the Premiere extension model was such that the actual application for Premiere was nothing more than a host for plug-ins and a small amount of code to facilitate communication with an abstract operating system layer.&amp;#160; The first time I saw that, my jaw dropped that the actual application was nearly nothing.&lt;/p&gt;  &lt;p&gt;So how is this accomplished?&amp;#160; In the expression problem, you can do this by making a clear separation between your data and your operations.&amp;#160; In fact, it’s a fairly good model to think of the work needed as an orthogonal grid:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;&amp;#160;&lt;/td&gt;        &lt;td&gt;&lt;strong&gt;Operations&lt;/strong&gt;&lt;/td&gt;        &lt;td&gt;&amp;#160;&lt;/td&gt;        &lt;td&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;&lt;strong&gt;Data&lt;/strong&gt;&amp;#160;&lt;/td&gt;        &lt;td&gt;Eval&lt;/td&gt;        &lt;td&gt;PrettyPrint&lt;/td&gt;        &lt;td&gt;Compile&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Add&lt;/td&gt;        &lt;td&gt;EvalAdd&lt;/td&gt;        &lt;td&gt;PPAdd&lt;/td&gt;        &lt;td&gt;CompileAdd&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Sub&lt;/td&gt;        &lt;td&gt;EvalSub&lt;/td&gt;        &lt;td&gt;PPSub&lt;/td&gt;        &lt;td&gt;CompileSub&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Mul&lt;/td&gt;        &lt;td&gt;EvalMul&lt;/td&gt;        &lt;td&gt;PPMul&lt;/td&gt;        &lt;td&gt;SompileMul&lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;  &lt;p&gt;You see that if I add a new data type, I need to add a set of operations as well.&amp;#160; Similarly, if I add a new operation, I need to define that operation of each existing data type.&lt;/p&gt;  &lt;p&gt;The overall operational model is one that I like to think of as Everlasting Gobstopper (or jaw breaker, if you prefer).&amp;#160; Here is what a jawbreaker looks like when you cut it open:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/Jawbreaker1_5227E6CD.jpg"&gt;&lt;img style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" title="Jawbreaker[1]" border="0" alt="Jawbreaker[1]" src="http://www.atalasoft.com/cs/blogs/stevehawley/Jawbreaker1_thumb_716A8DA0.jpg" width="404" height="390" /&gt;&lt;/a&gt; It’s a set of shells layered on top of each other.&amp;#160; This is the model that we’ll work with (it’s actually a little weirder than this), in that any given delivery of code is considered to be a solidified API and extensions that build on this work with ONE particular shipment in order to add to it.&amp;#160; Each new shipment is a new set of extensions that build a new delicious layer on the existing code.&amp;#160; To do otherwise is to create a very hard to support system – it can be done, but there will be runtime checks for inconsistency and contingency plans to handle them.&lt;/p&gt;  &lt;p&gt;How can we make this work?&amp;#160; Let’s start with a base Expr class:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Expr { }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;and then let’s create a repository for them:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; ExprRepository {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; ExprRepository() { Expressions = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; List&amp;lt;ExprPackage&amp;gt;(); } 
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; List&amp;lt;ExprPackage&amp;gt; Expressions { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;I haven’t defined ExprPackage.&amp;#160; It probably will be little more than an Expr type but it could be a factory method as well.&amp;#160; Now I’m going to define an interface and a class to represent operations:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;interface&lt;/span&gt; IVerbPackage { }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Verb {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Verb() { Implementations = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; VerbRespository(); }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Name { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; VerbRepository Implementations { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Type ReturnType { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;So the question is, what is a VerbRepository?&amp;#160; A VerbRespository is a collection of objects that contain a Type object for the class EType where EType inherits from Expr and a MethodInfo for a method that has the following signature, where RType is the return type.&amp;#160; I’m not going to define that – I’ll hand wave it away.&amp;#160; It could be a Dictionary mapping EType to an object that contains the MethodInfo – that would be fine.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; RType SomeMethod(Dispatcher d, Verb v, ETtype e);&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;So now we have some holes to fill in.&amp;#160; I just introduced a Dispatcher object.&amp;#160; What does that do?&amp;#160; Simply, it executes a particular verb for a particular expression type:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Dispatcher {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; Dispatch(Verb v, Expr e) {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        MethodInfo mi = v.Implemtations.GetMethod(e.Type);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (mi == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) { &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ArgumentException(&amp;quot;&lt;span style="color:#8b0000;"&gt;Incomplete implementation for Verb &lt;/span&gt;&amp;quot; + v.Name;); }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; target = v.Implementations.GetInstance(e.Type);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] args = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] { &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;, v, e };
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#008000;"&gt;// in actuality, this needs to be in a try/catch&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; returnVal = mi.Invoke(target, args);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; returnVal;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;So now I have code that based on the type of e looks up the appropriate method implementation for the given verb and executes it.&lt;/p&gt;

&lt;p&gt;So how do create verbs?&amp;#160; Like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; PrettyPrintImpl : IVerbPackage {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    [Verb(&amp;quot;&lt;span style="color:#8b0000;"&gt;PrettyPrint&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public string&lt;/span&gt; Add(Dispatcher d, Verb v, ExprAdd e)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; lhs = d.Dispatch(v, e.Left) &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; rhs = d.Dispatch(v, e.Right) &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; lhs + &amp;quot;&lt;span style="color:#8b0000;"&gt; + &lt;/span&gt;&amp;quot; + rhs;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    }    
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;The hosting application looks at all available assemblies and pulls any classes that implement IVerbPackage, then it extracts MethodInfo objects that are decorated with VerbAttribute and uses the string to label the verb (there are other ways to do this).&amp;#160; Now my implentation is type strong.&amp;#160; The only thing I don’t like is the cast – it’s cruft.&amp;#160; By defining the first method that implements a verb named PrettyPrint, I’m defining how all verbs should act.&amp;#160; I should instead define Dispatch like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; T Dispatch&amp;lt;T&amp;gt;(Verb v, Expr e) {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    MethodInfo mi = v.Implementations.GetMethod(e.Type);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (mi == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) { &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ArgumentException(&amp;quot;&lt;span style="color:#8b0000;"&gt;...&lt;/span&gt;&amp;quot;); }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; target = v.Implementations.GetInstance(e.Type);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] args = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt;[] { &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;, v, e };
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; returnVal = mi.Invoke(target, args);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; (T)returnVal;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This lets me rewrite PrettyPrint like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;[Verb(&amp;quot;&lt;span style="color:#8b0000;"&gt;PrettyPrint&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Add(Dispatcher d, Verb b, ExprAdd e)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; lhs = d.Dispatch&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;(v, e.Left);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; rhc = d.Dispatch&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;(v, e,Right);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; lhs + &amp;quot;&lt;span style="color:#8b0000;"&gt; + &lt;/span&gt;&amp;quot; + rhs;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;I’ve moved the cast to a more appropriate place and now I’m honoring the contract.&amp;#160; I will get a runtime error if I use the wrong flavor of Dispatch – sorry, that’s a practical limitation.&lt;/p&gt;

&lt;p&gt;So what happens when the world starts?&lt;/p&gt;

&lt;p&gt;Some code scans a directory for assemblies and finds all assemblies that have classes that inherit from Expr and classes that implement IVerbPackage.&amp;#160; The system attempts to build the orthogonal collection of Verbs for the given Expr.&amp;#160; When this is complete, the system can now start executing verbs on the data.&amp;#160; What do you do on non-orthogonal Verbs?&amp;#160; There are a number of choices.&amp;#160; The most obvious ones are nothing or throw – I can’t say I like either of these.&amp;#160; Another option might be to allow a method to define default behavior – another method maybe decorated as [VerbDefault(“name”)] and to use this, if it exists, for the verb, otherwise disqualify the Verb.&lt;/p&gt;

&lt;p&gt;There are three bad things about this implementation.&amp;#160; The first is that I could easily forget to implement a given Verb for a given Expr.&amp;#160; This is avoidable – imagine that Dispatcher contained in it a method called DefineVerb(Type t, string name, ProgrammingLanguage lang), which when executed generates an entire verb set for a given Expr type t.&amp;#160; This is effectively using the extension system to write your next extension.&amp;#160; Awesome.&lt;/p&gt;

&lt;p&gt;The second bad thing is two developers who are in parallel writing new extensions – one writes a new verb, the other writes a new Expr.&amp;#160; Both extensions can’t co-exist because they didn’t know about each other when they were written.&amp;#160; This is effectively applying two new layers onto the gobstopper simultaneously.&amp;#160; Reject one – or either could fix the incomplete implementation.&amp;#160; Having default verb implementations goes a long way to help this problem.&amp;#160; I understand that this is an ongoing problem with people who create complicated Ruby Gems.&lt;/p&gt;

&lt;p&gt;The final problem is human error on calling Dispatch.&amp;#160; What if I dispatch on the wrong type?&amp;#160; Fail.&amp;#160; Can’t the compiler catch this?&amp;#160; The better way, I think is to try to code to avoid the problem.&amp;#160; One way is to instead of providing a dispatcher, provide a delegate that does the dispatching and is thus fixed on return type.&amp;#160; The code that scans for verbs would only accept methods of this form:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; ReturnType Method(Dispatcher d, Func&amp;lt;Dispatcher, Verb, Expr, ReturnType&amp;gt; del, Expr e);&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;And in this, I eliminate the Dispatch method in Dispatcher as I’m passing it in to the function.&amp;#160; Now my prettyprint looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;[Verb(&amp;quot;&lt;span style="color:#8b0000;"&gt;PrettyPrint&lt;/span&gt;&amp;quot;)]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Add(Dispatcher d, Func&amp;lt;Dispatcher, Verb, Expr, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; del, Verb v, AddExpr e)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; lhs = del(d, v, e.Left);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; rhs = del(d, v, e,Right);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; lhs + &amp;quot;&lt;span style="color:#8b0000;"&gt; + &lt;/span&gt;&amp;quot; + rhs;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;And tada, I have compiler/runtime enforced type safety.&amp;#160; Now, where does that Func&amp;lt;&amp;gt; come from?&amp;#160; I write it on the fly. That’s not exactly beginner code, but it’s straight forward to do.&lt;/p&gt;

&lt;p&gt;I would like to point out now that for a production system, this extensibility model not sufficient.&amp;#160; Generally speaking the best models operate in terms of published APIs.&amp;#160; Clients of an API request from a host an API by name (or type) and by version.&amp;#160; This allows APIs to exist with legacy versions as well as revisions.&amp;#160; This gives you non-breaking legacy support for (nearly) free.&amp;#160; Also, any good extension model should have the facility to load/unload extensions on the fly.&amp;#160; This requires an event model to allow clients to deal with their APIs going away.&amp;#160; Finally there is a missing tier in the Expression Problem – there is the sense of data and operation, but missing is the notion of &lt;em&gt;meaning&lt;/em&gt;.&amp;#160; For example, Add(Expr1, Expr2) is perfectly valid as long as Expr1 and Expr2 are numeric, but what if Expr1 is and array?&amp;#160; A function declaration?&amp;#160; A sequence expression?&amp;#160; An argument list?&amp;#160; There is nothing to handle this well in the model.&amp;#160; Nor is there a coherent generic factory model for constructing expressions.&amp;#160; Hopefully that would be addressed too.&lt;/p&gt;

&lt;p&gt;Extensibility is not a new concept in software engineering.&amp;#160; By looking at the tools that are available in modern OOP systems, it is possible to create a solution to the Expression Problem that is compact, type-safe, and readable – all elements of practical engineering.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx&amp;amp;;subject=Solving+the+Expression+Problem+with+OOP" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx&amp;amp;;title=Solving+the+Expression+Problem+with+OOP" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx&amp;amp;title=Solving+the+Expression+Problem+with+OOP" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx&amp;amp;;title=Solving+the+Expression+Problem+with+OOP" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx&amp;amp;;title=Solving+the+Expression+Problem+with+OOP&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20969" width="1" height="1"&gt;</description></item><item><title>Using a Proxy Class to Fix F# Protected Access Limitation</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx</link><pubDate>Tue, 10 Aug 2010 15:11:41 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20964</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;In &lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;this previous entry&lt;/a&gt;, I presented a workaround to F# not having support for protected members.&amp;#160; Upon thinking on it further, I decided that this could nearly be fixed with an adapter class.&amp;#160; The adapter class would be implemented in C# and would override all protected members and call optional/non-optional delegates to perform the actual work.&lt;/p&gt;  &lt;p&gt;If you wanted to implement an ImageCommand from dotImage in F#, you would start with a C# class like this:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Drawing;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; Atalasoft.Imaging;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; Atalasoft.Imaging.ImageProcessing;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Runtime.Serialization;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;namespace&lt;/span&gt; DelegatedImageCommander
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;delegate&lt;/span&gt; AtalaImage PerformActualCommandDelegate(AtalaImage source, AtalaImage dest, Rectangle area, &lt;span style="color:#0000ff;"&gt;ref&lt;/span&gt; ImageResults results);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;abstract&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; DelegatedImageCommand : ImageCommand
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        Func&amp;lt;AtalaImage, AtalaImage&amp;gt; _constructChangedSourceImage, _constructFinalImage;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        Func&amp;lt;ImageResults&amp;gt; _constructImageResults;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        Func&amp;lt;AtalaImage, PixelFormat, AtalaImage&amp;gt; _getChangedPixelFormat;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        PerformActualCommandDelegate _performActualCommand;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        Func&amp;lt;AtalaImage, PixelFormat, PixelFormat[], PixelFormat&amp;gt; _selectBestAlternatePixelFormat, _selectPreferredPixelFormat;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        Action&amp;lt;AtalaImage&amp;gt; _verifyProperties;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; DelegatedImageCommand(PerformActualCommandDelegate performActualCommand,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Action&amp;lt;AtalaImage&amp;gt; verifyProperties,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Func&amp;lt;AtalaImage, AtalaImage&amp;gt; constructChangedSourceImage,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Func&amp;lt;AtalaImage, AtalaImage&amp;gt; constructFinalImage,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Func&amp;lt;ImageResults&amp;gt; constructImageResults,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Func&amp;lt;AtalaImage, PixelFormat, AtalaImage&amp;gt; getChangedPixelFormat,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Func&amp;lt;AtalaImage, PixelFormat, PixelFormat[], PixelFormat&amp;gt; selectBestAlternatePixelFormat,
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            Func&amp;lt;AtalaImage, PixelFormat, PixelFormat[], PixelFormat&amp;gt; selectPreferredPixelFormat)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (performActualCommand == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ArgumentNullException(&amp;quot;&lt;span style="color:#8b0000;"&gt;performActualCommand&lt;/span&gt;&amp;quot;);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _performActualCommand = performActualCommand;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _verifyProperties = verifyProperties;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _constructChangedSourceImage = constructChangedSourceImage;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _constructFinalImage = constructFinalImage;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _constructImageResults = constructImageResults;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _getChangedPixelFormat = getChangedPixelFormat;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _selectBestAlternatePixelFormat = selectBestAlternatePixelFormat;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            _selectPreferredPixelFormat = selectPreferredPixelFormat;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; DelegatedImageCommand(PerformActualCommandDelegate performActualCommand, Action&amp;lt;AtalaImage&amp;gt; verifyProperties)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            : &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;(performActualCommand, verifyProperties, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; AtalaImage ConstructChangedSourceImage(AtalaImage image)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_constructChangedSourceImage != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _constructChangedSourceImage(image);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.ConstructChangedSourceImage(image);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; AtalaImage ConstructFinalImage(AtalaImage image)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_constructFinalImage != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _constructFinalImage(image);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.ConstructFinalImage(image);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; ImageResults ConstructImageResults()
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_constructImageResults != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _constructImageResults();
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.ConstructImageResults();
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; AtalaImage GetChangedPixelFormat(AtalaImage sourceImage, PixelFormat newFormat)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_getChangedPixelFormat != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _getChangedPixelFormat(sourceImage, newFormat);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.GetChangedPixelFormat(sourceImage, newFormat);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; AtalaImage PerformActualCommand(AtalaImage source, AtalaImage dest, Rectangle imageArea, &lt;span style="color:#0000ff;"&gt;ref&lt;/span&gt; ImageResults results)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _performActualCommand(source, dest, imageArea, &lt;span style="color:#0000ff;"&gt;ref&lt;/span&gt; results);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; PixelFormat SelectBestAlternatePixelFormat(AtalaImage sourceImage, PixelFormat sourceFormat, PixelFormat[] formats)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_selectBestAlternatePixelFormat != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _selectBestAlternatePixelFormat(sourceImage, sourceFormat, formats);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.SelectBestAlternatePixelFormat(sourceImage, sourceFormat, formats);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; PixelFormat SelectPreferredPixelFormat(AtalaImage sourceImage, PixelFormat sourceFormat, PixelFormat[] formats)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_selectPreferredPixelFormat != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _selectPreferredPixelFormat(sourceImage, sourceFormat, formats);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.SelectPreferredPixelFormat(sourceImage, sourceFormat, formats);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; VerifyProperties(AtalaImage image)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_verifyProperties != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                _verifyProperties(image);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Then in F#, instead of inheriting from ImageCommand, you would inherit from DelegatedImageCommand and provide a set of delegates to perform the actual work.&amp;#160; In ImageCommand, you can get away with default behavior for everything except PerformActualCommand and you’re good to go.&amp;#160; I provided two constructors: one with all the delegates and one with the most common case.&amp;#160; Now an F# class that inherits from DelegatedImageCommand will present the correct interface to the world.&amp;#160; Almost.&lt;/p&gt;

&lt;p&gt;I say almost because ImageCommand is serializable, and as such you are &lt;em&gt;&lt;strong&gt;supposed&lt;/strong&gt;&lt;/em&gt; to create a constructor that is protected which takes a SerializationInfo object and a StreamingContext object.&amp;#160; F# doesn’t let you make protected constructors, so this approach won’t work properly.&amp;#160; It turns out that the protected constructor can be public – it is only suggested that it is protected.&lt;/p&gt;

&lt;p&gt;However, if you want to do this properly, you would need to define a shell class in C# that has the correct public interface and data/property model and then do the actual work in F#.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;;subject=Using+a+Proxy+Class+to+Fix+F%23+Protected+Access+Limitation" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;;title=Using+a+Proxy+Class+to+Fix+F%23+Protected+Access+Limitation" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;title=Using+a+Proxy+Class+to+Fix+F%23+Protected+Access+Limitation" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;;title=Using+a+Proxy+Class+to+Fix+F%23+Protected+Access+Limitation" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx&amp;amp;;title=Using+a+Proxy+Class+to+Fix+F%23+Protected+Access+Limitation&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/10/using-a-proxy-class-to-fix-f-protected-access-limitation.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20964" width="1" height="1"&gt;</description></item><item><title>F# Discoveries This Week 08/08/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx</link><pubDate>Sun, 08 Aug 2010 18:57:45 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20961</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;So many links, all well worth your time.&amp;#160; I know one thing I won’t be missing is Don Syme’s online talk at C4FSharp on 8/17.&amp;#160; It’s great to be part of a language community in which the founder interacts in such a direct way.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/fsharp-component-design-guidelines.pdf"&gt;Draft F# Component Design Guidelines now Available (pdf)&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.communityforfsharp.net/august-2010-live-meeting"&gt;Don Syme will be speaking online for the Community for F# on 8/17&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.nyalt.net/calendar/14226459/?eventId=14226459"&gt;I’ll be speaking at the NYC ALT.NET User Group on 8/25&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.slideshare.net/wkhazzard/what-the-math-geeks-dont-want-you-to-know-about-fsharp-4917609"&gt;Kevin Hazzard’s Slides from DevConnections are up&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://cufp.org/conference/sessions/2010/eden-fwpf-framework-building-gui-tools"&gt;Howard Mansell will present Eden: (An F#/WPF framework for building GUI tools) at CUFP&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://langref.org/fsharp+clojure+scala+haskell"&gt;F# is now at 93% on langref, only 1% behind scala. (Great Going!)&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.pexforfun.com/"&gt;PexForFun.com now has puzzles for F#&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsxplat.codeplex.com/releases/view/49967"&gt;FSharp Cross Platform Packages and Samples 1.1 Released&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Audio/Video&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://skillsmatter.com/podcast/agile-testing/jon-harrop-qr-decomposition"&gt;Jon Harrop at the London F-Sharp User Group: QR Decomposition&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This lecture takes the audience from a tiny numerically-robust implementation of a common linear algebra algorithm through several stages of optimization, culminating in a high-performance solution that easily outperforms Intel’s Math Kernel Library. The algorithm studied is QR decomposition, which is commonly used for linear least squares best fit.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;F# Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.intellifactory.com/blogs/adam.granicz/2010/8/5/Expert-F!sharp!-2.0---what%27s-new"&gt;Adam Granicz’s Expert F# 2.0 – what’s new?&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;There comes a time when you just have to stop working for a minute and take a few moments to enjoy the fruits of your hard labor. For me, one of these moments lately came when I received the author copies of our book, Expert F# 2.0&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://bloggemdano.blogspot.com/2010/08/f-templates-now-on-visual-studio.html"&gt;Daniel Mohl’s F# Templates Now On Visual Studio Gallery&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;As Don Syme mentioned in a recent blog post, I've been working to get the five F# templates that have been announced on this blog up on Visual Studio Gallery.&amp;#160; I'm happy to say that all are now available.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bloggingabout.net/blogs/vagif/archive/2010/08/04/mock-framework-challenges-in-f.aspx"&gt;Vagif Abilov’s Mock framework challenges in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;So far I only tried very basic mocking described in the first post of Richard’s series: faking return value. As I expected, even such a simple operation became a challenge when executed from F# code. I managed to make tests work only for two and half frameworks.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bugsquash.blogspot.com/2010/08/figment-web-dsl-for-f.html"&gt;Mauricio Scheffer’s Figment: a web DSL for F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;As I said, this is very much work in progress, and there's still a lot to do. I intend to make it fully open source when I finish writing my thesis.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/08/segment-tree-in-f.html"&gt;Neil Carrier’s Segment Tree in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Suffice to say that a segment tree stores a group of intervals on an ordered set, in such a way that all the intervals containing a given value can be efficiently located. Such a query is sometimes called a “stabbing query,” because it’s like sticking a spear through the data and seeing which entries get stabbed.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/lazy-f-sequence-evaluation-gotchas.html"&gt;Neil Carrier’s F# Sequence Lazy Evaluation Gotchas&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Today’s post will be old news to experienced F# programmers. Actually, it’s old news to me, relative newcomer that I am. However, it’s one of those things I tend to forget until it jumps up to bite me, as it did today.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://weblogs.asp.net/esanchez/archive/2010/08/06/f-the-acm-and-the-sec.aspx"&gt;Edgar Sanchez’s F#, the ACM, and the SEC&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;And it is this last recommendation on DSLs that carries interesting news for F# because at the end of page 6 it states “Experience seems to show that higher-order programming languages such as F# provide a particularly good basis for domain-specific languages.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://flyingfrogblog.blogspot.com/2010/08/pure-f-now-only-2-slower-than-ocaml.html"&gt;Jon Harrop’s Pure F# now only 2× slower than OCaml&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This is a surprising and encouraging result not only because it makes F# competitive for an even wider variety of tasks but because it also implies that Microsoft are taking F# so seriously that they are optimizing the .NET garbage collector for it!&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;Steve Hawley’s Protect Yourself&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;One solution is to label things that need to be protected, disassemble the output, run a regular expression to search/replace the accessibility and reassemble. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://cashforlifetv.com/blog/index.php/2010/08/03/f-and-net-needed-at-credit-suisse-is-there-a-future-for-this-and-microsoft-in-the-quant-world/"&gt;F# and .NET needed at Credit Suisse? Is there a future for this and Microsoft in the quant world?&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;As I said, when you compare to these other languages in the world of quant, F# appears to be taking an early lead.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://stefanoricciardi.com/2010/08/05/project-euler-problem-4-in-f/"&gt;Stefano Ricciardi’s Project Euler Problem 4 in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The actual algorithm uses brute force to test for palindromicity (neologism?) all the numbers that can be composed multiplying together 3 digits numbers (those from 100 to 999), picking the highest one.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Miscellaneous&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://lambda-the-ultimate.org/node/4024"&gt;Lambda the Ultimate’s OSCON 2010 Emerging Languages Camp Roundup&lt;/a&gt;&lt;/h3&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+08%2f08%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f08%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+08%2f08%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f08%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+08%2f08%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/08/08/f-discoveries-this-week-08-08-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20961" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/data+structures/default.aspx">data structures</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/don+syme/default.aspx">don syme</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/ecm/default.aspx">ecm</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/lazy+evaluation/default.aspx">lazy evaluation</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Mock/default.aspx">Mock</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/pex/default.aspx">pex</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/puzzles/default.aspx">puzzles</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/qr+decomposition/default.aspx">qr decomposition</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/WebSharper/default.aspx">WebSharper</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/wpf/default.aspx">wpf</category></item><item><title>Inception Movie Review from a Data Security Perspective</title><link>http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx</link><pubDate>Fri, 06 Aug 2010 12:48:08 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20953</guid><dc:creator>loufranco</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This is part of my ongoing series of extremely limited perspective movie reviews:&lt;/p&gt;  &lt;p&gt;Previous Reviews:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/loufranco/archive/2009/05/11/star-trek-review-from-an-ecm-perspective.aspx"&gt;&lt;em&gt;Star Trek&lt;/em&gt; from an ECM Perspective&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;&lt;em&gt;Twilight: Eclipse&lt;/em&gt; from a Social Media Perspective&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Like the previous ones – SPOILER ALERT. Inception is the kind of movie where you might not want to know anything going in. So, please don’t read further if you don’t want any part of the plot spoiled.&lt;/p&gt;  &lt;p&gt;In &lt;em&gt;Inception&lt;/em&gt; there’s an elite team that can infiltrate your subconscious while you’re dreaming and extract secret information while your defenses are down. The plot of the movie is set up when someone asks them if they can do an “inception” where they plant an idea into a victim’s subconscious. Since the idea is detrimental to the victim, they must somehow convince him that it is his, and that it will be good for him to follow through with it.&lt;/p&gt;  &lt;p&gt;Obviously, extraction directly relates to data security, and the attacks and defenses that are discussed in the movie have analogous ones in the security world. An obvious one is a &lt;a href="http://en.wikipedia.org/wiki/Honeypot_%28computing%29"&gt;honeypot&lt;/a&gt; and how it relates to the labyrinths that the dream architects construct.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;[Honeypots] computers run special software, designed to appear to an intruder as being important and worth looking into. In reality, these programs are dummies, and their patterns are constructed specifically to foster interest in attackers.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Creating a honeypot is like “taking two minutes to create a maze that takes a minute to solve”.&lt;/p&gt;  &lt;p&gt;Things like a “militarized subconscious”, “totems”, “forgers”, “chemists”, and “projections” have counterparts in the network security world.&lt;/p&gt;  &lt;p&gt;But, what about “inception”? After thinking about it for a few minutes, I remembered this &lt;a href="http://www.npr.org/templates/story/story.php?storyId=127742365"&gt;story from WWII&lt;/a&gt;. In 1943, the Allies wanted to convince the Germans that they would attack through Sardinia, not Sicily, so:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“The idea, very simply, was to get a dead body, equip the dead body with false papers, and then drop it somewhere the Germans would find it,”&lt;/p&gt;    &lt;p&gt;[…] And it was an elaborate creation: the fictitious Major Martin was equipped with ticket stubs, keys, a religious medal, letters from an imaginary father and fiancee, and unpaid bills. Cholmondeley and Montagu thought that the more convincing his personal story was, the more likely the Germans would be to believe the ruse. And along with the personal items, he carried carefully faked letters hinting that the Allies were planning to invade Greece and Sardinia, not Sicily.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But, this is not a computer attack. While the idea of data tampering is nothing new—I haven’t heard of a tampering attack with the intent to mislead someone into making a bad decision. Data tampering is often used to gain access for another purpose or to cover up tracks (e.g. log tampering).&lt;/p&gt;  &lt;p&gt;But, I suspect that this is a real threat as well. One so good, that it&amp;#160; often goes undetected.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx&amp;amp;;subject=Inception+Movie+Review+from+a+Data+Security+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx&amp;amp;;title=Inception+Movie+Review+from+a+Data+Security+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx&amp;amp;title=Inception+Movie+Review+from+a+Data+Security+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx&amp;amp;;title=Inception+Movie+Review+from+a+Data+Security+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx&amp;amp;;title=Inception+Movie+Review+from+a+Data+Security+Perspective&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/08/06/inception-movie-review-from-a-data-security-perspective.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20953" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/document+management/default.aspx">document management</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/ecm/default.aspx">ecm</category></item><item><title>Protect Yourself</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx</link><pubDate>Tue, 03 Aug 2010 19:08:52 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20944</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;I’ve been looking at F# to assess how well it plays with the .NET ecosystem and I’ve found a number of blemishes.&amp;#160; Most recently, I found that F# has no equivalent to the C# protected access on members/classes.&amp;#160; Why should we care about protected?&lt;/p&gt;  &lt;p&gt;One of my favorite patterns as an author of an API is &lt;a href="http://www.exciton.cs.rice.edu/javaresources/designpatterns/TemplatePattern.htm"&gt;template pattern&lt;/a&gt;.&amp;#160; In this pattern, a base class, typically abstract, defines the way that a process should happen but doesn’t define certain steps.&amp;#160; These steps are left as an exercise to concrete implementations.&amp;#160; The steps, like the steps in sausage making, are meant to stay out of the public eye.&lt;/p&gt;  &lt;p&gt;At one point, I refactored the dotImage class ImageCommand to use that pattern.&amp;#160; There are six steps in a typical image command, some optional/default, some not.&amp;#160; Rather than make every command implement every single step on its own, I made a template that handles all this for you in the Apply() method (side note, Apply() is virtual, so if you don’t like it you can replace it).&amp;#160; Most of the templated methods are protected since they need to be visible to subclasses, but shouldn’t be public.&amp;#160; Many, but not all, have reasonable default implementations that handle 80% of all cases.&lt;/p&gt;  &lt;p&gt;The problem is that if I implement an image command in F# all this protected methods magically become public.&amp;#160; This is contrary to the &lt;a href="http://msdn.microsoft.com/en-us/library/dd233188.aspx"&gt;language reference&lt;/a&gt;, which says:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The access specifier protected is not used in F#, although it is acceptable if you are using types authored in languages that do support protected access. Therefore, if you override a protected method, your method remains accessible only within the class and its descendents.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have verified that &lt;strong&gt;this is false&lt;/strong&gt; – override a protected member and it magically becomes public.&lt;/p&gt;  &lt;p&gt;There is hope in the future – the language reserves the keyword ‘protected’ so I think someone has the intent of putting it in.&amp;#160; Meantime, I’m left holding the bag.&amp;#160; What to do?&lt;/p&gt;  &lt;p&gt;One solution is to label things that need to be protected, disassemble the output, run a regular expression to search/replace the accessibility and reassemble.&amp;#160; This is straight forward, but fragile.&amp;#160; I’d use this only for a last-ditch solution.&lt;/p&gt;  &lt;p&gt;I’d prefer to use an assembly editor of some kind.&amp;#160; I initially looked at &lt;a href="http://ccimetadata.codeplex.com/"&gt;CCI&lt;/a&gt; and wrote a simple module visitor to do what I wanted, but my first test broke CCI – it’s just not ready yet.&amp;#160; Instead, I tried out &lt;a href="http://mono-project.com/Cecil"&gt;Cecil&lt;/a&gt;, part of the Mono project and found it worked fine.&amp;#160; Here is my solution.&lt;/p&gt;  &lt;p&gt;First, define a custom attribute for your code base that can be used to label protected members (at present, I have it configured to only be used on methods and constructors – I don’t have much used for protected fields, but I could see protected properties):&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;open System
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;[&amp;lt;AttributeUsage(AttributeTargets.Method ||| AttributeTargets.Constructor, AllowMultiple=&lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;, Inherited=&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)&amp;gt;]
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;type AtalaProtectedAttribute() =
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    inherit System.Attribute()
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Next, create a small C# console application that uses Cecil to apply the change.&amp;#160; Most of the app is error checking, so I’ll just paste in the meat (note: in the CLI, protected is called “family”):&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    ModuleDefinition module = ModuleDefinition.ReadModule(sourceFile);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;foreach&lt;/span&gt; (TypeDefinition type &lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; module.Types)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;foreach&lt;/span&gt; (MethodDefinition method &lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; type.Methods) 
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; attrIndex = attributeIndex(method.CustomAttributes);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (attrIndex &amp;lt; 0)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span style="color:#0000ff;"&gt;continue&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            method.CustomAttributes.RemoveAt(attrIndex);
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (method.IsPublic)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                method.IsPublic = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (method.IsPrivate)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                method.IsPrivate = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            method.IsFamily = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#008000;"&gt;// and later&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; attributeIndex(Collection&amp;lt;CustomAttribute&amp;gt; coll)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;{
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (coll == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; -1;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; coll.Count; i++)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        CustomAttribute attr = coll[i];
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (attr.AttributeType.Name == &amp;quot;&lt;span style="color:#8b0000;"&gt;AtalaProtectedAttribute&lt;/span&gt;&amp;quot;)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; i;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; -1;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;}
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Finally, a call to module.Write() produces an assembly with protected access.&lt;/p&gt;

&lt;p&gt;All that remains is the human error of neglecting to put in the [&amp;lt;AtalaProtected&amp;gt;] attribute.&amp;#160; This is easily remedied with a unit test that reflects on all assemblies, finds classes that inherit and override protected members and have mismatched protection.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx&amp;amp;;subject=Protect+Yourself" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx&amp;amp;;title=Protect+Yourself" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx&amp;amp;title=Protect+Yourself" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx&amp;amp;;title=Protect+Yourself" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx&amp;amp;;title=Protect+Yourself&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/08/03/protect-yourself.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20944" width="1" height="1"&gt;</description></item><item><title>F# Discoveries This Week 07/30/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx</link><pubDate>Fri, 30 Jul 2010 19:03:57 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20927</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;It’s Friday and once again I’ve gathered up more F# content for your viewing pleasure.&amp;#160; If you happen find yourself in the Boston area this next Monday come meet me for our &lt;a href="http://www.fsug.org/"&gt;New England F# User Group meeting&lt;/a&gt;.&amp;#160; We are always happy to have new people interested in checking out functional programming.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/lisa/archive/2010/07/25/vs-2010-keyboard-shortcuts-for-c-vb-c-f-now-available-in-letter-8-5x11in-and-a4-210-215-297mm-print-ready-sizes.aspx"&gt;VS2010 Keyboard Shortcuts Now Available in Letter and A4 Size&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://langref.org/fsharp+clojure+scala+haskell"&gt;F# samples are 74% complete on langref.org&lt;/a&gt; (nudge nudge)&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/07/24/contract-position-f-interactive-in-silverlight.aspx"&gt;Two Contract Positions: F# Interactive in Silverlight&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://fsug.org/"&gt;Scott Theleman will be speaking at New England FSUG on 8/2&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Audio / Video&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://tv.devexpress.com/#XPOFSharp.movie"&gt;eXpress Persistant Objects and the F# Language&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/07/29/some-f-project-templates-available-online.aspx"&gt;Don Syme’s Some F# Project Templates Available Online&lt;/a&gt; and &lt;a href="http://bloggemdano.blogspot.com/2010/07/f-silverlight-mvvm-multi-project.html"&gt;Daniel Mohl’s An F# Silverlight MVVM Mutli-Project Template&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;If you have your own templates or projects-that-could-be-turned-into-templates, here are the steps to make and publish a template to the Visual Studio Gallery, making it really easy to access by the whole community.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://benhutchison.wordpress.com/2009/06/02/study-functional-programming-or-be-ignorant/"&gt;Ben Hutchison’s Study Functional Programming or Be Ignorant&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Right now, if you want to understand the state of the art in computer programming, those are your choices as I see them.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bohdanszymanik.blogspot.com/2010/07/heatimage-mapping-with-netf.html"&gt;Bohdan Szymanik’s Heat/Image Mapping with .NET/F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Most of the effort was spent aggregating and binning the data, the actual image prep was trivial. The following assumes you have an array of data to display.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/cartesian"&gt;Neil Carrier’s Cartesian Product of Lists in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;So without further ado (other than to note that all the code here is presented &amp;quot;as-is&amp;quot; and without warranty or implied fitness of any kind; use at your own risk) here is my Cartesian product of lists code.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/jaredpar/archive/2010/07/27/converting-system-func-lt-t1-tn-gt-to-fsharpfunc-lt-t-"&gt;Jared Parsons’ Converting System.Func&amp;lt;T1..TN&amp;gt; to FSharpFunc&amp;lt;T,TResult&amp;gt;&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Interop of delegate style types between F# and other .Net languages is a pain point that results from a fundamental difference in how delegates are represented in the F# language. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;Steve Hawley’s Limit Your Memoization, Please&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;So the lesson in this (and in many CS problems) is that you need to really understand the specific domain of your problem before applying a sweeping technique like memoization.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blog.ctaggart.com/2010/07/exploring-gac-with-f-and-monocecil.html"&gt;Cameron Taggart’s Exploring the GAC with F# and Mono.Cecil&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Mono.Cecil can be used to look inside assemblies. May be you want to search GAC to find types that implement a certain interface. In this post, I’ll show how to find all the types that implement IDisposable as an example.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blog.ctaggart.com/2010/07/find-authenticode-signed-assemblies.html"&gt;Cameron Taggart’s Find Authenticode Signed Assemblies&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Mono.Security can be used to check for the presence of an Authenticode signature on a assembly.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://community.devexpress.com/blogs/garyshort/archive/2010/07/26/xpo-f-lists-and-seqs-oh-my.aspx"&gt;Gary Short’s XPO – F# Lists and Seqs Oh My!&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Let’s assume we have a small database of people and we wish to calculate the combined age. The functional method of doing that would be to “fold” the elements of a collection of People over a function that accumulates the age of each person, in an accumulator value, which is threaded through the fold.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://geekswithblogs.net/MarkPearl/archive/2010/07/27/f-euler-problem-9.aspx"&gt;Mark Pearl’s F# Euler Problem 9&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;After some more thinking, I decided to use tuples instead and generate the permutations using the Seq.unfold method.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://tabbles.net/blog/2010/07/29/fsharp-tutorial-how-fsharp-adapts-to-how-we-think-part1/"&gt;Maurizio Colucci’s How F# adapts to the way we think – part1&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This is the first episode of a series meant to show how easily F# adapts to the way we think. I assume no knowledge of functional languages, but I do assume knowledge of an imperative language such as C#.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.codeproject.com/KB/recipes/FSharpasyncronous.aspx"&gt;Wiston Gubantes’ F# Asynchronous Programming&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Async programming in functional languages such as F# is such a breeze.... &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Community&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://stackoverflow.com/questions/3233473/immutable-data-structures-performance"&gt;Stack Overflow: Immutable data structures performance&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://stackoverflow.com/questions/3350644/functional-reactive-f-storing-states-in-games"&gt;Stack Overflow: Functional Reactive F# - Storing States in Games&lt;/a&gt;&lt;/h3&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+07%2f30%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f30%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+07%2f30%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f30%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f30%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/30/f-discoveries-this-week-07-30-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20927" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/asynchronous/default.aspx">asynchronous</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/authenticode/default.aspx">authenticode</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Euler/default.aspx">Euler</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsug/default.aspx">fsug</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/internals/default.aspx">internals</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/memoization/default.aspx">memoization</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/modeling/default.aspx">modeling</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/mono/default.aspx">mono</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/templates/default.aspx">templates</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/VS2010/default.aspx">VS2010</category></item><item><title>Limit Your Memoization, Please</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx</link><pubDate>Mon, 26 Jul 2010 20:18:00 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20915</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>2</slash:comments><description>
&lt;p&gt;Memoization is a great pattern.&amp;nbsp; We’ve known about it for years outside of functional programming.&amp;nbsp; It is essentially a combination of a cache and a function pointer.&amp;nbsp; For some input, x, you look up x in the cache and if it’s there, you return the found value.&amp;nbsp; If not, you call the function on x, cache the result then return it.&amp;nbsp; This is especially exciting when you look at F# where working with functions as data is natural.&lt;/p&gt;
  
&lt;p&gt;Referring to &lt;a href="http://blogs.msdn.com/b/dsyme/archive/2007/05/31/a-sample-of-the-memoization-pattern-in-f.aspx"&gt;Don Syme&lt;/a&gt;’s and &lt;a href="http://codebetter.com/blogs/matthew.podwysocki/archive/2009/06/18/revisiting-memoization.aspx"&gt;Matthew Podwysocki&lt;/a&gt;’s blogs, you can find some canonical examples of memoization.&amp;nbsp; Each of these, and the version in &lt;a href="http://blogs.msdn.com/b/chrsmith/"&gt;Chris Smith&lt;/a&gt;’s &lt;a href="http://oreilly.com/catalog/9780596153656"&gt;Programming F#&lt;/a&gt; book are based on Dictionary objects and end up looking like this:&lt;/p&gt;
  
&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let memoize (f: 'a -&amp;gt; 'b)=&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let cache = &lt;span&gt;new&lt;/span&gt; Dictionary&amp;lt;_, _&amp;gt;()&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        fun x -&amp;gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            let ok, res = cache.TryGetValue(x)&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;if&lt;/span&gt; ok then res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;else&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                let res = f x&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                cache.[x] &amp;lt;- res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;which is OK as far as demonstrating how memoization works for a CS 200 level class or &lt;i&gt;&lt;b&gt;demonstrating&lt;/b&gt;&lt;/i&gt; the power of using memoization on expensive functions.&amp;nbsp; It is, however, a solidly poor choice when dealing with real world problems.&lt;/p&gt;

&lt;p&gt;Therefore, I’m going to present a real-world problem that lends itself to memoization and is not something you would ever, ever want to ship to clients using the above pattern.&lt;/p&gt;

&lt;p&gt;Since we’re in image processing, we care a lot about how our algorithms perform.&amp;nbsp; Image processing is a funny domain because things that you might dismiss as cheap blow up when then need to be performing hundreds of millions of times – especially things that involve memory.&lt;/p&gt;

&lt;p&gt;Consider this problem – I have a 24 bit continuous color image that I would like represented as an 8 bit paletted image, with a specific palette applied.&amp;nbsp; To do this, I need a function that given a color gives me the best matching entry in that palette.&lt;/p&gt;

&lt;p&gt;Working with Color objects can be a bit of a bummer and having to do abstract Palette look ups will also slow us down, so we’ll build an array of tuples that matches a palette:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let inline tupledColor (c:Color) = ((&lt;span&gt;int&lt;/span&gt; c.B), (&lt;span&gt;int&lt;/span&gt; c.G), (&lt;span&gt;int&lt;/span&gt; c.R))&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;   &lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let paletteToTupleArray (sourcePalette:Palette) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let limit = sourcePalette.Colors-1&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let result:(&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;)[] = Array.zeroCreate sourcePalette.Colors&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span&gt;for&lt;/span&gt; i &lt;span&gt;in&lt;/span&gt; 0..limit &lt;span&gt;do&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            result.[i] &amp;lt;- sourcePalette.GetEntry(i) |&amp;gt; tupledColor&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        result&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;I’m also promoting the byte values of the colors to ints since in .NET bytes and ints are internally 4 bytes *anyway* and the math with be less bogged down.&lt;/p&gt;

&lt;p&gt;For matching two colors, we need the distance between them.&amp;nbsp; For this problem, using Euclidean distance is good enough, but we’ll use the square of the distance to avoid square roots:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let inline delta a b = a - b&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let inline colorDistanceSquared (b1, g1, r1) (b2, g2, r2) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let db = delta b1 b2&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let dg = delta g1 g2&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let dr = delta r1 r2&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        db * db + dg * dg + dr * dr&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;and in this, you can see one of the reasons I like F# – inline functions.&amp;nbsp; I can write my delta function and use it without the cost of a runtime function call and it makes the color distance function (itself inline) easier to read.&lt;/p&gt;

&lt;p&gt;Now we have a function to look up the color.&amp;nbsp; This is a tail-recursive helper function that returns the closest match.&amp;nbsp; bestDist and bestIndex are accumulators of the best results so far, i is our current index, color is the color we’re searching for and colors is our palette.&amp;nbsp; Note that I could eliminate the limit parameter and use colors.Length, but I’d rather use a local than a member.&amp;nbsp; There’s probably a clever way to do with with fold or find, but I think this is good enough:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let rec findBestColorLookup bestDist bestIndex i limit (color:&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;) (colors:(&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;)[]) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span&gt;if&lt;/span&gt; i &amp;gt;= limit then bestIndex&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        &lt;span&gt;else&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            let dist = colorDistanceSquared color colors.[i]&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;if&lt;/span&gt; dist = 0 then i&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            elif dist &amp;lt; bestDist then findBestColorLookup dist i (i + 1) limit color colors&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;else&lt;/span&gt; findBestColorLookup bestDist bestIndex (i+1) limit color colors&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Then our final findBestColor looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let findBestColor (b, g, r) (colors:(&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;)[]) = findBestColorLookup worstDistance 0 0 colors.Length (b, g, r) colors&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Now I can define a type to act as a color matcher for a given palette:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    type colorMatcher (sourcePalette:Palette) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let colors = paletteToTupleArray sourcePalette &lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        member &lt;span&gt;this&lt;/span&gt;.matchColor (b, g, r) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            findBestColor (b, g, r) colors&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;which is nice, but will run like a dog, running the palette array.&amp;nbsp; This is a perfect time to use memoizing to make it faster.&amp;nbsp; Here’s the problem – in a 24 bit image, you will have a possible 2&lt;sup&gt;24&lt;/sup&gt; colors to match.&amp;nbsp; Even a moderate subset of that will be heinously expensive in a memoized version of this function.&amp;nbsp; The expense comes from the cost of expanding the underlying hashtable every time you overload it.&amp;nbsp; So let’s extend the memoization pattern to include a clamp to keep this from going berserk:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let clampedMemoize (f: 'a -&amp;gt; 'b) limit =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let cache = &lt;span&gt;new&lt;/span&gt; Dictionary&amp;lt;_, _&amp;gt;()&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        fun x -&amp;gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            let ok, res = cache.TryGetValue(x)&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;if&lt;/span&gt; ok then res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;else&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                let res = f x&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span&gt;if&lt;/span&gt; cache.Count &amp;lt; limit then cache.[x] &amp;lt;- res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;which now will ignore the cache when you start crossing the limit.&amp;nbsp; This lets us keep memory use from getting out of control.&amp;nbsp; Now I can rewrite my color matcher with memoization:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    type colorMatcher (sourcePalette:Palette) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let colors = paletteToTupleArray sourcePalette &lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let memoFind = clampedMemoize (fun (b, g, r) -&amp;gt; findBestColor (b, g, r) colors) paletteCacheLimit&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        member &lt;span&gt;this&lt;/span&gt;.matchColor (b, g, r) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            memoFind (b, g, r)&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Now if I do some refactoring to allow partial function application I can neaten up the code a bit:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let findBestColor (colors:(&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;*&lt;span&gt;int&lt;/span&gt;)[]) (b, g, r) = findBestColorLookup worstDistance 0 0 colors.Length (b, g, r) colors&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    type colorMatcher (sourcePalette:Palette) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let colors = paletteToTupleArray sourcePalette &lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let memoFind = clampedMemoize (findBestColor colors) paletteCacheLimit&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        member &lt;span&gt;this&lt;/span&gt;.matchColor (b, g, r) =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            memoFind (b, g, r)&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;one thing is left to investigate – we’re hashing a tuple.&amp;nbsp; We don’t have to.&amp;nbsp; We could rebind those bits into a single int and use that as a key in our dictionary.&amp;nbsp; This is a way of saying, “hey, I know more about this problem domain than you do, so let me do the hashing.&amp;nbsp; Here’s a clamped memoizer with an outboard hash:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    let clampedMemoizeWithHasher (f: 'a -&amp;gt; 'b) (h: 'a -&amp;gt; &lt;span&gt;int&lt;/span&gt;) limit =&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        let cache = &lt;span&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span&gt;int&lt;/span&gt;, _&amp;gt;()&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;        fun x -&amp;gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            let hash = h x&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            let ok, res = cache.TryGetValue(hash)&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;if&lt;/span&gt; ok then res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;            &lt;span&gt;else&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                let res = f x&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                &lt;span&gt;if&lt;/span&gt; cache.Count &amp;lt; limit then cache.[hash] &amp;lt;- res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;                res&lt;br&gt;&lt;/pre&gt;
&lt;pre style="margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;At this point as well, this type of solution might benefit from having the hashed color put into a balanced binary tree instead of hashing.&lt;/p&gt;

&lt;p&gt;So the lesson in this (and in many CS problems) is that you need to really understand the specific domain of your problem before applying a sweeping technique like memoization.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx&amp;amp;;subject=Limit+Your+Memoization%2c+Please" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx&amp;amp;;title=Limit+Your+Memoization%2c+Please" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx&amp;amp;title=Limit+Your+Memoization%2c+Please" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx&amp;amp;;title=Limit+Your+Memoization%2c+Please" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx&amp;amp;;title=Limit+Your+Memoization%2c+Please&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/26/limit-your-memoization-please.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20915" width="1" height="1"&gt;</description></item><item><title>F# Discoveries This Week 07/23/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx</link><pubDate>Fri, 23 Jul 2010 19:54:12 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20912</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;One of my favorite things about the F# community is that its members tend to build things that are a bit more interesting, and think about concepts that are a bit deeper.&amp;#160; This week is no exception.&amp;#160; Come on in and see what’s been happening in the F# world.&lt;/p&gt;  &lt;p&gt;A quick note to those giving F# talks or running events: If you would like listed here please don’t hesitate to contact me via the email link at the top of the page.&amp;#160; I’d love to help you help others to learn F#.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Events&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://bloggemdano.blogspot.com/2010/07/nashville-geek-lunch-1130-am-next.html"&gt;Nashville Geek Lunch 11:30 AM Next Tuesday (7/27/2010)&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://tomasp.net/blog/event-object-duality.aspx"&gt;Tomas Petricek’s The Duality of Object and Event references&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;In this article, I'll talk about an interesting example of duality that (to my best knowledge) wasn't described by anyone before. The two dual structures are references between objects in a normal program and references between events in a reactive application.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://mariusbancila.ro/blog/2010/07/18/resources-for-the-f-presentation-at-ronua-roadshow/"&gt;Marius Bancila’s Resources for the F# Presentation at Ronua Roadshow&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The program that I shown exhibits traits of both functional (for computing the fractal) and object oriented (for displaying the fractal) paradigms.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/two-instruction-virtual-computer.html"&gt;Neil Carrier’s A Two-Instruction Virtual RISC&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;One of my favorite hobbies is building really tiny virtual computers. The experience has even paid off a time or two when I needed to create a compact domain-specific language (DSL).&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/this-post-is-about-pair-of-f-operators.html"&gt;Neil Carrier’s F#'s Little-Known (?) and (?&amp;lt;-) Operators&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;These two operators work similar to the C/C++ “stringizing” pre-processor operator. That is, they convert non-string code (limited to simple identifiers in the case of F#) into strings according to the following translation patterns:&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://lepensemoi.free.fr/index.php/2010/07/17/arbitraging-bookmakers-with-f"&gt;Julien Ortin’s Arbitraging bookmakers with F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The principle is rather simple.&amp;#160; Take the best quotes for each outcome, and process.&amp;#160; If the sum of 1/quote_i is less than one, an arbitrage opportunity exists.&amp;#160; The amount to bet on each outcome is 100/quote. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://v2matveev.blogspot.com/2010/07/tricky-late-binding-operators.html"&gt;Vladimir Matveev’s Tricky late binding operators&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;F# Dynamic and DynamicAssignment operators are not as simple as they appear ex facte. Most popular sample of their usage is something like this:&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://v2matveev.blogspot.com/2010/06/playing-with-websharper.html"&gt;Vladimir Matveev’s Playing with WebSharper&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;As a sample we’ll make simple StickyNotes application. Web design is not my primary and favorite skill, so I'll omit cross-browser compatibility and bind all styles to Firefox.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://naveensrinivasan.com/2010/07/16/using-f-to-automate-reading%E2%80%93the-morning-brew/"&gt;Naveen Srinivasan’s Using F# to Automate Reading–The Morning Brew&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I like to try and automate most of the stuff . So I thought why not write a script that reads the Morning Brew feed, filter the excluded content that I am not interested in and open the urls before I come in.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://stevegilham.blogspot.com/2010/07/building-partcover-4-on-vista.html"&gt;Steve Gilham’s Building PartCover 4 on Vista&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Following on from earlier in the week, I pulled the current trunk from SourceForge, and set about building it then putting it to work on some F# code which had caused&lt;/em&gt; an earlier version (the most recent available at the end of last year) to balk.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.codeproject.com/KB/net-languages/FS_Recursion_on_Reader.aspx"&gt;Gert-Jan van der Kamp’s Using a DataReader like a list in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This article demonstrates a technique how you can write recursive algorithms in F# using a Reader instead of a list, so you don't have to load all your data into memory first.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://saladwithsteve.com/2010/07/building-fsharp-on-the-mac.html"&gt;Steve Jenson’s Building F# on Mac OS X&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Joe says his team at Microsoft runs into these issues often with users and was kind enough to walk me through the steps to get F# running on the mac.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+07%2f23%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f23%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+07%2f23%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f23%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f23%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/23/f-discoveries-this-week-07-23-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20912" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/_3F00_/default.aspx">?</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/_3F003C00_-/default.aspx">?&lt;-</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/automation/default.aspx">automation</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Duality/default.aspx">Duality</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/late+binding/default.aspx">late binding</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/RISC/default.aspx">RISC</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/WebSharper/default.aspx">WebSharper</category></item><item><title>The Good Old Days Weren’t That Good</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx</link><pubDate>Tue, 20 Jul 2010 14:54:22 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20906</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;The Computer History Museum has published &lt;a href="http://www.computerhistory.org/highlights/macpaint/"&gt;the source code to MacPaint and Quickdraw&lt;/a&gt;.&amp;#160; This is pretty cool – I spent a lot of time hacking the Mac around that time, so it was interesting to me to see how this code was put together.&amp;#160; I haven’t gone through all of it yet, but for grins, I pulled up the assembly source to MacPaint and started looking through the various routines.&amp;#160; Here’s one I found:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;---------------------------------------------------------------------
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;  PROCEDURE MyGetItem(menu: menuHandle; item: INTEGER; VAR itemString: Str63)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;  *** just type-coerce VAR Str255 to Str63 ***
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;;
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;         JMP      GetItem&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;To understand this, you need to understand Pascal strings.&amp;#160; Pascal was the API language for the Macintosh, which presented a number of benefits and a number of problems.&amp;#160; Brian Kernighan wrote a pretty good &lt;a href="http://www.cs.virginia.edu/~evans/cs655-S00/readings/bwk-on-pascal.html"&gt;paper about the deficits of Pascal&lt;/a&gt; in 1981 covering the language pretty well.&amp;#160; One of those problems centered around strings, which only halfway existed as a usable type in Pascal.&amp;#160; I say halfway usable because there wasn’t really a string type in Pascal, even though you could type them in.&lt;/p&gt;

&lt;p&gt;Most implementations of Pascal had some way to get strings into a packed array of char or some other type.&amp;#160; On the Mac, they gave you a few types to work with: Str255, a 256 bytes array with the first byte being a length byte.&amp;#160; Str63, a 64 byte array and a couple others.&lt;/p&gt;

&lt;p&gt;Variables of type Str255 are wasteful – especially for menus.&amp;#160; Most menu items (“Save”, “Quit”, “Cut”) are far shorter than 255 characters, but when you declare a Str255, you are saying that you have the full 256 bytes to work with.&amp;#160; Since GetItem is declared as taking a Str255, you can’t pass it anything else.&amp;#160; Bill Atkinson, decided to do a hard cast by writing assembly language glue to pass allow a Str63 to get passed in instead.&amp;#160; While this will work most of the time and probably all the time in the first revision of MacOS, if a menu item exists with more than 63 characters in it, this will fail.&amp;#160; And it will fail by silently overwriting either the stack or the heap.&amp;#160; Both cases are bad.&lt;/p&gt;

&lt;p&gt;The cause of this problem is several fold:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Bill’s version of Pascal probably didn’t allow casting (which would’ve been unsafe anyway)&lt;/li&gt;

  &lt;li&gt;Pascal strings are awful – certainly worse than C, which are pretty bad&lt;/li&gt;

  &lt;li&gt;The Mac team didn’t insist on a reasonable string extension to Pascal to allow variable length strings (one version of Pascal I used allowed the declaration TYPE Str255 = VARYING[255] OF CHAR&lt;/li&gt;

  &lt;li&gt;Memory resources were tight on MacPaint to require shorter strings&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As a side note, in 1988 I wrote a version of MacPaint in C called StevePaint for SunOS.&amp;#160; It handled 256 color images instead of black and white, better text handling, and image convolution (blur, etc).&amp;#160; That code took me a semester with a full course load.&amp;#160; It helped that the Suns I had access to were 68020 based machines running at a much better clip than the original Mac and that the UI was more or less designed for me.&amp;#160; Still, never needing to drop into assembly language was a big win.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx&amp;amp;;subject=The+Good+Old+Days+Weren%e2%80%99t+That+Good" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx&amp;amp;;title=The+Good+Old+Days+Weren%e2%80%99t+That+Good" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx&amp;amp;title=The+Good+Old+Days+Weren%e2%80%99t+That+Good" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx&amp;amp;;title=The+Good+Old+Days+Weren%e2%80%99t+That+Good" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx&amp;amp;;title=The+Good+Old+Days+Weren%e2%80%99t+That+Good&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/20/the-good-old-days-weren-t-that-good.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20906" width="1" height="1"&gt;</description></item><item><title>F# Discoveries This Week 07/16/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx</link><pubDate>Fri, 16 Jul 2010 15:49:19 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20903</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;As promised, a fresh batch of links to sooth your aching desire for more F#.&amp;#160; I’m particularly excited to announce I’ll give giving a F# tutorial this year at the &lt;a href="http://cufp.org/"&gt;Commercial Users of Functional Programming&lt;/a&gt; conference.&amp;#160; CUFP is going to have a lot of great content this year and will be well worth attending for anyone interested in functional programming. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News &lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.navision-blog.de/2010/07/14/fake-f-make-1-40-5-0-released-bugfixes-for-cruisecontrol-net/"&gt;FAKE – F# Make 1.40.5.0 Released&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/dsyme/archive/2010/07/15/f-jobs-at-credit-suisse-london.aspx"&gt;F# Jobs at Credit Suisse, London&lt;/a&gt;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://cufp.org/f-20-day-beach-rick-minerich"&gt;I’ll be giving a F# tutorial at CUFP&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Video&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://vimeo.com/13215304"&gt;Steffen Forkmann speaks on F# Open Source Tools at the New England F# User Group&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Presented at the &lt;a href="http://fsug.org"&gt;New England F# User Group&lt;/a&gt; on June 7, 2010, Steffen discusses FAKE and NaturalSpec. Steffen is the author of the two open source F# projects &amp;quot;FAKE - F# Make&amp;quot; and &amp;quot;NaturalSpec&amp;quot;.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.russiantequila.com/wordpress/?p=149"&gt;Alex Pedenko’s Introducing Furious – A proof-of-concept RRM for F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Meet furious. Furious is a RRM - a Record Relation Mapping system. It is a database-independent object query dsl for records, that currently has a (barebones) mysql implementation. Here's how it works. Suppose you have a record graph like so…&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.codeproject.com/KB/net-languages/ExploringAmazonwithFsharp.aspx"&gt;Vagif Abilov’s Exploring Amazon S3 with F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The purpose of this article is to show how fast you can dig into low level details of an unknown technology using F#, and how little code you need to write. Therefore I keep the text of the article short, focusing just on the required steps.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fdatamining.blogspot.com/2010/07/f-async-workflow-application-flickr.html"&gt;Yin Zhu’s F# Async workflow application: a Flickr crawler&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;My strategy is to use the search query to search images with some specific tags and from the result page(as shown below), the url of each image is extracted, from which the image and its tags are then crawled. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.whattofix.com/blog/archives/2010/07/f-versus-micros.php"&gt;Daniel Markham’s F# Versus Microsoft's Regex. A Lesson in Types&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I was doing some text processing. As part of that, I set up a few RegExes. As I continued coding, I realized that I was following a pattern: apply the regex, check the match count, and if there were a bunch of matches, either get the first or last item.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsharpnews.blogspot.com/2010/07/f-vs-mathematica-even-faster-pricer-for.html"&gt;Jon Harrop’s F# vs Mathematica: an even faster pricer for American options&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This new optimized and parallelized F# solution is now a whopping 960× faster than the original Mathematica code from Sal Mangano's Mathematica Cookbook.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/pure-oop-personal-retrospective.html"&gt;Neil Carrier’s Pure OOP – A Personal Retrospective&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Almost instantly, my thoughts about the problem undergo a phase change, and I re-write my earlier code to be more succinct, maintainable, and composable, and usually more computationally efficient.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/integer-square-roots.html"&gt;Neil Carrier’s Integer Square Roots&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This is an old algorithm, once popular in assembly language programs on small processors. The fact that it uses only integers, addition, subtraction, and less-than branching, mean that its hardware and software requirements are at rock bottom.&lt;/em&gt;&lt;/p&gt;   &lt;em&gt;&lt;/em&gt;    &lt;p&gt;&lt;/p&gt;   &lt;em&gt;&lt;/em&gt;&lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://lepensemoi.free.fr/index.php/2010/07/13/f-event-module-extension"&gt;Julien Ortin’s F# Event module extension&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Functions to extend the F# Event module.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://lepensemoi.free.fr/index.php/2010/07/09/socket-helpers-in-f"&gt;Julien Ortin’s Socket helpers in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This post describes a module to perform common socket operations using asynchronous operations and reactive programming.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://lepensemoi.free.fr/index.php/2010/07/07/european-central-bank-extracting-reference-rates-with-f"&gt;Julien Ortin’s European Central Bank – extracting reference rates with F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Every day, the European Central Bank publishes “official” reference FX (foreign exchange) rates where currencies are quoted against the Euro (expressed as EUR/XXX), or 1 EUR = xxx XXX.&amp;#160; The exchange rates of the last thirty sessions are available in xml format which we shall try to parse.&amp;#160; In order to do so, we use F# and active patterns, based on Don Syme’s draft paper.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Petr Lepilov’s F# interactive, AppFabric cache and PowerShell &lt;a href="http://sharpamqp.net/blog/post/F-interactive-AppFabric-cache-and-PowerShell-%28Part-1%29.aspx"&gt;Part 1&lt;/a&gt; and &lt;a href="http://sharpamqp.net/blog/post/F-interactive-AppFabric-cache-and-PowerShell-%28Part-2%29.aspx"&gt;Part 2&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Applications can store any serializable CLR object without worrying about where the object gets stored. Scalability can be achieved by simply adding more computers on demand. The cache also allows for copies of data to be stored across the cluster, thus protecting data against failures. It runs as a service accessed over the network.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://stevegilham.blogspot.com/2010/07/dotcover-10-beta-first-impressions.html"&gt;Steve Gilham’s dotcover 1.0 beta – first impressions&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Not having R# at home -- because I rarely use C# even if I'm writing for .net -- it's this which interested me more. So, I gave it a try on my current F# project&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fortysix-and-two.blogspot.com/2010/07/f-and-code-contracts-not-quite-there.html"&gt;Kurt Schelfthout’s F# and Code Contracts: not quite there yet&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;In this post I’ll show how you can get Code Contracts sort of working for F#. From my very initial explorations, I would conclude that they seem basically usable for F# programming – but you’ll need some glue and tape, and not everything works as you’d expect.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Edmon Begoli’s Scala vs. F#, Application Programming Features &lt;a href="http://www.developer.com/lang/other/article.php/3883051/Scala-vs-F-Comparing-Functional-Programming-Features"&gt;Round 1&lt;/a&gt; and &lt;a href="http://www.developer.com/net/article.php/10916_3890906_1/Scala-vs-F-Round-2-Application-Programming-Features.htm"&gt;Round 2&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;F# and Scala, two relatively recent programming languages, provide most .NET and Java software developers with new functional programming features that are worth understanding and evaluating.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;Ivan Towlson’s F# pattern matching for beginners, &lt;a href="http://hestia.typepad.com/flatlander/2010/07/f-pattern-matching-for-beginners-part-1-getting-started.html"&gt;Part 1&lt;/a&gt;, &lt;a href="http://hestia.typepad.com/flatlander/2010/07/f-pattern-matching-for-beginners-part-2-decomposition.html"&gt;Part 2&lt;/a&gt; and &lt;a href="http://hestia.typepad.com/flatlander/2010/07/f-pattern-matching-for-beginners-part-3-guards.html"&gt;Part 3&lt;/a&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Pattern matching provides a concise but clear and highly expressive way of writing conditional logic, because it combines the conditional flow with the ability to extract values of interest&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+07%2f16%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f16%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+07%2f16%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f16%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+07%2f16%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/16/f-discoveries-this-week-07-16-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20903" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/algorithms/default.aspx">algorithms</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/contracts/default.aspx">contracts</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/cufp/default.aspx">cufp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/events/default.aspx">events</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fake/default.aspx">fake</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Flickr/default.aspx">Flickr</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/furious/default.aspx">furious</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Mathematica/default.aspx">Mathematica</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/options/default.aspx">options</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Regex/default.aspx">Regex</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/S3/default.aspx">S3</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/sockets/default.aspx">sockets</category></item><item><title>Google’s Social Circles give it Acquisition Options</title><link>http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx</link><pubDate>Thu, 15 Jul 2010 12:58:31 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20899</guid><dc:creator>loufranco</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A couple of days ago, &lt;a href="http://www.atalasoft.com/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;I wrote about the social circles concept&lt;/a&gt; that a UX Researcher at Google is evangelizing. Here is the &lt;a href="http://www.slideshare.net/padday/the-real-life-social-network-v2"&gt;social circles presentation&lt;/a&gt;. The important part starts on Slide 47:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;People don’t have one group of friends. &lt;/p&gt;    &lt;p&gt;Making people create one big friends group has many of the same problems as planning seating arrangements at your wedding. […] Anyone who is married and went through this will remember how stressful it is.&lt;/p&gt;    &lt;p&gt;Yet that’s what is happening online! Everyone being shoved into this big bucket. People don’t have one group of friends. Offline, people have multiple groups of friends that form around life stages and shared experiences.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is sort of a problem with Facebook for me. Right now, it’s mostly managed by maintaining a separate profile on LinkedIn for my professional network, which brings up another advantage Circles would give Google – the ability to acquire LinkedIn.&lt;/p&gt;  &lt;p&gt;Right now, if Facebook announced that it acquired LinkedIn, I’d probably delete one of my profiles. There’s just no way I could imagine them doing it the way I’d want it done (total separation). On the other hand, not withstanding Google’s Buzz debacle, if they do a good job with Circles, then I could see them incorporating LinkedIn or other networks.&lt;/p&gt;  &lt;p&gt;The other obvious option is &lt;a href="http://www.ning.com/"&gt;Ning&lt;/a&gt;. In Ning, circles are the default, as it’s a way of creating niche social networks. If I belong to different networks on Ning, my friends in one don’t even know I’m in another, let alone what’s going on in the network. Each Ning network is a natural fit for Circles.&lt;/p&gt;  &lt;p&gt;This gives Google some options for growing their networks fast, and in a way that doesn’t break privacy. Even better, it’s a strategy that Facebook won’t want to copy as a single network seems to be part of their DNA, so it gives &lt;a href="http://www.atalasoft.com/cs/blogs/loufranco/archive/2010/06/08/vectors-of-innovation-apple-v-google.aspx"&gt;Google a vector of innovation to differentiate itself from Facebook&lt;/a&gt;.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx&amp;amp;;subject=Google%e2%80%99s+Social+Circles+give+it+Acquisition+Options" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx&amp;amp;;title=Google%e2%80%99s+Social+Circles+give+it+Acquisition+Options" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx&amp;amp;title=Google%e2%80%99s+Social+Circles+give+it+Acquisition+Options" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx&amp;amp;;title=Google%e2%80%99s+Social+Circles+give+it+Acquisition+Options" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx&amp;amp;;title=Google%e2%80%99s+Social+Circles+give+it+Acquisition+Options&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/15/google-s-social-circles-give-it-acquisition-options.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20899" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/facebook/default.aspx">facebook</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/google/default.aspx">google</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/social+media/default.aspx">social media</category></item><item><title>VerCache Madness with .NET ActiveX Controls</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx</link><pubDate>Tue, 13 Jul 2010 15:37:39 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20896</guid><dc:creator>RickM</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;About a year ago I was working on building our DotTwain ActiveX control and wrote &lt;a href="http://www.atalasoft.com/cs/blogs/rickm/archive/2009/06/03/net-2-0-activex-control-gotchas-safe-for-scripting-and-hooking-into-events.aspx"&gt;two&lt;/a&gt; &lt;a href="http://www.atalasoft.com/cs/blogs/rickm/archive/2009/07/14/net-2-0-activex-controls-part-2-controlling-internet-explorer-via-iwebbrowser.aspx"&gt;articles&lt;/a&gt; on some useful tips that I discovered.&amp;#160; Since that time, I’ve seen a problem on a few customer computers where, after upgrading once, the control would never run.&amp;#160; Instead, it would just try to reinstall after every page load. &lt;/p&gt;  &lt;p&gt;After much frustration, it turned out that the problem is related to a little-known Internet Explorer registry entry called VerCache.&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{GUID}] &amp;quot;VerCache&amp;quot;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I figured this out after noticing that every machine exhibiting this problem had the same value for VerCache.&amp;#160; Once the VerCache was set to this value, uninstalling did nothing.&amp;#160; The repeated-reinstallation behavior happened with any new version installed which shared the control GUID.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What’s a VerCache?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Strangely enough, searching for &lt;em&gt;&lt;a href="http://www.google.com/#hl=en&amp;amp;source=hp&amp;amp;q=&amp;ldquo;VerCache&amp;rdquo;+ActiveX"&gt;“VerCache” ActiveX&lt;/a&gt;&lt;/em&gt; gives you little more than an &lt;a href="http://blogs.msdn.com/b/askie/archive/2009/05/22/why-doesn-t-my-activex-control-fail-to-update-in-internet-explorer.aspx"&gt;IE Team blog post&lt;/a&gt; and &lt;a href="http://social.answers.microsoft.com/Forums/en-US/InternetExplorer/thread/cc0e30bd-ca53-4158-b6c0-5988eccd47a5"&gt;one MSDN forums entry&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;At first, I was very excited when I found this IE team blog post.&amp;#160; It appeared that I had found my solution. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Here in the above mentioned screenshots they both are having same file date time stamps and that Causes the VerCache registry key to not get updated.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;To resolve this , ensure that at least one of these parameters - “Created” date time stamp, “Modified” date time stamp or the file size, on the updated control is different from the old version of the control and you should be GTG!&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Unfortunately, this information seems to be incorrect, or at least overly vague.&amp;#160; I observed the same bad VerCache value on different machines with different version of the control.&amp;#160; Each of these had different “created” and “modified” time stamps.&amp;#160; In fact, the CAB, the installer in the CAB, and the control assembly itself each had different “created” and “modified” time stamps for every single version.&amp;#160; I even tried updating the INF and setup launcher timestamps to no avail.&lt;/p&gt;  &lt;p&gt;The only thing which did not vary consistently was file size as we rebuild and repackage our control for each DotImage version we release.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Some of the things I tried or considered.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Early on, I discovered simply deleting the registry key after uninstalling fixed the issue temporarily and was under the impression that it was a single bad version of the control causing this.&amp;#160; So, I wrote a small cleaner utility to fix the issue.&amp;#160; However, as time wore on it was apparent that this issue occurred in a somewhat random fashion with all versions of the control.&lt;/p&gt;  &lt;p&gt;Another simple fix I thought about was updating the control GUID with each version.&amp;#160; However, this would require updating both our documentation and demos with every build.&amp;#160; Additionally, our customers would need to update their javascript with every upgrade.&amp;#160; This was unacceptable.&lt;/p&gt;  &lt;p&gt;The next thing I tried was to have the installer launch a custom console program on install which cleaned the registry value.&amp;#160; This worked great in XP.&amp;#160; However, in Windows 7 the console program, even as admin, did not have access to the registry values I wanted to delete.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Finally, a solution.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the end the only solution I found worked consistently and met our needs was to put custom installer actions into the control itself.&amp;#160; When both installing and uninstalling the installer calls the control’s custom actions which removes any existing VerCache value for the control.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;First, I snagged a class I had made previously for cleaning guid-based registry entries:&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:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:4fcde709-6e98-4cb7-9762-8821089cdbb1" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px;"&gt;Code Snippet&lt;/div&gt; &lt;div style="background:#ddd;max-height:300px;overflow:auto;"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;white-space:nowrap;"&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;delegate&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;RegActionBreakOnTrue&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;RegistryKey&lt;/span&gt; basekey, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; key);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;&amp;lt;T&amp;gt; : &lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt; { &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; T eventData; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; EventArgs(T eventData) { &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.eventData = eventData; } &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; T EventData { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; eventData; } } } &lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;RegGuidCleaner&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; _guid;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; RegGuidCleaner(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; guid)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        _guid = guid;&lt;/li&gt; &lt;li&gt;        Locations = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;[] {};&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;[] Locations { &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff;"&gt;set&lt;/span&gt;; }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;RegistryKey&lt;/span&gt; GetPathBase(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; path)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#2b91af;"&gt;RegistryKey&lt;/span&gt; baseKey;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (path.StartsWith(&lt;span style="color:#a31515;"&gt;@&amp;quot;HKEY_CURRENT_USER&amp;#92;&amp;quot;&lt;/span&gt;))&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            baseKey = &lt;span style="color:#2b91af;"&gt;Registry&lt;/span&gt;.CurrentUser;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (path.StartsWith(&lt;span style="color:#a31515;"&gt;@&amp;quot;HKEY_LOCAL_MACHINE&amp;#92;&amp;quot;&lt;/span&gt;))&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            baseKey = &lt;span style="color:#2b91af;"&gt;Registry&lt;/span&gt;.LocalMachine;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;ApplicationException&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Unexpected location type: &amp;quot;&lt;/span&gt; + path);&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; baseKey;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; GetBaselessPath(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; location)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; truncatedLoc = location.Substring(location.IndexOf(&lt;span style="color:#a31515;"&gt;&amp;#39;&amp;#92;&amp;#92;&amp;#39;&lt;/span&gt;) + 1);&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; truncatedLoc;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; PerformRegActionForEach(&lt;span style="color:#2b91af;"&gt;RegActionBreakOnTrue&lt;/span&gt; action)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;foreach&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; location &lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; Locations)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; fullPath = location + _guid;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af;"&gt;RegistryKey&lt;/span&gt; baseKey = GetPathBase(fullPath);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; baselessPath = GetBaselessPath(fullPath);&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (action(baseKey, baselessPath))&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff;"&gt;break&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        }&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; EnteriesExist&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;get&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; doesKeyExist = &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            PerformRegActionForEach((baseKey, subkey) =&amp;gt;&lt;/li&gt; &lt;li&gt;            {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; key = baseKey.OpenSubKey(subkey);&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (key != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                {&lt;/li&gt; &lt;li&gt;                    doesKeyExist = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;                }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            });&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; doesKeyExist;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        }&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; DeleteEntries()&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    {&lt;/li&gt; &lt;li&gt;        PerformRegActionForEach((baseKey, subkey) =&amp;gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            {&lt;/li&gt; &lt;li&gt;                Messages(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;String&lt;/span&gt;&amp;gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Deleting Registry Key: &amp;quot;&lt;/span&gt; + baseKey.ToString() + &lt;span style="color:#a31515;"&gt;@&amp;quot;&amp;#92;&amp;quot;&lt;/span&gt; + subkey));&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                baseKey.DeleteSubKeyTree(subkey);&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt; (&lt;span style="color:#2b91af;"&gt;Exception&lt;/span&gt; ex) &lt;/li&gt; &lt;li&gt;            {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                Messages(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;String&lt;/span&gt;&amp;gt;(ex.ToString()));&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        });&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;event&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;EventArgs&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;String&lt;/span&gt;&amp;gt;&amp;gt; Messages = &lt;span style="color:#0000ff;"&gt;delegate&lt;/span&gt; { };&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;Please forgive the catch (Exception ex).&amp;#160; So far it has been unnecessary to handle failure cases for anything other than logging.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Next, I added a custom installer class to remove the entries: &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:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:25bc1176-eb8d-4735-84b6-81686d4a70df" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px;"&gt;Code Snippet&lt;/div&gt; &lt;div style="background:#ddd;max-height:300px;overflow:auto;"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;white-space:nowrap;"&gt; &lt;li&gt;[&lt;span style="color:#2b91af;"&gt;RunInstaller&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;partial&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;RegistryCleanerInstallerClass&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;Installer&lt;/span&gt;&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; RegistryCleanerInstallerClass()&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        InitializeComponent();&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; CleanVerCache()&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af;"&gt;RegGuidCleaner&lt;/span&gt; cleaner = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;RegGuidCleaner&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;{&amp;quot;&lt;/span&gt; + &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;AcquisitionControl&lt;/span&gt;).GUID + &lt;span style="color:#a31515;"&gt;&amp;quot;}&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            cleaner.Locations = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;[] { &lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515;"&gt;@&amp;quot;HKEY_CURRENT_USER&amp;#92;Software&amp;#92;Microsoft&amp;#92;Windows&amp;#92;CurrentVersion&amp;#92;Ext&amp;#92;Settings&amp;#92;&amp;quot;&lt;/span&gt;, &lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;             };&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            cleaner.DeleteEntries();&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt; { }&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Install(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; stateSaver)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Install(stateSaver);&lt;/li&gt; &lt;li&gt;        CleanVerCache();&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Commit(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; savedState)&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Commit(savedState);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Rollback(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; savedState)&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Rollback(savedState);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        CleanVerCache();&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Uninstall(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; savedState)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Uninstall(savedState);&lt;/li&gt; &lt;li&gt;        CleanVerCache();&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I also decided to move the com registration into a custom action as well.&amp;#160; The installer-based registration had been intermittently not working which caused us to hand test every release version of the control before sending it out. &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:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:89c375a9-4a17-41f4-bfa6-46ee72dfea29" class="wlWriterEditableSmartContent"&gt; &lt;div style="border:#000080 1px solid;color:#000;font-family:'Courier New', Courier, Monospace;font-size:10pt;"&gt; &lt;div style="background:#000080;color:#fff;font-family:Verdana, Tahoma, Arial, sans-serif;font-weight:bold;padding:2px 5px;"&gt;Code Snippet&lt;/div&gt; &lt;div style="background:#ddd;max-height:300px;overflow:auto;"&gt; &lt;ol style="background:#ffffff;margin:0 0 0 2.5em;padding:0 0 0 5px;white-space:nowrap;"&gt; &lt;li&gt;[&lt;span style="color:#2b91af;"&gt;RunInstaller&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;partial&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;ComRegisterInstallerClass&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;Installer&lt;/span&gt;&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; ComRegisterInstallerClass()&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        InitializeComponent();&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Install(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; stateSaver)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Install(stateSaver);&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#2b91af;"&gt;RegistrationServices&lt;/span&gt; regSrv = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; System.Runtime.InteropServices.&lt;span style="color:#2b91af;"&gt;RegistrationServices&lt;/span&gt;();&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!regSrv.RegisterAssembly(&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.GetType().Assembly, &lt;span style="color:#2b91af;"&gt;AssemblyRegistrationFlags&lt;/span&gt;.SetCodeBase))&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            {&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;InstallException&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Failed to register componenet for COM interop&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            }&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        }&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Commit(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; savedState)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Commit(savedState);&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Rollback(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; savedState)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Rollback(savedState);&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#2b91af;"&gt;RegistrationServices&lt;/span&gt; regSrv = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; System.Runtime.InteropServices.&lt;span style="color:#2b91af;"&gt;RegistrationServices&lt;/span&gt;();&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!regSrv.UnregisterAssembly(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.GetType().Assembly))&lt;/li&gt; &lt;li&gt;            {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;                &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;InstallException&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Failed to unregister componenet for COM interop&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        {&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    [System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityPermission&lt;/span&gt;(System.Security.Permissions.&lt;span style="color:#2b91af;"&gt;SecurityAction&lt;/span&gt;.Demand)]&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Uninstall(&lt;span style="color:#2b91af;"&gt;IDictionary&lt;/span&gt; savedState)&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.Uninstall(savedState);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af;"&gt;RegistrationServices&lt;/span&gt; regSrv = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; System.Runtime.InteropServices.&lt;span style="color:#2b91af;"&gt;RegistrationServices&lt;/span&gt;();&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!regSrv.UnregisterAssembly(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.GetType().Assembly))&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            {&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;InstallException&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;Failed to unregister componenet for COM interop&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;            }&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;        }&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background:#f3f3f3;"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Finally, I added the the custom action calls to the installer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/rickm/customAction1_1431B5FB.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="customAction1" border="0" alt="customAction1" src="http://www.atalasoft.com/cs/blogs/rickm/customAction1_thumb_4F851BB9.png" width="408" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/rickm/customAction2_27DE9F8F.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="customAction2" border="0" alt="customAction2" src="http://www.atalasoft.com/cs/blogs/rickm/customAction2_thumb_329BF6E4.png" width="408" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This still won’t allow an existing broken control to upgrade.&amp;#160; However, after manually uninstalling the old control, the new one will install and work fine.&amp;#160; At least that’s what I’ve found in IE 8.0.7600.16385 Update 0 on Windows 7 Enterprise 64-bit.&amp;#160; ActiveX tends to be a bit of a moving target these days.&lt;/p&gt;  &lt;p&gt;Now, let’s hope I never need speak of this again.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx&amp;amp;;subject=VerCache+Madness+with+.NET+ActiveX+Controls" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx&amp;amp;;title=VerCache+Madness+with+.NET+ActiveX+Controls" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx&amp;amp;title=VerCache+Madness+with+.NET+ActiveX+Controls" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx&amp;amp;;title=VerCache+Madness+with+.NET+ActiveX+Controls" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx&amp;amp;;title=VerCache+Madness+with+.NET+ActiveX+Controls&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/13/vercache-madness-with-net-activex-controls.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20896" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/.NET/default.aspx">.NET</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/activex/default.aspx">activex</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/activex+control/default.aspx">activex control</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/com/default.aspx">com</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/winforms/default.aspx">winforms</category></item><item><title>Technical CEO’s must be CEO’s in addition to being Technical</title><link>http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx</link><pubDate>Tue, 13 Jul 2010 12:02:38 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20895</guid><dc:creator>loufranco</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Paul Adams, a Google UX Researcher, is writing a book called &lt;em&gt;&lt;a href="http://www.thinkoutsidein.com/blog/2010/05/book-update-cover-and-interior-design/"&gt;Social Circles&lt;/a&gt;&lt;/em&gt;, which you can get a good preview of in &lt;a href="http://www.slideshare.net/padday/the-real-life-social-network-v2"&gt;this presentation&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Don’t be put off by the 216 slides – it’s a quick read. The key insight is that the Facebook model of a single group of friends doesn’t match real-life social circles that have mutually exclusive friends and that you might want to communicate to each differently. &lt;/p&gt;  &lt;p&gt;The document itself is a call to action to Google to recognize that the web is undergoing fundamental change, and in some ways is reminiscent of &lt;a href="http://www.wired.com/thisdayintech/2010/05/0526bill-gates-internet-memo/"&gt;Bill Gates’s memo about the Internet in 1995&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Paul Adams:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The social web is not a fad, and it’s not going away. It’s not an add-on to the web as we know it today. It’s a fundamental change, a re-architecture, and in hindsight its evolution is obvious.&lt;/p&gt;    &lt;p&gt;[…] Make no mistake about this. Everyone in this room will need to learn how to design social features on websites.&lt;/p&gt;    &lt;p&gt;[…] When we use search engines today, it’s a pretty solitary experience. We get millions of web pages in our results, yet we don’t see any other people.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Bill Gates:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Browsing the Web, you find almost no Microsoft file formats. After 10 hours of browsing, I had not seen a single Word .DOC, AVI file, Windows .EXE (other than content viewers), or other Microsoft file format.&lt;/p&gt;    &lt;p&gt;[…] One scary possibility being discussed by Internet fans is whether they should get together and create something far less expensive than a PC which is powerful enough for Web browsing.&lt;/p&gt;    &lt;p&gt;[…] The Internet is a tidal wave. It changes the rules. It is an incredible opportunity as well as incredible challenge.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The Gates memo is reminder of how a technical CEO is critical in leading a software company. It’s full of detailed instructions that only a former programmer would be able to understand. &lt;/p&gt;  &lt;p&gt;Eric Schmidt, Sergey Brin and Larry Page are all very technical themselves, and yet this call to arms comes from someone else in the organization. I’m sure Paul Adams is very skilled, but not knowing the internal politics of Google, it’s not clear if his call to action will cause change. It’s not enough to be technical, you also must lead. In the “Next Steps” section of the Gates memo, he says:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;I want every product plan to try and go overboard on Internet features. One element that will be crucial is coordinating our various activities. The challenge/opportunity of the Internet is a key reason behind the recent organization.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Google needs a similar message about social features coming from Schmidt.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx&amp;amp;;subject=Technical+CEO%e2%80%99s+must+be+CEO%e2%80%99s+in+addition+to+being+Technical" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx&amp;amp;;title=Technical+CEO%e2%80%99s+must+be+CEO%e2%80%99s+in+addition+to+being+Technical" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx&amp;amp;title=Technical+CEO%e2%80%99s+must+be+CEO%e2%80%99s+in+addition+to+being+Technical" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx&amp;amp;;title=Technical+CEO%e2%80%99s+must+be+CEO%e2%80%99s+in+addition+to+being+Technical" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx&amp;amp;;title=Technical+CEO%e2%80%99s+must+be+CEO%e2%80%99s+in+addition+to+being+Technical&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/13/technical-ceo-s-must-be-ceo-s-in-addition-to-being-technical.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20895" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/facebook/default.aspx">facebook</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/google/default.aspx">google</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/microsoft/default.aspx">microsoft</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/social+media/default.aspx">social media</category></item><item><title>F# Discoveries this Week 07/09/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx</link><pubDate>Fri, 09 Jul 2010 17:42:10 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20886</guid><dc:creator>RickM</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;This week we once again reap another huge crop of fantastic F# content.&amp;#160; In fact, it’s been getting so overwhelming that I’ll be moving to an every week format from here on out.&amp;#160; Please come in, read, and enjoy!&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006794"&gt;A New F# Case Study on Microsoft.com&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;With its new tools, the bank can speed development by 50 percent or more, improve quality, and reduce costs.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://www.meetup.com/FSharpLondon/"&gt;Next F# London Meetup Announced: July 28th&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The next meetup of the F#unctional London Meetup Group will be held on July 28, with Zach Bray talking on Agile Acceptance Testing with F#&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.itwriting.com/blog/articles/don-syme-on-f-microsofts-functional-programming-language-for-net"&gt;Tim Anderson (of The Register) Interviews Don Syme&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I met Syme at the QCon conference in London, in March 2010, and interviewed him shortly afterwards. Some quotes from that interviewed have already been published in an article for The Register, but I am now posting nearly all of it here.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://dotnetkicks.com/fsharp"&gt;DotNetKicks Now has a F# Section&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Thanks to everyone on twitter who voted!&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://sourceforge.net/projects/quantifa/"&gt;Quantifa 0.0.2 Released&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Quantifa is an F# open-source library for quantitative finance and risk management. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;&lt;a href="http://laurent.le-brun.eu/site/index.php/2010/06/25/58-new-fsharp-mode-for-emacs"&gt;F#-mode for Emacs updated to 0.3&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The F# mode for Emacs is two years old, and has been downloaded more than 1,000 times.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="https://blogs.msdn.com/b/dsyme/archive/2010/07/08/tabbles-organize-your-files-written-in-f.aspx"&gt;Tables: Organize Your Files. Written in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Tabbles is a new way of organizing files: it combines virtual folders and tags, and auto-organizes and tags your files in very intelligent ways. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Audio / Video&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://channel9.msdn.com/posts/MSDNSweden/Svea-Ekonomi-uses-F-for-automated-billing-system-for-the-Telecom-industry/"&gt;Svea Ekonomi on F# for automated billing system for the Telecom industry&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;In earlier versions of the billing system, much of the business logic resided in SQL Server and various Perl and Java programs. That made the solution hard to maintain and tailor to the needs of the customers. By using F# instead of an object oriented language the developers at Svea Ekonomi can be a lot more productive.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Articles&lt;/h1&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.voyce.com/index.php/2010/06/30/minilight-renderer-in-fsharp/"&gt;Ian Voyce’s Minilight renderer in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I’m a sucker for eye-candy, and the other day I came across the beautifully lit renders produced by &lt;/em&gt;&lt;em&gt;Minilight&lt;/em&gt;&lt;em&gt;. It’s a nice, minimal implementation of a global illumination renderer that’s been ported to a wide variety of different languages from C to ActionScript. So of course, I couldn’t resist trying to implement it in F#.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsharpnews.blogspot.com/2010/07/f-vs-mathematica-fast-pricer-for.html"&gt;Jon Harrop’s F# vs Mathematica: fast pricer for American options&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p align="left"&gt;&lt;em&gt;Another example from Sal Mangano's Mathematica Cookbook, this time taken from Andreas Lauschke's example, is a &amp;quot;fast&amp;quot; pricer for American options. The relevant section of the book stresses the importance of performance in this context and the Mathematica code presented was heavily optimized by experts.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsharpnews.blogspot.com/2010/07/f-vs-mathematica-parametric-plots.html"&gt;Jon Harrop’s F# vs Mathematica: parametric plots&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Another example from Sal Mangano's Mathematica Cookbook (p.520) is an elegant little Mathematica program that uses a crude numerical integrator to plot the trajectory of a differential equation representing the populations of predators (foxes) and prey (rabbits):&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsharpnews.blogspot.com/2010/07/f-vs-mathematica-red-black-trees.html"&gt;Jon Harrop’s F# vs Mathematica: red-black trees&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The simpler F# solution is also 20× faster at inserting 100k elements and 100× faster at computing the range of depths in the resulting tree.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsharpnews.blogspot.com/2010/07/lorenz-attractor.html"&gt;Jon Harrop’s Lorenz Attractor&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The Lorenz attractor is a fractal derived from the trajectory of a 3-dimensional dynamical system that exhibits chaotic flow. This blog post describes a 35-line program that computes trajectories of this attractor and visualizes them as a beautiful whisp using Windows Presentation Foundation.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/06/composable-order-relations.html"&gt;Neil Carrier’s Composable Order Relations&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Even before I started experimenting, I realized that checking a list for sorting was just a specific example of checking whether the pairs in a list satisfied a certain binary order relation. So I decided to work directly on a more general solution.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/continuation-passing-mnemonics.html"&gt;Neil Carrier’s Continuation-Passing Mnemonics&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Learning to construct continuations can be tough. It’s easy to state how they work: they facilitate tail recursion by recursively passing the remainder of a computation. But it can be a lot harder to actually get one working from scratch.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/dijkstras-shunting-yard-algorithm.html"&gt;Neil Carrier’s Dijkstra’s Shunting-Yard Algorithm&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Without further ado, here is my first F# implementation of Dijkstra’s shunting-yard algorithm, including a basic test (based on the example at Wikipedia). This is probably not a minimal or most-efficient implementation, but it is a starting place.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/07/arity-and-unit-arguments-in-f-20.html"&gt;Neil Carrier’s Arity and Unit Arguments in F# 2.0&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;While working on an internal domain-specific language, I encountered a case where passing a unit into a function made the syntax somewhat more readable. The completely artificial example below illustrates the concept as the function xfer1. I also tried a two-unit version, which is illustrated as xfer2.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bloggemdano.blogspot.com/2010/07/presentation-5-best-practices-for-f.html"&gt;Daniel Mohl’s Presentation: 5 Best Practices for F# Development slides and examples&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;Thanks to all who come out to the New England F# User Group meeting tonight!&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://tomasp.net/blog/dynamic-sql.aspx"&gt;Tomas Petricek’s Dynamic in F#: Reading data from SQL database&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;If you ever tried to call a SQL stored procedure directly using the SqlCommand, then you can surely appreciate the elegance of this code snippet. Let's now take a look at a larger example and some of the neat tricks that make this possible...&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Erik Schulz’s &lt;a href="http://gradbot.blogspot.com/2010/06/cartesian-tree-sort-revisited.html"&gt;Cartesian Tree Sort – Revisited&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/cartesian-tree-sort-skew-heap.html"&gt;Cartesian Tree Sort – Skew Heap&lt;/a&gt; and &lt;a href="http://gradbot.blogspot.com/2010/07/beating-quick-sort-cartesian-tree-merge.html"&gt;Beating Quick Sort - Cartesian Tree Merge&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;After looking at skew heap, merge sort and Cartesian tree, I figured there has to be a way to combine all three.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Julien Ortin’s &lt;a href="http://lepensemoi.free.fr/index.php/2010/06/25/seo-analysis-in-f"&gt;SEO Analysis in F#,&lt;/a&gt; and &lt;a href="http://lepensemoi.free.fr/index.php/2010/06/27/seo-analysis-in-f-a-friendly-application"&gt;SEO Analysis in F#, a friendly application&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Last time, we created a library of Search Engine Optimization (SEO) helpers. This time we’ll see how to use them to actually fetch information about your webiste rankings (and your competitors’).&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://lepensemoi.free.fr/index.php/2010/07/07/european-central-bank-extracting-reference-rates-with-f"&gt;Julien Ortin’s European Central Bank – extracting reference rates with F#&lt;/a&gt; &lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Every day, the European Central Bank publishes “official” reference FX (foreign exchange) rates where currencies are quoted against the Euro (expressed as EUR/XXX), or 1 EUR = xxx XXX. The exchange rates of the last thirty sessions are available in xml format which we shall try to parse.&amp;#160; In order to do so, we use F# and active patterns, based on Don Syme’s draft paper.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.intellifactory.com/blogs/anton.tayanovskyy/2010/6/29/Optimizing-JavaScript-with-F!sharp!.article"&gt;Anton Tayanovskyy’s Optimizing JavaScript with F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The need for optimizing JavaScript is very peculiar. This is not about delivering top wall-clock performance, but rather delivering the most compact (in Release mode) and most readable (in Debug mode) source. In the case of WebSharper™, it is also about relieving the compiler and the macro writer from the burden of emitting optimal code.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blog.roundthecampfire.net/2010/06/my-first-f-post.html"&gt;Chris Ballard’s My First F# Post&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;That said, this post will take you through my solution for Euler 54, which (somewhat unusually) isn't a particularly mathematical problem, but turns out to be a great way to demonstrate some of the features of the F# language. The basic principle of this problem is to compare two hands of cards in the game of poker, and to determine which is the winning hand.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blog.roundthecampfire.net/2010/06/prime-numbers-building-eulermaths.html"&gt;Chris Ballard’s Prime Numbers - Building the EulerMaths library in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Those of you who are doing Project Euler know what I am talking about by the EulerMaths library. There are certain fundamentals which crop up again and again in the questions and it is important to work these into a reusable and performant library.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bloggemdano.blogspot.com/2010/06/wpf-mvvm-multi-project-template.html"&gt;Daniel Mohl’s WPF MVVM Multi-Project Template: A Polyglot Approach&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;As an advocate for using the right tool for the job, I have created a new WPF MVVM multi-project template composed of an C# View project, an F# ViewModel project, and an F# Model project.&amp;#160; &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.codeproject.com/KB/net-languages/FSharp_Eliza_Bot.aspx"&gt;Rodolfo Ortega’s Eliza like chat bot in F# language for fun&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;This is a very simple Eliza like chat bot. I call it Meliza Sharp. I wrote it for having fun learning the F# language shipped with Visual Studio 2010. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bugsquash.blogspot.com/2010/07/abusing-printfformat-in-f.html"&gt;Mauricio Scheffer’s Abusing PrintfFormat in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Pretty cool, huh? This trick can be used for other things, since PrintfFormatProc is fully reusable. For example, I'm currently using PrintfFormat manipulation to define type-safe routing in a web application&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://geekswithblogs.net/MarkPearl/archive/2010/07/06/f-ndash-depressingly-simple-text-file-access.aspx"&gt;Mark Pearl’s Depressingly simple text file access&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Today I was doing some work work and kept having to parse a log file. After a few hours of doing the same routine stuff I thought I might try and automate it using F#.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Mathias’s &lt;a href="http://clear-lines.com/blog/post/On-the-road-from-C-to-F-reading-Stock-Quotes.aspx"&gt;On the road from C# to F#: reading stock quotes&lt;/a&gt; and &lt;a href="http://clear-lines.com/blog/post/From-C-Sharp-to-F-Sharp-reading-historical-stock-quotes.aspx"&gt;more stocks&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Mads Kristensen has a nice post where he shows how to read&amp;#160; stock quotes from Yahoo finance using C#, which was very helpful to get started. I figured it would be interesting to try out a conversion to F# and see what the result looked like.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx&amp;amp;;subject=F%23+Discoveries+this+Week+07%2f09%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx&amp;amp;;title=F%23+Discoveries+this+Week+07%2f09%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx&amp;amp;title=F%23+Discoveries+this+Week+07%2f09%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx&amp;amp;;title=F%23+Discoveries+this+Week+07%2f09%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx&amp;amp;;title=F%23+Discoveries+this+Week+07%2f09%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/07/09/f-discoveries-this-week-07-09-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20886" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/arity/default.aspx">arity</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/case+study/default.aspx">case study</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/don+syme/default.aspx">don syme</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/dotnetkicks/default.aspx">dotnetkicks</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/emacs/default.aspx">emacs</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/renderer/default.aspx">renderer</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Sorting/default.aspx">Sorting</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/sql/default.aspx">sql</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/unit/default.aspx">unit</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/WebSharper/default.aspx">WebSharper</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/wpf/default.aspx">wpf</category></item><item><title>Why Software Has Bugs</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx</link><pubDate>Thu, 08 Jul 2010 14:20:34 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20882</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I’ve been thinking about the causes of bugs in software in the past week.&amp;#160; I reflect on this a lot and as I get older, I try to put habits into place that eliminate bugs before they happen.&amp;#160; As an example, in doing string manipulation in C, I had a nasty habit of writing the null terminator in the wrong place – always off by one on the generous side.&amp;#160; I put into place a habit that eliminated this by effectively proving my code correct through induction as I wrote it.&lt;/p&gt;  &lt;p&gt;But these kinds of bugs are the microscopic bugs.&amp;#160; I’m thinking of the more granular and endemic.&lt;/p&gt;  &lt;p&gt;The main three causes of larger bugs are:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Finite memory &lt;/li&gt;    &lt;li&gt;Finite storage &lt;/li&gt;    &lt;li&gt;Finite processing time &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I say this because when the straightforward solution for a problem is not so good, it requires us to be clever instead.&amp;#160; And this quote from Brian Kernighan is a pretty good illustration of why that’s not always the best thing:&lt;/p&gt;  &lt;blockquote&gt;   &lt;h3&gt;&lt;font color="#800040"&gt;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.&lt;/font&gt;&lt;/h3&gt; &lt;/blockquote&gt;  &lt;p&gt;Take, for example, color quantization.&amp;#160; This is the task of selecting a good, finite palette of colors to be used in rendering a continuously colored image.&amp;#160; I can describe a straight forward algorithm very concisely:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;foreach&lt;/span&gt; (pixel &lt;span style="color:#0000ff;"&gt;in&lt;/span&gt; image)
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    add the color to a histogram
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;&lt;span style="color:#0000ff;"&gt;while&lt;/span&gt; size of histogram &amp;gt; desired number of colors
&lt;/pre&gt;&lt;pre style="background-color:#ffffff;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;font-size:12px;"&gt;    merge least frequent colors into nearest greater frequencied colors&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;There we go.&amp;#160; Color quantization in 4 lines of code.&amp;#160; The problem is that in a 24 bit image, there could be up to 16,777,216 (2&lt;sup&gt;24&lt;/sup&gt;) possible colors, and the main chunk of a straightforward histogram will require 67,108,864 bytes, but since we have to merge, we can’t just store the frequency – we’ll need the color too, so that’s 134,217,728 bytes.&amp;#160; So scanning the histogram on the first pass alone will take something on the order of 33M operations (16M reads and 16M compares) – and you want to do this because you want to eliminate all the empty cells.&amp;#160; Then you need to sort the cells on frequency – there’s an n * log n operation, where n is in the millions.&lt;/p&gt;

&lt;p&gt;It’s bad.&amp;#160; Really bad.&amp;#160; You could get away with another approach of limiting your histogram to the size of the image – that’s good – you can’t have any more unique colors than you have pixels, but now each time you record a color, you’re going to either have to hash on the color or insertion sort.&amp;#160; The cleverness required just went up.&lt;/p&gt;

&lt;p&gt;There is a fairly good way to do quantization called Octree Quantization&amp;#160; (Michael Gervautz, Werner Purgathofer), which uses a sparse tree where each node has up to 8 children and the greatest depth of the tree is 8.&amp;#160; In this case, r, g, and b components are used to navigate a path through the tree by using most to least significant bits in r, g, and b to select a child from a given node.&amp;#160; When the load on the tree gets too high, it gets reduced.&amp;#160; This is all very, very clever and to make it perfomant requires even more cleverness.&lt;/p&gt;

&lt;p&gt;I say this because in implementing the algorithm on my test image, which had 16M pixels in it, I found that one particular routine – a very simple one – was getting called 75M times.&amp;#160; This is bane of image processing.&amp;#160; Simple routines that get called an insane number of times.&amp;#160; With some refactoring, I eliminated 2/3 of the cost of that routine.&amp;#160; Ultimately, the running time of the quantization in managed code on a 2.4G machine was 3.3 seconds.&amp;#160; Compare this with the cost of simply scanning the image, which is .374 seconds.&amp;#160; &lt;/p&gt;

&lt;p&gt;But each of these refactorings adds complexity and complexity adds bugs.&amp;#160; And the ultimate cause of those bugs is limited resources, because each change in algorithm and each refactoring was necessitated by the problem scope.&amp;#160;&amp;#160; Roughly 10% of the cost of quantization is scanning the image and 90% is cleverness.&amp;#160; You shouldn’t be surprised now about why I think that cleverness causes bugs.&lt;/p&gt;

&lt;p&gt;So what can we do to avoid the cost of cleverness?&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Don’t assume you need to be clever a priori&lt;/li&gt;

  &lt;li&gt;Use a language appropriate to the problem domain &lt;/li&gt;

  &lt;li&gt;Use well-debugged, well-tested libraries to do common data structuring &lt;/li&gt;

  &lt;li&gt;Strive to keep your code as clean&lt;sup&gt;1&lt;/sup&gt; and as readable as possible &lt;/li&gt;

  &lt;li&gt;Optimize based on measurements not instinct&lt;/li&gt;

  &lt;li&gt;Unit test before and after refactoring &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;by clean, I mean something similar to the adage of always wearing clean underwear because you might have to go to the hospital – if you just refactored and someone else had to pick up you code, would they want to jam spikes into their eyes (or for the clearer thinkers, would they want to jam spikes into &lt;strong&gt;&lt;em&gt;your&lt;/em&gt;&lt;/strong&gt; eyes)?&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx&amp;amp;;subject=Why+Software+Has+Bugs" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx&amp;amp;;title=Why+Software+Has+Bugs" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx&amp;amp;title=Why+Software+Has+Bugs" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx&amp;amp;;title=Why+Software+Has+Bugs" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx&amp;amp;;title=Why+Software+Has+Bugs&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/07/08/why-software-has-bugs.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20882" width="1" height="1"&gt;</description></item><item><title>Twilight: Eclipse from a Social Media Perspective</title><link>http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx</link><pubDate>Thu, 08 Jul 2010 13:30:01 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20878</guid><dc:creator>loufranco</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Last year, I wrote a review of &lt;a href="http://www.atalasoft.com/cs/blogs/loufranco/archive/2009/05/11/star-trek-review-from-an-ecm-perspective.aspx"&gt;Star Trek from an ECM Perspective&lt;/a&gt;, and I’ve been looking out for other movies that have an interesting collaboration angle, but couldn’t think of one until last week when I went to a midnight showing of the new Twilight movie.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Spoiler Alert: I have to give away some details of the movie (and the next one) in this review.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There are at least three kind of telepathic collaboration in Twilight. Edward can read thoughts (except for Bella’s), the wolf pack is connected to each other telepathically, and Alice can “follow” decisions and see the future after a decision is made.&lt;/p&gt;  &lt;p&gt;I think a lot could be said about how the wolf pack telepathy is like Facebook (Jacob talks about the drama of a love triangle being broadcast around the wolf pack). And perhaps Alice has some kind of super-twitter that people can’t help using to blurt out their plans to her.&lt;/p&gt;  &lt;p&gt;But I think the most interesting Social Media aspect to Twilight is Bella. Bella’s thoughts cannot be read, and in the Twilight world, &lt;em&gt;privacy is a super-power&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;And, it’s not just incidental, Bella’s ability to keep her thoughts to herself is an integral part of the plot. For example:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;It’s part of Edward’s attraction to her (the other part being his insatiable desire to have her for dinner)&lt;/li&gt;    &lt;li&gt;It probably saved her life with the Volturi in &lt;em&gt;New Moon&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;She uses it to mask feelings she might have for Jacob.&lt;/li&gt;    &lt;li&gt;(&lt;em&gt;Breaking Dawn &lt;/em&gt;SPOILER) Her privacy abilities expand in &lt;em&gt;Breaking Dawn&lt;/em&gt; to include being able to shield others.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In any case, with the world moving towards more sharing and openness, it’s interesting to remember the power of privacy as well.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx&amp;amp;;subject=Twilight%3a+Eclipse+from+a+Social+Media+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx&amp;amp;;title=Twilight%3a+Eclipse+from+a+Social+Media+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx&amp;amp;title=Twilight%3a+Eclipse+from+a+Social+Media+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx&amp;amp;;title=Twilight%3a+Eclipse+from+a+Social+Media+Perspective" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx&amp;amp;;title=Twilight%3a+Eclipse+from+a+Social+Media+Perspective&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/07/08/twilight-eclipse-from-a-social-media-perspective.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20878" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/ecm/default.aspx">ecm</category><category domain="http://www.atalasoft.de/cs/blogs/loufranco/archive/tags/social+media/default.aspx">social media</category></item><item><title>F# Range Specification Mistake</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx</link><pubDate>Wed, 30 Jun 2010 20:10:27 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20859</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I’ve already mentioned how much &lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/archive/2010/06/04/chasing-your-tail-in-f.aspx"&gt;I dislike F# for loops&lt;/a&gt;.&amp;#160; I ran into an issue in the spec that affects loops as well any language construct that uses the range syntax &lt;em&gt;expr&lt;sub&gt;1&lt;/sub&gt; .. expr&lt;sub&gt;2&lt;/sub&gt;&lt;/em&gt;.&amp;#160; The spec for ranges is this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The default definition of these operators is in Microsoft.FSharp.Core.Operators. The (&lt;i&gt;..&lt;/i&gt;) operator generates an IEnumerable&amp;lt;_&amp;gt; for the range of values between the given start (&lt;i&gt;expr&lt;sub&gt;1&lt;/sub&gt;&lt;/i&gt;) and finish (&lt;i&gt;expr&lt;sub&gt;2&lt;/sub&gt;&lt;/i&gt;) values, using an increment of 1 (as given by Microsoft.FSharp.LanguagePrimitives.GenericOne).&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is great – if you use the following code:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;let x = [| 0..7 |];;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;you get this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;val x : int [] = [|0; 1; 2; 3; 4; 5; 6; 7|]&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;which is what you’d expect.&amp;#160; If you do this, on the other hand:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;let x = [| 7..0 |];;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;you get this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;val x : int [] = [||]&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Empty array?&amp;#160; Really?&amp;#160; Well, yes – by the spec they say that they will construct an IEnumerable&amp;lt;_&amp;gt; and use an increment of 1.&amp;#160; In reality, they should use an increment of sign(expr&lt;sub&gt;2&lt;/sub&gt; – &lt;em&gt;expr&lt;sub&gt;1&lt;/sub&gt;&lt;/em&gt;). This means that if I write the following function:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;let f a b =&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; for i in a .. b do someOtherFunction i&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I will only get predictable results is a &amp;lt; b.&amp;#160; The workaround is to write it this way:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;let f a b =&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; for i in a .. sign (b – a) .. b do someOtherFunction i&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;in order to get predictable results.&amp;#160; Note that &lt;strong&gt;I do not want to do this&lt;/strong&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;let f a b =&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; for i in (min a b) .. (max a b) do someOtherFunction i&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;as that will always run low to high and not in the order asked&lt;/p&gt;  &lt;p&gt;Range syntax is a nice bit of sugar.&amp;#160; It’s a shame to see it so badly broken.&amp;#160; I imagine that this was brought in from OCAML but &lt;a href="http://pauillac.inria.fr/ocaml/htmlman/manual021.html"&gt;the section of the spec (such as it is) that I found&lt;/a&gt; doesn’t proscribe the ordering of a range.&amp;#160; I’d be interested in hearing if the F# implementation was accidental or not.&amp;#160; It would certainly lighten the syntax by removing the need for downto in for loops.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx&amp;amp;;subject=F%23+Range+Specification+Mistake" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx&amp;amp;;title=F%23+Range+Specification+Mistake" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx&amp;amp;title=F%23+Range+Specification+Mistake" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx&amp;amp;;title=F%23+Range+Specification+Mistake" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx&amp;amp;;title=F%23+Range+Specification+Mistake&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/30/f-range-specification-mistake.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20859" width="1" height="1"&gt;</description></item><item><title>How Google Can Bust Facebook Network Effects</title><link>http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx</link><pubDate>Tue, 29 Jun 2010 16:24:28 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20857</guid><dc:creator>loufranco</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;There was a leak today that Google is building a Facebook competitor called Google Me (to go along with Orkut, Wave, and Buzz). &lt;a href="http://gigaom.com/2010/06/28/google-trying-to-build-facebook-competitor-good-luck-with-that/"&gt;GigaOM reports&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Could Google put together a credible competitor to Facebook? Anything is possible, but so far there’s little reason to believe that the search giant could come up with a service that represented a real threat. Orkut may be popular in South America and India, but has shown no signs of growing outside of those countries. Could Google use it as the basis for something that takes parts of Google Buzz, parts of Google Profiles, parts of Google Wave and parts of Blogger to construct a comprehensive social network? Theoretically, but that sounds more like a Frankenstein-style strategy than anything else — stitching together pieces of half-dead services and hoping they come alive.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The problem with the Google social networks aren’t their feature sets, it’s that no one uses them (because no one uses them). Going right up against Facebook with just comparable features is doomed to failure, because no one really has a feature problem with Facebook.&lt;/p&gt;  &lt;p&gt;The problem they need to solve is how do they get a person sitting at their computer to open an account to use a service that is useless until others join. Their options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Sign them up automatically – this has already spectacularly failed with Buzz.&amp;#160; Perhaps there’s a better way.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Pay them.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Make it so that signing up makes some other Google service better. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;And, they need to incent people to invite others in. Options are&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Sign up all of your email contacts and connect you to them (oh yeah, that didn’t work)      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Pay them.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Make is so that getting others to join makes some other Google service better. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Automatic sign-up has already failed, and I can’t see Google resorting to paying people. So, the only path is to somehow augment all Google services with the data from their social network (in a way that preserves privacy). The huge advantage that Google has over Facebook is that they can incorporate the data into search results without making the data indexable. Facebook has to either recreate all Google services or open up their data.&lt;/p&gt;  &lt;p&gt;Here are some ideas for how Google services can be augmented with social data:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;My registered likes and interests should make my search results better.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Likes and interests should be used by Google reader to suggest articles and feeds.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Likes and interests should augment maps with places I like      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Let advertisers target search keywords and demographics      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;My network’s likes should augment my search results. When I search for a product, let me know that someone likes an alternative.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Let me designate a search as wanting a network result page. Like Quora, but only for my network (I do this ad-hoc on Facebook already).      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Highlight mail that is from someone in my network. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;After doing that, they can try to use my use of other services to augment the network. I would love if more things added to my timeline instead of sending e-mail. Let me designate filters that divert there instead. There are definitely some feeds that I would divert there as well.&lt;/p&gt;  &lt;p&gt;Essentially, Google needs to fight the network effect of Facebook with one of their own (between their own services).&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx&amp;amp;;subject=How+Google+Can+Bust+Facebook+Network+Effects" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx&amp;amp;;title=How+Google+Can+Bust+Facebook+Network+Effects" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx&amp;amp;title=How+Google+Can+Bust+Facebook+Network+Effects" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx&amp;amp;;title=How+Google+Can+Bust+Facebook+Network+Effects" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx&amp;amp;;title=How+Google+Can+Bust+Facebook+Network+Effects&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/loufranco/archive/2010/06/29/how-google-can-bust-facebook-network-effects.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20857" width="1" height="1"&gt;</description></item><item><title>Applied F# Symposium Session 2</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx</link><pubDate>Fri, 25 Jun 2010 18:58:00 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20851</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;How to Define Consumable Classes&lt;/p&gt;  &lt;p&gt;Fine Points&lt;/p&gt;  &lt;p&gt;1. F# is &lt;b&gt;&lt;u&gt;F&lt;/u&gt;&lt;/b&gt;ree, C# is &lt;b&gt;&lt;u&gt;C&lt;/u&gt;&lt;/b&gt;losed – members in F# are public by default, members in C# are private by default. When in doubt, spell it out.&lt;/p&gt;  &lt;p&gt;2. F# &lt;i&gt;wants&lt;/i&gt; you to use lots of little static functions. &lt;b&gt;Our customers don’t&lt;/b&gt; – they want objects/controls. Follow the template&lt;/p&gt;  &lt;p&gt;3. F# has multiple, sometimes conflicting syntaxes for defining things. Sorry.&lt;/p&gt;  &lt;p&gt;4. Files in an F# project are not necessarily in alphabetical order; they are in parse/necessity/dependency order. Again, sorry.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Content&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Best practice point – here’s how to build a class file&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Gross Structure&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;namespace declaration&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;open clauses&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;helper modules&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;open clauses&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;class definition(s)&amp;gt;&lt;/p&gt;  &lt;p&gt;Example:&lt;/p&gt;  &lt;p&gt;namespace Frobozz.lifeform&lt;/p&gt;  &lt;p&gt;open System&lt;/p&gt;  &lt;p&gt;open System.IO&lt;/p&gt;  &lt;p&gt;module internal argutils =&lt;/p&gt;  &lt;p&gt;let raiseOnNull s o =&lt;/p&gt;  &lt;p&gt;if o = null then raise(ArgumentNullException(s)) else o&lt;/p&gt;  &lt;p&gt;open argutils&lt;/p&gt;  &lt;p&gt;type FilePath(s:string) =&lt;/p&gt;  &lt;p&gt;let _pathStr = raiseOnNull "s" s&lt;/p&gt;  &lt;p&gt;let _path = _pathStr.Split([| '/'; '\\' |])&lt;/p&gt;  &lt;p&gt;member this.Path with get() = _path&lt;/p&gt;  &lt;p&gt;Exercise&lt;/p&gt;  &lt;p&gt;1. Define a class called Digit which constructs with a string, its name, and has a read-only property Name and overrides ToString to print its name&lt;/p&gt;  &lt;p&gt;2. Define a class called Hand which constructs with an int, the number of digits, and has a property which is a list of Digit, initialized to the digits. Every hand with n digits has n-1 fingers and 1 thumb.&lt;/p&gt;  &lt;p&gt;3. Show and tell for abstract life forms, then make your favorite non-mute animal&lt;/p&gt;  &lt;p&gt;4. Show and tell for interfaces and mix-in classes&lt;/p&gt;  &lt;pre style="font-size:small;" class="fsharp"&gt;&lt;div style="text-align:center;font-weight:bold;"&gt;&amp;nbsp;&lt;/div&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;namespace&lt;/span&gt; Frobozz.&lt;span&gt;lifeform&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; System&lt;br&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; System.&lt;span&gt;IO&lt;/span&gt;&lt;br&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; System.&lt;span&gt;Media&lt;/span&gt;&lt;br&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; System.&lt;span&gt;Reflection&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;module&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;internal&lt;/span&gt; utils &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; raiseOnNull s o &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; o &lt;span&gt;=&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;null&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;raise&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;ArgumentNullException&lt;span&gt;(&lt;/span&gt;s&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; o&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; raiseOnNegative s n &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;sign&lt;/span&gt; n &lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;raise&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;ArgumentOutOfRangeException&lt;span&gt;(&lt;/span&gt;s&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; n&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; utils&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; Digit&lt;span&gt;(&lt;/span&gt;name:&lt;span style="font-weight:bold;"&gt;string&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; _name &lt;span&gt;=&lt;/span&gt; raiseOnNull &lt;span&gt;"name"&lt;/span&gt; name&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; this.&lt;span&gt;Name&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt; get&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; _name&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;override&lt;/span&gt; this.&lt;span&gt;ToString&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; this.&lt;span&gt;Name&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;module&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;internal&lt;/span&gt; lifeHelpers &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; namedDigit &lt;span&gt;(&lt;/span&gt;n:&lt;span style="font-weight:bold;"&gt;int&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;new&lt;/span&gt; Digit&lt;span&gt;(&lt;/span&gt;&lt;a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"&gt;&lt;span style="font-weight:bold;"&gt;String&lt;/span&gt;&lt;/a&gt;.&lt;span&gt;Format&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"finger {0}"&lt;/span&gt;, n&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;rec&lt;/span&gt; makeDigits n l &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; n &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; l&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;elif&lt;/span&gt; n &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;new&lt;/span&gt; Digit &lt;span&gt;"thumb"&lt;/span&gt; :: l&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;namedDigit &lt;span&gt;(&lt;/span&gt;n &lt;span&gt;-&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; :: &lt;span&gt;(&lt;/span&gt;makeDigits &lt;span&gt;(&lt;/span&gt;n &lt;span&gt;-&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; l&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; makeDigits1 n &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; n &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;new&lt;/span&gt; Digit&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"thumb"&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; ::  &lt;span&gt;[&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;for&lt;/span&gt; i &lt;span style="font-weight:bold;"&gt;in&lt;/span&gt; &lt;span&gt;1&lt;/span&gt; .. &lt;span&gt;(&lt;/span&gt;n&lt;span&gt;-&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;namedDigit i&lt;span&gt;)&lt;/span&gt; &lt;span&gt;]&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; &lt;span&gt;[&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; lifeHelpers&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; Hand&lt;span&gt;(&lt;/span&gt;digitCount:&lt;span style="font-weight:bold;"&gt;int&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; _digits &lt;span&gt;=&lt;/span&gt; makeDigits digitCount &lt;span&gt;[&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; this.&lt;span&gt;Digits&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt; get&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; _digits&amp;nbsp;&amp;nbsp; &lt;span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;AbstractClass&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;br&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; Lifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;abstract&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; Vocalize : &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;AbstractClass&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;br&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; SoundLifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;inherit&lt;/span&gt; Lifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;abstract&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; GetSoundStream : &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; Stream&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;override&lt;/span&gt; this.&lt;span&gt;Vocalize&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; stm &lt;span&gt;=&lt;/span&gt; this.&lt;span&gt;GetSoundStream&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;|&amp;gt;&lt;/span&gt; raiseOnNull &lt;span&gt;"GetSoundStream"&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; player &lt;span&gt;=&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;new&lt;/span&gt; SoundPlayer&lt;span&gt;(&lt;/span&gt;stm&lt;span&gt;)&lt;/span&gt;&lt;br&gt;        player.&lt;span&gt;PlaySync&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; FSharpDuck&lt;span&gt;(&lt;/span&gt;assem : Assembly, resName:&lt;span style="font-weight:bold;"&gt;string&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;inherit&lt;/span&gt; SoundLifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;override&lt;/span&gt; this.&lt;span&gt;GetSoundStream&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        assem.&lt;span&gt;GetManifestResourceStream&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;resName&lt;span&gt;)&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; IVocal &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;abstract&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; Vocalize : &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; BetterLifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;abstract&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; Metabolize : &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;unit&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;default&lt;/span&gt; this.&lt;span&gt;Metabolize&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; Console.&lt;span&gt;WriteLine&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"breathing."&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;member&lt;/span&gt; this.&lt;span&gt;CanSpeak&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt; get&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;this :&lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;obj&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; :? IVocal&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; Slug&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;inherit&lt;/span&gt; BetterLifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; BetterDuck&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;inherit&lt;/span&gt; BetterLifeform&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;interface&lt;/span&gt; IVocal &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;override&lt;/span&gt; this.&lt;span&gt;Vocalize&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; Console.&lt;span&gt;WriteLine&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"quack."&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;div style="text-align:center;font-weight:bold;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/pre&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx&amp;amp;;subject=Applied+F%23+Symposium+Session+2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx&amp;amp;;title=Applied+F%23+Symposium+Session+2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx&amp;amp;title=Applied+F%23+Symposium+Session+2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx&amp;amp;;title=Applied+F%23+Symposium+Session+2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx&amp;amp;;title=Applied+F%23+Symposium+Session+2&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/applied-f-symposium-session-2.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20851" width="1" height="1"&gt;</description></item><item><title>F# Symposium Session 1</title><link>http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx</link><pubDate>Fri, 25 Jun 2010 18:54:00 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20850</guid><dc:creator>Steve Hawley</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I’ve been running an F# symposium internally at Atalasoft.&amp;nbsp; Here is the first session’s notes and the “answers”.&lt;/p&gt;  &lt;p&gt;1. Define simple polynomial:&lt;/p&gt;  &lt;p&gt;type polynomial =&lt;/p&gt;  &lt;p&gt;{ A : double; B : double; C : double; }&lt;/p&gt;  &lt;p&gt;How do we evaluate some polynomial p at position x?&lt;/p&gt;  &lt;p&gt;How do we get the roots of p?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image002_5440A066.gif"&gt;&lt;img src="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image002_thumb_140A86EC.gif" style="border:0px none;display:inline;" title="clip_image002" alt="clip_image002" border="0" height="40" width="115"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Simple recursive functions – define Member a l&lt;/p&gt;  &lt;p&gt;a is a member of a l if and only if&lt;/p&gt;  &lt;p&gt;a) The l is not empty&lt;/p&gt;  &lt;p&gt;b) a is the same as the front of the l or Member a (everything but the front of l) is true&lt;/p&gt;  &lt;p&gt;Show trivial in-built Member f’n&lt;/p&gt;  &lt;p&gt;Write Rember a l – Rember returns a new list that l’ such that l’ does not contain any instances of a.&lt;/p&gt;  &lt;p&gt;3. Tail recursion – Square roots&lt;/p&gt;  &lt;p&gt;Newton’s Method:&lt;/p&gt;  &lt;p&gt;Make a guess.&lt;/p&gt;  &lt;p&gt;For a certain number of iterations:&lt;/p&gt;  &lt;p&gt;Refine the guess (is actually a Taylor series expansion IIRC) in this way:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image004_0CEB4A74.gif"&gt;&lt;img src="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image004_thumb_4CB530F9.gif" style="border:0px none;display:inline;" title="clip_image004" alt="clip_image004" border="0" height="45" width="240"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Write with a for-loop/mutability.&lt;/p&gt;  &lt;p&gt;Recast it recursively&lt;/p&gt;  &lt;p&gt;4. Hermite polynomials – here is the definition of a Hermite polynomial:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image006_4595F481.gif"&gt;&lt;img src="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image006_thumb_6C640AC1.gif" style="border:0px none;display:inline;" title="clip_image006" alt="clip_image006" border="0" height="20" width="89"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image008_13322102.gif"&gt;&lt;img src="http://www.atalasoft.com/cs/blogs/stevehawley/clip_image008_thumb_250EB4CF.gif" style="border:0px none;display:inline;" title="clip_image008" alt="clip_image008" border="0" height="34" width="240"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Write Hermite recursively&lt;/p&gt;  &lt;p&gt;Write Hermite iteratively&lt;/p&gt;  &lt;p&gt;Write Hermite iteratively, tail-recursively&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;module&lt;/span&gt; File1&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;open&lt;/span&gt; System&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;type&lt;/span&gt; polynomial &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span&gt;{&lt;/span&gt; A : double&lt;span&gt;;&lt;/span&gt; B : double&lt;span&gt;;&lt;/span&gt; C : double&lt;span&gt;;&lt;/span&gt; &lt;span&gt;}&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; eval p x &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span&gt;(&lt;/span&gt;p.&lt;span&gt;A&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; x &lt;span&gt;*&lt;/span&gt; x&lt;span&gt;)&lt;/span&gt; &lt;span&gt;+&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;p.&lt;span&gt;B&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; x&lt;span&gt;)&lt;/span&gt; &lt;span&gt;+&lt;/span&gt; p.&lt;span&gt;C&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; root p &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; discriminant &lt;span&gt;=&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;p.&lt;span&gt;B&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; p.&lt;span&gt;B&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;4.0&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; p.&lt;span&gt;A&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; p.&lt;span&gt;C&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; p.&lt;span&gt;A&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt; || discriminant &lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;raise&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;ArgumentOutOfRangeException&lt;span&gt;(&lt;/span&gt;&lt;span&gt;"p"&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; twoA &lt;span&gt;=&lt;/span&gt; &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; p.&lt;span&gt;A&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; radical &lt;span&gt;=&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;sqrt&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;discriminant&lt;span&gt;)&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; plusRoot &lt;span&gt;=&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;-&lt;/span&gt;p.&lt;span&gt;B&lt;/span&gt; &lt;span&gt;+&lt;/span&gt; radical&lt;span&gt;)&lt;/span&gt; &lt;span&gt;/&lt;/span&gt; twoA&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; minusRoot &lt;span&gt;=&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;-&lt;/span&gt;p.&lt;span&gt;B&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; radical&lt;span&gt;)&lt;/span&gt; &lt;span&gt;/&lt;/span&gt; twoA&lt;br&gt;        &lt;span&gt;(&lt;/span&gt;plusRoot, minusRoot&lt;span&gt;)&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; derivative p &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span&gt;{&lt;/span&gt; A &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; B &lt;span&gt;=&lt;/span&gt; p.&lt;span&gt;A&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; &lt;span&gt;2.0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt; C &lt;span&gt;=&lt;/span&gt; p.&lt;span&gt;B&lt;/span&gt; &lt;span&gt;}&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; derivativeAt p x &lt;span&gt;=&lt;/span&gt; eval &lt;span&gt;(&lt;/span&gt;derivative p&lt;span&gt;)&lt;/span&gt; x&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;rec&lt;/span&gt; Member a l &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;match&lt;/span&gt; l &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt;&lt;br&gt;    | &lt;span&gt;[&lt;/span&gt;&lt;span&gt;]&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;false&lt;/span&gt;&lt;br&gt;    | head :: tail &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; a &lt;span&gt;=&lt;/span&gt; head &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;true&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; Member a tail&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;rec&lt;/span&gt; Member1 a l &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"&gt;&lt;span style="font-weight:bold;"&gt;List&lt;/span&gt;&lt;/a&gt;.&lt;span&gt;exists&lt;/span&gt; a l&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;rec&lt;/span&gt; rember a l &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;match&lt;/span&gt; l &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt;&lt;br&gt;    | &lt;span&gt;[&lt;/span&gt;&lt;span&gt;]&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span&gt;[&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;br&gt;    | head :: tail &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; a &lt;span&gt;=&lt;/span&gt; head &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; rember a tail &lt;br&gt;                      &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; head :: rember a tail&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; MutableNewtonSquareRoot S iterations &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;mutable&lt;/span&gt; guess &lt;span&gt;=&lt;/span&gt; S &lt;span&gt;/&lt;/span&gt; &lt;span&gt;2.0&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;for&lt;/span&gt; i &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;to&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;iterations&lt;span&gt;-&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;do&lt;/span&gt;&lt;br&gt;        guess &lt;span&gt;&amp;lt;-&lt;/span&gt; &lt;span&gt;0.5&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;guess &lt;span&gt;+&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;S &lt;span&gt;/&lt;/span&gt; guess&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    guess&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; NewtonSquareRoot S iterations &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;rec&lt;/span&gt; NewtonWorker guess iterations &lt;span&gt;=&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; iterations &lt;span&gt;&amp;lt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; guess&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt;&lt;br&gt;            &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; newguess &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.5&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;guess &lt;span&gt;+&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;S &lt;span&gt;/&lt;/span&gt; guess&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;            NewtonWorker newguess &lt;span&gt;(&lt;/span&gt;iterations &lt;span&gt;-&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; roughestimate &lt;span&gt;=&lt;/span&gt; S &lt;span&gt;/&lt;/span&gt; &lt;span&gt;2.0&lt;/span&gt;&lt;br&gt;    NewtonWorker roughestimate iterations&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;rec&lt;/span&gt; hermite1 x n &lt;span&gt;=&lt;/span&gt; &lt;br&gt;    &lt;span style="font-weight:bold;"&gt;match&lt;/span&gt; n &lt;span style="font-weight:bold;"&gt;with&lt;/span&gt;&lt;br&gt;    | &lt;span&gt;0&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span&gt;1.0&lt;/span&gt;&lt;br&gt;    | &lt;span&gt;1&lt;/span&gt; &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span&gt;2.0&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;x&lt;br&gt;    | _ &lt;span&gt;-&amp;gt;&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;2.0&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;x&lt;span&gt;*&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;hermite1 x &lt;span&gt;(&lt;/span&gt;n&lt;span&gt;-&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style="font-weight:bold;"&gt;double&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;n&lt;span&gt;-&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;hermite1 x &lt;span&gt;(&lt;/span&gt;n&lt;span&gt;-&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:small;" class="fsharp"&gt;&lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; hermite2 x n &lt;span&gt;=&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;mutable&lt;/span&gt; prev &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;mutable&lt;/span&gt; curr &lt;span&gt;=&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;if&lt;/span&gt; n &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;then&lt;/span&gt; &lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; x &lt;span style="font-weight:bold;"&gt;else&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;br&gt;    &lt;span style="font-weight:bold;"&gt;for&lt;/span&gt; i &lt;span&gt;=&lt;/span&gt; &lt;span&gt;2&lt;/span&gt; &lt;span style="font-weight:bold;"&gt;to&lt;/span&gt; n &lt;span style="font-weight:bold;"&gt;do&lt;/span&gt;&lt;br&gt;        &lt;span style="font-weight:bold;"&gt;let&lt;/span&gt; newcurr &lt;span&gt;=&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;2.0&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; x &lt;span&gt;*&lt;/span&gt; curr&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style="font-weight:bold;"&gt;double&lt;/span&gt; i&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; &lt;span&gt;1.0&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;*&lt;/span&gt; prev&lt;br&gt;        prev &lt;span&gt;&amp;lt;-&lt;/span&gt; curr&lt;br&gt;        curr &lt;span&gt;&amp;lt;-&lt;/span&gt; newcurr&lt;br&gt;    curr&amp;nbsp; &lt;/pre&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx&amp;amp;;subject=F%23+Symposium+Session+1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx&amp;amp;;title=F%23+Symposium+Session+1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx&amp;amp;title=F%23+Symposium+Session+1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx&amp;amp;;title=F%23+Symposium+Session+1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx&amp;amp;;title=F%23+Symposium+Session+1&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/stevehawley/archive/2010/06/25/f-symposium-session-1.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20850" width="1" height="1"&gt;</description></item><item><title>F# Discoveries This Week 06/25/2010</title><link>http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx</link><pubDate>Fri, 25 Jun 2010 14:40:51 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:20848</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;As always, a huge number of software releases and high quality articles this week.&amp;#160; My favorite thing about the F# community is that someone is always writing about something that tickles my brain.&amp;#160; While right out of a computer science textbook, I enjoyed Erik Schulz’s sorting animations quite a lot.&amp;#160; His animations are excellent.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;News&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!2120.entry"&gt;VS2010 Pro Power Tools Released&lt;/a&gt; (fixes scrolling reference dialog)&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;A set of extensions to Visual Studio Professional (and above) which improves developer productivity.&amp;#160; Includes a &lt;/em&gt;&lt;em&gt;New ‘Add Reference’ dialog: Pops up fast and is more pleasant (less frustrating) to use.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://huwmancode.codeplex.com/"&gt;HuwmanCode 0.1 Released – Simplified Windows Services in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;HuwmanCode is a collection of libraries intended to enhance the base class libraries for developers writing F#. Using HuwmanCode you can write a Windows Service in F# entirely.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://fsprojectextender.codeplex.com/"&gt;F# Project Extender 0.9.3 Released&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Installing F# Project Extender provides tools to better organize files in F# projects by allowing project subdirectories and separating file management in Solution Explorer from controlling compilation order.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://vcc.codeplex.com/"&gt;VCC 2.1.30625 Released (Written in F#)&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;VCC is a mechanical verifier for concurrent C programs. VCC takes a C program, annotated with function specifications, data invariants, loop invariants, and ghost code, and tries to prove these annotations correct. If it succeeds, VCC promises that your program actually meets its specifications.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://github.com/sandersn/fing"&gt;Fing 0.1 Released&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Fing is F# API Search. It's inspired by Hoogle, although it is not a port.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Audio/Video&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://skillsmatter.com/podcast/open-source-dot-net/tomas-petricek-reactive-programming-in-fsharp"&gt;Tomas Petricek at the London F# User Group – Reactive Programming in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;During this talk, Tomas will cover two techniques. We'll start by looking at F# events and declarative approach for specifying event processing. Next, we'll look at embedding F# event handling into asynchronous workflows and programming using &amp;quot;state machines&amp;quot;. We'll also briefly mention how this relates to more general functional programming &amp;quot;design patterns&amp;quot;.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;&lt;a href="http://www.fsug.org/OtherEvents/TechEdOnline/tabid/69/Default.aspx"&gt;A Listing of F# TechEd Talks, at the New England F# User Group&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;A complete listing of all TechEd talks pertaining to F#.&amp;#160; Thanks Talbott!&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1 align="center"&gt;Articles&lt;/h1&gt;  &lt;h3&gt;&lt;a href="http://programmingzen.com/2010/06/23/how-microsoft-is-changing-the-programming-world/"&gt;Antonio Cangiano’s How Microsoft is changing the programming world.&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The end result of Microsoft’s new approach is that now Joes everywhere are getting exposed to functional programming (masses of people who would otherwise be virtually shielded from the rest of the programming world).&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://gradbot.blogspot.com/2010/06/cartesian-tree-sort.html"&gt;Erik Schulz’s Cartesian Tree Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/insertion-sort.html"&gt;Insertion Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/priority-queue-heap-sort.html"&gt;Priority Queue &amp;amp; Heap Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/heap-sort.html"&gt;Heap Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/selection-sort.html"&gt;Selection Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/quick-sort.html"&gt;Quick Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/gnome-sort.html"&gt;Gnome Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/comb-sort.html"&gt;Comb Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/06/odd-even-sort.html"&gt;Odd-even Sort&lt;/a&gt;, &lt;a href="http://gradbot.blogspot.com/2010/05/cocktail-sort.html"&gt;Cocktail Sort&lt;/a&gt;, and &lt;a href="http://gradbot.blogspot.com/2010/05/bubble-sort.html"&gt;Bubble Sort&lt;/a&gt;.&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Inspired be Wikipedia's algorithm pages I decided to recreate their animations using JavaSrcipt and HTML5 canvas elements. IE 8 does not support canvas however new versions of all other modern browsers do. Mozilla Firefox, Google Chrome, Safari, and Opera.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://laurent.le-brun.eu/site/index.php/2010/06/23/57-fsharp-opengl-a-cross-platform-sample"&gt;Laurent Le Brun’s F# + OpenGL: a cross-platform sample&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The nice thing is that the application was cross-platform. I tried it on Windows, Linux and Mac, it worked everywhere, without changing a single line. It seems like F# is ready to make great cross-platform 3D applications!&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://bloggemdano.blogspot.com/2010/06/f-wpf-mvvm-project-template.html"&gt;Daniel Mohl’s An F# WPF MVVM Project Template&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I've been planning for a while to create an F# WPF MVVM Template to add to the other templates that have been announced on this blog.&amp;#160; A resent post by Mark Pearl provided a great simple example which helped kick me into gear and bring this plan to fruition.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blogs.msdn.com/b/jomo_fisher/archive/2010/06/15/use-fslex-and-fsyacc-to-make-a-parser-in-f.aspx"&gt;Jomo Fisher’s Use FsLex and FsYacc to make a parser in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The starter project implements a simple calculator language that you can grow into a more sophisticated Domain Specific Language or text processing application.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://lepensemoi.free.fr/index.php/2010/06/15/seo-helpers-in-f"&gt;Julien Ortin’s SEO helpers in F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;In this post, we describe how to implement functions that help fetch information that can be used to study how well (or bad) the keywords are used on a given website in comparison with other (successful) competitors.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://techneilogy.blogspot.com/2010/06/flip-operator-for-f.html"&gt;Neil Carrier’s Flip Operator for F#&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I ask again: is there a good native way to do this in F#? If not, it might well worth standardizing this. (And potentially other FORTH-like operators like “over” and “rot,” perhaps with an extensible syntax.)&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.intellifactory.com/blogs/joel.bjornson/2010/6/18/Fun-with-dependent-formlets.article"&gt;Joel Björnson’s Fun with dependent formlets&lt;/a&gt; (in WebSharper)&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;To give some hints of what you can do with the WebSharper formlet library, the objective of the following exercise is to create a simple spread-sheet like widget based on formlets. &lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.intellifactory.com/blogs/joel.bjornson/2010/6/17/More-of-Ext-JS-and-WebSharper.article"&gt;Joel Björnson’s More of Ext JS and WebSharper&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;In general, seamlessly being able to create data abstractions and transfer data back and forth between the server and client is a very strong incentive for using the WebSharper extension.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.intellifactory.com/blogs/joel.bjornson/2010/6/17/Reactive-programming-with-WebSharper.article"&gt;Joel Björnson’s Reactive programming with WebSharper&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;In following post I'd like to highlight F# (and WebSharper) support for asynchronous and reactive programming.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://geekswithblogs.net/MarkPearl/archive/2010/06/23/f-seq.unfold.aspx"&gt;Mark Pearl’s F# Seq.Unfold&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The more I play the more I am really loving F# and how succinct the language is.&amp;#160; Today I thought I would put up a brief post on the Seq.unfold function.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://blog.codingadventure.com/2010/06/21/testing-f/"&gt;Daniel Merino’s Testing F#&lt;/a&gt; (with Traveling Salesmen)&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The next example is a little snippet that returns a dictionary distances between cities for a small distributed traveling salesman problem I did last year to test F# on a software engineering class.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://richardminerich.com/2010/06/love-the-lambda/"&gt;Richard Minerich’s Love the Lambda&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;So the idea for Love the Lambda was born:&amp;#160; I would demonstrate both the usefulness and sheer novelty of first class functions and do so simultaneously in C# and F#.&amp;#160; More than that, I would use the opportunity as a kind of F# omnibus.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;a href="http://www.petehunt.net/blog/?p=15"&gt;Pete Hunt’s F# rocks (so far)&lt;/a&gt;&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;I have to say, I really like F# so far. For those of you not in the know, F# is Microsoft’s new first-class language that has been in development since 2002 but debuted in Visual Studio 2010. It is basically a dialect of O’Caml that runs on .NET and has full Visual Studio support.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+06%2f25%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+06%2f25%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx&amp;amp;title=F%23+Discoveries+This+Week+06%2f25%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+06%2f25%2f2010" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx&amp;amp;;title=F%23+Discoveries+This+Week+06%2f25%2f2010&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.de/cs/blogs/rickm/archive/2010/06/25/f-discoveries-this-week-06-25-2010.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.de/cs/aggbug.aspx?PostID=20848" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/F_2300_+Project+Extender/default.aspx">F# Project Extender</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Fing/default.aspx">Fing</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/FsLex/default.aspx">FsLex</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/FsYacc/default.aspx">FsYacc</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/HuwmanCode/default.aspx">HuwmanCode</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/OpenGL/default.aspx">OpenGL</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Parsers/default.aspx">Parsers</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Reactive+Programming/default.aspx">Reactive Programming</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/SEO/default.aspx">SEO</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/Sorting/default.aspx">Sorting</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/VC2010+Pro+Power+Tools/default.aspx">VC2010 Pro Power Tools</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/VCC/default.aspx">VCC</category><category domain="http://www.atalasoft.de/cs/blogs/rickm/archive/tags/WebSharper/default.aspx">WebSharper</category></item></channel></rss>