<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
    <title>Jacob Peoples' Blog</title>
    <link>https://jpeoples.github.io/blog</link>
    <atom:link href="https://jpeoples.github.io/blog/rss.xml" rel="self" type="application/rss+xml" />
    <description>Jacob Peoples' Web Log</description>
    
    <item>
        <title>Boredom World 4: You can&#39;t &#34;do anything&#34;, so do what you can</title>
        <link>https://jpeoples.github.io/blog/2022/11/15/do-what-you-can/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2022/11/15/do-what-you-can/</guid>
        <pubDate>Mon, 14 Nov 2022 09:00:00 -0000</pubDate>
        <description>&lt;p&gt;In &lt;a href=&#34;https://www.amazon.com/defining-decade-your-twenties-matter/dp/0446561754&#34;&gt;Meg Jay’s The Defining Decade&lt;/a&gt; she recalls a client who tells her that whenever he tries to think about what he wants to do with his life, he feels “lost in the ocean”, no land in sight, no sense of direction. His whole life he had been told he could “do anything” and now he was suffering for it.&lt;/p&gt;
&lt;p&gt;After all, if your options are infinite, then surely any concrete path you may consider is inferior to some other option you’ve not yet thought of. The result is this sense of being lost in the middle of the ocean, which is really referring to a lack of &lt;a href=&#34;https://www.ribbonfarm.com/2019/04/15/mediocratopia-4/&#34;&gt;environmental anisotropy&lt;/a&gt;. Everything looks the same, because nothing is good enough when your options are infinite &amp;ndash; you can’t see land in any direction you look.&lt;/p&gt;
&lt;p&gt;This is the result of an overload of choices, leading to an &lt;a href=&#34;https://jpeoples.github.io/blog/2020/07/23/boredom-world-1/&#34;&gt;inability to make a decision&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;She explains to him:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“You’ve spent more than two decades shaping who you are. You have experiences, interests, strengths, weaknesses, diplomas, hang-ups, priorities. You didn’t just this moment drop onto the planet or, as you put it, into the ocean. The past twenty-five years are relevant. You’re standing in front of six flavors of jam and you know something about whether you prefer kiwi or black cherry.”&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Eventually she gets him to come up with some reasonable options available to him given where he is at now, with his history, experience, and interests. This is a clear win: &lt;a href=&#34;https://jpeoples.github.io/blog/2019/11/creativity-space/#artificial-constraints&#34;&gt;constraints can help us come up with creative solutions&lt;/a&gt;. Within our model in this blogchain, it is using the client’s history and current location as an &lt;a href=&#34;https://jpeoples.github.io/blog/2020/08/16/orientation-and-overcoming-overload-boredom/&#34;&gt;orientation&lt;/a&gt;, filtering the landscape of possibilities to a more reasonable, local set.&lt;/p&gt;
&lt;p&gt;But it still isn’t enough.&lt;/p&gt;
&lt;p&gt;When the client considers these options, they feel mundane compared to his prior prospects of being able to “do anything”. They feel &lt;a href=&#34;https://breakingsmart.substack.com/p/against-waldenponding&#34;&gt;too ordinary&lt;/a&gt;. And none of them really jump out at him as better than the others.&lt;/p&gt;
&lt;p&gt;So we see that, at least in this case, an orientation would ideally be more than just a filter producing a short-list of items from a larger, more overwhelming set. It would also provide a framework for weighing and comparing those items.&lt;/p&gt;
&lt;p&gt;For some, such a framework can be provided by a strong sense of moral duty or beliefs about the state of the world, as Nate Soares &lt;a href=&#34;https://mindingourway.com/caring-about-some/&#34;&gt;refers to&lt;/a&gt; in his &lt;a href=&#34;https://mindingourway.com/guilt/&#34;&gt;replacing guilt&lt;/a&gt; series. But even then, as a fickle individual human, the actual goal or value system driving you &lt;a href=&#34;https://mindingourway.com/you-dont-get-t/&#34;&gt;may not always be perfectly transparent&lt;/a&gt;. The good news is that because the role of an orientation is only to provide a sense of direction, there is no need to fully comprehend the destination.&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:2&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; A strong sense of direction is enough to allow you to weigh and compare the available options (and stop feeling lost in the middle of the ocean).&lt;/p&gt;
&lt;p&gt;If you’re still unsure, a way to go about finding a suitable orientation may be to evaluate the work you’ve done in the past, selecting the work you enjoyed the most, or found the most fulfilling. Given this list, you can try to find the through-line that unites them all. Again, I think it would be a mistake to try to be too specific &amp;ndash; the orientation should be open-ended and general so as to be adaptable. If you’ve primarily worked in a particular, specific area, but are open to branching out, it makes sense that your work in that area is more of a microcosm of the more general pattern that underlies your orientation.&lt;/p&gt;
&lt;p&gt;Given that the orientation serves as an interpretive framework &amp;ndash; a unified understanding of what you are trying to do &amp;ndash; it can also be used to interpret the work you have now, assuming you are currently working. That is to say, the orientation can be used to help guide your current work decisions. Indeed, we previously talked about &lt;a href=&#34;https://jpeoples.github.io/blog/2020/08/16/orientation-and-overcoming-overload-boredom/&#34;&gt;Richard Hamming’s orientation toward doing great work&lt;/a&gt;. He points out that it may be possible to reframe the work you already have to make it more important and more consequential. And likewise, you can use &lt;em&gt;your&lt;/em&gt; orientation to reframe or reinterpret the work you already have to be more meaningful by being more aligned with your orientation.&lt;/p&gt;
&lt;p&gt;As a final note it is worth remembering that the orientation is only one component of what is a dynamic system. It should be anything but static across a lifetime. As your scaffolding of experiences and priorities shifts, as your environment changes, the interpretive framework you use to evaluate opportunities and make decisions should also change.&lt;/p&gt;
&lt;p&gt;With that having been said, the value of having an explicit orientation in your mind right now is that it is a powerful tool for introspection. Once you have an orientation that feels properly aligned, it can be used to make concrete decisions in ways that are also aligned. It can be used to clarify your desires. It can be used to determine concrete goals. And thus for those that struggle to understand or determine their goals or desires, finding such an orientation can be immensely valuable. Goals and desires are downstream of orientation. So find one.&lt;/p&gt;
&lt;!-- Footnotes themselves at the bottom. --&gt;

&lt;h3 id=&#34;notes&#34;&gt;Notes&lt;a class=&#34;headerlink&#34; href=&#34;#notes&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;When she talks about jam here, she is referring to the &lt;a href=&#34;https://medium.com/@FlorentGeerts/the-jam-experiment-how-choice-overloads-makes-consumers-buy-less-d610f8c37b9b&#34;&gt;jam experiment&lt;/a&gt;.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:2&#34;&gt;
&lt;p&gt;I should note here that Nate draws the&lt;a href=&#34;https://mindingourway.com/you-dont-get-t/#:~:text=I%20just%20don%27t,the%20arrow%20points.&#34;&gt; same conclusion&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I just don&amp;rsquo;t have an exact description of what I&amp;rsquo;m working towards.&lt;/p&gt;
&lt;p&gt;And I don&amp;rsquo;t need one, to figure out what to do next. Not yet, anyway. I can&amp;rsquo;t tell you exactly where I&amp;rsquo;m going, but I can sure see which direction the arrow points.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:2&#34; title=&#34;Jump back to footnote 2 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>Boredom World 3: Overcoming the Hastings Limit By Bootstrapping a World-View</title>
        <link>https://jpeoples.github.io/blog/2020/10/27/overcoming-the-hastings-limit/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2020/10/27/overcoming-the-hastings-limit/</guid>
        <pubDate>Tue, 27 Oct 2020 14:48:35 -0000</pubDate>
        <description>&lt;blockquote&gt;
&lt;p&gt;[E]mbrace the fact that there will be good shows you’ll either miss
or be very late to. I called it “&lt;a href=&#34;https://twitter.com/backlon/status/1192455542221918208&#34;&gt;The Hastings
Limit&lt;/a&gt;” last
November — named after Netflix’s CEO who said that his only real
competition was sleep. The Hastings Limit is the moment when you
admit to yourself that there’s stuff that you would absolutely love
that you’re absolutely just going to not see.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.theverge.com/2020/1/17/21069703/streaming-wars-peacock-subscription-fatigue-exhaustion-apple-hbo-hulu-netflix-quibi-disney-augh#D9bdv8&#34;&gt;Dieter Bohn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;The &lt;a href=&#34;https://twitter.com/backlon/status/1192455542221918208&#34;&gt;Hastings
Limit&lt;/a&gt; is
declaring attentional bankruptcy. It is highly
relevant to the notion of overload boredom. In fact, it&amp;rsquo;s pretty much a
direct statement of how too much access to content produces boredom.
Drowning in an ocean of content, the only way to reach the surface is to
take control of your own attention.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&#34;https://jpeoples.github.io/blog/2020/08/16/orientation-and-overcoming-overload-boredom/&#34;&gt;my
model&lt;/a&gt;,
triaging must be done via some orientation, to act as a filter on all
this incoming content. But this is difficult to bootstrap when your
attention feels pulled in a hundred directions at once. What&amp;rsquo;s a
consumer to do?&lt;/p&gt;
&lt;p&gt;I think we have to understand orientation as &amp;ndash; at least in part &amp;ndash; a
kind of self-knowledge. A way to actively manage our own attention, by
knowing intuitively what will be most appealing or relevant. In new
environments, or when exposed to many new things all at once &amp;ndash; like on
Twitter&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; &amp;ndash; we are often lacking any such properly calibrated filter.&lt;/p&gt;
&lt;p&gt;A simple and intuitive approach is reflected in the common advice: read
nothing directly on social media &amp;ndash; instead use it to collect links. By
&lt;a href=&#34;https://zettelkasten.de/posts/reading-web-rss-note-taking/&#34;&gt;separating collection and
consuming&lt;/a&gt;,
you can revisit your decisions later when the context has changed, and
see if the particular piece of media still feels salient. This idea
makes perfect sense when you remember that the marketing of content in
general is done with the particular intent of manipulating your salience
landscape to make you click. Of course, inbox management comes with its
own issues, but ultimately this may be a &lt;a href=&#34;https://notes.andymatuschak.org/%C2%A7Inboxes_and_attention_management&#34;&gt;more manageable
situation.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Another is to relinquish control for a while. Read widely, dipping in
here and there, and pay attention to what actually seems to pay off and
what doesn&amp;rsquo;t. Start &lt;a href=&#34;http://www.collaborativefund.com/blog/how-to-read-lots-of-inputs-and-a-strong-filter/&#34;&gt;many books, finish
few.&lt;/a&gt;
With time, and reflection, this process can help you understand your own
interests in a bottom-up fashion.&lt;/p&gt;
&lt;p&gt;Of course, any of this is dependent upon your giving up on the fear of
missing out. And the solution is not to unplug &amp;ndash; this is its own
pathology which Venkatesh Rao called &lt;a href=&#34;https://breakingsmart.substack.com/p/against-waldenponding&#34;&gt;the fear of being
ordinary&lt;/a&gt;.
You must come to know yourself. To act with intention and clarity toward
the development of your own idiosyncratic experience of the world &amp;ndash;
your very own world-view.&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;Twitter has an interesting ability to impart just enough
 context onto things so as to have you &lt;a href=&#34;https://twitter.com/michael_nielsen/status/1305908051153620992&#34;&gt;care about pretty much
 anything&lt;/a&gt;.
 This can be good, but perhaps is a double-edged sword.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>Boredom World 2: The Role of Orientation in Overcoming Overload Boredom</title>
        <link>https://jpeoples.github.io/blog/2020/08/16/orientation-and-overcoming-overload-boredom/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2020/08/16/orientation-and-overcoming-overload-boredom/</guid>
        <pubDate>Sun, 16 Aug 2020 12:48:21 -0000</pubDate>
        <description>&lt;p&gt;The following, due to Orrin Klapp, gives the beginnings of a mental
