<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon on Software</title>
	<atom:link href="http://si-w.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://si-w.co.uk/blog</link>
	<description>Occasional thoughts on .net development. In particular C#, UI Patterns, Agile practices and software development in general</description>
	<lastBuildDate>Mon, 26 May 2014 20:01:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.7.29</generator>
	<item>
		<title>WPF &#8211; pass multiple parameters to a Command</title>
		<link>http://si-w.co.uk/blog/2014/05/26/wpf-pass-multiple-parameters-to-a-command/</link>
		<pubDate>Mon, 26 May 2014 20:00:50 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=372</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><script src="https://gist.github.com/smwhit/aea23e1e4d85c03792fd.js"></script></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F&amp;title=WPF+-+pass+multiple+parameters+to+a+Command" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F&amp;title=WPF+-+pass+multiple+parameters+to+a+Command" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F&amp;title=WPF+-+pass+multiple+parameters+to+a+Command" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F&amp;headline=WPF+-+pass+multiple+parameters+to+a+Command" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=WPF+-+pass+multiple+parameters+to+a+Command&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=WPF+-+pass+multiple+parameters+to+a+Command&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=WPF+-+pass+multiple+parameters+to+a+Command&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=WPF+-+pass+multiple+parameters+to+a+Command&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=WPF+-+pass+multiple+parameters+to+a+Command&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F&amp;title=WPF+-+pass+multiple+parameters+to+a+Command&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F26%2Fwpf-pass-multiple-parameters-to-a-command%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>Linq &#8211; difference of two collections</title>
		<link>http://si-w.co.uk/blog/2014/05/20/linq-difference-of-two-collections/</link>
		<pubDate>Tue, 20 May 2014 18:57:09 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=369</guid>
		<description><![CDATA[I&#8217;ve recently worked on some ETL tasks where there is a requirement to to show what has changed between different versions of datasets. LINQ and a custom IEqualityComparer eats this problem for breakfast:]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve recently worked on some ETL tasks where there is a requirement to to show what has changed between different versions of datasets. LINQ and a custom <code>IEqualityComparer</code> eats this problem for breakfast:</p>
<p><script src="https://gist.github.com/smwhit/ce078e4e683246113cb2.js"></script></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F&amp;title=Linq+-+difference+of+two+collections" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F&amp;title=Linq+-+difference+of+two+collections" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F&amp;title=Linq+-+difference+of+two+collections" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F&amp;headline=Linq+-+difference+of+two+collections" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Linq+-+difference+of+two+collections&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Linq+-+difference+of+two+collections&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Linq+-+difference+of+two+collections&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Linq+-+difference+of+two+collections&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Linq+-+difference+of+two+collections&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F&amp;title=Linq+-+difference+of+two+collections&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F05%2F20%2Flinq-difference-of-two-collections%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>Streaming data with WCF</title>
		<link>http://si-w.co.uk/blog/2014/03/06/streaming-data-with-wcf/</link>
		<pubDate>Thu, 06 Mar 2014 21:20:22 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=359</guid>
		<description><![CDATA[WCF defaults to buffering the entire message before transmitting. It is possible to stream your data so data can start to be processed on the server or client before it entirely transmitted. Comprehensive documentation can be found on Set server &#8230; <a href="http://si-w.co.uk/blog/2014/03/06/streaming-data-with-wcf/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>WCF defaults to buffering the entire message before transmitting. It is possible to stream your data so data can start to be processed on the server or client before it entirely transmitted.</p>
<p>Comprehensive documentation can be found on <a href="http://msdn.microsoft.com/en-us/library/ms733742(v=vs.110).aspx" title="MSDN" target="_blank"></a></p>
<p>Set server app.config to be:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;bindings&gt;
   &lt;netTcpBinding&gt;
      &lt;binding name=&quot;customNetTcpBinding&quot;
               maxBufferSize=&quot;200000000&quot;
               maxReceivedMessageSize=&quot;200000000&quot;
               transferMode=&quot;Streamed&quot;&gt;
      &lt;/binding&gt;
    &lt;/netTcpBinding&gt;
&lt;/bindings&gt;
</pre>
<p>The above should allow files of up to about 190mb to be streamed.</p>
<p>The key attribute is:</p>
<pre class="brush: plain; title: ; notranslate">
 transferMode=&quot;Streamed&quot; - default is buffered
</pre>
<p>The client config required is.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;bindings&gt;
   &lt;netTcpBinding&gt;
      &lt;binding name=&quot;NetTcpBinding_IFileUpload&quot; transferMode=&quot;Streamed&quot; /&gt;
   &lt;/netTcpBinding&amp;gt;
&lt;/bindings&gt;
</pre>
<p>For a complete example, our response type definition:</p>
<pre class="brush: csharp; title: ; notranslate">
public class UploadFileResponse
{
   public string Message { get; set; }
}
</pre>
<p>Service interface:</p>
<pre class="brush: csharp; title: ; notranslate">
[ServiceContract]
public interface IFileUpload
{
   [OperationContract]
   UploadFileResponse UploadFileViaStream(Stream fileStream);
}
</pre>
<p>Service class implementation:</p>
<pre class="brush: csharp; title: ; notranslate">
public class FileUploadService : IFileUpload
{
   public UploadFileResponse UploadFileViaStream(Stream stream)
   {
      var response = new UploadFileResponse();

      using (var fileStream = File.Create(&quot;teststream&quot;))
      {
         stream.CopyTo(fileStream);
      }

      response.Message = &quot;Successfully completed&quot;;
      return response;
   }
}
</pre>
<p>And if we look at Microsoft Service Trace Viewer we can see that it is indeed streaming our data:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;E2ETraceEvent xmlns=&quot;http://schemas.microsoft.com/2004/06/E2ETraceEvent&quot;&gt;
	&lt;System xmlns=&quot;http://schemas.microsoft.com/2004/06/windows/eventlog/system&quot;&gt;
		&lt;EventID&gt;0&lt;/EventID&gt;
			&lt;Type&gt;3&lt;/Type&gt;
			&lt;SubType Name=&quot;Information&quot;&gt;0&lt;/SubType&gt;
			&lt;Level&gt;8&lt;/Level&gt;
			&lt;TimeCreated SystemTime=&quot;2014-03-06T18:17:25.8188503Z&quot; /&gt;
			&lt;Source Name=&quot;System.ServiceModel.MessageLogging&quot; /&gt;
			&lt;Correlation ActivityID=&quot;{00000000-0000-0000-0000-000000000000}&quot; /&gt;
			&lt;Execution ProcessName=&quot;WCFLargeFileAPI.vshost&quot; ProcessID=&quot;2984&quot; ThreadID=&quot;11&quot; /&gt;
			&lt;Channel /&gt;
	&lt;/System&gt;
&lt;ApplicationData&gt;
&lt;TraceData&gt;
	&lt;DataItem&gt;
		&lt;MessageLogTraceRecord Time=&quot;2014-03-06T18:17:25.8188503+00:00&quot; Source=&quot;ServiceLevelReceiveRequest&quot; Type=&quot;System.ServiceModel.Channels.StreamedMessage&quot; xmlns=&quot;http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace&quot;&gt;
		&lt;s:Envelope xmlns:s=&quot;http://www.w3.org/2003/05/soap-envelope&quot; xmlns:a=&quot;http://www.w3.org/2005/08/addressing&quot;&gt;
			&lt;s:Header&gt;
				&lt;a:Action s:mustUnderstand=&quot;1&quot;&gt;http://tempuri.org/IFileUpload/UploadFileViaStream&lt;/a:Action&gt;
				&lt;a:MessageID&gt;urn:uuid:7e9efd61-3868-481c-ab5d-17c19f93526a&lt;/a:MessageID&gt;
				&lt;a:ReplyTo&gt;
				&lt;a:Address&gt;http://www.w3.org/2005/08/addressing/anonymous&lt;/a:Address&gt;
			&lt;/a:ReplyTo&gt;
			&lt;VsDebuggerCausalityData xmlns=&quot;http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink&quot;&lt;uIDPo1d4u3tgmU9MjjApxUoHeD8AAAAABU27dsajsEGNM7x3QCkSz7rxDZ3MpsRFrpqvfafNFOAACQAA&lt;/VsDebuggerCausalityData&gt;
			&lt;a:To s:mustUnderstand=&quot;1&quot;&gt;net.tcp://localhost:7891/&lt;a:To&gt;
			&lt;/s:Header&gt;
		&lt;s:Body&gt;... stream ...&lt;/s:Body&gt;
		&lt;/s:Envelope&gt;
		&lt;/MessageLogTraceRecord&gt;
	&lt;/DataItem&gt;
&lt;/TraceData&gt;
&lt;/ApplicationData&gt;
&lt;/E2ETraceEvent&gt;
</pre>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F&amp;title=Streaming+data+with+WCF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F&amp;title=Streaming+data+with+WCF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F&amp;title=Streaming+data+with+WCF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F&amp;headline=Streaming+data+with+WCF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Streaming+data+with+WCF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Streaming+data+with+WCF&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Streaming+data+with+WCF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Streaming+data+with+WCF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Streaming+data+with+WCF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F&amp;title=Streaming+data+with+WCF&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F06%2Fstreaming-data-with-wcf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>How to setup a MetaDataExchange endpoint with a WCF net.tcp binding</title>
		<link>http://si-w.co.uk/blog/2014/03/05/how-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding/</link>
		<comments>http://si-w.co.uk/blog/2014/03/05/how-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding/#comments</comments>
		<pubDate>Wed, 05 Mar 2014 19:26:04 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=346</guid>
		<description><![CDATA[Create a host application, such as a Console Application for easy testing Add a reference to System.ServiceModel Add a service interface such as : Add a service implementation : Host the service as you wish: And a minimal app.config file &#8230; <a href="http://si-w.co.uk/blog/2014/03/05/how-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Create a host application, such as a Console Application for easy testing</p>
<p>Add a reference to System.ServiceModel</p>
<p>Add a service interface such as :</p>
<pre class="brush: csharp; title: ; notranslate"> 
[ServiceContract]     
public interface IHelloWorldService     
{         
    [OperationContract]         
    string SayHello(string to);     
} 
</pre>
<p>Add a service implementation :</p>
<pre class="brush: csharp; title: ; notranslate">
public class HelloWorldService : IHelloWorldService
{
    public string SayHello(string to)
    {
       return string.Format(&amp;quot;Hello, {0}!&amp;quot;, to);
    }
}
</pre>
<p>Host the service as you wish:</p>
<pre class="brush: csharp; title: ; notranslate">
class Program
{
    static void Main(string[] args)
    {
        var host = new ServiceHost(typeof(HelloWorldService));
        host.Open();
        Console.WriteLine(&amp;quot;Press any key to close&amp;quot;);
            Console.ReadKey(true);
            host.Close();
        }
    }
</pre>
<p>And a minimal app.config file where all the magic happens:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;configuration&gt;
    &lt;startup&gt; 
        &lt;supportedRuntime version=&quot;v4.0&quot; sku=&quot;.NETFramework,Version=v4.5&quot; /&gt;
    &lt;/startup&gt;
  &lt;system.serviceModel&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name=&quot;MexBehaviour&quot;&gt;
          &lt;serviceMetadata httpGetEnabled=&quot;false&quot; /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;services&gt;
      &lt;service behaviorConfiguration=&quot;MexBehaviour&quot; name=&quot;Server.HelloWorldService&quot;&gt;
        &lt;endpoint address=&quot;&quot; binding=&quot;netTcpBinding&quot;
            contract=&quot;Server.IHelloWorldService&quot; /&gt;
        &lt;endpoint address=&quot;mex&quot; binding=&quot;mexTcpBinding&quot; bindingConfiguration=&quot;&quot;
            contract=&quot;IMetadataExchange&quot; /&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress=&quot;net.tcp://localhost:7891&quot; /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
      &lt;/service&gt;
    &lt;/services&gt;
  &lt;/system.serviceModel&gt;
&lt;/configuration&gt;
</pre>
<p>And it works:</p>
<p><a href="http://si-w.co.uk/blog/wp-content/uploads/2014/03/WCFTestClient1.png"><img src="http://si-w.co.uk/blog/wp-content/uploads/2014/03/WCFTestClient1.png" alt="WCFTestClient" width="1214" height="770" class="alignnone size-full wp-image-357" srcset="http://si-w.co.uk/blog/wp-content/uploads/2014/03/WCFTestClient1.png 1214w, http://si-w.co.uk/blog/wp-content/uploads/2014/03/WCFTestClient1-300x190.png 300w, http://si-w.co.uk/blog/wp-content/uploads/2014/03/WCFTestClient1-1024x649.png 1024w" sizes="(max-width: 1214px) 100vw, 1214px" /></a></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F&amp;title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F&amp;title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F&amp;title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F&amp;headline=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F&amp;title=How+to+setup+a+MetaDataExchange+endpoint+with+a+WCF+net.tcp+binding&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F03%2F05%2Fhow-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://si-w.co.uk/blog/2014/03/05/how-to-setup-a-metadataexchange-endpoint-with-a-wcf-net-tcp-binding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Showing a TextBox Watermark in WPF</title>
		<link>http://si-w.co.uk/blog/2014/02/05/showing-a-textbox-watermark-in-wpf/</link>
		<pubDate>Wed, 05 Feb 2014 16:38:50 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=343</guid>
		<description><![CDATA[Read all about it]]></description>
				<content:encoded><![CDATA[<p><a href="http://prabu-guru.blogspot.co.uk/2010/06/how-to-add-watermark-text-to-textbox.html">Read all about it</a></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F&amp;title=Showing+a+TextBox+Watermark+in+WPF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F&amp;title=Showing+a+TextBox+Watermark+in+WPF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F&amp;title=Showing+a+TextBox+Watermark+in+WPF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F&amp;headline=Showing+a+TextBox+Watermark+in+WPF" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Showing+a+TextBox+Watermark+in+WPF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Showing+a+TextBox+Watermark+in+WPF&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Showing+a+TextBox+Watermark+in+WPF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Showing+a+TextBox+Watermark+in+WPF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Showing+a+TextBox+Watermark+in+WPF&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F&amp;title=Showing+a+TextBox+Watermark+in+WPF&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F02%2F05%2Fshowing-a-textbox-watermark-in-wpf%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>Moq &#8211; Return different results for each call</title>
		<link>http://si-w.co.uk/blog/2014/01/29/moq-return-different-results-for-each-call/</link>
		<pubDate>Wed, 29 Jan 2014 19:38:40 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=340</guid>
		<description><![CDATA[More for my own recall than anything, but this feature of Moq that I hadn&#8217;t seen before solved an issue. If you need to return different results on each invocation of a method: Moq SetupSequence]]></description>
				<content:encoded><![CDATA[<p>More for my own recall than anything, but this feature of Moq that I hadn&#8217;t seen before solved an issue. If you need to return different results on each invocation of a method:</p>
<p><a href="http://codecontracts.info/2011/07/28/moq-setupsequence-is-great-for-mocking/">Moq SetupSequence</a></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F&amp;title=Moq+-+Return+different+results+for+each+call" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F&amp;title=Moq+-+Return+different+results+for+each+call" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F&amp;title=Moq+-+Return+different+results+for+each+call" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F&amp;headline=Moq+-+Return+different+results+for+each+call" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Moq+-+Return+different+results+for+each+call&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Moq+-+Return+different+results+for+each+call&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Moq+-+Return+different+results+for+each+call&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Moq+-+Return+different+results+for+each+call&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Moq+-+Return+different+results+for+each+call&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F&amp;title=Moq+-+Return+different+results+for+each+call&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2014%2F01%2F29%2Fmoq-return-different-results-for-each-call%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>CouchDB QuickStart</title>
		<link>http://si-w.co.uk/blog/2013/09/10/couchdb-quickstart/</link>
		<pubDate>Tue, 10 Sep 2013 20:17:29 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=317</guid>
		<description><![CDATA[I&#8217;m a complete CouchDB novice. Here is what I learnt in the first few hours. What is it? tldr &#8211; It&#8217;s a document database, that heavily uses http for querying and administration Installation Setting up a dev environment on a &#8230; <a href="http://si-w.co.uk/blog/2013/09/10/couchdb-quickstart/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a complete CouchDB novice. Here is what I learnt in the first few hours.</p>
<h2><strong>What is it?</strong></h2>
<p>tldr &#8211; It&#8217;s a document database, that heavily uses http for querying and administration</p>
<h2><strong>Installation</strong></h2>
<p>Setting up a dev environment on a mac is pretty easy. I have homebrew installed as my package manager.</p>
<pre>brew search couch</pre>
<p>showed that the package is called &#8216;couchdb&#8217;</p>
<pre>brew install couchdb</pre>
<p>went off and did it&#8217;s thing. After 45 minutes or so, it seemed to have hung on the make task. The <a href="http://wiki.apache.org/couchdb/Installing_on_OSX">CouchDB Mac installation instructions</a> suggested using the command</p>
<pre>brew install -v couchdb</pre>
<p>and this worked for me.</p>
<p>Couch is now installed in <code>/usr/local/bin/couchdb</code> on my system.</p>
<p>We start the server with <code>couchdb</code> and see the following:</p>
<pre>Apache CouchDB 1.4.0 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [] Apache CouchDB has started on http://127.0.0.1:5984/</pre>
<p>In another window, we can act as a client &#8211; <code>curl http://127.0.0.1:5984/</code> which tells us</p>
<pre>{"couchdb":"Welcome","uuid":"8e9e41844b1be7e68475d288b5d14bc3","version":"1.4.0","vendor":{"version":"1.4.0-1","name":"Homebrew"}}</pre>
<h2>Web Admin via Futon</h2>
<p>Futon is a web interface to CouchDB. We can perform database administration tasks, and create and edit documents. I was able to create a new database and insert a simple document.<br />
<img class="alignnone size-full wp-image-322" alt="futon_document" src="http://si-w.co.uk/blog/wp-content/uploads/2013/09/futon_document.png" srcset="http://si-w.co.uk/blog/wp-content/uploads/2013/09/futon_document.png 1036w, http://si-w.co.uk/blog/wp-content/uploads/2013/09/futon_document-300x191.png 300w, http://si-w.co.uk/blog/wp-content/uploads/2013/09/futon_document-1024x655.png 1024w" sizes="(max-width: 1036px) 100vw, 1036px" /></p>
<p>Note that CouchDB has assigned and Id and a Revision to the document. You can assign your own unique identifiers should you wish.<br />
You can even ask CouchDB to give you a range of UUIDs : </p>
<pre>curl -X GET http://127.0.0.1:5984/_uuids?count=5</pre>
<p><code>{"uuids":"0b225462ddccbb8f19ec612ef70319f9","0b225462ddccbb8f19ec612ef7031eba",<br />
"0b225462ddccbb8f19ec612ef7032269","0b225462ddccbb8f19ec612ef7032e8d",<br />
"0b225462ddccbb8f19ec612ef7032f8d"]}</code></p>
<h6>Please don&#8217;t use the above UUIDs, they belong to me</h6>
<h2>Retrieving data with node.js</h2>
<p>Following the code from <a href="https://github.com/cloudhead/cradle" title="https://github.com/cloudhead/cradle">https://github.com/cloudhead/cradle</a> it was super simple to query the document we have already created.<br />
After we have run <code>npm install cradle</code> the following was enough to get us started.</p>
<pre>var cradle = require('cradle');
var db = new(cradle.Connection)().database('hello_couch');
db.get('0b225462ddccbb8f19ec612ef70007fd', function(err, doc) {
  console.log(doc);
});
</pre>
<p>which returns</p>
<pre>{ _id: '0b225462ddccbb8f19ec612ef70007fd',
       _rev: '1-7f6fc4765d88ba5da29b5f5938b46c2c',
       message: 'hello from couch db' }</pre>
<p>Getting started was simple enough. Now to learn more about the ecosystem and how to use it in a real application.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F&amp;title=CouchDB+QuickStart" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F&amp;title=CouchDB+QuickStart" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F&amp;title=CouchDB+QuickStart" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F&amp;headline=CouchDB+QuickStart" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=CouchDB+QuickStart&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=CouchDB+QuickStart&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=CouchDB+QuickStart&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=CouchDB+QuickStart&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=CouchDB+QuickStart&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F&amp;title=CouchDB+QuickStart&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F09%2F10%2Fcouchdb-quickstart%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>My git command line cheatsheet</title>
		<link>http://si-w.co.uk/blog/2013/07/24/my-git-command-line-cheatsheet/</link>
		<pubDate>Wed, 24 Jul 2013 18:34:19 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=312</guid>
		<description><![CDATA[An extension of my short term memory: revert changes to file git checkout &#60;filespec&#62; create a new local branch and switch to it git checkout -b &#60;branch_name&#62; create a new local branch git branch &#60;branch_name&#62; switch branch git checkout &#60;branch_name&#62; &#8230; <a href="http://si-w.co.uk/blog/2013/07/24/my-git-command-line-cheatsheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>An extension of my short term memory:</p>
<table>
<tr>
<td>revert changes to file</td>
<td>git checkout &lt;filespec&gt;</td>
<tr>
<tr>
<td>create a new local branch and switch to it</td>
<td>git checkout -b &lt;branch_name&gt;</td>
<tr>
<tr>
<td>create a new local branch</td>
<td>git branch &lt;branch_name&gt;</td>
<tr>
<tr>
<td>switch branch</td>
<td>git checkout &lt;branch_name&gt;</td>
<tr>
<tr>
<td>commit to remote</td>
<td>git push origin master </td>
<tr>
<tr>
<td>display remote details</td>
<td>git remote -v </td>
<tr>
<tr>
<td>list files containing string</td>
<td>git grep &lt;search_text&gt;</td>
<tr>
</table>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F&amp;title=My+git+command+line+cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F&amp;title=My+git+command+line+cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F&amp;title=My+git+command+line+cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F&amp;headline=My+git+command+line+cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=My+git+command+line+cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=My+git+command+line+cheatsheet&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=My+git+command+line+cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=My+git+command+line+cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=My+git+command+line+cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F&amp;title=My+git+command+line+cheatsheet&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F24%2Fmy-git-command-line-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>My Emacs Cheatsheet</title>
		<link>http://si-w.co.uk/blog/2013/07/12/my-emacs-cheatsheet/</link>
		<pubDate>Fri, 12 Jul 2013 19:47:13 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=293</guid>
		<description><![CDATA[I&#8217;ve been taking a look at emacs &#8211; this is my brain dump so far &#8211; mainly taken from the in-built tutorial Navigation Move forward a page Ctrl+v Move backward a page Meta+v Move to next line Ctrl+n Move to &#8230; <a href="http://si-w.co.uk/blog/2013/07/12/my-emacs-cheatsheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been taking a look at emacs &#8211; this is my brain dump so far &#8211; mainly taken from the in-built tutorial</p>
<table>
<th>Navigation</th>
<th></th>
<tr>
<td>Move forward a page</td>
<td> Ctrl+v</td>
</tr>
<tr>
<td>Move backward a page</td>
<td>Meta+v</td>
</tr>
<tr>
<td>Move to next line</td>
<td>Ctrl+n</td>
</tr>
<tr>
<td>Move to previous line</td>
<td> Ctrl+p</td>
</tr>
<tr>
<td>Move backward a character</td>
<td> Ctrl+b</td>
</tr>
<tr>
<td>Move forward a character</td>
<td> Ctrl+f</td>
</tr>
<tr>
<td>Move backward a word</td>
<td> Meta+b</td>
</tr>
<tr>
<td>Move forward a word</td>
<td> Meta+f</td>
</tr>
<tr>
<td>Move to start of document</td>
<td>Meta+lt;</td>
</tr>
<tr>
<td>Move 10 lines down</td>
<td> Ctrl+u 10 Ctrl+n</td>
</tr>
<tr>
<td>Move to start of line</td>
<td> Ctrl+a</td>
</tr>
<tr>
<td>Move to end of line</td>
<td> Ctrl+e</td>
</tr>
<tr>
<td>Move to start of sentence</td>
<td> Meta+a</td>
</tr>
<tr>
<td>Move to end of sentence</td>
<td> Meta+e</td>
</tr>
</table>
<table>
<th>Text Entry</th>
<th></th>
<tr>
<td>Inserts 8x *</td>
<td>Ctrl+u 8 *</td>
</tr>
<tr>
<td>Undo</td>
<td>Ctrl+/</td>
</tr>
<tr>
<td>delete next character after cursor</td>
<td>Ctrl+d</td>
</tr>
<tr>
<td>delete next word before cursor</td>
<td>Meta+Del</td>
</tr>
<tr>
<td>delete next word after cursor</td>
<td>Meta+d</td>
</tr>
<tr>
<td>delete from cursor position to eol</td>
<td>Ctrl+k</td>
</tr>
<tr>
<td>delete from cursor to end of current sentence</td>
<td>Meta+k</td>
</tr>
<tr>
<td>start selection</td>
<td>Ctrl+Space</td>
</tr>
<tr>
<td>kill text in selection/line</td>
<td>Ctrl+k</td>
</tr>
<tr>
<td>reinsert killed text (yanking)</td>
<td>Ctrl+y</td>
</tr>
</table>
<table>
<th>Window Management</th>
<th></th>
<tr>
<td>Kill all other windows</td>
<td>Ctrl+x 1</td>
</tr>
<tr>
<td>Save a file</td>
<td>Ctrl+x Ctrl+s</td>
</tr>
<tr>
<td>Save some buffers</td>
<td>Ctrl+x s</td>
</tr>
<tr>
<td>Quit</td>
<td>Ctrl+x Ctrl+c</td>
</tr>
<tr>
<td>Find a file</td>
<td>Ctrl+x Ctrl+f</td>
</tr>
<tr>
<td>suspend process</td>
<td>Ctrl+z</td>
</tr>
<tr>
<td>bring suspended process back</td>
<td>fg or %emacs</td>
</tr>
<tr>
<td>switch cursor to open buffer</td>
<td>Ctrl+x o</td>
</tr>
<tr>
<td>Help</td>
<td>Ctrl+h ?</td>
</tr>
<tr>
<td>Close bottom window</td>
<td>Ctrl+x 1</td>
</tr>
<tr>
<td>Stop a command</td>
<td>Ctrl+g</td>
</tr>
</table>
<table>
<th>Buffers</th>
<th></th>
<tr>
<td>List buffers</td>
<td>Ctrl+x Ctrl+b</td>
</tr>
<tr>
<td>close buffer</td>
<td>Ctrl+x 1</td>
</tr>
<tr>
<td>switch to buffer</td>
<td>Ctrl+x b BUFFER_NAME</td>
</tr>
<tr>
<td>Ctrl+x 2</td>
<td>open second buffer with same file</td>
</tr>
<tr>
<td>Ctrl+Meta+v</td>
<td>scroll bottom window</td>
</tr>
<tr>
<td>Ctrl+x 4 Ctrl+f</td>
<td>open specified file in new window</td>
</tr>
</table>
<table>
<th>Searching</th>
<th></th>
<tr>
<td>Incremental Search</td>
<td>Ctrl+s</td>
</tr>
<tr>
<td>Search backwards</td>
<td>Ctrl+r</td>
</tr>
</table>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F&amp;title=My+Emacs+Cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F&amp;title=My+Emacs+Cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F&amp;title=My+Emacs+Cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F&amp;headline=My+Emacs+Cheatsheet" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=My+Emacs+Cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=My+Emacs+Cheatsheet&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=My+Emacs+Cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=My+Emacs+Cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=My+Emacs+Cheatsheet&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F&amp;title=My+Emacs+Cheatsheet&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2013%2F07%2F12%2Fmy-emacs-cheatsheet%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
		<item>
		<title>SQL &#8211; find by text</title>
		<link>http://si-w.co.uk/blog/2012/03/21/sql-find-by-text/</link>
		<pubDate>Wed, 21 Mar 2012 22:07:22 +0000</pubDate>
		<dc:creator><![CDATA[simon]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://si-w.co.uk/blog/?p=289</guid>
		<description><![CDATA[Many moons ago (at least 18 months ago), I had a stored procedure that let me search for text in DML in the databases. Yeah, so I could search for &#8220;Order&#8221; and it would find all mentions in SPs, functiosn &#8230; <a href="http://si-w.co.uk/blog/2012/03/21/sql-find-by-text/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Many moons ago (at least 18 months ago), I had a stored procedure that let me search for text in DML in the databases. Yeah, so I could search for &#8220;Order&#8221; and it would find all mentions in SPs, functiosn etc.</p>
<p>Here is my new version:</p>
<pre class="brush: sql; title: ; notranslate">
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 

SELECT 
        SUBSTRING (qt.text,(qs.statement_start_offset/2) + 1, 
        ((CASE WHEN qs.statement_end_offset = -1 
        THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2 
        ELSE qs.statement_end_offset 
        END - qs.statement_start_offset)/2) + 1) AS [Individual Query] 
, qt.text AS [Parent Query] 
, DB_NAME(qt.dbid) AS DatabaseName 
, qp.query_plan 
FROM sys.dm_exec_query_stats qs 
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as qt 
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp 
WHERE SUBSTRING (qt.text,(qs.statement_start_offset/2) + 1, 
        ((CASE WHEN qs.statement_end_offset = -1 
        THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2 
        ELSE qs.statement_end_offset 
        END - qs.statement_start_offset)/2) + 1) 
LIKE '@searchtext' 
and DB_NAME(qt.dbid) = @database
</pre>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F&amp;title=SQL+-+find+by+text" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F&amp;title=SQL+-+find+by+text" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F&amp;title=SQL+-+find+by+text" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F&amp;headline=SQL+-+find+by+text" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=SQL+-+find+by+text&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=SQL+-+find+by+text&amp;u=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=SQL+-+find+by+text&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=SQL+-+find+by+text&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=SQL+-+find+by+text&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F&amp;title=SQL+-+find+by+text&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fsi-w.co.uk%2Fblog%2F2012%2F03%2F21%2Fsql-find-by-text%2F" ><img class="lightsocial_img" src="http://si-w.co.uk/blog/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			</item>
	</channel>
</rss>
