<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Re.Mark</title>
	<atom:link href="http://remark.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://remark.wordpress.com</link>
	<description>My Life As A Blog</description>
	<lastBuildDate>Sun, 22 Jan 2012 08:04:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='remark.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Re.Mark</title>
		<link>http://remark.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://remark.wordpress.com/osd.xml" title="Re.Mark" />
	<atom:link rel='hub' href='http://remark.wordpress.com/?pushpress=hub'/>
		<item>
		<title>TF#I Friday #7 Part 2 : In which it still isn&#8217;t Friday</title>
		<link>http://remark.wordpress.com/2011/06/29/tfi-friday-7-part-2-in-which-it-still-isnt-friday/</link>
		<comments>http://remark.wordpress.com/2011/06/29/tfi-friday-7-part-2-in-which-it-still-isnt-friday/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 14:09:39 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/06/29/tfi-friday-7-part-2-in-which-it-still-isnt-friday/</guid>
		<description><![CDATA[Looking at how to call F# from C#, I thought I should share this link.&#160; I have 2 projects in one solution (one in F# and one in C#.)&#160; The C# project (a console application) references the F# project (a library) and that works.&#160; Doesn’t do anything useful yet, but one step at a time…<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=492&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Looking at how to call F# from C#, I thought I should share <a href="http://geekswithblogs.net/MarkPearl/archive/2010/03/02/getting-f-and-c-to-talk.aspx">this link</a>.&#160; I have 2 projects in one solution (one in F# and one in C#.)&#160; The C# project (a console application) references the F# project (a library) and that works.&#160; Doesn’t do anything useful yet, but one step at a time…</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=492&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/06/29/tfi-friday-7-part-2-in-which-it-still-isnt-friday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #7 : In which it isn&#8217;t really Friday but there is some F#</title>
		<link>http://remark.wordpress.com/2011/06/29/tfi-friday-7-in-which-it-isnt-really-friday-but-there-is-some-f/</link>
		<comments>http://remark.wordpress.com/2011/06/29/tfi-friday-7-in-which-it-isnt-really-friday-but-there-is-some-f/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 10:45:40 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/06/29/tfi-friday-7-in-which-it-isnt-really-friday-but-there-is-some-f/</guid>
		<description><![CDATA[After my simple start to an anagram solver in C#, I have a simple equivalent in F#: let generateKey (chars : char[]) = new string(chars) let lookup = words &#124;&#62; Seq.groupBy(fun x -&#62; generateKey(x.ToCharArray() &#124;&#62; Array.sort))   The lookup function expects a list of strings.  It works – although I’ve only tried it with fairly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=487&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After my simple start to an anagram solver in C#, I have a simple equivalent in F#:</p>
<pre style="background-color:#ffffff;width:100%;">let generateKey (chars : char[]) = new string(chars)</pre>
<pre style="background-color:#ffffff;width:100%;">let lookup =  words |&gt; Seq.groupBy(fun x -&gt; generateKey(x.ToCharArray() |&gt; Array.sort))
 
</pre>
<p>The <span style="font-family:Consolas;">lookup</span> function expects a list of strings.  It works – although I’ve only tried it with fairly short lists of words.  Next exercise is to try calling this (or something like it) from C#.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/487/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=487&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/06/29/tfi-friday-7-in-which-it-isnt-really-friday-but-there-is-some-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #6 : In which I write no F# at all</title>
		<link>http://remark.wordpress.com/2011/05/27/tfi-friday-6-in-which-i-write-no-f-at-all/</link>
		<comments>http://remark.wordpress.com/2011/05/27/tfi-friday-6-in-which-i-write-no-f-at-all/#comments</comments>
		<pubDate>Fri, 27 May 2011 16:31:36 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/05/27/tfi-friday-6-in-which-i-write-no-f-at-all/</guid>
		<description><![CDATA[I’ve been spending a little time recently writing a simple Windows Phone 7 app and I’ve been impressed with how easy it has been.&#160; I’ve been thinking of writing an anagram solver as an exercise in F# – and it might make for another simple phone app – so I thought I’d start with a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=486&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’ve been spending a little time recently writing a <a href="http://social.zune.net/redirect?type=phoneApp&amp;id=840f0278-1586-e011-986b-78e7d1fa76f8">simple Windows Phone 7 app</a> and I’ve been impressed with how easy it has been.&#160; I’ve been thinking of writing an anagram solver as an exercise in F# – and it might make for another simple phone app – so I thought I’d start with a few simple steps.</p>
<p>The first step is to try (part of) a potential solution – given a list of words, group the words by the constituent letters (so that, for instance, horse and shore would be grouped together.)&#160; That way, I won’t have to try every single combination of letters and compare against a list of words.&#160; My intention this week was to write a simple program in C# to do this.&#160; Here’s the method that does the work:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">private</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, List&lt;<span style="color:#0000ff;">string</span>&gt;&gt; ProcessWordList(<span style="color:#0000ff;">string</span>[] words)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">{
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    Dictionary&lt;<span style="color:#0000ff;">string</span>, List&lt;<span style="color:#0000ff;">string</span>&gt;&gt; result = <span style="color:#0000ff;">new</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, List&lt;<span style="color:#0000ff;">string</span>&gt;&gt;();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">string</span> word <span style="color:#0000ff;">in</span> words)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        IOrderedEnumerable&lt;<span style="color:#0000ff;">char</span>&gt; ordered = from <span style="color:#0000ff;">char</span> a <span style="color:#0000ff;">in</span> word.ToCharArray()
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                                           orderby a
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                                           select a;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">string</span> orderedString = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">string</span>(ordered.ToArray());
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">if</span> (result.ContainsKey(orderedString))
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">           result[orderedString].Add(word);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">else</span>
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            List&lt;<span style="color:#0000ff;">string</span>&gt; list = <span style="color:#0000ff;">new</span> List&lt;<span style="color:#0000ff;">string</span>&gt;();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            list.Add(word);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            result.Add(orderedString, list);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">return</span> result;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">}</pre>
<p>Next exercise is either to extend the program towards solving anagrams or to write the method above in F#.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/486/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=486&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/05/27/tfi-friday-6-in-which-i-write-no-f-at-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #5 : In which I return to C# for a bit</title>
		<link>http://remark.wordpress.com/2011/03/25/tfi-friday-5-in-which-i-return-to-c-for-a-bit/</link>
		<comments>http://remark.wordpress.com/2011/03/25/tfi-friday-5-in-which-i-return-to-c-for-a-bit/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 16:43:38 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/03/25/tfi-friday-5-in-which-i-return-to-c-for-a-bit/</guid>
		<description><![CDATA[In my last post I counted some words using F#, which turned out to require a single, simple line of F#.&#160; When I’d done the same thing before in C# i had iterated over the words and kept a count as I went, which is a typically imperative approach.&#160; So, I wondered if you could [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=484&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my last post <a href="http://remark.wordpress.com/2011/03/04/tfi-friday-4-in-which-i-count-some-words/">I counted some words using F#</a>, which turned out to require a single, simple line of F#.&#160; When I’d done the <a href="http://blogs.msdn.com/b/ukmsdn/archive/2011/02/22/featured-article-pex-and-visual-studio.aspx">same thing before in C#</a> i had iterated over the words and kept a count as I went, which is a typically imperative approach.&#160; So, I wondered if you could apply the functional approach to C# &#8211; perhaps using LINQ.&#160; Turns out you can. </p>
<p>Firstly, it’s helpful to have some words to count.&#160; Here’s a simple approach:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">string</span> test = &quot;<span style="color:#8b0000;">The cat sat on the mat.</span>&quot;;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">string</span>[] words = test.Split(' ');</pre>
<p>(In F# I populated a list of words directly, so there’s an extra line of C# here – largely because I started with my previous C# code.)&#160; Right, now to the counting in one line:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">var result = from word <span style="color:#0000ff;">in</span> words
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">             let strippedWord = StripPunctuation(word).ToLower()
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">             where strippedWord.Length &gt; 0
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">             group word by strippedWord into grouped
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">             select <span style="color:#0000ff;">new</span> { Word = grouped.Key, Count = grouped.Count() };</pre>
<p>You&#160; may have noticed a call to <font face="Consolas">StripPunctuation</font> – a utility function I had in my previous C# code.&#160; Here it is (declared <font face="Consolas">static</font> as I was running it in a console application:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> StripPunctuation(<span style="color:#0000ff;">string</span> word)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">{
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">string</span> result = word;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">if</span> (result.Length &gt; 0)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">if</span> (<span style="color:#0000ff;">char</span>.IsPunctuation(result[0]))
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            result = result.TrimStart(result[0]);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">if</span> (result.Length &gt; 0)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            <span style="color:#0000ff;">if</span> (<span style="color:#0000ff;">char</span>.IsPunctuation(result[result.Length - 1]))
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                result = result.TrimEnd(result[result.Length - 1]);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">return</span> result;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">}</pre>
<p>And now, with a little sprinkling of dynamic capability, outputting the results to the console:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">foreach</span> (dynamic entry <span style="color:#0000ff;">in</span> result)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">{
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    Console.WriteLine(&quot;<span style="color:#8b0000;">{0}\t{1}</span>&quot;, entry.Word, entry.Count);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">}</pre>
<p>So it is possible to apply the more functional approach courtesy of LINQ, although there’s still more code than I had in F#.&#160; The C# is doing a couple of extra things (it strips out punctuation and is case insensitive) &#8211; but the point isn’t really the comparison between the two examples so much as the fact that by grasping some functional concepts can result in a change to your C# – which is a good reason to learn some F#.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=484&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/03/25/tfi-friday-5-in-which-i-return-to-c-for-a-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #4 : In which I count some words</title>
		<link>http://remark.wordpress.com/2011/03/04/tfi-friday-4-in-which-i-count-some-words/</link>
		<comments>http://remark.wordpress.com/2011/03/04/tfi-friday-4-in-which-i-count-some-words/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 16:09:24 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/03/04/tfi-friday-4-in-which-i-count-some-words/</guid>
		<description><![CDATA[For a recent MSDN Flash article I wrote some simple code to calculate word frequency in C#.&#160; As I get to grips with F#, I’m learning that the most rewarding but also the most difficult aspect is to think in a more functional way.&#160; To count words in an imperative style (as I did in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=483&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For <a href="http://blogs.msdn.com/b/ukmsdn/archive/2011/02/22/featured-article-pex-and-visual-studio.aspx">a recent MSDN Flash article I wrote</a> some simple code to calculate word frequency in C#.&#160; As I get to grips with F#, I’m learning that the most rewarding but also the most difficult aspect is to think in a more functional way.&#160; To count words in an imperative style (as I did in my C# example) I would iterate through a collection of words and keep a running count.&#160; And, of course, you could write code in F# to do that.&#160; But what would be the point?&#160; How about approaching it in a different fashion?&#160; So, with those questions in mind, I fired up Visual Studio and went about trying to bend my brain into a more F# like shape.&#160; One of the things I like about F# is F# Interactive &#8211; a REPL which makes trying out and learning F# (as well as prototyping) easy &#8211; so that was where I started.&#160; First thing I needed to do was to create a list of words (since at this stage I’m concerned simply with calculating frequency and not reading files or strings.)&#160; It’s fairly simple to do that in F#:</p>
<p><font face="Consolas">let words = [&quot;the&quot;; &quot;cat&quot;; &quot;sat&quot;; &quot;on&quot;; &quot;the&quot;; &quot;mat&quot;];;</font></p>
<p>(the double semicolons are signal to F# Interactive the completion of a statement.)&#160; After reading a bit about processing sequences in F#, I spotted that there is a function to count elements in a list – it can easily be used against the whole list like this:</p>
<p><font face="Consolas">let count = words |&gt; Seq.countBy(fun x -&gt; x);;</font></p>
<p>The <font face="Consolas">countBy</font> function takes a function to generate a key – in this case we can use each individual word.&#160; To see if that has worked, we can print out the contents of the result:</p>
<p><font face="Consolas">printfn &quot;%A&quot; count;;</font></p>
<p>And in this case, I got the following result:</p>
<p><font face="Consolas">seq [(&quot;the&quot;, 2); (&quot;cat&quot;, 1); (&quot;sat&quot;, 1); (&quot;on&quot;, 1); ...]     <br />val it : unit = ()</font></p>
<p>Which means it worked as intended.&#160; There’s work to be done to make it the equivalent of the C# code, but the core counting is implemented in one line of code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/483/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=483&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/03/04/tfi-friday-4-in-which-i-count-some-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #3 : Still getting started</title>
		<link>http://remark.wordpress.com/2011/02/11/tfi-3-still-getting-started/</link>
		<comments>http://remark.wordpress.com/2011/02/11/tfi-3-still-getting-started/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 17:57:17 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/02/11/tfi-3-still-getting-started/</guid>
		<description><![CDATA[After mentioning in my last post that my initial exposure to F# was negative, I’ve just had a similar reaction looking around the web.  I think that’s because there’s two things to learn – the functional paradigm and a new syntax – and many of he posts out there assume that you’re familiar with at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=478&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After mentioning in <a href="http://remark.wordpress.com/2011/01/07/tfi-friday-2-getting-started/">my last post</a> that my initial exposure to F# was negative, I’ve just had a similar reaction looking around the web.  I think that’s because there’s two things to learn – the functional paradigm and a new syntax – and many of he posts out there assume that you’re familiar with at least one of the two.  Which is why of the two books I mentioned before, I prefer <a href="http://www.amazon.co.uk/Real-World-Functional-Programming-Examples/dp/1933988924/">Functional Programming</a> – it gives examples in both C# and F#, which means you can separate the paradigm from the syntax and still learn about both.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/478/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=478&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/02/11/tfi-3-still-getting-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #2 : Getting started</title>
		<link>http://remark.wordpress.com/2011/01/07/tfi-friday-2-getting-started/</link>
		<comments>http://remark.wordpress.com/2011/01/07/tfi-friday-2-getting-started/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 17:50:07 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2011/01/07/tfi-friday-2-getting-started/</guid>
		<description><![CDATA[My initial introduction to F# was effective.&#160; Unfortunately, the effect it had was to convince me that I should never learn F#.&#160; And so I stayed away from the language for a couple of years until its inclusion in Visual Studio 2010 reawakened my interest.&#160;&#160; I’m glad I’ve gone back to learning about F#, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=477&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My initial introduction to F# was effective.&#160; Unfortunately, the effect it had was to convince me that I should never learn F#.&#160; And so I stayed away from the language for a couple of years until its inclusion in Visual Studio 2010 reawakened my interest.&#160;&#160; I’m glad I’ve gone back to learning about F#, but it does make you realise that the first few minutes with a new language or technology are crucial.</p>
<p>So, this time around, I decided to go back to my tried and trusted method which consists simply of reading and experimenting.&#160; In support of which I bought a couple of books: <a href="http://www.amazon.co.uk/Programming-F-Chris-Smith/dp/0596153643/">Programming F#</a> and <a href="http://www.amazon.co.uk/Real-World-Functional-Programming-Examples/dp/1933988924/">Functional Programming</a>.&#160; Other books are available.&#160; As for online resources, I tend to read articles that are suggested via the maelstrom of near real time social online noise-makers or search for relevant stuff.&#160; However, there’s a few links worth noting as good starting places:</p>
<p><a href="http://msdn.microsoft.com/en-gb/fsharp">F# Developer Centre</a></p>
<p><a href="http://blogs.msdn.com/b/dsyme/">Don Syme’s blog</a></p>
<p><a href="http://tomasp.net/blog/">Tomas Petricek’s blog</a></p>
<p><a href="http://cs.hubfs.net/forums/default.aspx">hubFS forums</a></p>
<p>Of course, you’ll find your own places and resources as I’m sure I will as the journey continues.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/477/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/477/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/477/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/477/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/477/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/477/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/477/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/477/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=477&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2011/01/07/tfi-friday-2-getting-started/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>TF#I Friday #1 : The f#un starts here</title>
		<link>http://remark.wordpress.com/2010/12/03/tfi-friday-1/</link>
		<comments>http://remark.wordpress.com/2010/12/03/tfi-friday-1/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 17:35:55 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Languages]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2010/12/03/tfi-friday-1/</guid>
		<description><![CDATA[A while ago I started a series of blog posts called Ruby Tuesday in attempt to get better acquainted with Ruby.  Over time, I ended up spending more and more time with Python.  And then .NET 4 introduced the DLR and the dynamic type to C#.  It felt like I’d learned what I set out [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=473&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A while ago I started a series of blog posts called Ruby Tuesday in attempt to get better acquainted with Ruby.  Over time, I ended up spending more and more time with Python.  And then .NET 4 introduced the DLR and the dynamic type to C#.  It felt like I’d learned what I set out to learn and it was time to embark on learning another language.  I’d been scared off F# in a presentation a few years ago, but I’m interested in languages that do things differently, that encourage me to think about problems in a different way so the curiosity remained alive.   Functional programming offers a different approach from imperative programming and F# is a .NET Language &#8211; and a first class citizen in Visual Studio 2010.   Decision made.  I’ve started to learn a little about F# and recently wrote a <a href="http://blogs.msdn.com/b/ukmsdn/archive/2010/12/01/a-brief-introduction-to-f.aspx">short introduction to F#</a> for the current edition of the MSDN newsletter, which prompted the thought that maybe I should start a series of F# posts to help me continue the journey.  This is the initial post (and, who knows, quite possibly the last) in that series.  Should be a fun ride.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/473/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=473&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2010/12/03/tfi-friday-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic Football Stats</title>
		<link>http://remark.wordpress.com/2010/06/17/dynamic-football-stats/</link>
		<comments>http://remark.wordpress.com/2010/06/17/dynamic-football-stats/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 11:41:18 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2010/06/17/dynamic-football-stats/</guid>
		<description><![CDATA[A couple of days ago I noticed that The Guardian had made data about the England vs USA game that took place last week available.&#160; I downloaded the data (which is in a Google Apps spreadsheet) and saved each sheet as a CSV file. Originally, I intended to read the data with IronPython.&#160; Reading CSV [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=472&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I noticed that <a href="http://www.guardian.co.uk/">The Guardian</a> had made <a href="http://www.guardian.co.uk/news/datablog/2010/jun/14/england-v-usa-world-cup-match-data-opta">data about the England vs USA game</a> that took place last week available.&#160; I downloaded the data (which is in a Google Apps spreadsheet) and saved each sheet as a CSV file.</p>
<p>Originally, I intended to read the data with IronPython.&#160; Reading CSV data with Python is very simple – there’s a <a href="http://docs.python.org/library/csv.html">built in CSV module</a>.&#160; However, this module is written in C, which means it’s not available in IronPython – see <a href="http://docs.python.org/library/csv.html">here</a> for more info.&#160; There is aproject called <a href="http://code.google.com/p/ironclad/">IronClad</a> that allows Python modules written in C to be used from IronPython.&#160; At the moment, it’s built against .NET 2, which means that I could get it to work in .NET 2, but I had plans to use .NET 4 and the dynamic support in C#.&#160;&#160; Time for another approach.</p>
<p>Using the <a href="http://www.codeproject.com/KB/database/CsvReader.aspx">CsvReader</a> class,it’s easy to access the data in a CSV file.&#160; I started with the Player Summaries sheet.&#160; To make this dynamic (and, therefore, useful for each of these sheets and, potentially, other as yet unknown sheets) I created a class to hold each row of data.&#160; Here it is:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> DynamicDataObject : DynamicObject
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">{
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">readonly</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, dynamic&gt; data;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">public</span> DynamicDataObject(Dictionary&lt;<span style="color:#0000ff;">string</span>, dynamic&gt; data)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">this</span>.data = data;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">bool</span> TryGetMember(GetMemberBinder binder, <span style="color:#0000ff;">out</span> <span style="color:#0000ff;">object</span> result)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        result = data[binder.Name];
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">return</span> (result != <span style="color:#0000ff;">null</span>);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">}</pre>
<p>By inheriting from DynamicObject, it will be possible to call this class dynamically – meaning that I can use the names of the data fields as defined properties on the class.&#160; Next I created a DataReader class that reads the data from the CSV file and stores it as an IEnumerable&lt;DynamicDataObject&gt;.&#160; Here’s that class:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> DataReader : IEnumerable&lt;DynamicDataObject&gt;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">{
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">readonly</span> List&lt;DynamicDataObject&gt; dataList;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">public</span> DataReader(<span style="color:#0000ff;">string</span> filename)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">this</span>.dataList = <span style="color:#0000ff;">new</span> List&lt;DynamicDataObject&gt;();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">using</span> (StreamReader streamReader = <span style="color:#0000ff;">new</span> StreamReader(filename))
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            <span style="color:#0000ff;">using</span> (CsvReader reader = <span style="color:#0000ff;">new</span> CsvReader(streamReader, <span style="color:#0000ff;">true</span>))
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                <span style="color:#0000ff;">string</span>[] headers = reader.GetFieldHeaders();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt; cleanHeaders = CleanHeaders(headers);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                <span style="color:#0000ff;">while</span> (reader.ReadNextRecord())
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                    Dictionary&lt;<span style="color:#0000ff;">string</span>, dynamic&gt; data = <span style="color:#0000ff;">new</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, dynamic&gt;();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                    <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">string</span> header <span style="color:#0000ff;">in</span> headers)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        <span style="color:#0000ff;">int</span> result;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        dynamic <span style="color:#0000ff;">value</span>;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        <span style="color:#0000ff;">if</span> (<span style="color:#0000ff;">int</span>.TryParse(reader[header],  <span style="color:#0000ff;">out</span> result))
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                            <span style="color:#0000ff;">value</span> = result;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        <span style="color:#0000ff;">else</span>
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                            <span style="color:#0000ff;">value</span> = reader[header];
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                        data.Add(cleanHeaders[header], <span style="color:#0000ff;">value</span>);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                    <span style="color:#0000ff;">this</span>.dataList.Add(<span style="color:#0000ff;">new</span> DynamicDataObject(data));
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">private</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt; CleanHeaders(<span style="color:#0000ff;">string</span>[] headers)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt; result = <span style="color:#0000ff;">new</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt;();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">foreach</span> (<span style="color:#0000ff;">string</span> header <span style="color:#0000ff;">in</span> headers)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            <span style="color:#0000ff;">string</span> cleanheader = header.Replace(' ', '_');
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            cleanheader = cleanheader.Split('(')[0];
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">            result.Add(header, cleanheader);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">return</span> result;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    #region IEnumerable&lt;DynamicDataObject&gt; Members
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">public</span> IEnumerator&lt;DynamicDataObject&gt; GetEnumerator()
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">this</span>.dataList.GetEnumerator();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    #endregion
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    #region IEnumerable Members
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">this</span>.dataList.GetEnumerator();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    #endregion
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">}</pre>
<p>There’s a couple of things worth pointing out.&#160; The first is that I’ve cleaned up the field names so that they can be used in code (by replacing spaces with underscores and removing anything in brackets).&#160; The second is that if a value is an integer, I’m storing it as an integer.&#160; I’m storing these values of type dynamic, which will come in handy when we want to query the data.</p>
<p>Speaking of querying that data, I wanted to use LINQ.&#160; Here’s some simple code I wrote in a console application to try it out:</p>
<pre></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"><span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> Main(<span style="color:#0000ff;">string</span>[] args)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">{
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    DataReader reader = <span style="color:#0000ff;">new</span> DataReader(@&quot;<span style="color:#8b0000;">C:\Users\Mark\Downloads\Eng-USA Data\Player Summaries.csv</span>&quot;);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    var result = from dynamic player <span style="color:#0000ff;">in</span> reader
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                 where player.Goals &gt; 0
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">                 select player;
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    <span style="color:#0000ff;">foreach</span> (dynamic player <span style="color:#0000ff;">in</span> result)
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    {
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">        Console.WriteLine(player.Player_Name + &quot;<span style="color:#8b0000;"> - </span>&quot; + player.Goals + &quot;<span style="color:#8b0000;"> goals</span>&quot;);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    }
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;"></pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    Console.WriteLine(&quot;<span style="color:#8b0000;">Press any key to exit...</span>&quot;);
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">    Console.ReadKey();
</pre>
<pre style="background-color:#ffffff;width:100%;font-family:consolas,&#039;font-size:12px;margin:0;">}</pre>
<p>And here’s the output:</p>
<p><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://remark.files.wordpress.com/2010/06/image.png?w=224&#038;h=75" width="224" height="75" /> </p>
<p>By using the dynamic support in C#, the LINQ query just works and I can reference properties dynamically without having to create a class specifically for each sheet of data.&#160; It’s important in the LINQ query to declare the player of type dynamic – otherwise C# will revert to its statically typed ways and inform you that the Goals property doesn’t exist, which, given that it only exists at runtime, is correct.&#160; Now I can analyse the data easily.&#160; Doesn’t change the result though…</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/472/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=472&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2010/06/17/dynamic-football-stats/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>

		<media:content url="http://remark.files.wordpress.com/2010/06/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Occasionally Connected Silverlight Applications</title>
		<link>http://remark.wordpress.com/2010/06/08/occasionally-connected-silverlight-applications/</link>
		<comments>http://remark.wordpress.com/2010/06/08/occasionally-connected-silverlight-applications/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 09:01:40 +0000</pubDate>
		<dc:creator>remark</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[MSArchitectPortal]]></category>

		<guid isPermaLink="false">https://remark.wordpress.com/2010/06/08/occasionally-connected-silverlight-applications/</guid>
		<description><![CDATA[Earlier this year, Dr Dave and I worked on a Proof of Concept with Trader Media (probably most famous for Autotrader) and Fortune Cookie.&#160; You can read more about the project here.&#160;&#160; The application needed to be able to cope with being disconnected some of the time.&#160; Dr Dave and I took what we learned [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=470&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Earlier this year, <a href="http://drdave.co.uk/blog/">Dr Dave</a> and I worked on a Proof of Concept with Trader Media (probably most famous for Autotrader) and Fortune Cookie.&#160; You can read more about the project <a href="http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000007511">here</a>.&#160;&#160; The application needed to be able to cope with being disconnected some of the time.&#160; Dr Dave and I took what we learned from this aspect of the project and wrote an article for MSDN Magazine, which you can read <a href="http://bit.ly/a6cf1i">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/remark.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/remark.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/remark.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/remark.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/remark.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/remark.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/remark.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/remark.wordpress.com/470/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=remark.wordpress.com&amp;blog=100616&amp;post=470&amp;subd=remark&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://remark.wordpress.com/2010/06/08/occasionally-connected-silverlight-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c6beed77324fea14990c07a16232add?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">remark</media:title>
		</media:content>
	</item>
	</channel>
</rss>