model for this generalized notion of boredom I introduced in the &lt;a href=&#34;https://jpeoples.github.io/blog/2020/07/23/boredom-world-1/&#34;&gt;last
post&lt;/a&gt;:&lt;sup id=&#34;fnref:klapp&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:klapp&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Meaning and interest are found mostly in the mid-range between
extremes of redundancy and variety – these extremes being called,
respectively, banality and noise. Any gain in banality or noise, and
consequent meaning loss and boredom, we view as a loss of potential
&amp;hellip; for a certain line of action at least; and loss of potential is
one definition of entropy.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If this is right, and the anxious boredom produced by exposure to an
ephemeral environment is indeed the result of too much variety of input,
the obvious solution is the intentional introduction of redundancy &amp;ndash;
the introduction of some structure atop the ephemeral stream.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&#34;https://jpeoples.github.io/blog/2019/12/ephemerality-bus-ticket-theory-of-genius/&#34;&gt;my post&lt;/a&gt; discussing Paul Graham&amp;rsquo;s &lt;a href=&#34;http://paulgraham.com/genius.html&#34;&gt;bus ticket theory
of genius&lt;/a&gt;, I refer to such a structure as a &lt;em&gt;scaffolding&lt;/em&gt;
&amp;ndash; greedily built up from a series of structure preserving
transformations using the ephemeral stream as source of raw materials.
By gradually building up such a scaffolding we develop a point of view
that imposes structure and meaning onto this otherwise unstructured
environment. We begin to see ways to integrate the raw materials that
float by into our scaffolding, and as the structure grows and becomes
more elaborate, the opportunities for growth themselves become more
frequent. Through the lens of this structure, we can begin to make sense
of the environment, to understand it, and therefore overcome boredom,
understood as &lt;a href=&#34;https://jpeoples.github.io/blog/2020/07/23/boredom-world-1/&#34;&gt;the inability to make a decision.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But there is still something missing from this overall all account &amp;ndash;
something I will refer to as &lt;em&gt;orientation&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Broadly speaking, an orientation is some specification of direction
relative to a given position. For the present model then, I&amp;rsquo;ll use
orientation to refer to some possibly vague, directional sense of how we
are trying to grow our scaffolding. It is a filter both on the items we
draw from the ephemeral stream itself, and on the transformations we
choose to apply to the structure.&lt;/p&gt;
&lt;p&gt;Putting it all together, we get a mental model what a strategy for
dealing with this kind of ephemeral environment might look like. As
inputs are drawn from the stream, they are filtered and integrated into
our scaffolding through our orientation. As this scaffolding develops,
so too does our orientation. Finally, through the lens of this
scaffolding we are able to make decisions and take actions, which
themselves influence the ephemeral stream.&lt;/p&gt;
&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;Illustration of the model&#34; title=&#34;Illustration of the model&#34;  src=&#34;https://jpeoples.github.io/blog/2020/08/16/model_diagram_transparent.png&#34;  width=&#34;500&#34;   /&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;intuitive-orientations&#34;&gt;Intuitive Orientations&lt;a class=&#34;headerlink&#34; href=&#34;#intuitive-orientations&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In my &lt;a href=&#34;https://jpeoples.github.io/blog/2019/11/service-anxiety-information-overload/&#34;&gt;original post exploring some of these ideas&lt;/a&gt;, I
refer to the role of serendipity in alleviating anxiety produced by
ephemerality. I think with this notion of an orientation, we can further
clarify this role.&lt;/p&gt;
&lt;p&gt;In particular, looking broadly at the work of Tiago Forte, whom I drew
upon heavily in that initial post, there is an emphasis on resonance and
serendipity as a means of feeding and tending your &lt;a href=&#34;https://www.buildingasecondbrain.com/&#34;&gt;second brain&lt;/a&gt;.
He suggests that when reading and taking notes, you should save those
things that seem to &lt;em&gt;resonate&lt;/em&gt;. Notes themselves are taken in raw form,
saved, and when they serendipitously resurface in the process of some
project, you can further tend them through the process of &lt;a href=&#34;https://fortelabs.co/blog/series/ps/&#34;&gt;progressive
summarization&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The second brain here is an external instantiation of the scaffolding,
and resonance and serendipity combine to form a kind of intuitive
orientation to select raw materials, and transform the existing
structure, respectively. The direction here is not defined so much by
some actual intended outcome or destination, but instead, an emergent
direction determined by the following of the intuitive sense of what
resonates, what already exists, and what resurfaces.&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s return to the bus ticket theory. For Graham, the key component
of this theory is a &amp;ldquo;disinterested obsession with something that
matters&amp;rdquo;. Crucially though, whether the thing matters tends to be
revealed &lt;em&gt;after the fact&lt;/em&gt;. During the actual process, the disinterested
obsession may well appear to be, like bus-ticket collecting, with
something inconsequential. In terms of the subjective experience of
being inside this process, that the object of obsession is something
that matters is actually irrelevant. While doing the work, the obsession
manifests as a kind of focus &amp;ndash; a straightforward filter on the
ephemeral stream that works by ignoring most things, and focusing very
hard on a small subset of things. The structure emerges through simply
following this intense curiosity, naturally noticing connections in the
process of collecting and revisiting gathered materials.&lt;/p&gt;
&lt;p&gt;The obsession functions as an orientation in exactly the sense I am
describing. And as an orientation, I think it works very similarly to
the resonance and serendipity approach, except the state of obsession
probably leads to a much more focused set of things that resonate, and
thus that get integrated into the scaffolding. The work itself, though,
is still driven by intuition and curiosity. The rest is then largely up
to luck &amp;ndash; that the collecting and connecting leads to some
breakthrough, and that the subject matter turns out to be important.&lt;/p&gt;
&lt;h2 id=&#34;go-forth-and-become-great-scientists&#34;&gt;&lt;em&gt;Go Forth and Become Great Scientists!&lt;/em&gt;&lt;a class=&#34;headerlink&#34; href=&#34;#go-forth-and-become-great-scientists&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is the provocation concluding Richard Hamming&amp;rsquo;s classic talk, &lt;a href=&#34;https://www.site.uottawa.ca/~yymao/misc/Hamming_kaiser.html&#34;&gt;&lt;em&gt;You
and Your Research&lt;/em&gt;&lt;/a&gt;. This is an orientation in a
more direct sense: a constraint on the direction in which you want to
take your work in the form of the quality you want it to have, namely,
greatness.&lt;/p&gt;
&lt;p&gt;I think Hamming gives a couple of concrete pieces of advice in terms of
what such an orientation should look like:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Actively think about the important problems in your field.&lt;/li&gt;
&lt;li&gt;Have the courage to work on significant things, and then work hard
   with drive and emotional commitment.&lt;/li&gt;
&lt;li&gt;Reframe the work you already have to be more important or impactful.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;But that the orientation is more intentional does not mean that there is
no element of luck: &amp;ldquo;the particular thing you do is luck, but that you
do something is not.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;No matter how intentional, the orientation is only a kind of directional
guide &amp;ndash; a north star. There is no escaping the element of luck inherent
in that one may only build with the materials one comes across. It is no
accident that both Graham and Hamming invoke Pasteur: luck favours the
prepared mind.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Broadly, I think this notion of orientation, and the model that is
gradually being built up here, may give a useful lens to think about
anxiety and overwhelm induced by ephemeral environments. It gives us a
kind of recipe for designing &lt;a href=&#34;https://notes.andymatuschak.org/z53fk5XwrsnueNDDCq6WNe2VbPhrDGQmmVgNS&#34;&gt;executable
strategies&lt;/a&gt; to alleviate boredom, or avoid it
altogether. By orienting ourselves in a particular context, we can
follow the process, and trust that the scaffolding that gradually
develops will allow us to make sense of the ephemeral environment we
occupy.&lt;/p&gt;
&lt;p&gt;The orientations I&amp;rsquo;ve discussed here have largely been about
intellectual progress in an information-dense context &amp;ndash; and thus
focused on alleviating information overload. But as I&amp;rsquo;ve said, I think
this pattern of ephemerality-induced anxiety, or overload boredom,
manifests in other areas of life as well. I expect that future posts in
this blogchain will try and investigate some of these.&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:klapp&#34;&gt;
&lt;p&gt;Klapp, O. (1986) Overload and Boredom: Essays on the Quality
  of Life in the Information Society, Westport, CT: Greenwood. (h/t
  Mosurinjohn, S. “Overload, Boredom, and the Aesthetics of Texting.” In
  Michael E. Gardiner and Julian Jason Haladyn (Eds.), The Boredom
  Studies Reader: Frameworks and Perspectives, pp. 143-156. New York:
  Routledge, 2016.)&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:klapp&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>Boredom World 1: Boredom, Overload, and Meaning Collapse</title>
        <link>https://jpeoples.github.io/blog/2020/07/23/boredom-world-1/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2020/07/23/boredom-world-1/</guid>
        <pubDate>Thu, 23 Jul 2020 18:17:44 -0000</pubDate>
        <description>&lt;p&gt;In a couple of my most &lt;a href=&#34;https://jpeoples.github.io/blog/2019/11/service-anxiety-information-overload/&#34;&gt;recent&lt;/a&gt; &lt;a href=&#34;https://jpeoples.github.io/blog/2019/12/ephemerality-bus-ticket-theory-of-genius/&#34;&gt;posts&lt;/a&gt;, I&amp;rsquo;ve been gesturing at the notion of ephemerality as a source of overload and anxiety, and trying to determine some strategy for alleviating it. Here I&amp;rsquo;m going to give this problem a new name: boredom.&lt;/p&gt;

&lt;p&gt;Boredom may seem like a strange name for an anxious state of overwhelm brought on by having &lt;em&gt;too much&lt;/em&gt; going on. After all, we normally associate boredom with sitting around unable to think of anything to do. Indeed, Tolstoy called boredom the &amp;ldquo;desire for desires&amp;rdquo;. And while this resonates with my own experience of boredom, I&amp;rsquo;m going to recklessly generalize it further: &lt;em&gt;boredom is the inability to make a decision&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Boredom is not about being unable to think of anything to do, but being unable to choose. Crucially, this indecision can be brought on by both too little information/stimulation, or too much: &lt;a href=&#34;https://en.wikipedia.org/wiki/Information_overload&#34;&gt;information overload&lt;/a&gt; is indecision arising from having &lt;em&gt;too much information to adequately integrate&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.queensu.ca/religion/people/faculty/sharday-c-mosurinjohn&#34;&gt;Sharday Mosurinjohn&lt;/a&gt; lays this out well:&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Whereas one of the archetypal scenes of modern boredom was repetitive labour on the factory line, in the age of globalised, flexible, late capitalism we find ourselves twisting and turning through the digital information network, unsure if we’re ever really punched out and driven to distraction by clickbait, the need to update and emails stacking up like a losing Tetris game. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We can&amp;rsquo;t choose something to focus on, or what to prioritize, due to an overload of possible options. She &lt;a href=&#34;http://forboredom.com/about-the-project/&#34;&gt;explains further&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Given that other scholars have built an historical case about boredom as a modern phenomenon construed by 19th century artists and thinkers in terms of a “spiritual crisis,” what we are doing is arguing that it’s productive to understand late modern boredom – what I (Sharday) have called “overload boredom” – as a spiritual crisis. Overload boredom is what comes, perhaps unexpectedly, from not too little stimulation, but by too much – too much information to parse for meaning, too much connectivity to engage with any one connection, too many options, from consumer goods to ideologies, to do anything other than stand before them, paralyzed. Its key feature is that it makes us withdraw from engaging the very problems that cause it, making it even harder to recognize an already elusive affect.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;From here we can start to see boredom as more than sitting idly on a Sunday afternoon, but indeed, as a source of a crisis of meaning &amp;ndash; the inability to know ourselves, our desires, our needs.&lt;/p&gt;
&lt;p&gt;It is exactly boredom in this sense that is thus described by the anxiety produced in response to exposure to the ephemeral environment. &lt;em&gt;Ephemerality can produce a crisis of meaning&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I think this is a big and interesting topic &amp;ndash; something I&amp;rsquo;ve been thinking about for some time now &amp;ndash; so I think I&amp;rsquo;ll call this the first post of a new &lt;a href=&#34;https://tomcritchlow.com/2019/07/17/blogchains/&#34;&gt;blogchain&lt;/a&gt;: Boredom World.&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;Mosurinjohn, S. “Overload, Boredom, and the Aesthetics of Texting.” In Michael E. Gardiner and Julian Jason Haladyn (Eds.), The Boredom Studies Reader: Frameworks and Perspectives, pp. 143-156. New York: Routledge, 2016.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>Ephemerality and the Bus Ticket Theory of Genius</title>
        <link>https://jpeoples.github.io/blog/2019/12/ephemerality-bus-ticket-theory-of-genius/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2019/12/ephemerality-bus-ticket-theory-of-genius/</guid>
        <pubDate>Mon, 02 Dec 2019 21:01:56 -0000</pubDate>
        <description>&lt;p&gt;In Paul Graham’s recent essay, &lt;em&gt;&lt;a href=&#34;http://paulgraham.com/genius.html&#34;&gt;The Bus Ticket Theory of
Genius&lt;/a&gt;&lt;/em&gt;, he posits that
disinterested obsession, akin to that possessed by a bus ticket
collector, is a key component for doing great work. He writes&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When you look at the lives of people who&amp;rsquo;ve done great work, you
see a consistent pattern. They often begin with a bus ticket
collector&amp;rsquo;s obsessive interest in something that would have seemed
pointless to most of their contemporaries. One of the most
striking features of Darwin&amp;rsquo;s book about his voyage on the Beagle
is the sheer depth of his interest in natural history. His
curiosity seems infinite. Ditto for Ramanujan, sitting by the hour
working out on his slate what happens to series.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a mistake to think they were &amp;ldquo;laying the groundwork&amp;rdquo; for the
discoveries they made later. There&amp;rsquo;s too much intention in that
metaphor. Like bus ticket collectors, they were doing it because
they liked it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think what rings true to me about this is the rejection of the role of
top-down intentionality; the greatness of the resulting body of work is
an emergent property of disinterested pursuit of what was interesting.
In my experience in pursuing any kind of intellectual work, a top-down
imposition of structure always seems to be relatively useless except
insofar as it gets you doing &lt;em&gt;something&lt;/em&gt;. The real structure of anything
I’ve ever worked on has ultimately been revealed: it emerges from the
process discovery, refinement, iteration. Certainly, I imagine this
would be uncontroversial in the programming community. It is essentially
waterfall (top-down) vs agile (bottom-up, emergent).&lt;/p&gt;
&lt;p&gt;Graham goes on to say&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An obsessive interest will even bring you luck, to the extent anything
can. Chance, as Pasteur said, favors the prepared mind, and if there&amp;rsquo;s
one thing an obsessed mind is, it&amp;rsquo;s prepared.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And so again—serendipitously—serendipity enters the equation.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;In a &lt;a href=&#34;https://jpeoples.github.io/blog/2019/11/service-anxiety-information-overload/&#34;&gt;previous
post&lt;/a&gt;
I examined “service anxiety”—the fear of the loss of access to data
controlled by web services—and argued by analogy with information
overload, that to alleviate this anxiety one should relinquish control
and embrace serendipity. I argued that the connection between service
anxiety and information overload was ephemerality, either in the access
to the services we rely on, or in the information we are bombarded with.
This creates an unstable foundation—a drifting reality—on which we
attempt to build the structure of our lives.&lt;/p&gt;
&lt;p&gt;But the ephemerality runs even deeper and more literally than this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[W]hen we reach the end of our days, our life experience will equal
that which we have paid attention to, whether by choice or default. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tim Wu, paraphrasing William James, in &lt;em&gt;&lt;a href=&#34;https://www.amazon.com/Attention-Merchants-Scramble-Inside-Heads/dp/0385352018&#34;&gt;The Attention
  Merchants&lt;/a&gt;&lt;/em&gt;
  (p. 7)&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Even if you maintain a high-latency information diet—unplugging,
meditating, reading old books in a cabin in the woods all day—central to
your experience will still be a stream of consciousness that is
constantly shifting. The experience of reading a book is in itself
highly dynamic: a steady stream of words rattle through your
consciousness by which you attempt to glimpse some series of structures
of information from the author’s mind. All experience is constructed
from a stream of ephemeral sensory input.&lt;/p&gt;
&lt;p&gt;Do you remember everything you’ve ever read? Almost certainly not. The
things that stick are those that can be fitted into the elaborate
internal scaffolding of your own mind, which is itself built up through
a series of structure preserving transformations mining this ephemeral
stream of consciousness for the raw building materials.&lt;/p&gt;
&lt;p&gt;If we consider the ephemeral nature of how we experience life itself,
the strategy to handle service anxiety and information overload can be
applied much more broadly. The key to creating coherence in the
ephemeral stream that is life is to opportunistically build up this
internal scaffolding, embracing the role of serendipity, and allowing an
appropriate and manageable structure to emerge. &lt;/p&gt;
&lt;p&gt;In the realm of our daily routines and behaviours this would seem to
evoke Sarah Perry’s &lt;a href=&#34;https://www.ribbonfarm.com/2018/04/06/deep-laziness/&#34;&gt;Deep
Laziness&lt;/a&gt;.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;In the realm of intellectual progress I think it evokes, at least in
part, Paul Graham’s Bus Ticket Theory of Genius discussed above. The
state of disinterested obsession is a mindset that facilitates the
relinquishing of control and top-down intentionality, allowing one to
embrace the following of curiosity, the serendipitous realizations of
new connections, and the gradual emergence of a body of work.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Update: I&amp;rsquo;ve begun a blogchain in which I further examine some of
these themes: &lt;a href=&#34;https://jpeoples.github.io/blog/boredom-world/&#34;&gt;Boredom World&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;Credit to this post for putting the idea of structure preserving
 transformations into my internal scaffolding, letting me make the
 connections I’m trying to convey here :)&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>Creativity as a Search Problem: A Speculative Mental Model</title>
        <link>https://jpeoples.github.io/blog/2019/11/creativity-space/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2019/11/creativity-space/</guid>
        <pubDate>Thu, 21 Nov 2019 17:38:20 -0000</pubDate>
        <description>&lt;p&gt;One of my hobbies is writing,
