<?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>Knowing .NET</title>
	<atom:link href="http://www.knowing.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.knowing.net</link>
	<description>Software Development Process and Industry Analysis by the former Editor of Software Development, Computer Language, and Game Developer Magazines</description>
	<lastBuildDate>Wed, 15 May 2013 06:19:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Review &#8220;The Wasp Factory&#8221;</title>
		<link>http://www.knowing.net/index.php/2013/05/14/review-the-wasp-factory/</link>
		<comments>http://www.knowing.net/index.php/2013/05/14/review-the-wasp-factory/#comments</comments>
		<pubDate>Wed, 15 May 2013 06:17:16 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5582</guid>
		<description><![CDATA[The Wasp Factory by Iain Banks My rating: 4 of 5 stars Very well written. First-person account of a psychopath or maybe a sociopath living deep inside a metaphor in Scotland. Very unsettling, with a narrator who&#8217;s clearly unreliable, so one is always wondering if incidents or even entire characters are imaginary. Although certain twists [...]]]></description>
				<content:encoded><![CDATA[<p><a style="float: left; padding-right: 20px;" href="http://www.goodreads.com/book/show/567678.The_Wasp_Factory"><img alt="The Wasp Factory" src="http://d.gr-assets.com/books/1303915010m/567678.jpg" border="0" /></a><a href="http://www.goodreads.com/book/show/567678.The_Wasp_Factory">The Wasp Factory</a> by <a href="http://www.goodreads.com/author/show/7628.Iain_Banks">Iain Banks</a><br />
My rating: <a href="http://www.goodreads.com/review/show/613739599">4 of 5 stars</a></p>
<p>Very well written. First-person account of a psychopath or maybe a sociopath living deep inside a metaphor in Scotland. Very unsettling, with a narrator who&#8217;s clearly unreliable, so one is always wondering if incidents or even entire characters are imaginary. Although certain twists were heavily foreshadowed, the denoument was still quite tense. My only qualm is that I think the final few pages spelled out too much &#8212; it would have been more haunting if the narrator didnt become suddenly insightful and deconstruct the metaphor.</p>
<p>Havent been so compelled to turn pages in a while.</p>
<p><a href="http://www.goodreads.com/review/list/6080403-larry-o-brien">View all my reviews</a></p>
<p>via <a href="http://www.goodreads.com/review/show/613739599">Goodreads | Larry Obrien Kailua Kona, HIs review of The Wasp Factory</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2013/05/14/review-the-wasp-factory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing the Android Barometer using Xamarin.Android</title>
		<link>http://www.knowing.net/index.php/2013/04/06/accessing-the-android-barometer-using-monotouch-android/</link>
		<comments>http://www.knowing.net/index.php/2013/04/06/accessing-the-android-barometer-using-monotouch-android/#comments</comments>
		<pubDate>Sat, 06 Apr 2013 20:58:33 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5552</guid>
		<description><![CDATA[Easily: < ![CDATA[ [Activity (Label = "HelloBarometer", MainLauncher = true)] public class Activity1 : Activity, ISensorEventListener { TextView mainLabel; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); //Detect the barometer var sm = (SensorManager) this.GetSystemService(Context.SensorService); var barry = sm.GetDefaultSensor(SensorType.Pressure); //Subscribe to it sm.RegisterListener(this, barry, SensorDelay.Normal); // [...]]]></description>
				<content:encoded><![CDATA[<p>Easily:</p>
<pre class="brush: csharp">< ![CDATA[
[Activity (Label = "HelloBarometer", MainLauncher = true)]
public class Activity1 : Activity, ISensorEventListener
{
    TextView mainLabel;  

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);
        //Detect the barometer
        var sm = (SensorManager) this.GetSystemService(Context.SensorService);
        var barry = sm.GetDefaultSensor(SensorType.Pressure);
        //Subscribe to it
        sm.RegisterListener(this, barry, SensorDelay.Normal);
        // Get our button from the layout resource,
        // and attach an event to it
        mainLabel = FindViewById&lt;textview&gt;(Resource.Id.myText);
    }

    public void OnAccuracyChanged(Sensor sensor, SensorStatus accuracy)
    {
        Console.WriteLine("Things have changed");
    }

    public void OnSensorChanged(SensorEvent pressureEvent)
    {
        Console.WriteLine("Under pressure " + pressureEvent);
        var hPAs = pressureEvent.Values[0];
        var msg = string.Format("Current pressure: {0} hPA!", hPAs);
        mainLabel.Text = msg;
        var calcedAltitude = calculateAltitudeInFeet(hPAs);
        FindViewById&lt;TextView&gt;(Resource.Id.altitudeText).Text = string.Format("Calculated altitude is {0} ft", calcedAltitude);
    }

    double calculateAltitudeInFeet(float hPAs)
    {
        var pstd = 1013.25;
        var altpress =  (1 - Math.Pow((hPAs/pstd), 0.190284)) * 145366.45;
        return altpress;
    } 
}
]]</pre>
<p>I mean, I know I work for the guys, but this is just *ridiculously* easy. An hour ago I was installing the SDK...</p>
<p><a href="http://www.knowing.net/wp-content/uploads/2013/04/Screenshot_2013-04-06-11-05-28.png"><img src="http://www.knowing.net/wp-content/uploads/2013/04/Screenshot_2013-04-06-11-05-28.png" alt="" title="Screenshot_2013-04-06-11-05-28" width="768" height="1280" class="size-full wp-image-5565" /></a></p>
<p>And, yes, I live high on the side of an active volcano.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2013/04/06/accessing-the-android-barometer-using-monotouch-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tap 7 Times to Enable Developer Options in Android Jelly Bean</title>
		<link>http://www.knowing.net/index.php/2013/04/06/tap-7-times-to-enable-developer-options-in-android-jelly-bean/</link>
		<comments>http://www.knowing.net/index.php/2013/04/06/tap-7-times-to-enable-developer-options-in-android-jelly-bean/#comments</comments>
		<pubDate>Sat, 06 Apr 2013 19:46:45 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5550</guid>
		<description><![CDATA[How to enable developer settings on Android 4.2 &#124; Android Central. I just got myself a Nexus 4 for cross-platform development, but it didn&#8217;t initially appear as a device in Xamarin Studio. Initial Googling and SO&#8217;ing indicated a non-existent &#8220;Settings-&#62;Application-&#62;Developer&#8221; route to enable debugging on the phone. Instead, the correct sequence is &#8220;Settings-&#62;About phone-&#62;{tap 7 [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.androidcentral.com/how-enable-developer-settings-android-42">How to enable developer settings on Android 4.2 | Android Central</a>.</p>
<p>I just got myself a Nexus 4 for cross-platform development, but it didn&#8217;t initially appear as a device in Xamarin Studio. Initial Googling and SO&#8217;ing indicated a non-existent &#8220;Settings-&gt;Application-&gt;Developer&#8221; route to enable debugging on the phone.</p>
<p>Instead, the correct sequence is &#8220;Settings-&gt;About phone-&gt;{tap 7 times} Settings-&gt;Developer Options&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2013/04/06/tap-7-times-to-enable-developer-options-in-android-jelly-bean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Governor vs. Boyd Crowder</title>
		<link>http://www.knowing.net/index.php/2013/04/03/the-governor-vs-boyd-crowder/</link>
		<comments>http://www.knowing.net/index.php/2013/04/03/the-governor-vs-boyd-crowder/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 17:44:15 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5544</guid>
		<description><![CDATA[The Justified finale had a scene that summed up one of it&#8217;s greatest strengths: Raylan, the putative hero, and Boyd, the putative villain, demonstrate how parallel they are to each other: Raylan points to Boyd&#8217;s career and sneers at the thought that Boyd imagines himself anything other than &#8220;the bad guy.&#8221; Boyd points to Raylan&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>The <strong>Justified</strong> finale had a scene that summed up one of it&#8217;s greatest strengths: Raylan, the putative hero, and Boyd, the putative villain, demonstrate how parallel they are to each other: Raylan points to Boyd&#8217;s career and sneers at the thought that Boyd imagines himself anything other than &#8220;the bad guy.&#8221; Boyd points to Raylan&#8217;s actions and sneers that Raylan thinks he&#8217;s any different. Perfect: They <em>are</em> different, and make different choices, but both focus on different aspects, highlighting the ambiguity of the moral dilemmas that, taken one way, lead to acclaim and promotion in the US Marshall&#8217;s Service and, taken another, lead to universal contempt and jail.</p>

<p>Which they&#8217;d similarly set up with the Governor and Rick in <strong>The Walking Dead</strong>. Rick crazily hung on to the voice and visions of his dead wife while making the fateful decisions necessary for survival, the Governor hung on to the physical body of his dead daughter while doing the same. While the hard truth is that both are in the business of ordering the brutal actions that are necessary to make their group survive, Rick soothes himself by wallowing in guilt based on pre-zompocalypse morality. The Governor steels himself by sitting and staring at decapitated heads in fishtanks that are still gnawing to get at him. But why do people dwell on things? To bolster their weak spots: Rick&#8217;s belly-aching about morality implies that he needs to remind himself to not let it disappear, while the Governor&#8217;s zombiequarium implies that he needs to remind himself to never let himself relax. A similar point was made when the Governor said that, had he acted forcefully from the beginning, his daughter would fear him, but be alive. Meanwhile, we saw that Rick&#8217;s son is a little disdainful of his Dad&#8217;s morality.</p>

<p>But instead of developing the theme of parallelism between Rick and the Governor, they just put the Governor on the crazy train. Oh, he wasn&#8217;t just brutal, he was a <em>sadist</em>. He wasn&#8217;t just committed to pre-emptive murder, he was a psychopath. And most frustratingly of all, in the finale, he wasn&#8217;t a <em>competent leader</em>. And not only wasn&#8217;t he a competent leader in his assault on the jail, he apparently had never been competent in training his people to have the proper level of paranoia and response to deal with sneak attacks.</p>

<p>And just at a basic dramatic level, they cheated us of a final confrontation between the Governor and one of our protagonists. Instead, he slunk off with his A-team baddies and will now be a possible occasional appearance. Very disappointing for a show whose greatest strength is its willingness to kill off established characters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2013/04/03/the-governor-vs-boyd-crowder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hungarian Monadic Notation: Call Me Maybe</title>
		<link>http://www.knowing.net/index.php/2013/04/01/hungarian-monadic-notation-call-me-maybe/</link>
		<comments>http://www.knowing.net/index.php/2013/04/01/hungarian-monadic-notation-call-me-maybe/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 15:00:50 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5540</guid>
		<description><![CDATA[Update: this is an April Fool&#8217;s joke. It&#8217;s the most incoherent, illogical thing I could think of. It&#8217;s a bad idea, it wouldn&#8217;t work, and it misses the point of everything. Hungarian Monadic Notation: Call Me Maybe() Update: This was an April Fool&#8217;s joke. If you are interested in monads and are a C# or [...]]]></description>
				<content:encoded><![CDATA[<p><em>Update: this is an April Fool&#8217;s joke. It&#8217;s the most incoherent, illogical thing I could think of. It&#8217;s a bad idea, it wouldn&#8217;t work, and it misses the point of everything.</em></p>

<h1>Hungarian Monadic Notation: Call Me Maybe()</h1>

<p><em>Update: This was an April Fool&#8217;s joke. If you are interested in monads and are a C# or Java programmer, I strongly suggest <a href="http://ericlippert.com/2013/02/21/monads-part-one/">this series of posts by Eric Lippert</a>, which explains monads in a very pragmatic way.</em></p>

<p>If you follow the world of software development at all, you know that there has been a big uptick in discussion about &#8220;functional programming languages,&#8221; a type of language that emphasizes immutability and composition of functions to achieve higher reliability and, arguably, higher productivity.</p>

<p>On the other hand, functional programming languages look like Klingon, but with math:</p>

<pre><code>instance Monad[] where
   return x = [x]
   xs &gt;&gt;= f = concat (map f xs)
   fail _ = []
</code></pre>

<p>WTF, ammiright? (And for extra points, it&#8217;s not a right-shift, it&#8217;s &#8220;bind.&#8221; Because arcana.)</p>

<p>The most laughable claim of the functionistas is that functional code is easy to comprehend and debug. Lemme&#8217; tell ya, bud, I&#8217;ve been a dozen lambdas deep trying to figure out behavior and this whole &#8220;functional code is stateless,&#8221; is more full of crap than an Oklahoma feedlot at slaughter time.</p>

<p>Functional programs have every flutter of state that an imperative program has, just <em>not in any convenient stackframe</em>.  Or &#8212; and this is <em>awesome</em> to debug &#8212; it&#8217;s not <em>yet</em> in the stack frame &#8212; what&#8217;s in the stack frame is a bunch of goddamn function pointers and not-yet-enough parameters to call them. Sometimes the thing you&#8217;re stuck on is a dozen lambdas down and it&#8217;s <em>building</em> a goddamn function pointer that will calculate the parameters (Excuse me! I mean calculate <em>exactly one parameter</em>!) to another goddamn function pointer. Thank <em>heavens</em> you don&#8217;t have to struggle with the mind-numbing complexity of an <code>if</code> branch (&#8220;Oh my God! The code <em>could</em> go this way or it might go <em>that</em> way! What kind of cephalopodic mind could comprehend this tangle‽&#8221;).</p>

<p>And don&#8217;t get me started on compilation speed. I <em>love</em> this idea that the &#8220;compiler finds certain errors.&#8221; What they don&#8217;t say &#8220;And it does this in a mere several minutes. So don&#8217;t worry about missing one of those show-stopping narrowing conversions! We&#8217;ll take a look at it <em>every goddamn time</em> you want to fix a typo in a different source file.&#8221;</p>

<p>But, nonetheless, there are a <em>few</em> things that the FP world does that actually make sense once you machete away all the obfuscatory mathematical rigor.</p>

<h2>Maybe Something Functional Does Right</h2>

<p>The biggest practical thing, on a day-to-day basis, is that functional code doesn&#8217;t have to deal with <code>null</code> values. If you have some complex object that may-or-may-not initialize properly (let&#8217;s say a camera which may or may not be available on your phone), you are probably used to writing code that looks more or less like this:</p>

<pre><code>var theCamera = AttemptCameraInitialization();
if(theCamera == null){ 
   DealWithNoCamera(); 
}else{ 
   var aPhoto = theCamera.TakePhoto();
   if(aPhoto == null)
   {
      DealWithNoPhoto();
   }
   …etc…
}
</code></pre>

<p>Or maybe:</p>

<pre><code>try{
    var theCamera = AttemptCameraInitialization()
    var aPhoto = theCamera.TakePhoto();
}catch(npe){
    DealWithNullPointerException(npe);
}
</code></pre>

<p>And while the <code>try-catch</code> style isn&#8217;t nearly as wordy as the constant-error-checking style, it&#8217;s a little harder to debug and good coding style says that one ought not to rely on exceptions to deal with common alternatives. Contrast this with what one might see in the functional world (exact names and syntax differ between functional languages, so I&#8217;ll use Scala, whose Klingon-y parts can be swept under the rug, and can actually be comprehended by humans):</p>

<pre><code> val theCamera = AttemptCameraInitialization();
 val thePhoto = theCamera.TakePhoto();
</code></pre>

<p>And <em>even if</em> there was a problem during <code>AttemptCameraInitialization()</code>, no exception would be thrown. Instead, <code>theCamera</code> would be represented by a <code>None</code> object and, when a function is called on a <code>None</code> object, that <code>None</code> object simply returns another <code>None</code>.</p>

<p>So this may look like no big deal with a couple lines of code, but if you have an <code>A</code> that has a <code>B()</code> function that returns a <code>B</code> that has a <code>C()</code> function that returns a <code>C</code> that…a <code>Y</code> that has a <code>Z()</code> function that returns a <code>Z</code>, you can write code like:</p>

<pre><code>var myZ = a.B().C().D().….X().Y().Z(); 
</code></pre>

<p>Which is much more readable than putting a bunch of checks-for-null between every method. And in this situation, you just are ploughing along nicely through your functions until one returns a <code>None</code>, in which case every function subsequent to that returns a <code>None</code>. (So how much fun is it when you&#8217;ve stepped your debugger up to that <em>one line</em> of code? But put that aside for now…)</p>

<p>So, talk to a functional guy about what&#8217;s going on and <strong>BOOM</strong> he drops the &#8220;M&#8221; word. Of all the gatekeeper-words in the mystical arcana that guard the entrance to the D&amp;D den where all the cool functional kids are hanging, none has the power of &#8220;Monad.&#8221; It evens <em>sounds</em> like something that Gandalf would warn you about: &#8220;Beware the realm of endofunctors, for there, monoids become monads!&#8221;</p>

<p>Lemme&#8217; tell ya&#8217;, I&#8217;ve been There and Back Again and monads are no big deal. They&#8217;re just goddamned parameterized types with a handful of easy semantic rules. Seriously. That&#8217;s <em>it</em>. The reason that they&#8217;re confusing is that the semantics are so stupidly underwhelming that you keep thinking &#8220;Yeah, okay, but what <em>else</em>?&#8221; It&#8217;s like the gate to your vast underground treasure-city being guarded by the word &#8220;friend,&#8221; a fact which is conveniently documented on the transom.</p>

<h2>Anything Monads Can Do, Inheritance Can Do Better</h2>

<p>So how are we gonna&#8217; do this? Easy! Let&#8217;s say we start with a couple classes that look like this:</p>

<pre><code>class Camera 
{
    Photo TakePhoto() { … etc…}
}

class Photo
{
    Bitmap GetImage() { … etc… }
    Exposure GetExposure() { …etc… }
   …etc…
}
</code></pre>

<p>All you have to do is define the interface to these objects, so that we can implement simple alternative &#8220;None&#8221; classes. <em>But</em> to help future maintenance programmers, we&#8217;re going to use a little invention of mine called &#8220;Hungarian Monadic Notation&#8221; to indicate our intent:</p>

<pre><code>interface MMaybeCamera 
{
    MMaybePhoto TakePhoto();
}

interface MMaybePhoto
{
    Bitmap GetImage();
    MMaybeExposure GetExposure();
}
</code></pre>

<p>The way this works is that we indicate that a class or interface has this monadic intention by prefixing it&#8217;s name with an &#8220;M&#8221;. But because there are a lot of different monad patterns, you specify <em>which</em> monad in particular you&#8217;re talking about as the next part of the name. So in this case we have <code>MMaybeCamera</code> indicating that we&#8217;re looking at this particular pattern. Ditto for <code>MMaybePhoto</code> but you could also have, like, <code>MEitherPhoto</code> or <code>MStateCamera</code> etc. The possibilities are endless! And it&#8217;s super-easy to do and doesn&#8217;t introduce any of those stupid compilation errors!</p>

<p>Now that you&#8217;ve used HMN to name your interfaces, you just change your original implementations to implement the HMN interface:</p>

<pre><code>class Camera : MMaybeCamera{ … original code… }

class Photo : MMaybePhoto { …original… }
</code></pre>

<p><em>But</em> in addition, you also implement the alternative &#8220;empty&#8221; objects:</p>

<pre><code>class NoneCamera : MMaybeCamera 
{
    MMaybePhoto TakePhoto()
    {
        return new NonePhoto();
    }
}

class NonePhoto : MMaybePhoto
{
    MMaybeExposure()
    {
       return new NoneExposure();
    }

    Bitmap GetImage() 
    {
       throw new MonadException("This is a none,son.");
    }
}
</code></pre>

<p>Isn&#8217;t that inspiringly clean code? When you call a function on a <code>None{x}</code> class, it just returns another new <code>None{y}</code> object! Or, when you need to break out a real class, you just throw a <code>MonadException</code>. (The details of <code>MonadException</code> are left as an exercise.)</p>

<p>Naturally, you kick this all off with a <code>MMaybeCameraFactory</code> to initialize your original <code>MMaybeCamera.</code></p>

<h2>Future Work</h2>

<p>Although Hungarian Monadic Notation and it&#8217;s implementation patterns are agile best practices worthy of the enterprise, it&#8217;s true that there&#8217;s a certain amount of boilerplate code that&#8217;s associated with implementing each of the functions in the base interface.</p>

<p>In a future post, we&#8217;ll cover the answer:</p>

<p><strong>Reflux: The Monadic Reflection Dependency Injection Framework</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2013/04/01/hungarian-monadic-notation-call-me-maybe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Literate Programming from HTML</title>
		<link>http://www.knowing.net/index.php/2013/03/17/literate-programming-from-html/</link>
		<comments>http://www.knowing.net/index.php/2013/03/17/literate-programming-from-html/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 02:19:48 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5529</guid>
		<description><![CDATA[OK, let&#8217;s see if this works&#8230; This is the basic structure of the &#8220;Hello, World!&#8221; program in C#: using System; class Hello { &#60;getchunk id="Main"/&#62; } where the Main chunk is defined as : static void Main() { Console.WriteLine("Hello, World!"); } C# Command-Line Extraction And if you clone my Github repository, you can: $ mono [...]]]></description>
				<content:encoded><![CDATA[<p>OK, let&#8217;s see if this works&#8230;</p>
<p>This is the basic structure of the &#8220;Hello, World!&#8221; program in C#:</p>
<pre id="HelloWorld">using System;

class Hello
{
   &lt;getchunk id="Main"/&gt;
}</pre>
<p>where the <code>Main</code> chunk is defined as :</p>
<pre id="Main">static void Main()
{
   Console.WriteLine("Hello, World!");
}</pre>
<h2>C# Command-Line Extraction</h2>
<p>And if you <a href="https://www.github.com/lobrien/MTangle/">clone my Github repository</a>, you can:</p>
<pre>$ mono mtangle.exe MyWordPressPage.html HelloWorld

using System;

class Hello
{

static void Main()
{
   Console.WriteLine("Hello, World!");
}

}

<hr />

You can read a <a href="http://www.knowing.net/index.php/literate-programming-in-html-and-c/">poorly-written bootstrapping explanation here</a>.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2013/03/17/literate-programming-from-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Gray</title>
		<link>http://www.knowing.net/index.php/2012/12/26/the-gray/</link>
		<comments>http://www.knowing.net/index.php/2012/12/26/the-gray/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 19:09:39 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5493</guid>
		<description><![CDATA[Spoiler alert. Not that you care. Scientists at UCSD have shown that people actually prefer stories when they have advance knowledge of the plot twists. Maybe movie companies have figured this out, because the trailer for The Gray has the final two shots of the movie in it. Not, mind you, the final stunt, like [...]]]></description>
				<content:encoded><![CDATA[<p>Spoiler alert.</p>

<p>Not that you care. <a href="http://kotaku.com/5830092/spoiler-alert-people-like-spoilers">Scientists at UCSD have shown</a> that people actually <em>prefer</em> stories when they have advance knowledge of the plot twists. Maybe movie companies have figured this out, because the trailer for The Gray has the final two shots of the movie in it. Not, mind you, the final stunt, like in &#8220;Mission: Impossible&#8221; where the trailer featured (SPOILER ALERT!) Tom Cruise being flung from the exploding helicopter onto the train, which I always thought was the ultimate in bad-faith &#8212; but the final two <em>shots</em> of the movie. So (SPOILER ALERT!) you never see Liam Neeson go mano-a-mano  with the alpha wolf. You know, like <em>was promised</em> in the damn trailer when they showed Liam Neeson with the mini booze bottles strapped to his knuckles and growling. CUT TO BLACK, ROLL CREDITS. Yeah, that&#8217;s the end of the damned movie.</p>

<p>No pata-a-bottelo fight between Liam Neeson and the Wolf King. Which isn&#8217;t gray. It&#8217;s black. Wait! The Gray isn&#8217;t the wolf! It&#8217;s Liam! He&#8217;s morally ambiguous! Or middle-aged! Or, subsequent to standing against the wolf-king, will return as Liam the White! No, that&#8217;s not it. Let&#8217;s go for morally ambiguous. Yeah, that&#8217;s it. &#8220;The Gray&#8221; isn&#8217;t about the battle out there, or out there, it&#8217;s about in here (point at head)… And the battle in here (point at heart).</p>

<p>It&#8217;s also about how very, very ominous coughing is. Maybe the whole movie is a dream of a man dying in a tuberculosis ward. That would make about as much sense as the purported plot, which  is that Liam is a wolf-sniper for a let&#8217;s-say-oil-company on Alaska&#8217;s North Field. Liam dreams of lying beside his wife, who died of let&#8217;s-say-cancer, and who tells him not to be afraid. But Liam is afraid, as he tells Diaz-The-Hard-Case. Liam says &#8220;Any man who isn&#8217;t afraid is a liar, or a damn fool.&#8221; Actually John Wayne said that in &#8220;Sands of Iwo Jima&#8221; but Liam says something awfully similar. And then he alpha-rolls Diaz-the-Hard-Case, pisses on him, and the Wolf King realizes that there are two Wolf Kings afoot North of the Wall. And There Can Be Only One!</p>

<p>Or maybe there are, like, <em>dozens</em> of Wolf Kings. Because after Liam survives falling out a jet (soft snow) and puts together a rag-tag band of misfit survivors (a hard case, a philosopher, a couple guys in red shirts, and a token black dude) Liam explains that they can&#8217;t stay at the wreck site, what with its shelter, supplies, and attraction to rescuers. No, they must &#8220;wait until sunrise, figure out which way is South, and walk to help.&#8221; Which makes sense because, obviously, if you&#8217;re so deep in the Alaska backcountry that the company just writes off jet crashes (they actually say that &#8212; &#8220;What do they care? Do you know how much payroll they save by letting us die?&#8221;) then <em>obviously</em> the smart thing to do is hike to Anchorage.</p>

<p>Which is smart, too, because the plane crashed within the &#8220;kill radius&#8221; of a wolf den &#8212; the radius around a den in which wolves kill all living things…</p>

<p>OK, so at this point in the movie I told myself &#8220;OK, fine, it&#8217;s not Alaska. It&#8217;s Ice Planet Zebulon and they aren&#8217;t wolves, they&#8217;re Shark-Wolves. And, you know, I&#8217;m going to ignore the business about it being cold but no one putting their hood up or even zipping up their damn parkas. It&#8217;ll be <em>fine</em>. Trust in Liam.&#8221;</p>

<p>…So they walk. They walk miles and miles. They walk so far that Diaz-the-Hard-Case becomes Walt Whitman and accepts his fate as Meal #8 for… Well, apparently the Wolf King and his pack. Or maybe it&#8217;s another one, because not only have they walked miles and miles and left the &#8220;kill radius,&#8221; they&#8217;ve scaled a cliff separating them from the tundra.</p>

<p>Which brings us to the cliff scene. No, screw it. I can&#8217;t even try to back-project logic, physics, and continuity onto that sequence. There&#8217;s a cliff. They get down the cliff. They keep going. The wolves continue to attack. So apparently the wolves got down the cliff, too. Presumably also by jumping into trees and then climbing down them. Or maybe at the end they&#8217;re battling a different pack of shark-wolves.</p>

<p>But I&#8217;m going to assume they&#8217;re battling the same wolf pack and the same alpha Shark-Wolf. The movie doesn&#8217;t have the courage of its faux-Existentialist convictions to present &#8220;Well, actually it&#8217;s just shark-wolves all the way down.&#8221; No, no, there is an alpha Shark-Wolf King and eventually, <em>eventually</em> Liam must confront it.</p>

<p>Personally, I expected Liam to bottle-punch the Wolf King to death and then stand, bloodied and alone, in a ring of wolves who approach and slowly herd him into their den where they lick the blood off him and submit to him as the new Alpha Shark-Wolf.  Now <em>that</em> would have been an ending.</p>

<p>But no. Cut to black, roll credits.</p>

<p>We don&#8217;t need to see the battle, apparently, because we already know all that we need to know: Liam has journeyed through the existential tundra and re-engaged with life. We know this because of the poem he recites before doing battle. &#8220;Just four lines,&#8221; he says. Written by his Da. Who stole the first line from Shakespeare and ran out of ideas on the third, so he just repeats it.</p>

<blockquote>Once more into the fray.<br />
    Into the last good fight I&#8217;ll ever know.<br />
    Live and die on this day. <br />
    Live and die on this day. <br />
</blockquote>

<p>What a piece of crap.</p>

<p>Devin says that &#8220;The Gray&#8221; is a movie to be compared to &#8220;Anaconda.&#8221; Slander. You want a poem? Here&#8217;s just an example of the treasures in Anaconda:</p>

<blockquote> They strike, wrap around you;<br />
    Hold you tighter than <br />
    Your true love. And you<br />
    Get the privilege;<br />
    Of hearing your bones; <br />
    Break &#8216;fore the power;<br />
    Of the embrace;<br />
    Causes your veins to &#8216;xplode.<br />  
</blockquote>

<p>And that&#8217;s <em>way</em> before the Anaconda pukes up Jon Voigt whole. And you can be damn sure they didn&#8217;t show <em>that</em> in the trailer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2012/12/26/the-gray/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reviewed 4 Stars: Lost at Sea, The Jon Ronson Mysteries</title>
		<link>http://www.knowing.net/index.php/2012/11/19/reviewed-4-stars-lost-at-sea-the-jon-ronson-mysteries/</link>
		<comments>http://www.knowing.net/index.php/2012/11/19/reviewed-4-stars-lost-at-sea-the-jon-ronson-mysteries/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 18:16:21 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5479</guid>
		<description><![CDATA[Lost At Sea: The Jon Ronson Mysteries by Jon Ronson My rating: 4 of 5 stars Highly recommended. Ronson returns to the form of &#8220;Them,&#8221; and &#8220;The Men Who Stare At Goats,&#8221; in this collection of humorous journalistic essays. His last book, &#8220;The Psychopath Test,&#8221; was a little one-note and more judgmental, while this collection [...]]]></description>
				<content:encoded><![CDATA[<p><a style="float: left; padding-right: 20px;" href="http://www.goodreads.com/book/show/15737151-lost-at-sea"><img src="http://d.gr-assets.com/books/1346292925m/15737151.jpg" border="0" alt="Lost At Sea: The Jon Ronson Mysteries" /></a><a href="http://www.goodreads.com/book/show/15737151-lost-at-sea">Lost At Sea: The Jon Ronson Mysteries</a> by <a href="http://www.goodreads.com/author/show/1218.Jon_Ronson">Jon Ronson</a><br />
My rating: <a href="http://www.goodreads.com/review/show/459278663">4 of 5 stars</a></p>
<p>Highly recommended. Ronson returns to the form of &#8220;Them,&#8221; and &#8220;The Men Who Stare At Goats,&#8221; in this collection of humorous journalistic essays. His last book, &#8220;The Psychopath Test,&#8221; was a little one-note and more judgmental, while this collection travels broadly and shows Ronson in a variety of moods. Ronson&#8217;s best book remains &#8220;Them,&#8221; but I enjoyed every essay in &#8220;Lost at Sea.&#8221; An easy-to-read book with bite-sized essays perfect for the treadmill/exercycle.</p>
<p><a href="http://www.goodreads.com/review/list/6080403-larry-o-brien">View all my reviews</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2012/11/19/reviewed-4-stars-lost-at-sea-the-jon-ronson-mysteries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How does Ravelry make money?</title>
		<link>http://www.knowing.net/index.php/2012/11/19/how-does-ravelry-make-money/</link>
		<comments>http://www.knowing.net/index.php/2012/11/19/how-does-ravelry-make-money/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 16:00:29 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5476</guid>
		<description><![CDATA[Ravelry is a profitable 4-person company, a &#8220;lifestyle business&#8221;. This model is of little interest to venture capitalists but is, I think, very appealing to most people dreaming about their own business: Unraveled » Blog Archive » How does Ravelry make money?.]]></description>
				<content:encoded><![CDATA[<p>Ravelry is a profitable 4-person company, a &#8220;lifestyle business&#8221;. This model is of little interest to venture capitalists but is, I think, very appealing to most people dreaming about their own business:</p>
<p><a href="http://blog.ravelry.com/2012/01/25/how-does-ravelry-make-money/">Unraveled » Blog Archive » How does Ravelry make money?</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2012/11/19/how-does-ravelry-make-money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geek Cred Milestone: Stack Overflow Top 9%</title>
		<link>http://www.knowing.net/index.php/2012/11/13/geek-cred-milestone-stack-overflow-top-9/</link>
		<comments>http://www.knowing.net/index.php/2012/11/13/geek-cred-milestone-stack-overflow-top-9/#comments</comments>
		<pubDate>Tue, 13 Nov 2012 19:44:05 +0000</pubDate>
		<dc:creator>larry</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.knowing.net/?p=5471</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.knowing.net/wp-content/uploads/2012/11/Screen-Shot-2012-11-13-at-9.40.40-AM1.png"><img src="http://www.knowing.net/wp-content/uploads/2012/11/Screen-Shot-2012-11-13-at-9.40.40-AM1.png" alt="" title="Screen Shot 2012-11-13 at 9.40.40 AM" width="482" height="86" class="alignleft size-full wp-image-5472" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.knowing.net/index.php/2012/11/13/geek-cred-milestone-stack-overflow-top-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
