<?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>Steven Engelhardt</title>
	<atom:link href="http://www.deez.info/sengelha/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deez.info/sengelha</link>
	<description>A financial industry software developer's thoughts and insights</description>
	<lastBuildDate>Tue, 13 Apr 2010 18:28:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implementing a Spell Checker</title>
		<link>http://www.deez.info/sengelha/2010/04/13/implementing-a-spell-checker/</link>
		<comments>http://www.deez.info/sengelha/2010/04/13/implementing-a-spell-checker/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 18:27:24 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2010/04/13/implementing-a-spell-checker/</guid>
		<description><![CDATA[The following algorithms might be useful if you want to implement a spell checker (or Google-style “did you mean” feature):

Levenshtein distance 
Jaro-Winkler distance 
N-gram 

]]></description>
			<content:encoded><![CDATA[<p>The following algorithms might be useful if you want to implement a spell checker (or Google-style “did you mean” feature):</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance</a> </li>
<li><a href="http://en.wikipedia.org/wiki/Jaro-Winkler_distance">Jaro-Winkler distance</a> </li>
<li><a href="http://en.wikipedia.org/wiki/N-gram">N-gram</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2010/04/13/implementing-a-spell-checker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reader/Writer Lock Pattern</title>
		<link>http://www.deez.info/sengelha/2010/03/14/readerwriter-lock-pattern/</link>
		<comments>http://www.deez.info/sengelha/2010/03/14/readerwriter-lock-pattern/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 20:18:29 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2010/03/14/readerwriter-lock-pattern/</guid>
		<description><![CDATA[A reader-writer lock is a lock which will allow multiple concurrent readers but only one writer.&#160; A reader-writer lock can be significantly more efficient than a standard mutex if reads on your shared memory far outnumber writes.
Reader-writer locks naturally fit together with caches, as caches are only effective if reads far outnumber writes.
Here is a [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://en.wikipedia.org/wiki/Readers-writer_lock">reader-writer lock</a> is a lock which will allow multiple concurrent readers but only one writer.&#160; A reader-writer lock can be significantly more efficient than a standard <a href="http://en.wikipedia.org/wiki/Mutex">mutex</a> if reads on your shared memory far outnumber writes.</p>
<p>Reader-writer locks naturally fit together with <a href="http://en.wikipedia.org/wiki/Cache">cache</a>s, as caches are only effective if reads far outnumber writes.</p>
<p>Here is a general pattern for using a reader-writer lock with a cache:</p>
<ol>
<li>Acquire a reader lock. </li>
<li>Check the cache for the value. If it exists, save the value and go to step 8. </li>
<li>Upgrade the reader lock to a writer lock. </li>
<li>Check the cache for the value. If it exists, save the value and go to step 7. </li>
<li>Calculate the value (expensive, otherwise we wouldn’t cache it) </li>
<li>Insert the value into the cache. </li>
<li>Release the writer lock. </li>
<li>Release the reader lock. </li>
<li>Return the value. </li>
</ol>
<p>The reason why we have to check the cache for the value again in step (4) is because of the following possibility (assume step 4 doesn&#8217;t exist):</p>
<pre>Thread 1                         Thread 2
============================     ===============================
- Acquire reader lock            - Acquire reader lock
- Check cache for value          - Check cache for value
  with key A (not found)           with key A (not found)
- Upgrade to writer lock         - (block)
- Calculate value (expensive)
- Insert value into cache
- Release writer lock
- Release reader lock
                                 - Upgrade to writer lock
                                 - Calculate value (expensive)
                                   (<strong>We are paying this cost
                                   twice</strong>)
                                 - Insert value into cache
                                   (<strong>We are inserting two values
                                   with the same key, which may
                                   be fatal</strong>)</pre>
<p>With step 4 it becomes:</p>
<pre>Thread 1                         Thread 2
============================     ===============================
- Acquire reader lock            - Acquire reader lock
- Check cache for value          - Check cache for value
  with key A (not found)           with key A (not found)
- Upgrade to writer lock         - (block)
- Calculate value (expensive)
- Insert value into cache
- Release writer lock
- Release reader lock
                                 - Upgrade to writer lock
                                 - Check cache for value
                                   with key A (found)
                                 - Release writer lock
                                 - Release reader lock
- Return value                   - Return value</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2010/03/14/readerwriter-lock-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Problem With Academic Finance</title>
		<link>http://www.deez.info/sengelha/2009/10/15/the-problem-with-academic-finance/</link>
		<comments>http://www.deez.info/sengelha/2009/10/15/the-problem-with-academic-finance/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 18:41:56 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Finance]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/10/15/the-problem-with-academic-finance/</guid>
		<description><![CDATA[Pricing models like the arbitrage pricing theory or the Fama-French factor models simply assume that prices are right, then extrapolate from that what the relevant risk factors must be that determine prices.

Fox, Justin. What we talk about when we talk about the efficient market hypothesis. The Curious Capitalist Blog: 8 October 2009.
Exactly! 
]]></description>
			<content:encoded><![CDATA[<blockquote><p>Pricing models like the arbitrage pricing theory or the Fama-French factor models simply assume that prices are right, then extrapolate from that what the relevant risk factors must be that determine prices.</p>
</blockquote>
<p><cite>Fox, Justin. <a href="http://curiouscapitalist.blogs.time.com/2009/10/08/what-we-talk-about-when-we-talk-about-the-efficient-market-hypothesis/">What we talk about when we talk about the efficient market hypothesis.</a> <u><a href="http://curiouscapitalist.blogs.time.com/">The Curious Capitalist Blog</a></u>: 8 October 2009.</cite></p>
<p>Exactly! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/10/15/the-problem-with-academic-finance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling Multiple QueryString Parameters With the Same Key in ASP.NET</title>
		<link>http://www.deez.info/sengelha/2009/09/23/handling-multiple-querystring-parameters-with-the-same-key-in-aspnet/</link>
		<comments>http://www.deez.info/sengelha/2009/09/23/handling-multiple-querystring-parameters-with-the-same-key-in-aspnet/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 02:23:13 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/09/23/handling-multiple-querystring-parameters-with-the-same-key-in-aspnet/</guid>
		<description><![CDATA[When you are processing an HTTP request in ASP.NET you can retrieve the user-provided query string parameters using the HttpRequest.QueryString property.&#160; This property is an instance of the NameValueCollection class.
If the user has provided multiple parameters with the same key in the query string, HttpRequest.QueryString[key] will return all the values concatenated together with commas.&#160; If [...]]]></description>
			<content:encoded><![CDATA[<p>When you are processing an HTTP request in ASP.NET you can retrieve the user-provided query string parameters using the <a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring.aspx">HttpRequest.QueryString</a> property.&#160; This property is an instance of the <a href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.namevaluecollection.aspx">NameValueCollection class</a>.</p>
<p>If the user has provided multiple parameters with the same key in the query string, <code>HttpRequest.QueryString[key]</code> will return all the values concatenated together with commas.&#160; If you would rather process the values individually, use <code>HttpRequest.QueryString.GetValues(key)</code>, which will return an array of all the provided values.</p>
<p>For example:</p>
<p>URL: <a href="http://example.com?a=1&amp;a=2">http://example.com?a=1&amp;a=2</a>     <br /><code>HttpRequest.QueryString[&quot;a&quot;] = &quot;1,2&quot;</code>     <br /><code>HttpRequest.QueryString.GetValues(&quot;a&quot;) = { &quot;1&quot;, &quot;2&quot; }</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/09/23/handling-multiple-querystring-parameters-with-the-same-key-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Might and Magic 2</title>
		<link>http://www.deez.info/sengelha/2009/09/21/might-and-magic-2/</link>
		<comments>http://www.deez.info/sengelha/2009/09/21/might-and-magic-2/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 04:14:00 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/09/21/might-and-magic-2/</guid>
		<description><![CDATA[I spent many weeks of my childhood, along with a substantial portion of last weekend, playing Might and Magic 2, which I purchased in a bundle from GOG.com.
Fond memories.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.deez.info/sengelha/wp-content/uploads/2009/09/image.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 5px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.deez.info/sengelha/wp-content/uploads/2009/09/image-thumb.png" width="244" height="164" /></a>I spent many weeks of my childhood, along with a substantial portion of last weekend, playing <a href="http://shrines.rpgclassics.com/pc/mm2/">Might and Magic 2</a>, which I purchased in a bundle from <a href="http://www.gog.com">GOG.com</a>.</p>
<p>Fond memories.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/09/21/might-and-magic-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun Illusion</title>
		<link>http://www.deez.info/sengelha/2009/09/16/fun-illusion/</link>
		<comments>http://www.deez.info/sengelha/2009/09/16/fun-illusion/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 01:54:39 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/09/16/fun-illusion/</guid>
		<description><![CDATA[Stare at the red dot at the center of this image for a minute or two:

]]></description>
			<content:encoded><![CDATA[<p>Stare at the red dot at the center of this image for a minute or two:</p>
<p><img alt="troxler.jpg" src="http://scienceblogs.com/cognitivedaily/upload/2009/09/the_importance_of_perceptual_i/troxler.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/09/16/fun-illusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I&#8217;m Reading</title>
		<link>http://www.deez.info/sengelha/2009/09/16/what-im-reading-2/</link>
		<comments>http://www.deez.info/sengelha/2009/09/16/what-im-reading-2/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 01:32:42 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/09/16/what-im-reading-2/</guid>
		<description><![CDATA[



The Affluent Society by John Kenneth Galbraith



The Amazing Adventures of Kavalier &#38; Clay by Michael Chabon



Gödel, Escher, Bach: An Eternal Golden Braid by Douglas R. Hofstadter



Damned Lies and Statistics: Untangling Numbers from the Media, Politicians, and Activists by Joel Best



A Short History of Nearly Everything by Bill Bryson



Beautiful Architecture: Leading Thinkers Reveal the Hidden Beauty [...]]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td width="23"><img alt="The Affluent Society" src="http://ecx.images-amazon.com/images/I/41BP0JX95QL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Affluent-Society-John-Kenneth-Galbraith/dp/0395925002/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253150827&amp;sr=8-1">The Affluent Society</a> by John Kenneth Galbraith</td>
</tr>
<tr>
<td width="23"><img alt="The Amazing Adventures of Kavalier &amp; Clay" src="http://ecx.images-amazon.com/images/I/51YC4MVXGXL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Amazing-Adventures-Kavalier-Clay/dp/0312282990/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253150780&amp;sr=8-1">The Amazing Adventures of Kavalier &amp; Clay</a> by Michael Chabon</td>
</tr>
<tr>
<td width="23"><img alt="Godel, Escher, Bach: An Eternal Golden Braid" src="http://ecx.images-amazon.com/images/I/41V5ZTF24CL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Godel-Escher-Bach-Eternal-Golden/dp/0465026567/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253150879&amp;sr=1-1">Gödel, Escher, Bach: An Eternal Golden Braid</a> by Douglas R. Hofstadter</td>
</tr>
<tr>
<td width="23"><img alt="Damned Lies and Statistics: Untangling Numbers from the Media, Politicians, and Activists" src="http://ecx.images-amazon.com/images/I/51QP03R37YL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Damned-Lies-Statistics-Untangling-Politicians/dp/0520219783/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253150945&amp;sr=1-1">Damned Lies and Statistics: Untangling Numbers from the Media, Politicians, and Activists</a> by Joel Best</td>
</tr>
<tr>
<td width="23"><img alt="A Short History of Nearly Everything" src="http://ecx.images-amazon.com/images/I/4130HWHH8DL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Short-History-Nearly-Everything/dp/076790818X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253150985&amp;sr=1-1">A Short History of Nearly Everything</a> by Bill Bryson</td>
</tr>
<tr>
<td width="23"><img alt="Beautiful Architecture: Leading Thinkers Reveal the Hidden Beauty in Software Design" src="http://ecx.images-amazon.com/images/I/51smdB-4F7L._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Beautiful-Architecture-Leading-Thinkers-Software/dp/059651798X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253151005&amp;sr=1-1">Beautiful Architecture: Leading Thinkers Reveal the Hidden Beauty in Software Design</a> by Diomidis Spinellis, Georgios Gousios</td>
</tr>
<tr>
<td width="23"><img alt="A Random Walk Down Wall Street: The Time-Tested Strategy for Successful Investing (Revised and Updated)" src="http://ecx.images-amazon.com/images/I/51i7SzOILVL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg" width="120" height="120" /></td>
<td width="450"><a href="http://www.amazon.com/Random-Walk-Down-Wall-Street/dp/0393330338/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1253151071&amp;sr=1-1">A Random Walk Down Wall Street</a> by Burton G. Malkiel</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/09/16/what-im-reading-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009 Cubs Predictions &#8211; Take 4</title>
		<link>http://www.deez.info/sengelha/2009/08/09/2009-cubs-predictions-take-4/</link>
		<comments>http://www.deez.info/sengelha/2009/08/09/2009-cubs-predictions-take-4/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 01:59:14 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/08/09/2009-cubs-predictions-take-4/</guid>
		<description><![CDATA[Current Cubs team OBP: 0.328   Current Cubs team ERA: 3.79    This year’s prediction: 87-75 (Methodology)    Previous predictions: 82-80 (7/5), 82-80 (6/5), 78-84 (5/12)
]]></description>
			<content:encoded><![CDATA[<p>Current Cubs team OBP: 0.328   <br />Current Cubs team ERA: 3.79    <br />This year’s prediction: 87-75 (<a href="http://www.deez.info/sengelha/2006/05/09/2006-baseball-predictions/">Methodology</a>)    <br />Previous predictions: <a href="http://www.deez.info/sengelha/2009/07/05/2009-cubs-predictions-take-3/">82-80</a> (7/5), <a href="http://www.deez.info/sengelha/2009/06/05/2009-cubs-predictions-take-2/">82-80</a> (6/5), <a href="http://www.deez.info/sengelha/2009/05/12/2009-cubs-predictions/">78-84</a> (5/12)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/08/09/2009-cubs-predictions-take-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009 Cubs Predictions &#8211; Take 3</title>
		<link>http://www.deez.info/sengelha/2009/07/05/2009-cubs-predictions-take-3/</link>
		<comments>http://www.deez.info/sengelha/2009/07/05/2009-cubs-predictions-take-3/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 17:31:00 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/07/05/2009-cubs-predictions-take-3/</guid>
		<description><![CDATA[Current Cubs team OBP: 0.322   Current Cubs team ERA: 3.90    This year’s prediction: 82-80 (Methodology)    Previous prediction(s): 82-80 (6/5), 78-84 (5/12)
]]></description>
			<content:encoded><![CDATA[<p>Current Cubs team OBP: 0.322   <br />Current Cubs team ERA: 3.90    <br />This year’s prediction: 82-80 (<a href="http://www.deez.info/sengelha/2006/05/09/2006-baseball-predictions/">Methodology</a>)    <br />Previous prediction(s): <a href="http://www.deez.info/sengelha/2009/06/05/2009-cubs-predictions-take-2/">82-80</a> (6/5), <a href="http://www.deez.info/sengelha/2009/05/12/2009-cubs-predictions/">78-84</a> (5/12)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/07/05/2009-cubs-predictions-take-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009 Cubs Predictions &#8211; Take 2</title>
		<link>http://www.deez.info/sengelha/2009/06/05/2009-cubs-predictions-take-2/</link>
		<comments>http://www.deez.info/sengelha/2009/06/05/2009-cubs-predictions-take-2/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 00:36:11 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2009/06/05/2009-cubs-predictions-take-2/</guid>
		<description><![CDATA[Current Cubs team OBP: 0.329   Current Cubs team ERA: 4.17    This year’s prediction: 82-80 (Methodology)    Previous prediction(s): 78-84 (5/12)
]]></description>
			<content:encoded><![CDATA[<p>Current Cubs team OBP: 0.329   <br />Current Cubs team ERA: 4.17    <br />This year’s prediction: 82-80 (<a title="http://www.deez.info/sengelha/2006/05/09/2006-baseball-predictions/" href="http://www.deez.info/sengelha/2006/05/09/2006-baseball-predictions/">Methodology</a>)    <br />Previous prediction(s): <a href="http://www.deez.info/sengelha/2009/05/12/2009-cubs-predictions/">78-84</a> (5/12)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2009/06/05/2009-cubs-predictions-take-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