&lt;a href=&#34;https://soundcloud.com/jacob-peoples-5&#34;&gt;recording&lt;/a&gt;, and &lt;a href=&#34;https://soundcloud.com/pake-jeoples&#34;&gt;producing&lt;/a&gt; music.
Unfortunately, I have
often been hit by something like creative block.  The two ways this
primarily manifests is on the one hand as a lot of barely started
projects&lt;sup id=&#34;fnref:project-names&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:project-names&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, and on the other as more developed
ideas where I simply ran out of steam.  Most often cases in the former
category don&amp;rsquo;t really amount to anything: when or if I do return to them
later there usually isn&amp;rsquo;t really enough material to provide much more
inspiration than an empty project. Indeed, the amount of work required
to finish such a barely started project is nearly the same as just
starting from scratch.  This is in contrast to cases in the latter
category which are actually quite likely to get finished some day.  &lt;a href=&#34;https://soundcloud.com/pake-jeoples/reprobate-remainder&#34;&gt;My
most recently uploaded
track&lt;/a&gt;, as of
this writing, is the finished version of a project I started in
April 2018. The majority of elements were already there, in a rougher
form than in the final track, and all I really had to do was improve
some of the sounds, do some mixing, add some polish. The newly added
content was minimal.&lt;/p&gt;
&lt;p&gt;The contrast between these two cases is kind of interesting. While the
false starts may have in some instances represented ideas that seemed
promising at the start, I think most of the time they are pretty much
just failed experiments. Especially when you are new to something, such
failed experiments are an inevitable part of the process. On the other
hand, the near finished projects were obviously promising enough to
warrant being taken so close to completion. While you still got stuck,
the time away works to your advantage: whatever road block you hit that
kept you from finishing the thing in the first place is long forgotten.
So instead, you get a great start of an idea to which you can apply your
refreshed—and in the interim, likely refined—creative process. The
process of finishing can in such cases be a pleasant experience of
applying your skills without the more taxing process of trying to shape
an entire work from scratch.&lt;/p&gt;
&lt;p&gt;In between these many incomplete projects and failed experiments are the
works of inspired creativity—something which I imagine has tormented
anyone who does any kind of creative work. The work seems to flow out of
you naturally, joyfully. Indeed, one might be tempted to think of this
state as being synonymous with creativity. But alas, it is unreliable,
coming in erratic bursts. To be prolific, most of us can’t wait for this
kind of inspiration.&lt;/p&gt;
&lt;p&gt;An interesting observation is that the process of completing the
unfinished track I talked about above was a little bit like those
experiences of inspired creativity. There was never really any creative
block. I just got to work on the next thing until the track started to
feel finished.&lt;/p&gt;
&lt;h2 id=&#34;destinations-and-exploration&#34;&gt;Destinations and Exploration&lt;a class=&#34;headerlink&#34; href=&#34;#destinations-and-exploration&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;SeamlessR, a music producer who also makes youtube video tutorials,
touches on this in &lt;a href=&#34;https://www.youtube.com/watch?v=A--Ff6P8drk&#34;&gt;Ammunition and
Experience&lt;/a&gt;. There are at
least two ideas in that video. First is that experience provides a kind
of ammunition in the form of an intuition as to where things can go at
different stages of a project. The other is that given an idea,
experience also provides the knowledge needed to move in the right
direction to realize that idea. Though experience is given as the key in
both cases, the two are very different: the first is about knowing your
destination, and the second is about having the skills to actually get
to it.&lt;/p&gt;
&lt;div class=&#34;text-center&#34;&gt; &lt;iframe max-width=&#34;100%&#34; width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube.com/embed/A--Ff6P8drk&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt; &lt;/div&gt;

&lt;p&gt;It is worth pointing out that these are not really mutually exclusive.
Once you pick a destination, your experience gives you a sense of how to
get there. As you start to move in that direction the new context gives
you new ideas. Some of those ideas change your target destination. And
so on.  This cycle of choosing a direction, moving a bit, then
reevaluating that direction, starts to sound a lot like a search process
like &lt;a href=&#34;https://en.wikipedia.org/wiki/Gradient_descent&#34;&gt;gradient descent&lt;/a&gt;.
A gradient descent optimizer looks for peaks or valleys (depending on if
it is minimizing or maximizing) in some function by cycling back and
forth between finding the direction of steepest descent/ascent at the
current location, and taking a small step in that direction.&lt;/p&gt;
&lt;p&gt;Through this lens, the creative process is a kind of search for
&amp;ldquo;pleasing&amp;rdquo; points—for some subjective definition of pleasing—in an
extremely high dimensional space.&lt;/p&gt;
&lt;p&gt;This is in some sense literally true. Sticking with the music production
example, if you look at a typical digital audio workstation, it is
essentially this big array of knobs and dials and sliders and curves and
midi/audio data that can be manipulated in all kinds of context-specific
ways, and that all affect what the end result will be when you
ultimately press the play button. Our job as the producer then, is to
find the right spot in the space of possible configurations of all these
controls to produce an end result that is pleasing.&lt;/p&gt;
&lt;p&gt;Not only is the space huge and high dimensional; much of it is
degenerate or pathological. That is, many of those configurations of
knobs and sliders and curves and data will be mostly the same—I can
synthesize nearly identical sounds in multiple ways for example—and
many others will be akin to noise, or too unpleasant or chaotic to be
desirable. Making matters worse, even if we could learn to perfectly
avoid the degenerate and pathological parts of this space, what remains
is still too daunting and incomprehensibly large to be able to just
aimlessly explore and happen upon something pleasing&lt;sup id=&#34;fnref:pleasing&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:pleasing&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;The role of experience in this framework is then to provide two kinds of
knowledge and/or intuition which guide the search process:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Knowledge of potential destinations: experience develops awareness and
  intuition about pleasing regions of the space that can help define and
  refine target destinations. This is essentially the first kind of
  ammunition discussed by SeamlessR.&lt;/li&gt;
&lt;li&gt;Navigational knowledge: experience teaches you to read local cues and
  navigate nonlocal jumps to target destinations in this complex space.
  This corresponds to the second type of ammunition from the video.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;understanding-the-experiences-of-creative-work&#34;&gt;Understanding the Experiences of Creative Work&lt;a class=&#34;headerlink&#34; href=&#34;#understanding-the-experiences-of-creative-work&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We can employ this model to try and understand the three common
experiences of creative work mentioned above: false starts,
nearly-finish-complete-later, and inspired creativity.&lt;/p&gt;
&lt;p&gt;The false start could manifest in a couple ways. First, without any real
vision of what we want to create early on, we might wander about a
little bit, fail to come up with an idea, and then give up. On the other
hand, maybe we do have some vague vision early on, but lack the required
skill to navigate toward that region of the space successfully. Instead,
we set out in our best guess of the right direction, but quickly get
lost.&lt;/p&gt;
&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;Illustration of a false start&#34; title=&#34;Illustration of a false start&#34;  src=&#34;https://jpeoples.github.io/blog/2019/11/false-start.jpg&#34;  width=&#34;500&#34;   /&gt;
&lt;/figure&gt;

&lt;p&gt;The nearly-finish experience manifests as having a vision for what our
destination is (whether it came from inspiration or exploration) but
then getting lost after getting most of the way there. When we come back
to complete the work later, we are reminded of the vision, and, starting
much closer, are able to make our way there with relative ease. That
said, we may, if we don&amp;rsquo;t yet have enough experience to realize our
vision, still not be able to get unstuck.&lt;/p&gt;
&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;Illustration of a false start&#34; title=&#34;Illustration of a false start&#34;  src=&#34;https://jpeoples.github.io/blog/2019/11/nfcl.jpg&#34;  width=&#34;500&#34;   /&gt;
&lt;/figure&gt;

&lt;p&gt;Finally, inspired creativity looks a lot like the complete-later phase
of the previous case. The only difference is the journey from start to
vague vision is longer. But if the vision is within our grasp at our
current experience level, we are able to navigate into the general
region fairly easily.&lt;/p&gt;
&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;Illustration of a false start&#34; title=&#34;Illustration of a false start&#34;  src=&#34;https://jpeoples.github.io/blog/2019/11/inspired-creativity.jpg&#34;  width=&#34;500&#34;   /&gt;
&lt;/figure&gt;

&lt;p&gt;In the cases where we successfully make it to the region of the space
evoking the creative vision (marked &amp;ldquo;vague vision&amp;rdquo; in the diagrams), the
search becomes easier. We are where we want to be, roughly, so it is a
matter of finding the nearest local optimum in the &amp;ldquo;pleasing&amp;rdquo; field and
calling the work done. In the diagrams this is represented by the path
going from zig-zaggy to relatively direct.&lt;/p&gt;
&lt;p&gt;In contrast, when we get stuck, we are essentially trapped in some
not-very-pleasing region of the space, where we are unable to determine
how to move to improve the situation, or get closer to our vague vision
if we have one.  The result is a kind of overwhelm in the face of
ambiguity and high uncertainty.&lt;/p&gt;
&lt;h2 id=&#34;dont-get-stuck&#34;&gt;Don&amp;rsquo;t Get Stuck&lt;a class=&#34;headerlink&#34; href=&#34;#dont-get-stuck&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Perhaps this is not such a revelation, but creativity is a fundamentally
a productive activity. And therefore, to do creative work, you must
work. Productively. And &lt;a href=&#34;http://bookofhook.blogspot.com/2012/09/productivity-vs-uncertainty-apathy.html&#34;&gt;nothing hinders productive work like
uncertainty&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If the creative process is looking for pleasing points in a super high
dimensional space, uncertainty occurs when we are unable to distinguish
local directions in order to continue making progress. In the
optimization metaphor, we are trapped in a peak or valley—that is,  a
local minimum or maximum. Flailing about to try and get out of such a
peak or valley is hard for a typical optimizer, so it is better if you
can &lt;a href=&#34;https://www.ribbonfarm.com/2019/04/15/mediocratopia-4/&#34;&gt;avoid getting stuck in the first
place&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the model of inspired creativity above, it seems the best way to
avoid getting stuck would be to have a creative vision that is
realizable given our current level of skill. You can imagine the vision
as putting a large bias in the &amp;ldquo;pleasing&amp;rdquo; field against points outside a
particular region that we can then use to navigate toward that region.
The skill/experience component is still critical: if we don&amp;rsquo;t have the
experiential skills to navigate to the target region, the bias doesn&amp;rsquo;t
help, because we can&amp;rsquo;t translate the cues it is giving us into actual
directions. But assuming we do, once we get there, we go into ordinary
optimization mode and find a local optimum.&lt;/p&gt;
&lt;p&gt;So then how do we find a vision?&lt;/p&gt;
&lt;p&gt;As discussed above, there is a feedback cycle between moving in the
space and refining the target destination.  It stands to reason then,
that one way to find a vision is just to explore, and see what happens.
And perhaps, if generating a vision purely through exploration is
reliable enough with sufficient experience, then that is why some highly
prolific artists say &lt;a href=&#34;https://www.edmprod.com/episode-54/&#34;&gt;creative block is
bullshit&lt;/a&gt;. But in my experience
this aimless exploration can also lead to a lot of failed experiments.
So for the rest of us, with the framing we now have, perhaps we can
consider some other methods to try and bootstrap a vision when we lack
organic inspiration.&lt;/p&gt;
&lt;h3 id=&#34;artificial-constraints&#34;&gt;Artificial Constraints&lt;a class=&#34;headerlink&#34; href=&#34;#artificial-constraints&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Constraints can help break creative block. Most people are familiar with
this in the form of time constraints. When deadlines loom, it seems to
help us get started. This is Parkinson’s law: “work expands so as to
fill the time available for its completion.” But as Anne-Laure Le Cunff
writes in a &lt;a href=&#34;https://nesslabs.com/parkinson-law&#34;&gt;post on exploiting Parkinson’s
law&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Researchers found that when people face scarcity, they give themselves
the freedom to use resources in less conventional ways—because they
have to. The situation demands creativity which would otherwise remain
untapped.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Perhaps this is why some game developers find constrained
platforms—like the &lt;a href=&#34;https://www.lexaloffle.com/pico-8.php&#34;&gt;Pico-8&lt;/a&gt;
fantasy console—so freeing. There are all kinds of decisions that
constrain the design space of possible games for the platform that you
as a developer simply don’t need to make.&lt;/p&gt;
&lt;p&gt;Within our mental model we might explain this phenomenon by observing
that, when developing a vision, artificial constraints make the
exploration process less overwhelming by reducing the dimensionality of
the search space. As we start to develop a vision, if our chosen
constraints play to our existing strengths, they could also help make
the navigation process less prone to failure.&lt;/p&gt;
&lt;h3 id=&#34;combinatorial-creativity&#34;&gt;Combinatorial Creativity&lt;a class=&#34;headerlink&#34; href=&#34;#combinatorial-creativity&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;“&lt;a href=&#34;https://nesslabs.com/combinational-creativity&#34;&gt;Combinatorial
creativity&lt;/a&gt; is the
process of combining old ideas to come up with something new”. In our
mental model, I think this amounts to taking some points or specific
regions in the space, and asking: what might a subspace that contains
all these points look like? And within that subspace, what are some
other interesting and unique regions that I can explore?&lt;/p&gt;
&lt;p&gt;On one hand, by letting us think about regions of a subspace, a
combinatorial approach helps us develop a vision in a relatively direct
way. On the other hand, once we get to the general area, the subspace
also acts as a constraint on the optimization process. Further, we can
tailor the vision to our skills by choosing appropriately technical
examples to start with. For this reason, I wonder if this might be a
particularly powerful approach when working in a new, unfamiliar space.&lt;/p&gt;
&lt;h3 id=&#34;start-with-abundance&#34;&gt;Start With Abundance&lt;a class=&#34;headerlink&#34; href=&#34;#start-with-abundance&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In &lt;a href=&#34;https://www.perell.com/blog/how-to-cure-writers-block&#34;&gt;How to Cure Writer’s
Block&lt;/a&gt;, David
Perell recommends you “start writing once you have so much information
that you can’t not write.” Echoing SeamlessR above, he quotes Sebastian
Junger: “‘If you have writer’s block, you don’t have enough
ammunition.’” The fundamental idea behind the post is to take notes
about your ideas and reference materials as they come in, and write once
you’ve got enough material to make the process easy.&lt;/p&gt;
&lt;p&gt;In my reading, the recommendation is that the creative work, that is,
the writing, should not start until the creator has a big enough reserve
of context to resolve the ambiguity of starting. This gives you lots of
directions and ideas to explore while developing the vision for your own
contribution.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Fundamentally, there is probably no mental model or technique that will
just keep you from ever getting creative block again. If there was a
simple formula, it wouldn&amp;rsquo;t really be creative, would it? And even if
there was, you&amp;rsquo;d still have to deal with motivation, and finding the
time, and a million other things, surely.&lt;/p&gt;
&lt;p&gt;But I have found that this model helps me reason about some of the
problems I&amp;rsquo;ve had in my own creative projects, and provides a nice
framework in which to think about and compare a lot of the common advice
for boosting creative output.&lt;/p&gt;
&lt;p&gt;I also like that experience plays such an important role in the model in
order to successfully navigate the space. It&amp;rsquo;s a reminder that if you do
get stuck, the best thing to do is just keep trying. Practice. Do more
failed experiments. Try finishing something even if it doesn&amp;rsquo;t seem that
great. Roll with it anyway and see where it goes. You might surprise
yourself. And remember that &lt;a href=&#34;http://visakanv.com/1000/0152-letter-to-a-young-songwriter/&#34;&gt;quantity beats
quality&lt;/a&gt;
when doing is the best way to get better.&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:project-names&#34;&gt;
&lt;p&gt;So. Many. Project files with lovely names like idea, &lt;code&gt;new&lt;/code&gt;, &lt;code&gt;wave&lt;/code&gt;, &lt;code&gt;20190321 idea cool weird song&lt;/code&gt;&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:project-names&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:pleasing&#34;&gt;
&lt;p&gt;Better perhaps to say: too large to happen upon something that we, given our experience, can figure out how to work with.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:pleasing&#34; title=&#34;Jump back to footnote 2 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>What if this Web Service Dies? Connecting &#34;Service Anxiety&#34; and Information Overload</title>
        <link>https://jpeoples.github.io/blog/2019/11/service-anxiety-information-overload/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2019/11/service-anxiety-information-overload/</guid>
        <pubDate>Wed, 06 Nov 2019 17:26:56 -0000</pubDate>
        <description>&lt;p&gt;I&amp;rsquo;ve spent a lot of time thinking about organization and note-taking as
