<?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>Zero Bug Build &#187; Uncategorized</title>
	<atom:link href="https://www.zerobugbuild.com/?cat=1&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://www.zerobugbuild.com</link>
	<description>James World&#039;s blog for www.dotnetinsight.com</description>
	<lastBuildDate>Sat, 20 Oct 2018 15:03:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Quickly get a .gitignore file</title>
		<link>https://www.zerobugbuild.com/?p=443&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quickly-get-a-gitignore-file</link>
		<comments>https://www.zerobugbuild.com/?p=443#comments</comments>
		<pubDate>Sat, 20 Oct 2018 15:03:26 +0000</pubDate>
		<dc:creator>James World</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.zerobugbuild.com/?p=443</guid>
		<description><![CDATA[I posted a while back that like many people, I often use https://gitignore.io to create gitignore files. Previously I showed how to use Invoke-WebRequest to do this quickly. Quick as that was, I like it quicker! So I added the &#8230; <a href="https://www.zerobugbuild.com/?p=443">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I posted a while back that like many people, I often use <a href="https://gitignore.io" title="https://gitignore.io">https://gitignore.io</a> to create gitignore files. Previously I showed how to use <code>Invoke-WebRequest</code> to do this quickly. Quick as that was, I like it quicker! So I added the following powershell command to my profile which makes things even easier, and takes care of a few niggles such as correct UTF8 encoding without a BOM marker.</p>
<p>Now I can just do something like: <code>Get-GitIgnore VisualStudioCode</code></p>
<p><script src="https://gist.github.com/james-world/95e45539fc9e04d74817cff2fb742eb9.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>https://www.zerobugbuild.com/?feed=rss2&#038;p=443</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process this!</title>
		<link>https://www.zerobugbuild.com/?p=395&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=process-this</link>
		<comments>https://www.zerobugbuild.com/?p=395#comments</comments>
		<pubDate>Mon, 23 Mar 2015 09:29:49 +0000</pubDate>
		<dc:creator>James World</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.zerobugbuild.com/?p=395</guid>
		<description><![CDATA[During a code review the other day, I came up against an old friend &#8211; in this case a method called &#8220;ProcessImage&#8221;. Set inside, of course a class called &#8220;ImageProcessor&#8221;. Method names should be *intention* revealing, not *implementation* revealing. If &#8230; <a href="https://www.zerobugbuild.com/?p=395">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>During a code review the other day, I came up against an old friend &#8211; in this case a method called &#8220;ProcessImage&#8221;. Set inside, of course a class called &#8220;ImageProcessor&#8221;. Method names should be *intention* revealing, not *implementation* revealing. If you think of a program as being like a sausage machine &#8211; meat in, sausages out &#8211; then don&#8217;t call the operative method &#8220;ProcessMeat&#8221; &#8211; call it &#8220;MakeSausages&#8221;. This reveals the purpose clearly and uses the language of the business.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.zerobugbuild.com/?feed=rss2&#038;p=395</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Constraining a stream of events in Rx to a maximum rate</title>
		<link>https://www.zerobugbuild.com/?p=323&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=constraining-a-stream-of-events-in-rx-to-a-maximum-rate</link>
		<comments>https://www.zerobugbuild.com/?p=323#comments</comments>
		<pubDate>Wed, 09 Oct 2013 12:14:37 +0000</pubDate>
		<dc:creator>James World</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.zerobugbuild.com/?p=323</guid>
		<description><![CDATA[Sometimes, you want to limit the rate at which events arrive from an Rx stream. The Throttle operator will suppress an event if another arrives within a specified interval. This is very useful in many instances, but it does have &#8230; <a href="https://www.zerobugbuild.com/?p=323">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you want to limit the rate at which events arrive from an Rx stream.</p>
<p>The <code>Throttle</code> operator will suppress an event if another arrives within a specified interval. This is very useful in many instances, but it does have two important side-effects &#8211; even an unsuppressed event will be delayed by the interval, and events will get dropped altogether if they arrive too quickly.</p>
<p>I came across a situation where both of these were unacceptable. In this particular case, the desired behaviour was as follows: The events should be output at a maximum rate specified by a TimeSpan, but otherwise as soon as possible.</p>
<p>One solution works like this. Imagine our input stream is a bunch of people arriving at a railway station. For our output, we want people leave the station at a maximum rate. We set the maximum rate by having each person stand at the front of a flatbed railroad truck and sending that truck out of the station at a fixed speed. Because there is only one track, and all trucks travel at the same speed and have the same length, people will leave the station at a maximum rate when trucks are departing back-to-back. However, if the track is clear, the next person will be able to depart immediately.</p>
<p>So how to we translate this metaphor into Rx?</p>
<p>We will use the <code>Concat</code> operator&#8217;s ability to accept a stream of streams and merge them together back-to-back &#8211; just like sending railroad trucks down the track.</p>
<p>To get the equivalent of each person onto a railroad truck, we will use a Select to project each event (person) to an observable sequence (railroad truck) that starts with a single <code>OnNext</code> event (the person) and ends with an <code>OnComplete</code> exactly the defined interval later.</p>
<p>Lets assume the input events are an <code>IObservable&lt;T&gt;</code> in the variable <code>input</code>. Here&#8217;s the code:</p>
<pre class="prettyprint ">
var paced = input.Select(i =&gt; Observable.Empty&lt;T&gt;()
                                        .Delay(interval)
                                        .StartWith(i)).Concat();
</pre>
<p>I&#8217;ll leave it as an exercise to turn this into an extension method for easy reuse!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.zerobugbuild.com/?feed=rss2&#038;p=323</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