a way to try and keep on top of all the various things I encounter that
seem particularly interesting or useful.
Along the way, I&amp;rsquo;ve experimented with a lot of different productivity
and note-taking apps and services. A great thing about these is that
they mostly make it easy to access our notes or task-lists, or whatever
else, at any time, and from any place we might find ourselves, any
device we may use.  And while many of them seem promising, there is
always this nagging fear in the back of my mind, a fear that seems to
return whenever I think too much about any of the many web services I
depend on: if I pour too much of myself into this thing — this black
box of features over which I have no real control — what will I do if
it&amp;rsquo;s suddenly gone?&lt;/p&gt;
&lt;p&gt;After all, &lt;a href=&#34;https://killedbygoogle.com/&#34;&gt;it&amp;rsquo;s not as if web-based software services live forever&lt;/a&gt;.
What if the company goes out of business?
Or if I decide to fork out the cash for a premium service, what if money
gets tight and I need to cut costs?&lt;/p&gt;
&lt;p&gt;As a convenient shorthand, I&amp;rsquo;ll refer to this fear as &amp;ldquo;service
anxiety&amp;rdquo; for the remainder of this post.&lt;/p&gt;
&lt;h2 id=&#34;understanding-service-anxiety&#34;&gt;Understanding Service Anxiety&lt;a class=&#34;headerlink&#34; href=&#34;#understanding-service-anxiety&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As pointed out by Simon Pitt in
&lt;a href=&#34;https://onezero.medium.com/the-death-of-the-computer-file-doc-43cb028c0506&#34;&gt;Computer Files are Going Extinct&lt;/a&gt;, with these services
we no longer need to concern ourselves with maintaining information
stored as files on our hard drive.
Instead, through the magic of technology, all of our data can be accessed
anytime, on any device, through &amp;ldquo;bespoke, proprietary interfaces&amp;rdquo;.
Indeed, the easy access afforded by these kinds of services can be seen as part
of a general trend — identified by Alex Danco as
&lt;a href=&#34;https://alexdanco.com/2015/02/02/the-rise-of-the-access-economy/&#34;&gt;the rise of the access economy&lt;/a&gt; —
of technologies that allow cheap and easy access to the things we want
or need, all the while freeing us from the messy details and maintenance
work of ownership.
But this liberation from ownership is also a removal of agency. In
&lt;a href=&#34;https://alexdanco.com/2019/10/26/everything-is-amazing-but-nothing-is-ours/&#34;&gt;&lt;em&gt;Everything is Amazing but Nothing is Ours&lt;/em&gt;&lt;/a&gt;,
&lt;a href=&#34;https://alexdanco.com/2019/10/26/everything-is-amazing-but-nothing-is-ours/&#34;&gt;Danco points out&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Worlds of scarcity are made out of things. Worlds of abundance are
made out of dependencies. That’s the software playbook: find a system
made of costly, redundant objects; and rearrange it into a fast,
frictionless system made of logical dependencies. The delta in
performance is irresistible, and dependencies are a compelling
building block: they seem like just a piece of logic, with no cost and
no friction. But they absolutely have a cost: the cost is complexity,
outsourced agency, and brittleness. The cost of ownership is up front
and visible; the cost of access is back-dated and hidden.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In dependence, we inherit the fragilities of that on which we
depend, a lesson learned in the Node.js/npm ecosystem when the removal
of the tiny, independently maintained &amp;ldquo;left-pad&amp;rdquo; package
&lt;a href=&#34;https://arstechnica.com/information-technology/2016/03/rage-quit-coder-unpublished-17-lines-of-javascript-and-broke-the-internet/&#34;&gt;&amp;ldquo;broke the internet&amp;rdquo;&lt;/a&gt;.
&lt;a href=&#34;https://onezero.medium.com/the-death-of-the-computer-file-doc-43cb028c0506&#34;&gt;Pitt has a story of his own on this note&lt;/a&gt;, comparing a
website he had built in the &amp;rsquo;90s to one from just a year and a half ago:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The other day, I came across a website I’d written over two decades
ago. I double-clicked the file, and it opened and ran perfectly. Then
I tried to run a website I’d written 18 months ago and found I
couldn’t run it without firing up a web server, and when I ran NPM
install, one or two of those 65,000 files had issues that meant node
failed to install them and the website didn’t run. When I did get it
working, it needed a database. And then it relied on some third-party
APIs and there was an issue with CORS because I hadn’t whitelisted
localhost.&lt;/p&gt;
&lt;p&gt;My website made of files carried on, chugging along.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But this fragility goes beyond the potential brittleness of software
dependencies: the web services we use to power our lives — to manage our
data, to create, to access music, to read and to think — these are all
dependencies upon which we build our lives.
The price for all this ease and convenience is not only brittleness, but
more generally, our subjugation to the whims of the companies that are
building these services, defining the data structures that we can
create, where those data live, and how they can be interacted with and
used.&lt;/p&gt;
&lt;p&gt;Services come and their stewards encourage us to integrate them into the
foundations of our lives. But these building blocks don&amp;rsquo;t make much of a
foundation at all. They shift, and break, and disappear, and
change shape beneath the structures we&amp;rsquo;ve tried to build above, and we
must constantly adapt to maintain some semblance of stability lest it
all come crashing down.&lt;/p&gt;
&lt;h2 id=&#34;information-overload&#34;&gt;Information Overload&lt;a class=&#34;headerlink&#34; href=&#34;#information-overload&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In some sense this all is just another facet of the general experience of
anxious ephemerality that I think characterizes much of our
interaction with the internet.
The news cycle churns faster than ever.
Scandals come and go in the blink of an eye.
All we ever hear or see is what&amp;rsquo;s new.
&lt;a href=&#34;https://onezero.medium.com/the-death-of-the-computer-file-doc-43cb028c0506&#34;&gt;Pitt says:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don’t like this shift from timeless content to what is newest. Now,
when I visit websites, they promote to me the latest thing. Why should
the content that is the newest be the most important? It seems so
unlikely that something that was just created would happen to be
better than everything created throughout all time. What are the odds
that every time I arrive at the site, the pinnacle of human
achievement has just been breached? But we don’t seem to have a way of
sorting by quality. Only by recency.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The internet — that genie&amp;rsquo;s lamp of access to information —
facilitates all of this. You can&amp;rsquo;t have constant access through the
cloud, or automatically download thousands of dependencies you built
your software from, or provide an incessant stream of new information to
millions of users, without the &lt;a href=&#34;https://en.wikipedia.org/wiki/Series_of_tubes&#34;&gt;series of
tubes&lt;/a&gt;&lt;sup id=&#34;fnref:series-of-tubes&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:series-of-tubes&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; to move all that data about.
And for all the good the internet has done, all the convenience and
access to information it provides, it seems that more and more it&amp;rsquo;s
gotten to be &lt;a href=&#34;https://en.wikipedia.org/wiki/Information_overload&#34;&gt;too much of a good thing&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A common response to this are calls to simply unplug from it all and do
some long, slow, deep work — something Venkatesh Rao has called
&lt;em&gt;Waldenponding&lt;/em&gt;.
In &lt;a href=&#34;https://mailchi.mp/ribbonfarm/against-waldenponding&#34;&gt;Against Waldenponding&lt;/a&gt; Rao argues that such a
retreat is its own kind of hijacking of attention:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;25/ LONG before the digital media companies tried to pwn your attention
 by overloading it at difficult latency ranges, religious institutions
 tried to pwn you by suckering you into checking out of &amp;ldquo;temporal&amp;rdquo;
 matters by labeling them sinful/profane or whatever. This is utter
 bs.&lt;/p&gt;
&lt;p&gt;26/ That is in fact the original attention hack: powerful
 religious leaders telling smart people to check out and unplug from
 information flows. That way, they get the power.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Tim Wu&amp;rsquo;s &lt;a href=&#34;https://www.amazon.ca/Attention-Merchants-Scramble-Inside-Heads/dp/0804170045/&#34;&gt;&lt;em&gt;The Attention Merchants&lt;/em&gt;&lt;/a&gt;, a book examining
the history of the selling of attention, makes a similar point: &amp;ldquo;With
its combination of moral injunctions as well as daily and weekly
rituals, organized religion had long taken human attention as its
essential substrate,&amp;rdquo; (p. 26). Wu further notes that &amp;ldquo;[m]any of the most
talented copywriters [&amp;hellip;] came from families steeped in organized
religion,&amp;rdquo; (p. 71).&lt;/p&gt;
&lt;p&gt;Rather than disconnecting, Rao advocates that we embrace our
part in the &amp;ldquo;Global Social Computer in the Cloud (GSCITC)&amp;rdquo;, arguing that
while retreating for short periods can surely be healthy, long-term
unplugging is driven primarily by the &amp;ldquo;Fear of Being Ordinary (FOBO)&amp;rdquo; —
fear of being just another node in the GSCITC.  To best do our part, he
says we should strive to consume and respond to information at all
latencies — from the micro-moments of Twitter, to the most timeless
works from history — maintaining that a balance too far to either end
of the latency spectrum is a disadvantage.&lt;/p&gt;
&lt;p&gt;This contrary argument, that keeping plugged in is Good Actually, if
only you can manage it, is echoed by Tiago Forte. His &lt;a href=&#34;https://www.buildingasecondbrain.com/&#34;&gt;Building a Second
Brain&lt;/a&gt; course is based on, among other things, reaping the rewards
of plugging in to the relentless stream of information by processing it
and offloading the storage to a carefully curated collection of digital
information — a second brain.&lt;sup id=&#34;fnref:basb&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:basb&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;3/ So much of the success narrative today is still based on the old
model: get smart, know a lot, do one thing at a time, as early as
possible&lt;/p&gt;
&lt;p&gt;[&amp;hellip;]&lt;/p&gt;
&lt;p&gt;14/ This is the fundamental problem with what I call First Brainism
(incl. spaced repetition, memory palaces, deep work, digital
waldenponding, speed-reading, essentialism, paper notes
fundamentalists, and trad’l education): it tells you to get really
good at the old model&lt;/p&gt;
&lt;p&gt;15/ Obviously we need both, but prioritizing the biological brian as
the repository of knowledge is now the surest way to not only fall
behind, but to be more and more overwhelmed and stressed out as you do
so&lt;/p&gt;
&lt;p&gt;16/ We are in the early stages of the Second Brain era, when your
biological and cognitive deficiencies turn into superpowers, as along
as you are willing to give up some control and learn the new way&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/fortelabs/status/1148027264790958080&#34;&gt;Thread&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;Something else that both Forte and Rao seem to agree on is a certain key
role of serendipity within how we manage ourselves in relation to this
new era of information access.
In a &lt;a href=&#34;https://evernote.com/blog/podcast-tiago-forte-on-productivity/&#34;&gt;podcast on the Evernote blog&lt;/a&gt;,
describing his progressive summarization method, Forte describes a
heuristic to triage the process of progressively improving notes
based on when they naturally come up in the process of doing
something else:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’ll take notes on a source, whether it’s a conversation, an article,
a book, a podcast, audiobook, whatever. And then I just put it in my
system. Just the raw notes. The next time I see that, the next time I
serendipitously come across it — or it might be that I’m looking for a
project or looking for a resource that I want to use this note for — I
summarize it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rao argues that in a world of higher complexity — complexity often
beyond our grasp — things can look random and unpredictable. Such a
world makes personal growth in the traditional sense harder to pursue.
Instead, he favours a kind of progressive intensification, or &lt;a href=&#34;https://mailchi.mp/ribbonfarm/life-spirit-distillation&#34;&gt;life
spirit distillation:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reactionary retreat to deterministic personal growth actively defends
a ghostly state. Stochastic personal growth is like trying to beat the
&amp;ldquo;market&amp;rdquo; of life possibilities without factoring in your own capacity
for unplanned change.&lt;/p&gt;
&lt;p&gt;What does lead to progressive intensification is recognizing the
growing serendipity in the environment, and rapidly increasing
potential for more imaginative solutions to life challenges, with more
intense and unexpected rebirths, all around.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That both call to embrace serendipity in the way we interact with the
world is, I think, no accident. Indeed, a certain amount of faith that
the important things will come up again can help relieve the anxiety of
getting lost in a barrage of new information.  It is by learning to
methodically relinquish the need for control that we can come to reap
the rewards of the new world of information, while still maintaining
some base level of coherency.&lt;/p&gt;
&lt;h2 id=&#34;alleviating-service-anxiety&#34;&gt;Alleviating Service Anxiety&lt;a class=&#34;headerlink&#34; href=&#34;#alleviating-service-anxiety&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In a time of increasing complexity, our interactions with the external
world themselves come to be characterized by ephemerality — fleeting
glimpses of reality that feel increasingly disjoint and stochastic.  And
it is atop this drifting reality we are tasked to build our lives.&lt;/p&gt;
&lt;p&gt;This is the parallel between the previous discussions of service anxiety
and information overload: in both cases it is the rapid distribution of
information — facilitated by the internet — that begets the ephemeral
nature of the worlds we interact with, resulting in a loss of agency and
a spike of anxiety.&lt;/p&gt;
&lt;p&gt;So to alleviate service anxiety, can we again methodically relinquish
the need for control and embrace serendipity? As far as note-taking
services go,
&lt;a href=&#34;https://twitter.com/fortelabs/status/1161515095463256066&#34;&gt;Tiago Forte seems to have anticipated this question&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you wouldn’t be happy to see all your notes permanently erased,
you’re doing it wrong. Destroying your notes through creative
destruction is the goal, not meticulously hoarding them and treating
them as sacred objects worthy of veneration. Your notes should be
disposable&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In light of the lack of control we have over the services we use,
perhaps the answer is to use them to our benefit while we can, without
becoming too attached, because always, they may go.&lt;sup id=&#34;fnref:backup&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:backup&#34;&gt;3&lt;/a&gt;&lt;/sup&gt; Why do you
take notes, if not to learn, and ultimately to do?&lt;sup id=&#34;fnref:davies&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:davies&#34;&gt;4&lt;/a&gt;&lt;/sup&gt; Why use any
of these services if not as tools to achieve some goal defined on your
own terms? Does the carpenter fret that his hammer may break and be
rendered unusable, or does he rest easy knowing that if it did there
would be other hammers?&lt;/p&gt;
&lt;p&gt;To survive — perhaps even to thrive — in this ephemeral new world, is
to embrace its drifting nature and to develop processes with that drift
in mind.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&#34;https://twitter.com/context_ing/status/1160734161948168193&#34;&gt;There is no need for trust in information when there is faith in
process.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Update: I&amp;rsquo;ve begun a blogchain in which I further examine some of
these themes: &lt;a href=&#34;https://jpeoples.github.io/blog/boredom-world/&#34;&gt;Boredom World&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:series-of-tubes&#34;&gt;
&lt;p&gt;Hear Jonathan Blow humourously extend this term to
your CPU &lt;a href=&#34;https://youtu.be/YGTZr6bmNmk?t=1576&#34;&gt;here&lt;/a&gt;.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:series-of-tubes&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:basb&#34;&gt;
&lt;p&gt;Reader beware, this is based on my understanding of the course,
having not taken it.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:basb&#34; title=&#34;Jump back to footnote 2 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:backup&#34;&gt;
&lt;p&gt;Obviously not all contexts really allow one to embrace
ephemerality.  We really would prefer not to lose our tax records. But
these storage problems are not really new. The point is that with most
web-services we relinquish control of our data, and so we cannot back it
up in any meaningful sense.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:backup&#34; title=&#34;Jump back to footnote 3 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:davies&#34;&gt;
&lt;p&gt;There is in fact at least one other great reason to learn:
your own amusement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I knew I was going to like Prof. the Rev. Darcourt. He seemed to think
that learning could be amusing, and that heavy people needed stirring
up. Like Rabelais, of whom even educated people like Parlabane had
such a stupid opinion. Rabelais was gloriously learned because
learning amused him, and so far as I am concerned that is learning&amp;rsquo;s
best justification.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Maria Theotoky in Robertson Davies&amp;rsquo; &lt;a href=&#34;https://www.amazon.ca/Rebel-Angels-Robertson-Davies/dp/0143196987&#34;&gt;&lt;em&gt;The Rebel Angels&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:davies&#34; title=&#34;Jump back to footnote 4 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
        <title>Pinpoint Bugs Based on Data, Not Intuition</title>
        <link>https://jpeoples.github.io/blog/2019/10/debugging-pinpoint-with-data/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2019/10/debugging-pinpoint-with-data/</guid>
        <pubDate>Wed, 23 Oct 2019 22:43:01 -0000</pubDate>
        <description>&lt;p&gt;Often when debugging a problem, our brains have a strong intuition as to
exactly where the bug &amp;ldquo;must&amp;rdquo; be. We may even have seemingly valid
rational arguments as to why the bugs &amp;ldquo;must&amp;rdquo; be located in this
particular part of the code. &lt;em&gt;Whenever possible, I think it is best to
ignore these impulses and pinpoint bugs based on hard data&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;While knowledge of the code structure can help you narrow down the
source of the problem to a particular area within a larger program,
beyond that it may be most effective to ask what assumptions the program
makes, and to find where exactly those assumptions break. This is a
matter than can be addressed by hard facts, rather than an intuition.&lt;/p&gt;
&lt;p&gt;As a concrete example, yesterday I was debugging an algorithm I have
been developing as part of my research. The faulty behaviour was
occurring only when running it on a particular data set. And since this
algorithm is a bit complicated in implementation, and this particular
data set leading to the algorithm executing a less-commonly-used code
path, I reasoned, the bug must be a mistake in the logic of that
less-commonly-used code path. Knowing that the correct logic was a bit
complicated even in theory, I was confident that this would prove to be
the problem.&lt;/p&gt;
&lt;p&gt;So I reread the code, which was written more than a year ago now, and
gradually reloaded all the necessary context into my brain to understand
how it works. Stepping through, both mentally and literally in the
debugger, I simply could not see any problem.&lt;/p&gt;
&lt;p&gt;I even racked my brain to come up with two alternative inputs, which
theoretically, in a correct implementation, should have produced
identical results. In actuality, one hit the bug, and the other didn&amp;rsquo;t.
Bingo!&lt;/p&gt;
&lt;p&gt;At each stage of the algorithm, I plotted the output to try and pinpoint
exactly &lt;em&gt;when&lt;/em&gt; along the way the error occured. It told me nothing I
didn&amp;rsquo;t already suspect: the bug was in that aforementioned
less-commonly-used code path just like I knew it had to be.&lt;/p&gt;
&lt;p&gt;The only problem was, staring at the code, I could still find no error.&lt;/p&gt;
&lt;p&gt;Finally, I realized there was theoretically an invariant that should be
maintained across several of the steps taken in the relevant code path.
&lt;em&gt;Computing this invariant quantity after each line affecting the
relevant variables provided a hard data-based test.&lt;/em&gt; If ever the
invariant was broken, the bug &amp;ndash; or at least &lt;em&gt;a&lt;/em&gt; bug &amp;ndash; was found.&lt;/p&gt;
&lt;p&gt;This was exactly what solved it: it turned out that the error was in
a particular method, being called only in that less-commonly-used code
path, that was so simple in intent that my intuition would
never have taken me there. I quickly fixed it, and proceeded to find a
couple other bugs, similar in nature, that simply hadn&amp;rsquo;t bitten me yet.&lt;/p&gt;
&lt;p&gt;What I observed from this is that while my intuition and reasoning got
me to the right area of the code right away, it proceeded to lead me
astray. I was sure the bug was an error in the complicated logic of the
algorithm, when in fact it was a simple oversight in a simple method
being called in the process of executing that complicated logic. Only by
using data in the form of a broken invariant to prove the bug &lt;em&gt;had to
occur within that method&lt;/em&gt; did it occur to me to even look there.&lt;/p&gt;
&lt;p&gt;I think this gets back at the fact that as programmers we often can&amp;rsquo;t
reason that accurately about the complexity of our programs.  Conceptual
complexity and complexity of implementation are not the same.  But worse
is that even the simplest implementations are subject to the complexity
of evolution over time.  The problematic method in my case was
conceptually trivial. It&amp;rsquo;s implementation was clear and concise.  But in
the course of the evolution of the code a few new options had been added
to the class somewhere along the way which were not properly being taken
into account in this particular method. And because this method was only
called in what was a largely neglected code path, the bug remained
hidden in plain sight for a long time. In contrast, the big, complicated
block of logic implementing the algorithm &amp;ndash; a seemingly ideal habitat
for all kinds of nasty bugs &amp;ndash; where my intuition immediately led me,
having me step through code with my eyes glazed over for over an hour,
was, at the end of it all, just fine.&lt;/p&gt;
&lt;p&gt;And so, I conclude, when investigating a bug, try to ground your
investigation in hard data as quickly as possible. Avoid just blindly
stepping around the code except as a last resort. And ignore that
intuition that tells you the problem just has to be in this nasty bit of
logic here, because sometimes it&amp;rsquo;s the rosy patches that are the thorn
in your side.&lt;/p&gt;</description>
    </item>
    
    <item>
        <title>MATLAB: boxplot and isoutlier disagree about outliers</title>
        <link>https://jpeoples.github.io/blog/2019/09/24/matlab-boxplot-outliers/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2019/09/24/matlab-boxplot-outliers/</guid>
        <pubDate>Tue, 24 Sep 2019 00:00:00 -0000</pubDate>
        <description>&lt;p&gt;&lt;em&gt;TL;DR: &lt;a href=&#34;https://www.mathworks.com/help/matlab/ref/isoutlier.html&#34;&gt;&lt;code&gt;isoutlier&lt;/code&gt;&lt;/a&gt; classifies outliers based on scaled mean absolute
deviations, while &lt;a href=&#34;https://www.mathworks.com/help/stats/boxplot.html&#34;&gt;&lt;code&gt;boxplot&lt;/code&gt;&lt;/a&gt; is based on interquartile range.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Suppose I have some data in an &lt;code&gt;N&lt;/code&gt; by 10 array and pass it to matlab&amp;rsquo;s
&lt;code&gt;boxplot&lt;/code&gt;. By default, I get&lt;/p&gt;
&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;default boxplot&#34; title=&#34;default boxplot&#34;  src=&#34;https://jpeoples.github.io/blog/2019/09/24/boxplot.png&#34;   /&gt;
&lt;/figure&gt;

&lt;p&gt;Suppose I want to extract the statistics that MATLAB uses to generate the
plot. According to the &lt;a href=&#34;https://www.mathworks.com/help/stats/boxplot.html&#34;&gt;documentation&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;the central mark indicates the median, and the bottom and top edges of
the box indicate the 25th and 75th percentiles, respectively. The
whiskers extend to the most extreme data points not considered
outliers, and the outliers are plotted individually using the &amp;lsquo;+&amp;rsquo;
symbol.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Using simple MATLAB built-ins I might then write&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;[q1,q2,q3,w0,w1,outliers] &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;boxplot_statistics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;data&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;

&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c&#34;&gt;% quantile(data,3) will return the 25th, 50th, and 75th percentile&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% for each column&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;quants&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;quantile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;q1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;quants&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,:);&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;q2&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;quants&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,:);&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;q3&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;quants&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,:);&lt;/span&gt;

    &lt;span class=&#34;c&#34;&gt;% outliers will return a logical array where true indicates outliers&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% (outlier are computed per column)&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;outliers&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;isoutlier&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

    &lt;span class=&#34;c&#34;&gt;% To compute the whiskers, take max and min (per column). Setting&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% outlier values to NaN causes them to be ignored.&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;outliers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NaN&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;w0&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,[],&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;w1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,[],&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;But here is the result.&lt;/p&gt;
&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;incorrect boxplot_statistics results&#34; title=&#34;incorrect boxplot_statistics results&#34;  src=&#34;https://jpeoples.github.io/blog/2019/09/24/boxplot_wrong.png&#34;   /&gt;
&lt;/figure&gt;

&lt;p&gt;I&amp;rsquo;ve plotted the predicted tops and bottoms of the boxes in blue, the
medians in red, the whiskers in green, and the outliers in cyan. Notice
how the predicted outliers (cyan) drop below the actual whisker in
several places (and as a result the predicted upper whisker (green) is
also too low).&lt;/p&gt;
&lt;p&gt;What gives?&lt;/p&gt;
&lt;p&gt;Digging deeper into the &lt;code&gt;boxplot&lt;/code&gt; documentation, there is a parameter
&amp;lsquo;Whisker&amp;rsquo; with default value 1.5:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Maximum whisker length, specified as the comma-separated pair consisting of &amp;lsquo;Whisker&amp;rsquo; and a positive numeric value.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;boxplot&lt;/code&gt; draws points as outliers if they are greater than &lt;code&gt;q3 + w × (q3 – q1)&lt;/code&gt; or less than &lt;code&gt;q1 – w × (q3 – q1)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hence, &lt;code&gt;boxplot&lt;/code&gt; classifies outliers as those values that are &lt;code&gt;w&lt;/code&gt;
quartile ranges above the upper quartile or below the lower quartile.&lt;/p&gt;
&lt;p&gt;On the other hand, &lt;a href=&#34;https://www.mathworks.com/help/matlab/ref/isoutlier.html&#34;&gt;&lt;code&gt;isoutlier&lt;/code&gt; classifies points as outliers if they are
more than 3 scaled median absolute deviations from the median.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It turns out that if &lt;code&gt;w = 1.5&lt;/code&gt; we can achieve the same outlier
classification with &lt;code&gt;isoutlier(data, &#39;quartile&#39;)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;However, if we choose a custom value for the &lt;code&gt;Whisker&lt;/code&gt; parameter, we&amp;rsquo;d
like to be able to handle that too. Hence the final answer is:&lt;/p&gt;
&lt;script src=&#34;https://gist.github.com/jpeoples/c25f9cba36519b2c223349904961df57.js&#34;&gt;&lt;/script&gt;

&lt;figure class=&#34;text-center&#34;&gt;
    &lt;img alt=&#34;correct boxplot_statistics results&#34; title=&#34;correct boxplot_statistics results&#34;  src=&#34;https://jpeoples.github.io/blog/2019/09/24/boxplot_right.png&#34;   /&gt;
&lt;/figure&gt;</description>
    </item>
    
    <item>
        <title>Abuse of the Equals Sign</title>
        <link>https://jpeoples.github.io/blog/2018/02/equals/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2018/02/equals/</guid>
        <pubDate>Fri, 09 Feb 2018 00:00:00 -0000</pubDate>
        <description>&lt;p&gt;I have noticed a certain pattern of misuse of the equals sign amongst my
students that, beyond being formally incorrect, makes it harder for the graders
to determine if the student is demonstrating understanding or not. In
the following post I will try and explain the problem and how to avoid
it.&lt;/p&gt;

&lt;p&gt;The symbol &amp;ldquo;=&amp;rdquo; means &amp;ldquo;equals&amp;rdquo;. It is to be written only when the things
on either side are known to be equal, or if we are saying some meta
statement like, &amp;ldquo;we want to show that X = Y&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Suppose we have proved or assumed that &lt;script type=&#34;math/tex&#34;&gt;\sum_{i=2}^n 2i = (n-1)(n+2)&lt;/script&gt;,
and we want to show that &lt;script type=&#34;math/tex&#34;&gt;\sum_{i=2}^{n+1} 2i = n(n+3)&lt;/script&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s one way:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;script type=&#34;math/tex; mode=display&#34;&gt;\begin{aligned}
\sum_{i=2}^{n+1} 2i &amp;= \sum_{i=1}^n 2i + 2(n+1) \\
     &amp;= \sum_{i=2}^n 2i + 2(n+1) \\
     &amp;= (n-1)(n+2) + 2(n+1) \text{ (by the induction hypothesis) } \\
     &amp;= n^2 + n - 2 + 2n + 2 \\
     &amp;= n^2 + 3n \\
     &amp;= n(n+3)
\end{aligned}&lt;/script&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here every line and equals sign is justified by either basic algebra or
previously established facts. Every &amp;ldquo;=&amp;rdquo; really means &amp;ldquo;equals&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;However, sometimes we may not know ahead of time how to go from left to
right directly. In such cases, here is an alternative way:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We want to show &lt;script type=&#34;math/tex&#34;&gt;\sum_{i=2}^{n+1} 2i = n(n+3)&lt;/script&gt;. Observe that
&lt;script type=&#34;math/tex; mode=display&#34;&gt;\sum_{i=2}^{n+1} 2i = \sum_{i=2}^n 2i + 2(n+1)
     = (n-1)(n+2) + 2(n+1) 
     = n^2 + n - 2 + 2n + 2
     = n^2 + 3n &lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;On the other hand,
&lt;script type=&#34;math/tex; mode=display&#34;&gt;n(n+3) = n^2 + 3n&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;Indeed they are equal and so we have shown &lt;script type=&#34;math/tex&#34;&gt;\sum_{i=2}^{n+1} 2i = n(n+3)&lt;/script&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Either of these approaches is perfectly acceptable in a test situation,
and which is clearest may depend on the problem at hand, or the
preferences of the reader.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&#34;equals-vs-equals&#34;&gt;&amp;ldquo;Equals&amp;rdquo; vs &amp;ldquo;Equals?&amp;rdquo;&lt;a class=&#34;headerlink&#34; href=&#34;#equals-vs-equals&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What a lot of students end up writing is something like the following:&lt;/p&gt;
&lt;p&gt;
&lt;script type=&#34;math/tex; mode=display&#34;&gt;\begin{aligned}
 \sum_{i=2}^{n+1} 2i &amp;= n(n+3) \\
 (n-1)(n+2) + 2(n+1) &amp;= n(n+3) \\
  n^2 + n - 2 + 2n + 2 &amp;= n^2 + 3n \\
  n^2 + 3n &amp;= n^2 + 3n
\end{aligned}&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;Up until the very last line, none of these &amp;ldquo;=&amp;rdquo; mean &amp;ldquo;equals&amp;rdquo;. They mean
something like &amp;ldquo;equals?&amp;rdquo;. On the other hand, adjacent lines in the left
column or the right column really are known to be equal, yet no &amp;ldquo;=&amp;rdquo; is
written between them! &lt;em&gt;This is abuse of the equals sign&lt;/em&gt;! The true known
equalities flow down the left column and back up the right column (or
down the right and up the left).&lt;/p&gt;
&lt;p&gt;I know it makes sense while you write it, but as readers (or graders)
we now need to not only try and follow your calculations, but also
decide whether you really mean &amp;ldquo;equals&amp;rdquo; or &amp;ldquo;equals?&amp;rdquo; anywhere you&amp;rsquo;ve
written &amp;ldquo;=&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re unsure how to go from left to right and want to manipulate
each side separately that is OK. &lt;em&gt;But do not abuse the equal sign&lt;/em&gt;. Go
for the second style shown above instead. Or if you have extra time you
could figure out how to do the calculations in order on the back of the
page, and then write a clearer presentation for your final answer.&lt;/p&gt;
&lt;p&gt;In any case, by consistently using &amp;ldquo;=&amp;rdquo; to mean &amp;ldquo;equals&amp;rdquo; and never
&amp;ldquo;equals?&amp;rdquo;, graders don&amp;rsquo;t need to try and figure out what you mean at
every &amp;ldquo;=&amp;rdquo;.  They just need to follow your calculations and decide if
they are correct.&lt;/p&gt;</description>
    </item>
    
    <item>
        <title>A brainfuck interpreter in C</title>
        <link>https://jpeoples.github.io/blog/2017/11/brainfuck/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2017/11/brainfuck/</guid>
        <pubDate>Wed, 01 Nov 2017 00:00:00 -0000</pubDate>
        <description>
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ bf &amp;quot;++++++++[&amp;gt;++++[&amp;gt;++&amp;gt;+++&amp;gt;+++&amp;gt;+&amp;lt;&amp;lt;&amp;lt;&amp;lt;-]&amp;gt;+&amp;gt;+&amp;gt;-&amp;gt;&amp;gt;+[&amp;lt;]&amp;lt;-]&amp;gt;&amp;gt;.&amp;gt;---.+++++++..+++.&amp;gt;&amp;gt;.&amp;lt;-.&amp;lt;.+++.------.--------.&amp;gt;&amp;gt;+.&amp;gt;++.&amp;quot;
Hello World!
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Brainfuck&#34;&gt;brainfuck&lt;/a&gt; is a minimalistic esoteric programming language. The
basic model is to imagine an infinite array of byte cells all
initialized to 0. The data pointer begins at the beginning of the array.
A program is a sequence made up of eight different commands:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; increments the data pointer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; decrements the data pointer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;+&lt;/code&gt; increments the byte in the cell pointed to by the data pointer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-&lt;/code&gt; decrements the byte in the cell pointed to by the data pointer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.&lt;/code&gt; outputs the byte at the data pointer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;,&lt;/code&gt; reads one byte of input into the byte at the data pointer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; allow looping. At &lt;code&gt;[&lt;/code&gt;, if the current byte is 0, jump to
   the command after the matching &lt;code&gt;]&lt;/code&gt;.  At &lt;code&gt;]&lt;/code&gt;, if the byte is nonzero
   jump to the command after the matching &lt;code&gt;[&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is pretty straightforward to implement, but many of the
interpreters I&amp;rsquo;ve seen around online use a fixed data array. Below I&amp;rsquo;ll
discuss a nice simple means for implementing a dynamically
growing data array.&lt;/p&gt;
&lt;h3 id=&#34;the-block-structure&#34;&gt;The block structure&lt;a class=&#34;headerlink&#34; href=&#34;#the-block-structure&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blocks_allocated&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_array_cap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;unsigned&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;**&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;span class=&#34;cm&#34;&gt;/* Initialize block_data, and free internal memory */&lt;/span&gt;
&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;create_block_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;destroy_block_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;cm&#34;&gt;/* Handles growing the blocks array, and allocating blocks */&lt;/span&gt;
&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;block_data_grow_array&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;min_cap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;block_data_allocate_blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;up_to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;cm&#34;&gt;/* Clear block_data. This just initialized all allocated blocks to 0 */&lt;/span&gt;
&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;block_data_clear&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;cm&#34;&gt;/* Lookup a cell */&lt;/span&gt;
&lt;span class=&#34;kt&#34;&gt;unsigned&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;block_data_get_cell&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Here &lt;code&gt;blocks&lt;/code&gt; is an array of &lt;code&gt;block_array_cap&lt;/code&gt; pointers to blocks.
&lt;code&gt;blocks_allocated&lt;/code&gt; tracks how many of those blocks are already
allocated. &lt;code&gt;block_size&lt;/code&gt; is the number of bytes in each block.&lt;/p&gt;
&lt;p&gt;The key function here is &lt;code&gt;block_data_get_cell&lt;/code&gt;, which makes looking up a
cell trivial. Simply provide the data pointer index &lt;code&gt;i&lt;/code&gt;, and it will do any
necessary allocations, and do the math to find the correct block and
index inside that block, returning a pointer to the requested data.&lt;/p&gt;
&lt;h3 id=&#34;the-interpreter-loop&#34;&gt;The interpreter loop&lt;a class=&#34;headerlink&#34; href=&#34;#the-interpreter-loop&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Given this structure, implementing the interpreter is pretty easy. The
whole shebang lives in one function:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;interpret&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;begin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;FILE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;in&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;FILE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
               &lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;code&gt;begin&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; point to the instructions to interpret, &lt;code&gt;in&lt;/code&gt; and
&lt;code&gt;out&lt;/code&gt; are streams for the I/O commands &lt;code&gt;.&lt;/code&gt; and &lt;code&gt;,&lt;/code&gt;, and &lt;code&gt;blocks&lt;/code&gt; is an
initialized &lt;code&gt;block_data&lt;/code&gt; structure to represent the data array.&lt;/p&gt;
&lt;p&gt;With all this in place the actual loop logic is not much different from
that in the various
&lt;a href=&#34;https://github.com/saulpw/brainfuck/blob/master/main.c&#34;&gt;fixed-size&lt;/a&gt;
&lt;a href=&#34;https://gist.github.com/maxcountryman/1699708&#34;&gt;interpreters&lt;/a&gt;
floating around on the internet:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;interpret&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;begin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;FILE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;in&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;FILE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
               &lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt;           &lt;span class=&#34;n&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;          &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;begin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;kt&#34;&gt;size_t&lt;/span&gt;        &lt;span class=&#34;n&#34;&gt;data_ptr_ix&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;

    &lt;span class=&#34;kt&#34;&gt;unsigned&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data_get_cell&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data_ptr_ix&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

    &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;switch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;data_ptr_ix&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data_get_cell&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data_ptr_ix&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;&amp;lt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;data_ptr_ix&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;--&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;block_data_get_cell&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blocks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data_ptr_ix&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;+&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;-&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;fputc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fgetc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;in&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;[&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;match_pairs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;begin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;[&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;]&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;]&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!*&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_ptr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;match_pairs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;begin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;]&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39;[&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;cm&#34;&gt;/* All other characters are simply ignored */&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
        &lt;span class=&#34;n&#34;&gt;ip&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SUCCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Here &lt;code&gt;match_pairs&lt;/code&gt; is a function to search for matching brackets in a
given range.&lt;/p&gt;
&lt;p&gt;The entire source code for this interpreter, which includes a bit more
error handling than shown here is available
&lt;a href=&#34;https://gist.github.com/jpeoples/e71d432d1765c1d67f9ebb91b9b906e2&#34;&gt;here&lt;/a&gt;.
It includes a bit of additional code for reading files for instructions.
You can call the interpreter with&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;bf your,instructions.here
# OR
bf -f path/to/file/with/bf/code
&lt;/pre&gt;&lt;/div&gt;


&lt;h3 id=&#34;making-it-better&#34;&gt;Making it better&lt;a class=&#34;headerlink&#34; href=&#34;#making-it-better&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are some things we could do to make the interpreter better. For
one thing, we could eliminate all the ignored characters from the code
before calling interpret. Also
searching for matching brackets every loop iteration could be
sped up by creating a jump table before hand.
Finally, the same loop structure could be used to implement a compiler
converting a given brainfuck program into C code.
I might look at some of these things in a future post.&lt;/p&gt;
</description>
    </item>
    
    <item>
        <title>Lying cat: Bizarre Filesystem Behaviour</title>
        <link>https://jpeoples.github.io/blog/2017/05/bizarre_fs/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2017/05/bizarre_fs/</guid>
        <pubDate>Fri, 05 May 2017 00:00:00 -0000</pubDate>
        <description>
&lt;p&gt;Just a short post on something odd that happened to me last night.&lt;/p&gt;
&lt;p&gt;I was working on the Jinja template to generate the posts on this
website. I had a local server launched in the build directory of the
website so I could preview the results as I went. It was working fine; I
could make changes, rebuild, refresh, and immediately see those changes.
The usual.&lt;/p&gt;
&lt;p&gt;However, I noticed that the dates I wanted to appear underneath the
title of blog posts were not showing up. I double checked the template,
which seemed to be correct. It is a snippet like so:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;{% if formatted_date is defined %}
&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;date&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;{{formatted_date}}&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
{% endif %}
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The odd thing was that in the rendered templates I was viewing in the
browser, the actual result was:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;quot;date&amp;quot;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So somehow the &lt;code&gt;formated_date&lt;/code&gt; variable was being defined, but was
empty&amp;hellip;&lt;/p&gt;
&lt;p&gt;Except it wasn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;I printed out the variable in the context dictionary just before
rendering and saw the correct dates displayed for each post.&lt;/p&gt;
&lt;h2 id=&#34;the-weird-part&#34;&gt;The Weird Part&lt;a class=&#34;headerlink&#34; href=&#34;#the-weird-part&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;So far this is just a typical annoying bug story. Here&amp;rsquo;s the weird part:&lt;/p&gt;
&lt;p&gt;I opened the file directly by double clicking it in the build directory
and the page showed up in the browser, &lt;em&gt;with the date&lt;/em&gt;, even though it
wouldn&amp;rsquo;t show up when browsing from the local server, which should have
been the same file. Even this I would have been happy to attribute to
some weird browser behaviour, or some weird behaviour of the python http
server. I don&amp;rsquo;t know that much about web stuff in general so I can
believe anything.&lt;/p&gt;
&lt;p&gt;But here&amp;rsquo;s the thing. I closed the server and reopened it. Still the
date didn&amp;rsquo;t show up. Weird. So then I literally typed:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;cat path/to/post | less
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and scrolled down to where the date should be. It still wasn&amp;rsquo;t there.
Meanwhile, I have the very same file open in the browser and it &lt;em&gt;is&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Then I go:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pushd path/to/
cat post | less
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and sure enough, &lt;em&gt;the date shows up!&lt;/em&gt;. Then:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;popd
cat path/to/post | less
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and it still shows up!&lt;/p&gt;
&lt;p&gt;So what on earth was going on the first time I typed &lt;code&gt;cat&lt;/code&gt;?!&lt;/p&gt;
</description>
    </item>
    
    <item>
        <title>Extending Arun&#39;s Method for Least Square Point Set Fitting with Isotropic Scaling</title>
        <link>https://jpeoples.github.io/blog/2016/06/extending_arun_method/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2016/06/extending_arun_method/</guid>
        <pubDate>Thu, 30 Jun 2016 00:00:00 -0000</pubDate>
        <description>
&lt;p&gt;I recently wanted to extend my implementation of the ICP algorithm to
include isotropic scaling.  Internally, ICP alternates between finding
the closest points in the target shape to those in the source shape &amp;ndash;
thus giving two corresponding point sets &amp;ndash; and finding the optimal
rigid transformation to align those point sets.  As the alignment of the
shapes improve, so do the estimates of the closest points, and so on,
hence, the Iterative Closest Point algorithm.&lt;/p&gt;
&lt;p&gt;In the original paper Besl and McKay&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;
use a quaternion based method for finding the optimal rigid
transformation, but the algorithm can be implemented just as well
using a rotation-matrix method such as Arun&amp;rsquo;s method.&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:2&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h3 id=&#34;without-scaling&#34;&gt;Without Scaling&lt;a class=&#34;headerlink&#34; href=&#34;#without-scaling&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The method of Arun et al. is as follows:&lt;/p&gt;
&lt;p&gt;Given &lt;script type=&#34;math/tex&#34;&gt;\{X_i\}&lt;/script&gt;, and &lt;script type=&#34;math/tex&#34;&gt;\{Y_i\}&lt;/script&gt; as two sets of &lt;script type=&#34;math/tex&#34;&gt;N&lt;/script&gt;
&lt;script type=&#34;math/tex&#34;&gt;d&lt;/script&gt;-dimensional points,  we want to find rotation matrix &lt;script type=&#34;math/tex&#34;&gt;R&lt;/script&gt; and
translation vector &lt;script type=&#34;math/tex&#34;&gt;t&lt;/script&gt; such that
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_{i=1}^n || R X_i + t - Y_i||^2
&lt;/script&gt;
is minimised.&lt;/p&gt;
&lt;p&gt;The solution for translation is simple: the optimal translation will be
that which matches the centroid of the rotated source shape to that of
the target.  That is
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
t = \mu_Y - R\mu_X
&lt;/script&gt;
where &lt;script type=&#34;math/tex&#34;&gt;\mu_Z&lt;/script&gt; refers to the centroid of &lt;script type=&#34;math/tex&#34;&gt;Z&lt;/script&gt;, and &lt;script type=&#34;math/tex&#34;&gt;R&lt;/script&gt; is the optimal
rotation.  See the next section for a proof of this.&lt;/p&gt;
&lt;p&gt;The rotation is more complex, but they show that given the singular
value decomposition
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i (X_i-\mu_X)(Y_i-\mu_Y)^T = U \Lambda V^T
&lt;/script&gt;
then
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
R = VSU^T
&lt;/script&gt;
where
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
S = \left\lbrace
\begin{aligned}
    &amp; I &amp; \mathrm{if} &amp; \det(U)\det(V) = 1 \\
    &amp;\mathrm{diag}(1,1,\dots,1,-1) &amp; \mathrm{if} &amp; \det(U)\det(V) = -1
\end{aligned}
\right.
&lt;/script&gt;
&lt;/p&gt;
&lt;h3 id=&#34;adding-scaling&#34;&gt;Adding Scaling&lt;a class=&#34;headerlink&#34; href=&#34;#adding-scaling&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A solution including isotropic scaling was published by Umeyama in
1991.&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a class=&#34;footnote-ref&#34; href=&#34;#fn:3&#34;&gt;3&lt;/a&gt;&lt;/sup&gt; However, I also gave a shot at my own derivation, and I will
show that our results are the same.&lt;/p&gt;
&lt;p&gt;Adding in a scale factor, the objective function becomes
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
f(X, Y; s, R, t) = \sum_i ||sRX_i +t - Y_i||^2
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;The solution for &lt;script type=&#34;math/tex&#34;&gt;t&lt;/script&gt; can be found by setting the partial derivative to
zero
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\frac{\partial f}{\partial t} = 2\sum_i sRX_i + t - Y_i = 0
&lt;/script&gt;
hence
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
t = \frac{\sum_i Y_i - sRX_i}{N} = \mu_Y - sR\mu_X.
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;This is exactly the result mentioned above for &lt;script type=&#34;math/tex&#34;&gt;t&lt;/script&gt;, with the addition of
the scale factor &lt;script type=&#34;math/tex&#34;&gt;s&lt;/script&gt;.&lt;/p&gt;
&lt;p&gt;We can solve for &lt;script type=&#34;math/tex&#34;&gt;s&lt;/script&gt; by taking a partial derivative, this time with
respect to &lt;script type=&#34;math/tex&#34;&gt;s&lt;/script&gt;
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\frac{\partial f}{\partial s} = \sum_i 2(sRX_i + t - Y_i)^T RX_i = 0
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;It is a straightforward expnsion of the above to arrive at
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
0 = \sum_i sX_i^T X_i + t^T R X_i - Y_i^T R X_i
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;and expanding &lt;script type=&#34;math/tex&#34;&gt;t&lt;/script&gt; with the previous solution and rearranging yields
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i s(X_i - \mu_X)^T X_i = \sum_i Y_i^T RX_i - \mu_Y^T R X_i
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;Now note that &lt;script type=&#34;math/tex&#34;&gt;\sum_i (X_i - \mu_X) = 0&lt;/script&gt; and expand &lt;script type=&#34;math/tex&#34;&gt;X_i&lt;/script&gt; on the left
hand side to &lt;script type=&#34;math/tex&#34;&gt;X_i - \mu_X + \mu_X&lt;/script&gt;:
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\begin{multline*}
\sum_i s(X_i - \mu_X)^T X_i = \sum_i s(X_i - \mu_X)^T (X_i - \mu_X +
\mu_X) = \\ \sum_i s(X_i - \mu_X)^T (X_i - \mu_X) + (X_i - \mu_X)^T\mu_X
\end{multline*}
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;That last term is 0 and so
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i s(X_i - \mu_X)^T (X_i - \mu_X) = \sum_i Y_i^TRX_i - \mu_Y^T R X_i
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;That is
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
s = \frac{ \sum_i (Y_i^T R X_i) - N \mu_Y^T R \mu_X }{ \sum_j || X_j - \mu_X ||^2 }
= \frac{\sum_i (Y_i- \mu_Y)^T R (X_i - \mu_X)}{\sum_j || X_j - \mu_X
||^2}
&lt;/script&gt;
both of which are pretty nice.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: In my implementation I found that though the second form is more
satisfying to me mathematically, the 1st form seemed to work better for
computations. I don&amp;rsquo;t have an explanation for this.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&#34;comparing-with-umeyamas-solution&#34;&gt;Comparing with Umeyama&amp;rsquo;s Solution&lt;a class=&#34;headerlink&#34; href=&#34;#comparing-with-umeyamas-solution&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Using the notation I have been using in this post, Umeyama showed that
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
s = \frac{\operatorname{Tr}(\Lambda S)}{\sum_j ||X_j - \mu_X||^2}
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;Already, we see our denominators match, so we want to show
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\operatorname{Tr}(\Lambda S) = \sum_i (Y_i- \mu_Y)^T R (X_i - \mu_X)
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;Somehow we have to get the trace in there, so we&amp;rsquo;ll need two facts about
trace:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The trace of the product of two matrices is related by
    &lt;script type=&#34;math/tex&#34;&gt;\operatorname{Tr}(A^T B) =
    \operatorname{Tr}(A B^T) =
    \operatorname{Tr}(B A^T) =
    \operatorname{Tr}(B^T A)&lt;/script&gt;.&lt;/li&gt;
&lt;li&gt;For vectors &lt;script type=&#34;math/tex&#34;&gt;u&lt;/script&gt;and &lt;script type=&#34;math/tex&#34;&gt;v&lt;/script&gt;, the inner product and outer product are
    related by &lt;script type=&#34;math/tex&#34;&gt;u^Tv = \operatorname{Tr}(vu^T)&lt;/script&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Based on the 2nd fact, and recalling that
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i (X_i - \mu_X)(Y_i - \mu_Y)^T = U\Lambda V^T
&lt;/script&gt;
we can write the numerator of our &lt;script type=&#34;math/tex&#34;&gt;s&lt;/script&gt; equation as
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i (Y_i - \mu_Y)^T R (X_i - \mu_X) = \operatorname{Tr}(R \sum_i (X_i-\mu_X)(Y_i -
\mu_Y)^T)
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;We can now immediately substitute in &lt;script type=&#34;math/tex&#34;&gt;R = VSU^T&lt;/script&gt; and
&lt;script type=&#34;math/tex&#34;&gt;\sum_i (X_i - \mu_X)(Y_i - \mu_Y)^T = U\Lambda V^T&lt;/script&gt;
giving
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i (Y_i - \mu_Y)^T R (X_i - \mu_X) = \operatorname{Tr}(VSU^T U \Lambda V^T)
&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;immediately the &lt;script type=&#34;math/tex&#34;&gt;U&lt;/script&gt;, and &lt;script type=&#34;math/tex&#34;&gt;U^T&lt;/script&gt; cancel leaving &lt;script type=&#34;math/tex&#34;&gt;VS \Lambda V^T&lt;/script&gt;.
Transposing &lt;script type=&#34;math/tex&#34;&gt;VS&lt;/script&gt; and &lt;script type=&#34;math/tex&#34;&gt;\Lambda V^T&lt;/script&gt; (from the 1st fact) gives
&lt;script type=&#34;math/tex; mode=display&#34;&gt;
\sum_i (Y_i - \mu_Y)^T R (X_i - \mu_X) = \operatorname{Tr}(SV^T V
\Lambda) = \operatorname{Tr}(S \Lambda) = \operatorname{Tr}(\Lambda S)
&lt;/script&gt;
as required.&lt;/p&gt;
&lt;div class=&#34;footnote&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34;&gt;
&lt;p&gt;Besl, Paul J., and Neil D. McKay. &amp;ldquo;Method for registration of 3-D shapes.&amp;rdquo; In Robotics-DL tentative, pp. 586-606. International Society for Optics and Photonics, 1992.&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:1&#34; title=&#34;Jump back to footnote 1 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:2&#34;&gt;
&lt;p&gt;Arun, K. S.; Huang, T. S. &amp;amp; Blostein, S. D. Least-squares fitting of two 3-D point sets IEEE Transactions on pattern analysis and machine intelligence, IEEE, 1987, 698-700&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:2&#34; title=&#34;Jump back to footnote 2 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:3&#34;&gt;
&lt;p&gt;Umeyama, S. Least-squares estimation of transformation parameters between two point patterns IEEE Transactions on pattern analysis and machine intelligence, IEEE, 1991, 13, 376-380&amp;#160;&lt;a class=&#34;footnote-backref&#34; href=&#34;#fnref:3&#34; title=&#34;Jump back to footnote 3 in the text&#34;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
        <title>PATHMAN -- A Simple Path Manager for MATLAB</title>
        <link>https://jpeoples.github.io/blog/2016/06/pathman/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2016/06/pathman/</guid>
        <pubDate>Tue, 28 Jun 2016 00:00:00 -0000</pubDate>
        <description>
&lt;p&gt;MATLAB finds functions/classes/packages by searching the current working
directory, followed by the list of directories in its path variable.
Directories can be added or removed from the path via the &lt;a href=&#34;http://www.mathworks.com/help/matlab/ref/addpath.html&#34;&gt;&lt;code&gt;addpath&lt;/code&gt;&lt;/a&gt;
and &lt;a href=&#34;http://www.mathworks.com/help/matlab/ref/rmpath.html&#34;&gt;&lt;code&gt;rmpath&lt;/code&gt;&lt;/a&gt; functions.&lt;/p&gt;
&lt;p&gt;Often, when using MATLAB for data analysis, I want to run algorithms or
visualisation code that I have written myself, or retrieved from, for
example, the &lt;a href=&#34;https://www.mathworks.com/matlabcentral/fileexchange/&#34;&gt;MathWorks File Exchange (FEX)&lt;/a&gt;.  In order to do this, I
either need to add all the code-containing directories to my path, or
write the analysis scripts in the code directory itself.&lt;/p&gt;
&lt;p&gt;Doing the analysis in the same directory as the code is a poor option if
its an algorithm you intend to reuse, but getting all the directories
right to add the necessary path directories can be cumbersome as well.
Finally, just adding all your code permanently to your path can result
in name collisions.  This can be avoided by using smart naming schemes,
and packages, but in the case of third-party code, you may not have that
control.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/jpeoples/PATHMAN&#34;&gt;PATHMAN&lt;/a&gt; is a tool, implemented in MATLAB, to help with this
situation.  In particular it allows you to give short names to packs of
code, and add/remove them from the path using the commands&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman use shortname
% and
pathman unuse shortname
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It also allows you to list installed packs via&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman list [glob]
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;where &lt;code&gt;glob&lt;/code&gt; can be used to narrow pack names, and update installed
packs after editing their source directories via&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman update packname
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Such usage becomes particularly useful if you have many different code
packs in different locations, or complex logic to add code directories
to the path (see below).&lt;/p&gt;
&lt;h3 id=&#34;usage&#34;&gt;USAGE&lt;a class=&#34;headerlink&#34; href=&#34;#usage&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Here I will discuss a sample use-case. (All subsequent commands are
intended to be run on the MATLAB command line).&lt;/p&gt;
&lt;p&gt;Suppose I&amp;rsquo;ve got some algorithms developed during a recent research
project located in &lt;code&gt;~/research/somealgs&lt;/code&gt; which I now want to add to
PATHMAN with the name &amp;ldquo;somealgs&amp;rdquo;.  Suppose the source directory looks
like&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;somealgs/
    somesubalgs/
        % functions
    moresubalgs/
        % functions
    examples/
        % example scripts
    % more functions
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If I run&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman install ~/research/somealgs as somealgs
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;then this directory will be copied to a configurable PATHMAN root
directory, and that copy directory, and all subdirectories can be added
to path via&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman use somealgs
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and removed via&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman unuse somealgs
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Suppose I then realize the examples/ subdirectory should not be added to
the path.&lt;/p&gt;
&lt;p&gt;In my source directory, I can add the functions &lt;code&gt;addtopath&lt;/code&gt; and
&lt;code&gt;rmfrompath&lt;/code&gt; to implement this addpath, rmpath logic.&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;% addtopath.m&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;addtopath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;root&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c&#34;&gt;% root will be passed by pathman, specifying the root of source&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% tree&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;addpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;root&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;addpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fullfile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;root&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;somesubalgs&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;addpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fullfile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;root&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;moresubalgs&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;

&lt;span class=&#34;c&#34;&gt;% rmfrompath.m&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;rmfrompath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;root&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rmpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;root&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;rmpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fullfile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;root&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;somesubalgs&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;rmpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fullfile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;root&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;moresubalgs&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Finally, to tell PATHMAN about my updated source tree I call&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman update somealgs
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now PATHMAN will use that logic when I call &lt;code&gt;use&lt;/code&gt; and &lt;code&gt;unuse&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, I can tell PATHMAN to exclude that directory when copying
and then just use the default use/unuse logic.  To do so, add the file
&lt;code&gt;.pathmanignore&lt;/code&gt; to the source directory containing the single line&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;example
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This will cause PATHMAN to delete the copied example subdirectory after
copying the source tree. (Note that the lines of &lt;code&gt;.pathmanignore&lt;/code&gt; should
be relative paths to subdirectories, or files only.  globs, etc, do not
work).&lt;/p&gt;
&lt;h4 id=&#34;installation-and-more-information&#34;&gt;Installation and More Information&lt;a class=&#34;headerlink&#34; href=&#34;#installation-and-more-information&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;For install information and further usage guidelines see the &lt;a href=&#34;https://github.com/jpeoples/PATHMAN&#34;&gt;PATHMAN
repository&lt;/a&gt; and the PATHMAN MATLAB help&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;pathman help
% or
help(pathman)
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;which lists and documents all the command-line options for pathman.&lt;/p&gt;
&lt;p&gt;Feel free to ask any questions here or there as well.&lt;/p&gt;
</description>
    </item>
    
    <item>
        <title>Running yst on Windows</title>
        <link>https://jpeoples.github.io/blog/2015/11/yst_setup/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2015/11/yst_setup/</guid>
        <pubDate>Sun, 22 Nov 2015 00:00:00 -0000</pubDate>
        <description>
&lt;p&gt;&lt;a href=&#34;https://github.com/jgm/yst&#34;&gt;yst&lt;/a&gt; is a static site generator by John McFarlane, the originator of
the most utilitarian &lt;a href=&#34;http://pandoc.org/&#34;&gt;Pandoc&lt;/a&gt;.  It is, as far as I can tell, very
simple, and that simplicity is what drew me to consider switching the
site over.  Even though I ultimately decided not to go with it, I did
manage to get it set up and building the test site on my machine.  In
that process I hit a few road-blocks, so I thought I&amp;rsquo;d put the details
here in one place in case anyone else is having similar problems.&lt;/p&gt;
&lt;h3 id=&#34;installing&#34;&gt;Installing&lt;a class=&#34;headerlink&#34; href=&#34;#installing&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&#34;https://github.com/jgm/yst&#34;&gt;readme&lt;/a&gt; on github makes it sound so easy:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;cabal update
cabal install yst
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I did not get the error detailed in the readme regarding
template-haskell dependencies.&lt;/p&gt;
&lt;p&gt;Instead, I had an error installing a dependency: hdbc-sqlite3.  It&amp;rsquo;s a
simple enough error &amp;ndash; you simply need to install sqlite3 on your system
&amp;ndash; but for me at least, nothing is obvious when it comes to Windows.&lt;/p&gt;
&lt;p&gt;After poking around on Google I found &lt;a href=&#34;http://xyz.mmizzi.com/stuff/2014/11/3/install-hdbc-sqlite3-on-windows&#34;&gt;this&lt;/a&gt; post that
explained the correct sqlite3 files to download to get hdbc-sqlite3 to
build.  No worries.  Problem solved, right? Wrong.&lt;/p&gt;
&lt;p&gt;yst complains really fast if the sqlite3 dll is not on your path, so add
it now.&lt;/p&gt;
&lt;h3 id=&#34;first-run&#34;&gt;First Run&lt;a class=&#34;headerlink&#34; href=&#34;#first-run&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;After getting yst installed the next step in the read me is to generate
the test site:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;yst create mysite
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;generates the test site source, then&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;cd mysite
yst
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and voilà! Under the &lt;code&gt;site&lt;/code&gt; subdirectory you have your static site.&lt;/p&gt;
&lt;p&gt;Right?  Wrong.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the output when I run yst:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;Updating site\js\nav.js
Updating site\css\screen.css
Updating site\css\print.css
Updating site\css\hk-pyg.css
Updating site\april_events.tex
yst: site\april_events.tex: commitBuffer: invalid argument (invalid
character)
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Invalid character?&lt;/p&gt;
&lt;p&gt;The yst test site likes to show off it&amp;rsquo;s unicode support, and this is
the source of our issue.&lt;/p&gt;
&lt;p&gt;As detailed by the &lt;a href=&#34;http://jaspervdj.be/hakyll/tutorials/faq.html&#34;&gt;hakyll FAQ&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you get any of the errors:&lt;/p&gt;
&lt;p&gt;commitBuffer: invalid argument (invalid character) &lt;/p&gt;
&lt;p&gt;or:&lt;/p&gt;
&lt;p&gt;hGetContents: invalid argument (Invalid or incomplete multibyte or wide
   character)&lt;/p&gt;
&lt;p&gt;It means that your Hakyll executable couldn’t write to (in
the former case) or read (in the latter) from an UTF-8 encoded file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So for some reason yst can&amp;rsquo;t write unicode to the output file.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not sure why, but the same FAQ page provides a solution for Windows
just a short ways down the page.  Running&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;chcp 65001
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;before running &lt;code&gt;yst&lt;/code&gt; solved the problem for me, and left me with a
beautiful test site.&lt;/p&gt;
</description>
    </item>
    
    <item>
        <title>A dead simple argument parser for MATLAB</title>
        <link>https://jpeoples.github.io/blog/2015/06/ezparse/</link>
        <guid isPermaLink="true">https://jpeoples.github.io/blog/2015/06/ezparse/</guid>
        <pubDate>Thu, 25 Jun 2015 00:00:00 -0000</pubDate>
        <description>
&lt;p&gt;&lt;em&gt;Dear Readers&lt;/em&gt;,&lt;/p&gt;
&lt;p&gt;First off, my name is Jacob, and I am a master&amp;rsquo;s computer science
student.  Nice to meet you.&lt;/p&gt;
&lt;p&gt;A lot of my day-to-day work for my master&amp;rsquo;s is done &amp;ndash; originally to my
chagrin &amp;ndash; in MATLAB (I&amp;rsquo;ll admit sometimes I kind of like it).  Since a
lot of the code I write is for numerical computations, there are often a
variety of parameters and what not that need to be set.  Often, for
whatever I am doing there are reasonable default values to use.
However, MATLAB does not support default values for parameters the way
languages like Python do.  To get around this I have seen a couple of
approaches.&lt;/p&gt;
&lt;p&gt;One approach is to use an options struct.  For this  you would write
your function as&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;[outputargs] &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;what, ever, args, options&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% Let&amp;#39;s imagine we want 3 optional parameters, foo, bar, baz, each&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% taking default values of 0.&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% set defaults&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;baz&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;

&lt;span class=&#34;c&#34;&gt;% parse options parameter, iff it has been passed.&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nargin&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;isfield&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;isfield&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;bar&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;isfield&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;options&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;baz&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;baz&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;

&lt;span class=&#34;c&#34;&gt;% get on with the code&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% ...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then for a user to use this function they can simply do something like&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;what&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ever&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and the function will run with &lt;code&gt;foo = 24&lt;/code&gt;, &lt;code&gt;bar = 0&lt;/code&gt; and &lt;code&gt;baz = 0&lt;/code&gt;.  If
they want &lt;em&gt;all&lt;/em&gt; default parameters, they can either pass in an empty
struct, or simply leave out the argument altogether.&lt;/p&gt;
&lt;p&gt;Another very common approach, which I personally prefer, is to accept
name-value pairs of arguments.  This uses a builtin MATLAB feature,
&lt;code&gt;varargin&lt;/code&gt;, which allows you to collect all parameters beyond a certain
number into a single cell array.&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;[out] &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;what, ever, varargin&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% ...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In this code, if I call&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;c&#34;&gt;...&lt;/span&gt;
    &lt;span class=&#34;s&#34;&gt;&amp;#39;everybody in the car so come on lets ride&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;then the function will have &lt;code&gt;what = 1&lt;/code&gt;, &lt;code&gt;ever = 2&lt;/code&gt; and
&lt;code&gt;varargin = {3, 4, 5, &#39;everybody in the car so come on lets ride&#39;}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Using this, we can implement optional arguments that follow the
so-called name-value pair convention.  The user specifies a series of
pairs, where the first item is a string &amp;ndash; the name &amp;ndash; referring to an
optional parameter, and the second is the value to assign to the
optional parameter.  Therefore, going back to the &lt;code&gt;foo&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt;, &lt;code&gt;baz&lt;/code&gt;
example above, if I wanted to simply set &lt;code&gt;foo&lt;/code&gt; to 24 I would call the
function as&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;what&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ever&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It is the function&amp;rsquo;s job to parse this input, but MATLAB provides a tool
for doing this, called the &lt;a href=&#34;http://www.mathworks.com/help/matlab/ref/inputparser-class.html&#34;&gt;input parser&lt;/a&gt;.  Though
this tool provides a good deal of flexibility, it offers more options
than I really need, and requires more work to use than I would really
prefer.  For a while I found myself instead writing something along the
following lines whenever I needed such optional arguments:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;[out] &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;what, ever, varargin&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% set defaults&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;baz&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;na&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;varargin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;c&#34;&gt;% ensure there are optional arguments supplied, and there should be&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;% an even number if they are name-value pairs&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;mod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;na&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;na&lt;/span&gt;
        &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;varargin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;switch&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;varargin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;bar&amp;#39;&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;varargin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;varargin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;otherwise&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#39;Argument %s not recognised.&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;elseif&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% there are not an even number of arguments&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#39;Every argument after &amp;#39;&amp;#39;ever&amp;#39;&amp;#39; must be a name-value pair.&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;

&lt;span class=&#34;c&#34;&gt;% ...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This wasn&amp;rsquo;t so bad, I could copy and paste the code between files
whenever I needed name-value pair parsing, and simply modify the
names.  However, copy-and-pasting code is always a good hint that you
should just write a function, so I finally broke down and did exactly
that.&lt;/p&gt;
&lt;h3 id=&#34;ezparsem&#34;&gt;ezparse.m&lt;a class=&#34;headerlink&#34; href=&#34;#ezparsem&#34; title=&#34;Permanent link&#34;&gt;&amp;para;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;I had a couple of desired behaviours for this function in addition to
parsing name-value pairs.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Optional arguments should be case insensitive so calling
   &lt;code&gt;function(&#39;foo&#39;, 10)&lt;/code&gt; is equivalent to &lt;code&gt;function(&#39;FOO&#39;, 10)&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I wanted to also support flags &amp;ndash; names with no corresponding
   value &amp;ndash; that simply toggle a certain behaviour on (e.g. &lt;code&gt;function(&#39;verbose&#39;)&lt;/code&gt;
   to toggle verbose behaviour).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Setting up optional parameters and default values should take as
   little coding as possible.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The function addresses point 3. by accepting a struct argument, whose
field names define the names in the name-value pairs, and whose values
define the values in the name-value pairs.  Moreover, a specific default
value is used to indicate that the field should create a flag, instead
of a name-value pair.&lt;/p&gt;
&lt;p&gt;To clarify, recreating our foo, bar, baz example above, and adding a
&amp;lsquo;verbose&amp;rsquo; flag would look like this:&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;[out] &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;what, ever, args, varargin&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;baz&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;verbose&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;%FLAG%&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;

    &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;unparsed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ezparse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;varargin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

    &lt;span class=&#34;c&#34;&gt;% rest of code here&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% ...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now &lt;code&gt;opt&lt;/code&gt; contains all user supplied values, and defaults where no user
supplied value exists.  The verbose flag, if passed in by the user will
be set to 1, otherwise it will be set to 0.&lt;/p&gt;
&lt;p&gt;The second output of &lt;code&gt;ezparse&lt;/code&gt;, &lt;code&gt;unparsed&lt;/code&gt;, simply contains any
remaining arguments that could not be parsed.  These would be any
arguments not matched by a field in the &lt;code&gt;opt&lt;/code&gt; struct, trailing
arguments not following the name-value pattern, repeated options, etc.
Whether or not the existence of unparsed arguments should throw an
error, or simply be ignored is up to the function author.&lt;/p&gt;
&lt;p&gt;To give an example, if I passed in&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;funcname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;what&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ever&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;c&#34;&gt;...&lt;/span&gt;
         &lt;span class=&#34;s&#34;&gt;&amp;#39;verbose&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;bar&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;then the resulting &lt;code&gt;opt&lt;/code&gt; struct would have&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;baz&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;opt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;verbose&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class=&#34;n&#34;&gt;unparsed&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#39;baz&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The resulting function is available &lt;a href=&#34;https://github.com/jpeoples/matlab-ezparse&#34;&gt;here&lt;/a&gt;, but for
completeness here is the code listing.&lt;/p&gt;
&lt;div class=&#34;codehilite&#34;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;[ argstruct, unparsed ] &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;ezparse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; argstruct, argin &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%EZPARSE Fast and easy arg parser for &amp;#39;key&amp;#39;,val pair type optional args.&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   Pass in 2 parameters:&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%       ARGSTRUCT: a struct populated with default values for all optional&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%                  arguments.  Fields should be named corresponding to the&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%                  desired &amp;#39;key&amp;#39; in the key,value pairs.&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%       ARGIN:     The varargin cell array from your function&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   This also supports &amp;#39;flag&amp;#39; type arguments, where there is a string &amp;#39;key&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   with no value to be input, (for example&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%       func(blabh, blah, &amp;#39;optarg1&amp;#39;, 2, &amp;#39;verbose&amp;#39;)&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   where &amp;#39;verbose&amp;#39; is just a flag that gets toggled on.  These are&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   achieved by setting argstruct.flagname = &amp;#39;%FLAG%&amp;#39; in the default values&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   to signify a flag.&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   Note that all fields are case INsensitive&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   The returned &amp;#39;unparsed&amp;#39; is a cellarray of all args in argin that&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   couldn&amp;#39;t be parsed based on your input struct.  Most likely these are&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   simply arguments for which no corresponding field exists.  Handling&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   this is up to the user, for example it could simply be ignored, warned&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%   about, or throw an error, depending on the application.&lt;/span&gt;
&lt;span class=&#34;c&#34;&gt;%&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;argnames&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fieldnames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argstruct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;na&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;nf&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argnames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nf&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argnames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;j&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;na&lt;/span&gt;
        &lt;span class=&#34;n&#34;&gt;arg&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;strcmpi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;arg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
            &lt;span class=&#34;c&#34;&gt;% then we have matched a field&lt;/span&gt;
            &lt;span class=&#34;c&#34;&gt;% check for flag&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;strcmp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argstruct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;%FLAG%&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
                &lt;span class=&#34;c&#34;&gt;% arg is a flag&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;argstruct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;argin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[];&lt;/span&gt; &lt;span class=&#34;c&#34;&gt;% delete field from argin&lt;/span&gt;
                &lt;span class=&#34;n&#34;&gt;na&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
                &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;c&#34;&gt;% no need to search for this fld anymore&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;argstruct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;argin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[];&lt;/span&gt; &lt;span class=&#34;c&#34;&gt;%delete field from argin&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;na&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
            &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
        &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
    &lt;span class=&#34;c&#34;&gt;% set a field arg to false if not found in argin&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;strcmp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argstruct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;%FLAG%&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
        &lt;span class=&#34;n&#34;&gt;argstruct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fld&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;

&lt;span class=&#34;c&#34;&gt;% all remaining args could not be parsed!&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;unparsed&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;


&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;So that&amp;rsquo;s it.  It is only a few lines longer than the manual
implementation of the name-value pair parsing I showed previously, and
it&amp;rsquo;s usage requires only one more line of code after simply setting all
the defaults.&lt;/p&gt;
</description>
    </item>
    
</channel>
</rss>