<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>subsymbol.org (Blog posts)</title><link>http://www.subsymbol.org/</link><description></description><atom:link href="http://www.subsymbol.org/categories/blog.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:amber@cs.toronto.edu"&gt;L. Amber O'Hearn&lt;/a&gt; </copyright><lastBuildDate>Tue, 09 Jun 2026 23:13:51 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Orchard-free bootstrap window for Ironwood</title><link>http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;&lt;em&gt;There is probably some ZEC in the Orchard pool that we can prove was never from double-spent origin, but should we?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://x.com/i/status/2063262293442678830"&gt;When Ironwood opens, any ZEC currently in Orchard can enter the new pool via the turnstile.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This solves the supply uncertainty problem created by the existence of a double-spend bug that is now patched.
But there is a remaining problem.
Orchard notes are indistinguishable from each other in terms of provenance —
a note with a hidden double spend somewhere in its ancestry
looks identical to one with a completely clean history.
&lt;em&gt;If&lt;/em&gt; this bug has been exploited (which I highly doubt),
the current situation is simply going to be a race: whoever moves first gets in.&lt;/p&gt;
&lt;p&gt;As far as I can tell, though, &lt;em&gt;some&lt;/em&gt; ZEC in Orchard has a provably sound history:
any note whose creating transaction has no shielded ancestry since Orchard activation in May 2022.
These cannot have come via a double-spend transaction because double spends must originate in Orchard.
Because only shielded pools hide their spend graphs,
a note with no post-May-2022 shielded ancestry has a fully auditable value history.
No hidden double spend can exist in its past.
While other notes may exist in Orchard with no double-spend provenance,
it would not be verifiable, so notes of this type are only a subset, but they may be a significant one.&lt;/p&gt;
&lt;p&gt;I think it is too late to submit ideas for the new consensus rules for Ironwood,
and this idea has at least one flaw,
but I'm going to write it down anyway in case it's of interest or spurs other ideas later.&lt;/p&gt;
&lt;p&gt;The idea is to open Ironwood with a short VIP admission window during which only these &lt;strong&gt;Orchard-free&lt;/strong&gt; notes may enter.
This gives demonstrably sound ZEC first priority, rather than leaving admission to a race with no quality distinction.&lt;/p&gt;
&lt;p&gt;The feasibility of this depends directly on how feasible it would be
to create a zk proof to verify that a nullifier comes from a note created with a txid from a particular known set.
I don't have the background to analyze that right now, but it does seem to me that it's possible to do.&lt;/p&gt;
&lt;p&gt;The flaw I'm sure about is that because only some genuine transactions can be verified in this way,
we would have to enforce biased admission, putting provably good-provenance ZEC ahead of unprovably good-provenance ZEC.&lt;/p&gt;
&lt;section id="mechanism"&gt;
&lt;h2&gt;Mechanism&lt;/h2&gt;
&lt;p&gt;Here's how it would work.
Before Ironwood activates,
the full transaction graph is traced to identify every transaction that has an Orchard output
but whose inputs trace back to coinbase or pre-Orchard history without crossing any post-May-2022 shielded pool.
The set of qualifying txids is committed as a protocol consensus parameter before activation.&lt;/p&gt;
&lt;p&gt;During the VIP window, admission to Ironwood requires a zero-knowledge proof that
the entering note was created by one of these qualifying transactions,
and that its nullifier is unspent,
without revealing which transaction created it.
When this initial window closes, Ironwood opens to all.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="provenance-chain-examples"&gt;
&lt;h2&gt;Provenance Chain Examples&lt;/h2&gt;
&lt;p&gt;The diagram below illustrates valid and invalid provenance chains. Chains A, B, and C qualify for VIP admission. Chain D is disqualified because an Orchard transaction appears in its ancestry — regardless of how many transparent hops follow it.&lt;/p&gt;
&lt;img alt="Orchard-free provenance chains" src="http://www.subsymbol.org/images/orchard-free-provenance-chains.png"&gt;
&lt;/section&gt;
&lt;section id="real-world-example"&gt;
&lt;h2&gt;Real-World Example&lt;/h2&gt;
&lt;p&gt;I wrote some code to search for examples and by creating a dict of dict origin trace.
The following is a real, recent transaction on the Zcash mainnet that qualifies as Orchard-free (iff it has not since moved).
Its ancestry traces back exclusively to coinbase outputs:
15 separate coinbase transactions feed into it with no shielded intermediaries.
And it represents significant value.
I don't yet know how many such potentially qualifying notes exist,
because I don't yet have a full node running for quick analysis and I've had to search on explorer APIs.&lt;/p&gt;
&lt;p&gt;Transaction: &lt;a class="reference external" href="https://blockexplorer.one/zcash/mainnet/tx/5b2843fa67f46fb00b54a2bb7f43603df8ea1e8a43f209f3323f6ef5009da303"&gt;5b2843fa...09da303&lt;/a&gt;&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code json"&gt;&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-1" name="rest_code_491fee0eb1ee46598d0f470f318e9003-1" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-1"&gt;&lt;/a&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-2" name="rest_code_491fee0eb1ee46598d0f470f318e9003-2" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-2"&gt;&lt;/a&gt;&lt;span class="nt"&gt;"5b2843fa67f46fb00b54a2bb7f43603df8ea1e8a43f209f3323f6ef5009da303"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-3" name="rest_code_491fee0eb1ee46598d0f470f318e9003-3" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"61b8863a4309f0a797c0f7f268e9d6ef4ee7bb27954b71b8fd76476ca057a967"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-4" name="rest_code_491fee0eb1ee46598d0f470f318e9003-4" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"9adb7b460d3078a58cbdf1d9758edf31a444e9d90adb78aaff264252ea623c6b"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-5" name="rest_code_491fee0eb1ee46598d0f470f318e9003-5" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"08de598f8f05d04a7fbc4440146ed5938ac0359ea99a5efabd876b118fd9136d"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-6" name="rest_code_491fee0eb1ee46598d0f470f318e9003-6" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"daebd531bc8e9db495969a8aec3889a99182f7a220aa087e1895e69fc593336f"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-7" name="rest_code_491fee0eb1ee46598d0f470f318e9003-7" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"2392412651e328b114ed688388a8291cf9bc6b13e3a62304321257afd4721e71"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-8" name="rest_code_491fee0eb1ee46598d0f470f318e9003-8" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"4196d87bf14217a064e529cef3c98e7be24d575b8551ae5326bc852d3460cf72"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-9" name="rest_code_491fee0eb1ee46598d0f470f318e9003-9" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-9"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"e2704ad5f38d4a423108b2665b22622e05fb6f71ed585b62ac2f127f20e3867b"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-10" name="rest_code_491fee0eb1ee46598d0f470f318e9003-10" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"ab31922bed40edc5e7bd3e1c040c1b641939c6fbbc9fbfd696e1c8128e75327f"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-11" name="rest_code_491fee0eb1ee46598d0f470f318e9003-11" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-11"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"1956a1ee11175bd5f1538094c60eaa0665531bf76c3fc23b13615f1089c95d81"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-12" name="rest_code_491fee0eb1ee46598d0f470f318e9003-12" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-12"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"b6c07b84b1b80be94ed96a627fda6661e42d609deee3b7ba95252ac3a132b383"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-13" name="rest_code_491fee0eb1ee46598d0f470f318e9003-13" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-13"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"0b1a92ec597df115e4039fee6ecf7f33b897540fc18f1060a9ffc179c93f4a87"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-14" name="rest_code_491fee0eb1ee46598d0f470f318e9003-14" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-14"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"909a2d677fdb5d1c9422b4cb2a4eee46d42eb1e3d0b776d64a3154d06fac9e8a"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-15" name="rest_code_491fee0eb1ee46598d0f470f318e9003-15" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-15"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"c48ea6aea6969cb0ca7b352944167a06cad46129544b2119225b0754bbbafb8a"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-16" name="rest_code_491fee0eb1ee46598d0f470f318e9003-16" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-16"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"940174f44d65168a2ef729117b7eb10db72baf87dab70628e24fcaf4024c6a8d"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-17" name="rest_code_491fee0eb1ee46598d0f470f318e9003-17" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-17"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;"deced902f846d290354236fe20c8f84d16eb2cc01c534984577bebe263435d93"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"coinbase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-18" name="rest_code_491fee0eb1ee46598d0f470f318e9003-18" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-18"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_491fee0eb1ee46598d0f470f318e9003-19" name="rest_code_491fee0eb1ee46598d0f470f318e9003-19" href="http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html#rest_code_491fee0eb1ee46598d0f470f318e9003-19"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Each key at the second level is a direct ancestor txid; each maps to &lt;cite&gt;"coinbase"&lt;/cite&gt;, meaning it was a mining reward.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="open-question"&gt;
&lt;h2&gt;Open Question&lt;/h2&gt;
&lt;p&gt;Is this proof constructable within the existing Orchard/Halo2 infrastructure? Specifically: can a prover demonstrate that their note's creating txid is a member of the committed qualifying set, combined with nullifier non-membership, without revealing the txid?&lt;/p&gt;
&lt;p&gt;And if so, is it desirable?&lt;/p&gt;
&lt;/section&gt;</description><category>blog</category><category>Zcash</category><guid>http://www.subsymbol.org/posts/2026/06/09/orchard-free-bootstrap-window-for-ironwood.html</guid><pubDate>Tue, 09 Jun 2026 19:15:38 GMT</pubDate></item><item><title>Some Philosophical Implications of Deacon's Model of Symbolic Reference</title><link>http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;&lt;em&gt;This is an attempt from a few years ago to assemble some thoughts on&lt;/em&gt;
&lt;em&gt;Terrence Deacon's&lt;/em&gt; The Symbolic Species.
&lt;em&gt;It is presented here as written then with a few minor edits.&lt;/em&gt;&lt;/p&gt;
&lt;!-- Explain the hierarchy itself --&gt;
&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;
&lt;section id="a-hierarchy-of-referential-processes"&gt;
&lt;h2&gt;A hierarchy of referential processes&lt;/h2&gt;
&lt;p&gt;In his book &lt;em&gt;The Symbolic Species&lt;/em&gt;,
Terrence Deacon sketches a theory of human language
aiming to explain how it is qualitatively different
from other forms of animal communication,
and not just a more advanced form of the same kind of communication &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-1" id="footnote-reference-1" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;1&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
I will summarize his model and attempt to describe how it
leads to particular stances on
a selection of problems in the philosophy of language
and of linguistics.&lt;/p&gt;
&lt;p&gt;Deacon argues that different modes of reference entail properties
that constrain or allow different degrees of expressiveness, learnability,
and other formal characteristics affecting how they can be used.
It is the mode he terms &lt;em&gt;symbolic&lt;/em&gt;, which he holds responsible for the
unique properties of human languages.
This symbolic mode of communication in turn allows symbolic thought.&lt;/p&gt;
&lt;p&gt;The symbolic mode is contrasted with two simpler modes,
&lt;em&gt;iconic&lt;/em&gt; and &lt;em&gt;indexical&lt;/em&gt;, on which it depends.
He then argues that human communication is the only animal communication
that uses all three modes.
These three modes are not meant to be
properties of signs themselves,
but rather modes of cognitive processing.
And argues that symbolic processing cannot occur
without being simultaneous iconic and indexical processing.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="deacon-s-terminology-in-brief"&gt;
&lt;h2&gt;Deacon's terminology in brief&lt;/h2&gt;
&lt;p&gt;As these terms have all been used by other philosophers and linguists
in different ways, we must head off confusion.
The word 'symbol' is often used to refer to a mark,
such a character or other grapheme.
We will refer to that usage with &lt;em&gt;sign vehicle&lt;/em&gt;.
Similarly, the word 'indexical' has a different meaning historically
in discussion of the semantic reference pertaining to
certain words including demonstratives.
Deacon's use of the term is related and so
does have implications for that type of reference,
which I will touch on only tangentially.&lt;/p&gt;
&lt;!-- Deacon's hierarchy is based largely on Peirce's distinctions. --&gt;
&lt;p&gt;The simplest mode of reference in this model is &lt;em&gt;iconic&lt;/em&gt;.
What is meant by iconic reference,
is the mere recognition that x is similar to y and thus invokes it.
As such, iconic reference is basic to any cognitive process;
it reflects the formation of a category.
This is basic because all learning
requires enough stimulus generalization to
respond the same way to different stimuli
based on their similarity.
But such generalization can also be used in iconic sign vehicles
that bring to mind a category and thus &lt;em&gt;represent&lt;/em&gt; it.&lt;/p&gt;
&lt;p&gt;Iconic reference is necessary as a first step of language processing
even in sign vehicles that can be processed further as indices or symbols.
For example, a written character must be
recognized as being an instance of its class before it can be interpreted.
Similarly, this is reflected in
the type-token distinction of words in corpus analysis,
where we refer to a type as the class of the word
as separate from each of its token instances.&lt;/p&gt;
&lt;!-- 02c054b4-3e86-11eb-8db2-d4619d1011e0 indexical --&gt;
&lt;p&gt;&lt;em&gt;Indexical&lt;/em&gt; reference builds on iconic reference
by the addition of association.
To refer indexically requires that two categories
are already established via iconic reference.
The association of these categories allows one to index, or indicate the other.
Because these are established by co-occurrence,
there is potential for implication of causal relation.
Note also that indexical reference is transitive.
If smoke indicates fire and a smoke alarm indicates smoke,
then a smoke alarm indicates fire.&lt;/p&gt;
&lt;p&gt;As with iconicity,
associations are also characteristic of all learning processes
and not unique to human communication.
They do not even require cognition.
Biochemical communication, for example in the human body,
is based on what are often termed &lt;em&gt;signals&lt;/em&gt;,
because they indicate a physiological state.
For example, high levels of insulin
can indicate conditions favourable for growth,
so systems in the body respond to that signal
with growth promoting activity.&lt;/p&gt;
&lt;p&gt;Indexicality is a critical stage in linguistic processing.
For example, the process of associating the word 'cup'
with things in the world that hold liquid for drinking
entails iconic relationships between instances of the word 'cup'
and iconic relationships between instances of drinking vessels
establishing both categories
before (or at the same time as) the association between them can be made.
Indexical reference is also ubiquitous in animal communication.
For example, vervet alarm calls differentiate predator types.
Likewise, in human to animal communication,
a dog can be taught associations between spoken words
and behaviours such as sitting or events such as feeding.&lt;/p&gt;
&lt;p&gt;The mode of reference that sets human language apart is what Deacon terms &lt;em&gt;symbolic&lt;/em&gt;
Symbolic reference depends on a sign vehicle already having
been processed indexically.
It then entails further indexical reference among other symbols in a set.
What makes a word a symbol is not just that it indexically
points to a conceptually or physically present referent.
It must also refer to other words,
not only reflected in a thesaurus-like web of substitutability,
but in semantic ontologies and usage constraints
constituting grammar.
This aspect of symbolic reference is responsible for
its combinatorially expansive generative power.&lt;/p&gt;
&lt;p&gt;However, this also poses a fundamental problem
in language learnability.
If learning to symbolically process a word requires learning
its relationship with every other word,
then the task quickly becomes intractable.
The puzzle of how children seemingly effortlessly learn language,
despite this "poverty of the stimulus"
is a long-standing question,
and is the motivation for cognitive hypotheses
of innateness, and even of the hard-coded grammar modules
proposed by Chomsky that lack only
a small set of parameters by which to fit the native language &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-2" id="footnote-reference-2" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;2&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In AI terms, Chomsky's view says that the language learning problem requires high bias
in the bias-variance tradeoff of learning models.
That is, most of the information is already in the model.
This would seem to be confirmed by the fact that
computational models that learn
co-occurrence relationships between contiguous vocabulary items on a large scale
are still very limited in ability to recognize or generate well formed language.
Not only do they fail to capture long distance relationships,
but there is never enough data to capture the behaviour of rare collocations,
let alone predict the behaviour of unseen ones.&lt;/p&gt;
&lt;p&gt;While there is certainly evidence of bias in human brains
conferring ability to process language,
Deacon's view is that the machinery for learning these relationships
is not something added to the ability to process symbols,
but that is already present simply by having these three modes available,
and the ability to switch among them.
What is necessary to reduce the size of the language learning search space
is a way to constrain options.
Through a process of "desymbolization",
Deacon proposes that some words and contexts
call for only indexical reference to other words,
and knowing which mode of reference to use is part of what is learned.
So, for example, the word 'cup' can in principle occur in speech
with any other known word.
However the phrase 'a cup of ___' has a much smaller set of likely completions,
and 'not my cup of ___' even fewer.
This is because grammatical function words represent only indexically.
They point to specific relationships between symbols.
It does turn out that computational models that learn
implicit distribution patterns are much more powerful.&lt;/p&gt;
&lt;p&gt;Once the responsibility for the complexity of human language
is seen as an inherent property of optional symbolic reference,
the answer to the question of how humans can acquire complex grammars
ceases to require either more intelligence than other creatures
or more cognitive infrastructure than what is necessary for symbolic reference itself.
And since symbolic reference is built hierarchically from simpler forms of reference
already present in other animal communication,
and even other important non-verbal human communication,
there need only be an enhanced disposition to refer in this mode.&lt;/p&gt;
&lt;p&gt;Even the important property of recursion
follows emergently from symbolic reference itself,
because symbolic reference allows substitution across type levels.
For example, symbols can replace deictic indexicals,
such as 'that boy' being replaced with 'he',
or larger grammatical units such as entire arguments replaced with 'that',
or, more abstractly,
the implicit recursion of successively applying adjectives to noun phrases,
such as 'the little red hen'.&lt;/p&gt;
&lt;p&gt;Iconic reference and indexical reference are constrained
by the necessities of similarity of form
and correlation in time or space, respectively.
That means they cannot be substituted except
when those similarities or correlations apply transitively.
This constraint is transcended in the symbolic mode.
We don't actually need to have seen two words
occur together to learn a symbolic relationship between them!
In fact, we learn strong associations between words that occur in alternation.
For example, we associate words such as 'coffee' and 'tea',
even if each tends to occur in exclusion of the other.
This implies both that symbolic properties such as recursion cannot be added
to a system without symbolic reference,
and that once symbolic reference is in place,
nothing more is required for properties such as recursion to be possible.&lt;/p&gt;
&lt;p&gt;I hope through the following examples to further clarify
how this symbolic distinction operates.&lt;/p&gt;
&lt;!-- "has a grammar" means constraints on well formed combinations. --&gt;
&lt;!-- 98aeeb4e-3e4e-11eb-8db2-d4619d1011e0 not a simple mapping --&gt;
&lt;!-- 98aeeb4e-3e4e-11eb-8db2-d4619d1011e0 symbols and physical correspondence --&gt;
&lt;!-- 5a0c9e66-3e87-11eb-8db2-d4619d1011e0 type-token --&gt;
&lt;!-- b5ef23c8-3f10-11eb-8db2-d4619d1011e0 PoS --&gt;
&lt;!-- 13000828-400d-11eb-8db2-d4619d1011e0 recursion --&gt;
&lt;!-- a4491f74-40e2-11eb-8968-d4619d1011e0 analogy to math --&gt;
&lt;!-- c6bb6fa8-40e2-11eb-8968-d4619d1011e0 structure is not the constraint, but the product --&gt;
&lt;!-- Sapir Whorf --&gt;
&lt;!-- - - - - - - - - - - - --&gt;
&lt;/section&gt;
&lt;section id="linguistic-relativism"&gt;
&lt;h2&gt;Linguistic relativism&lt;/h2&gt;
&lt;p&gt;Deacon reasons that since
the structural properties of human language
emerge from the symbolic mode of reference,
the habitual use of symbolic reference for communication
in turn affects the way we think,
making it different from other kinds of thought
based on other forms of reference.
Because this mode is almost entirely restricted to humans,
this could be viewed as a species version of strong linguistic relativism &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-3" id="footnote-reference-3" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;3&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The relativistic idea that there is a relationship between
the particular language one speaks and the form of one's thoughts
is usually attributed to Sapir and Whorf.
It has been criticized as being either trivial in its weak form of mere influence,
or implausible in its strong form of limitation on what thoughts are possible.
It's not particularly contentious that, for example,
linguistic distinctions our language requires
can predispose us to make those distinctions
when thinking about objects, especially when we are preparing to talk about them,
but just because a certain meaning is more easily accessible in one language
than another, does not mean it cannot be arrived at in another.
However, if the comparison is among species rather than within,
the strong form becomes a more attractive hypothesis.
We know from the study of formal languages
that different generative rules in symbolic systems concretely affect
expressibility in mathematically provable ways.
Not having symbolic reference at all
seems to preclude many kinds of thought,
particularly thought involving modal and logical operators or other counterfactuals.&lt;/p&gt;
&lt;!-- 3db9ece6-458f-11eb-9ff5-d4619d1011e0 examples of things animals can't think due to grammar --&gt;
&lt;p&gt;If we think about animals in close human contact, for example dogs,
it's clear that we can teach some of them to "understand" words,
but this understanding appears to stay strictly within indexical interpretation.
A dog can learn to associate a word or phrase with a behaviour to perform,
or with an event to happen now, such as "Let's go for a walk" or "dinner time".
These are indexical understandings only,
because they associate a word category with
a conceptual category that is, crucially, coincident in time and place.
If the co-occurrence between the word and event ceased,
the association would eventually be extinguished, too.
But imagine trying to verbally present a dog with
an alternative between a walk and a meal,
or to tell him a story about yesterday's walk.
You cannot ask a dog whether he believes there is a squirrel outside.&lt;/p&gt;
&lt;!-- and probably most reliably when presented with
a particular pattern of intonation. --&gt;
&lt;p&gt;Consider trying to replicate the "marshmallow test" of delayed gratification.
In the original Stanford experiment,
young children were given a marshmallow, and a choice.
If they did not eat the marshmallow when the staff left the room,
they would soon be given two marshmallows to eat.
The idea is that two marshmallows are better than one,
and that a child who has the ability to temporarily inhibit
the impulse to eat the one given knowledge of the contingent second,
will have better outcomes in life.&lt;/p&gt;
&lt;p&gt;I submit that the corresponding test performed on dogs can only test obedience,
because the dog cannot be taught to understand the trade being offered,
even if they "know" the word for the treat in question.
We could train the dog not to eat a treat
because he knows he'll be rewarded.
We could even train him to reject a lesser treat, say, a strawberry,
in anticipation of a slice of beef.
But this would be a mere association of the strawberry with
the initiation of a performance: do not eat the strawberry and be rewarded with beef.
It would require training exactly because it could not be explained in words.
In other words, the dog can learn an association between behaviour and reward;
this is an indexical reference, a particular instance of
an "if x then y" relation.
But the dog can't seem to learn "if x then y" itself as a hypothetical structure
and then apply it to new referents.
If other animals had symbolic tools with which to organize perception,
we would expect to see expression of symbolic reference in their native communication,
or at least the ability to be taught to use it with humans.&lt;/p&gt;
&lt;!-- The interesting difference in the child and dog versions of the test
comes in the presumption that a choice can made.
In other words, if we presume that a dog likes strawberries but prefers beef,
how do we know that the dog, having eaten the strawberry or not,
knew the choice he was making?
I think at the very least we would require a kind of Turing Test,
in which the dog could --&gt;
&lt;p&gt;Although much of the focus of the discourse on
linguistic relativism among human languages is lexical —
the canonical example being the existence of many words for snow in the Arctic —
Whorf's original descriptions focused on what he deemed grammatical differences.
That is, he noted that in order to communicate
we have to agree on a system of organizing our perceptions,
and asserts it is this organization which then shapes our thought &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-4" id="footnote-reference-4" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;4&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
Specifically, he wrote about classifications that would either be
explicitly marked grammatically, for example with grammatical morphemes,
or implicitly through distribution patterns.&lt;/p&gt;
&lt;!-- a428029e-458d-11eb-9ff5-d4619d1011e0 experiences, categories don't require language --&gt;
&lt;p&gt;Arguably, from a strictly lexical perspective,
we should expect other animals to be able to associate words with
particular sets of stimuli in ways that could
illustrate different ways of organizing the perceptual world.
We know that we can teach lab animals complex tasks that entail such distinctions.
Experiencing categories is not a linguistic act.
It requires only iconic reference and is not unique to humans.
Using a word to refer to a category is only indexical reference
and is also demonstrably teachable to some animals as in our dog example.&lt;/p&gt;
&lt;p&gt;What is linguistic and symbolic is using categories to
constrain grammatical constructions.
For this purpose categories can be based on semantic properties grounded in experience
the way 'a cup of ___' imposes selectional restrictions &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-5" id="footnote-reference-5" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;5&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;,
but they can also be completely arbitrary such as grammatical gender.
Having the ability to organize categories around grammatical functions
is critical for reducing the search space of relations between words.
It's also essential for the recursive ability to
carry forward reference through a chain of substitution.&lt;/p&gt;
&lt;!-- differentiating into language requires shaping into a form
choosing features required by it --&gt;
&lt;!-- Thinking symbolically is a result of internalizing symbolic communication,
therefore animals cannnot think symbolically at all. --&gt;
&lt;!-- Emoji example --&gt;
&lt;!-- Sense and reference --&gt;
&lt;!-- - - - - - - - - - - - - - - - - - - - --&gt;
&lt;!-- Frege: predication is applying sense to a reference --&gt;
&lt;/section&gt;
&lt;section id="sense-and-reference"&gt;
&lt;h2&gt;Sense and reference&lt;/h2&gt;
&lt;p&gt;Deacon hypothesizes that the predicate-argument structure of linguistic communication
results from the dependence of symbolic reference on indexical reference &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-6" id="footnote-reference-6" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;6&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
The linguistic function of a predicate is to categorize its argument.
In this sense, the argument is what the discourse is "about",
and therefore its reference requires a kind of concreteness of instantiation,
or grounding to something "real",
while the predicate only refers to a symbolic category
that needn't itself be thus instantiated.
Thus the predicate derives grounding via its argument
and, according to Deacon, requires it to be meaningful.
Concreteness is a property of indexical reference,
because of its requirement for co-occurence or contiguity.
What an index refers to must be something present or proximate.
But because indexical reference has transitivity,
this proximity requirement for
words that refer indexically can be linked in a chain.
To see this, consider sentences (1) - (4).&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;&lt;p&gt;The girl sat in the chair.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;She was too heavy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It broke.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;That's a shame.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In Deacon's analysis, in (1) 'the' serves in both cases as a form of deixis
that grounds the sentence indexically to specific referents.
However, once they have been incorporated into the sentence,
they can be substituted symbolically in a way that carries the reference.
'She', 'it', and 'that' make use of grammatical category to transitively
maintain a chain of referential grounding.&lt;/p&gt;
&lt;p&gt;There is a tradition in analytic philosophy
to seek a direct correspondence between language and metaphysical reality;
for words and expressions to "attach" via reference to things in the world.
In Wittgenstein's Tractatus, he lays out a kind of logico-linguistic atomism,
where every proposition can be analyzed down to "names":
elements that directly refer to objects in the world.&lt;/p&gt;
&lt;p&gt;There have been many different
interpretations of what it means for an expression to refer to objects
and how that reference happens.
Gottlob Frege distinguished between sense and reference,
saying "We let a &lt;em&gt;sign&lt;/em&gt; &lt;em&gt;express&lt;/em&gt; its sense and &lt;em&gt;designate&lt;/em&gt; its nominatum." &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-7" id="footnote-reference-7" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;7&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
In other words, in this view,
sense is a set of properties that an expression describes,
and that description, in addition to corresponding to the properties,
also refers to something specific by them,
insofar as it narrows down the potential referential candidates to
the single thing in the world that has those properties.
If something does exist in the world with the properties,
the expression also corresponds to a true proposition.
He also pointed out that an expression
can have a sense and yet not have a nominatum;
not refer to anything existing in the world,
if there is nothing having the properties described.&lt;/p&gt;
&lt;p&gt;A distinction was subsequently proposed by Keith Donellan
about definite descriptions &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-8" id="footnote-reference-8" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;8&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
He suggested that when a definite description narrows a subject
to something specific that we don't know the referent for,
it merely attributes, but doesn't refer.
For example, his claim is that in a sentence such as
'The person who sat in my chair was too heavy.'
if we don't know who sat in the chair, then
the expression 'The person who sat in my chair' doesn't refer,
but merely attributes, having a meaning akin to
there exists a person x such that x sat in my chair.
Whereas if we do believe we know who sat in the chair,
then the expression refers to that person in a "rigid" way.
That is, in the attributive case,
any subsequent attribution is meant to apply to whoever sat in the chair,
whereas in the "referring" case,
subsequent attributions are meant to apply to the person we believed sat in the chair,
even if it turns out that they didn't sit in the chair after all,
or if there is contention over that point.&lt;/p&gt;
&lt;p&gt;In both cases there is an act of predication,
so Deacon's hypothesis would require an indexical reference in the phrase either way.
However, I don't think his hypothesis requires that the chain of reference
terminate in a rigid reference or Wittgensteinian atom.
Rather, the chain of reference need only terminate in some
mutually agreed upon focus of attention.
And this focus could be entirely fictional, such as the Jabberwock,
or incompletely specified, so long as it is held constant across substitutions.&lt;/p&gt;
&lt;p&gt;The requirement that every predicate be
a symbol grounded by its argument via indexical reference
and that a reference chain need trace back only to a mutual focus of attention,
may explain a further example in Donellan's argument.
Donellan pointed out that a definite description in a predicate
need neither refer nor attribute
(and thus carry the implication that there exists a referent).
His example contrasts the questions:&lt;/p&gt;
&lt;ol class="arabic simple" start="5"&gt;
&lt;li&gt;&lt;p&gt;Is de Gaulle the King of France?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is the King of France de Gaulle?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Normally, we would not consider (5) to contain the presupposition
that there is a king of France, whereas we would in (6).
Deacon's hypothesis would explain this by noting that
the first predication requires an indexical grounding,
because it begins the communication.
Therefore it asserts its description as referring to something,
even if it is only the attributive sense of
asserting that the thing exists.
The second predication derives its indexical reference from the first,
so it need not itself be grounded.
In this way, (5) does not assert there is a king of France,
but only asks if the referent, de Gaulle, fits that symbolic
(and therefore hypothetical), category of being king of France.
In contrast, (6) first asserts the king of France has a referent before
asking if it can be merged with the category of being de Gaulle.&lt;/p&gt;
&lt;!-- This interpretation of sense and reference is thus called "descriptivism."

Because descriptions inherently contain sense,
they can solve problems where a sentence appears vacuous
from a referent only analysis.
For example a sentence of the form "x is y" would seem meaningless
if x and y have no meaning other than referring to something,
but if they carry sense,
then the expression serves to --&gt;
&lt;!-- identify
two referents, where it may not have been a priori deducible
that the two descriptions referred to the same thing. --&gt;
&lt;!-- be03ccc4-3e45-11eb-8db2-d4619d1011e0 Donellan causal chain --&gt;
&lt;!-- d4d7d8f2-40dc-11eb-8968-d4619d1011e0 predication and sense --&gt;
&lt;!-- The problem of easy knowledge and private language --&gt;
&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;
&lt;!-- 30162e7c-3f10-11eb-8db2-d4619d1011e0 overview --&gt;
&lt;/section&gt;
&lt;section id="knowledge-of-language"&gt;
&lt;h2&gt;Knowledge of language&lt;/h2&gt;
&lt;p&gt;While the above discussion
suggests that expressions of language refer, at least transitively,
to objects in the world,
I have glossed over the difference between reference and meaning.
Potential differences are sometimes illustrated
by embedding propositions that look like they have the same meaning
from a reference point of view
into belief statements.
Hence the classic example from Frege of 'the morning star' and 'the evening star'
which both refer to Venus can be used to show the difference.&lt;/p&gt;
&lt;ol class="arabic simple" start="7"&gt;
&lt;li&gt;&lt;p&gt;I believe that the morning star is the morning star.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I believe that the morning star is the evening star.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If meaning were merely reference, (7) and (8) would have the same meaning.
Meaning appears to have more to do with ideas in the mind
than objects in the world.
Given that only the individual has access to his own ideas,
this led Locke to somewhat absurdly conclude that language must be private —
absurd because the putative function of language is to communicate,
and if meaning is necessarily private then nothing can be communicated &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-9" id="footnote-reference-9" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;9&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If what words or expressions refer to are ideas,
then we may be able to make a helpful analogy
between mental representations and indexical reference.
One theory of associative memory is that the hippocampus
organizes it by index.
For example, the word 'cup' can be an index into associative memory
which ties together perceptual fragments of actual experience
(though they may be merged or idealized over time).
In this way, the associations with the word 'cup' for an individual
are indeed private.
However, because 'cup' can also be processed symbolically,
that means there are associations with other symbols
and how those symbols interact via grammar.
Grammar, unlike associative memory, is procedural
and therefore processed in part in the cerebellum &lt;a class="brackets" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-10" id="footnote-reference-10" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;10&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
Because the &lt;em&gt;word&lt;/em&gt; 'cup' and its grammatical occurrences
are exactly what is shared when people use language to communicate,
this symbol-to-symbol structure is negotiated in public,
regardless of the idiosyncratic associative contents of its indexical grounding.
In other words,
perhaps what is private is not language, the symbolic system,
but merely associations in the pre-verbal processing of meanings.&lt;/p&gt;
&lt;p&gt;Debate about whether language can be private
does sometimes center on discussion of grammatical rules.
For example, Saul Kripke and others point out
that there can be many, perhaps even infinitely many rules that a given
data set of usage seen at a given point in time is obeying,
and therefore there is no way to distinguish
whether you and I are following the same rules
or whether our rules merely agree thus far,
but are each, essentially, private and different.
To be sure even within what is considered correct usage,
there are idiosyncracies in production
such that linguistic forensics can sometimes determine authorship
just by statistical analysis.&lt;/p&gt;
&lt;p&gt;In analogy to formal languages, many have sought
to characterize human languages as infinite sets
of utterances that would qualify as grammatically correct English.
This analogy leads naturally to treating the problem
as an inference puzzle to find the formal language
that would generate the appropriate grammar.
In contrast, Deacon's view is that language in the wild
is not so much deemed correct or incorrect,
but understandable or not,
and that this depends exactly on whether the indexical references can be
derived from immediate sources of joint attention, linguistic or non-linguistic.
This would explain tolerance of "broken" English
by foreigners and children, or the fragments characteristic of dialogue.
Interestingly, this does seem to imply that language
requires outside verification to judge,
denying the ability of language to be private.&lt;/p&gt;
&lt;p&gt;A related problem in language knowledge
that Deacon specifically aimed to address
was the Chomskian idea that the complexity of grammar
is so high that humans must have innate grammatical structures
that need only be parameterized to function.
They seem to agree that the induction of a rule set
is implausible,
but Deacon's solution is to consider the complexity inherent in the
symbolic mode of reference,
and the constraints to be exactly what is imposed
by generic learning constraints in the human brain.
Thus, we incorporate desymbolization exactly to the degree needed
to cope with our cognitive limitations,
such as short term memory capacity.
In other words, the forms of grammatical constraints human languages have
are a direct result of our limited cognitive ability to deal with symbolic reference,
and this is the source of apparent universality.
The structure is the product of the process,
not the constraint that has to be learned.&lt;/p&gt;
&lt;p&gt;In "Language and Problems of Knowledge",
Chomsky goes so far as to say that we must have innate concepts
that need only be given labels [1].
Otherwise, he says, we could not explain that children at
their peak of language acquisition learn
many words a day, sometimes after a single occurrence.
But this is not so remarkable when we remember that concepts are not symbolic,
they are merely indexical, and therefore do not require language.
It's possible that when children are in the phase of
acquiring lexical items at this rate,
they have a backlog of concepts waiting for labels,
not because those concepts were innate,
but because they were acquired non-verbally before the rest of their language ability
was ready to label them,
and the phase corresponds to a sudden readiness to acquire words symbolically,
because they have figured out how to do this mode of reference.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="summary"&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;Deacon's model of symbolic reference
distinguishes a hierarchy of modes of reference,
such that the first two are ubiquitous in learning and communication
in all living systems,
whereas the symbolic mode, building on the others, is unique to human language.
These distinctions cast new light on some old problems.
While they do not directly bear on differences between human languages,
they clarify how certain word-like communications in other animals
differ from full-fledged symbolic words, while retaining indexical properties,
and how this limitation to their use in communication,
likely imposes limitations in thought.&lt;/p&gt;
&lt;p&gt;Conceiving of reference as a mode of processing
rather than something inherent in sign vehicles themselves
allows a shift in the objective of linguistic analyses
from finding assertions about things in the world
to maintaining shared focus on a small, but growing set of ideas
as they are transformed and created through predications.
This ability to focus on ideas via symbolic reference
allows a kind of cognition that is not dependent on
the proximity or reality of any object,
and yet is always linked to a shared context.&lt;/p&gt;
&lt;p&gt;The general constraints of memory are sufficient to
require limitations on symbol-to-symbol relations
that would be reflected as a kind of universal
in any language.
Therefore, according to Deacon,
We need no special innate representation of grammar,
but only a capacity to optionally use symbolic reference,
in order to end up with language structures sharing basic properties.
Non-human animal communication is not simplified symbolic language,
but rather non-symbolic.&lt;/p&gt;
&lt;!-- Grammar syntactic-semantic --&gt;
&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;
&lt;!-- Error correction --&gt;
&lt;!-- - - - - - - - - - - - - - - - - --&gt;
&lt;!-- 33854d56-3f0e-11eb-8db2-d4619d1011e0 overview --&gt;
&lt;!-- 7d350224-3f0f-11eb-8db2-d4619d1011e0 symbolic level --&gt;
&lt;!-- 19ac3fd6-40e7-11eb-8968-d4619d1011e0
A broken category that is not a error, is a metaphor. --&gt;
&lt;!-- Metaphor --&gt;
&lt;!-- - - - - - - - - --&gt;
&lt;!-- Computational Cognitive Science --&gt;
&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;
&lt;!-- 7fc79df2-40e1-11eb-8968-d4619d1011e0 neural nets --&gt;
&lt;!-- bce30aec-40e5-11eb-8968-d4619d1011e0 Search space reduction --&gt;
&lt;aside class="footnote-list brackets"&gt;
&lt;aside class="footnote brackets" id="footnote-1" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-1"&gt;1&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Deacon, Terrence William and International Society for Science and Religion. The Symbolic Species: The Co-Evolution of Language and the Brain. Cambridge: International Society for Science and Religion, 2007.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-2" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-2"&gt;2&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Chomsky, Noam. “Language and Problems of Knowledge.” Teorema: Revista Internacional de Filosofía 16, no. 2 (1997): 5–33.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-3" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-3"&gt;3&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Deacon spends many pages describing a set of experiments in which
the researchers successfully (though with difficulty)
teach chimps to make a modest number of symbolic references.
This is important for two reasons: first it shows that
symbolic reference is a process, not an innate brain structure,
that you either have or you don't,
and second it shows that nonetheless it is much easier for humans
to make that particular leap, so there must be an innate &lt;em&gt;facility&lt;/em&gt;.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-4" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-4"&gt;4&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Scholz, Barbara C., Francis Jeffry Pelletier, and Geoffrey K. Pullum. “Philosophy of Linguistics.” In The Stanford Encyclopedia of Philosophy, edited by Edward N. Zalta, Summer 2020. Metaphysics Research Lab, Stanford University, 2020.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-5" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-5"&gt;5&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;selectional restrictions: &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Selection_(linguistics"&gt;https://en.wikipedia.org/wiki/Selection_(linguistics&lt;/a&gt;)&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-6" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-6"&gt;6&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Deacon, Terrence W. “Beyond the Symbolic Species.” In The Symbolic Species Evolved, edited by Theresa Schilhab, Frederik Stjernfelt, and Terrence Deacon, 6:9–38. Biosemiotics. Dordrecht: Springer Netherlands, 2012.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-7" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-7"&gt;7&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Frege, G.: 1892, ‘On Sense and Nominatum’, in Martinich, Aloysius, ed. The Philosophy of Language. New York, N.Y: Oxford University Press, 2010.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-8" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-8"&gt;8&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Donnellan, Keith S. “Reference and Definite Descriptions.” The Philosophical Review 75, no. 3 (July 1966): 281.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-9" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-9"&gt;9&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Locke, John, and Frederick Ryland. Locke on Words: An Essay Concerning Human Understanding. W.S. Sonnenschein &amp;amp; Company, 1882.&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-10" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html#footnote-reference-10"&gt;10&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;See e.g. Adamaszek, Michael, and Kenneth C. Kirkby. “Cerebellum and Grammar Processing.” In The Linguistic Cerebellum, 81–105. Elsevier, 2016.&lt;/p&gt;
&lt;/aside&gt;
&lt;/aside&gt;
&lt;/section&gt;</description><category>blog</category><category>language</category><category>philosophy</category><guid>http://www.subsymbol.org/posts/2022/08/28/some-philosophical-implications-of-deacons-model-of-symbolic-reference.html</guid><pubDate>Sun, 28 Aug 2022 22:52:12 GMT</pubDate></item><item><title>I did it!</title><link>http://www.subsymbol.org/posts/i-did-it.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;section id="i-did-it"&gt;
&lt;h2&gt;I did it!&lt;/h2&gt;
&lt;p&gt;It's been a long time since I wrote anything here;
everything I've written has been over at
&lt;a class="reference external" href="https://mostly-fat.com"&gt;Mostly Fat&lt;/a&gt; or the companion book site,
being health or nutrition related in nature.&lt;/p&gt;
&lt;p&gt;I've had some subsymbol themed ideas to write, but after six years I was afraid I might forget how to use Nikola,
or that the code would have changed so dramatically that I wouldn't be able to get my site to build at all.
So I had been putting it off.&lt;/p&gt;
&lt;p&gt;But I finally tried it today, and it worked!&lt;/p&gt;
&lt;p&gt;I did run into a snag with the old posts written in html.
It seems that where Nikola used to read "meta" files for certain information,
it now expects to read that information out of the html head.
That was easy enough to fix once I figured out the issue.&lt;/p&gt;
&lt;p&gt;There are still some warnings and formatting changes that I need to clean up,
but this seems good enough to at least try deploying!
I'm eager to start writing here again.&lt;/p&gt;
&lt;/section&gt;</description><category>blog</category><guid>http://www.subsymbol.org/posts/i-did-it.html</guid><pubDate>Wed, 14 Apr 2021 21:45:35 GMT</pubDate></item><item><title>Notes on Fragment Grammars</title><link>http://www.subsymbol.org/posts/notes-on-fragment-grammars.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;Last week I read
&lt;a class="reference external" href="http://dspace.mit.edu/handle/1721.1/44963"&gt;Fragment Grammars: Exploring Computation and Reuse in Language&lt;/a&gt;
by Timothy J. O'Donnell, Joshua B. Tenenbaum, and Noah D. Goodman.&lt;/p&gt;
&lt;p&gt;As I mentioned in &lt;a class="reference external" href="http://subsymbol.org/journal/wednesday-february-25th-2015.html"&gt;my journal&lt;/a&gt;,
the authors of this tech report promise to generalise &lt;a class="reference external" href="http://papers.nips.cc/paper/3101-adaptor-grammars-a-framework-for-specifying-compositional-nonparametric-bayesian-models.pdf"&gt;adaptor grammars&lt;/a&gt; (a variety of &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Stochastic_context-free_grammar"&gt;PCFG&lt;/a&gt; that uses a &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Pitman%E2%80%93Yor_process"&gt;Pitman-Yor process&lt;/a&gt; to adapt its probabilities based on context) by using a &lt;em&gt;heterogenous&lt;/em&gt; lexicon (one that is not married to some prescriptivist notion of linguistic category such as word or morpheme, and thus can include items smaller or larger than words).
The "lexicon" is chosen to optimise between storing a relatively small number of tiny units which require a lot of computation to structure together vs. storing a large number of long strings which cover large stretches of text, but aren't very flexible or general.
In other words, it's a tradeoff in compression vs. computation.&lt;/p&gt;
&lt;p&gt;Here are my impressions on first reading.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What I really love about this tech report is that it unpacks a lot of typically presumed knowledge right inside it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So if you didn't know about PCFGs or memoization, or Chinese restaurant processes, or non-parametric Bayesian methods before, you can get a lot of what you need to know right there.
Of course, The reason a typical conference or journal paper doesn't include such thorough background, is simply that there isn't the space for it.
Moreover, one can usually assume that the audience has the appropriate background, or knows how to acquire it.
Nonetheless, I find it a great pleasure to read something that assumes an educated audience that isn't intimidated by statistical models or equations, but might not know every niche term involved in such a specialised task.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are some ways in which reading this paper helped me to grok non-parametric Bayesian techniques.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I had never thought of LDA and related algorithms as &lt;em&gt;stochastic memoisation&lt;/em&gt;, which is how they are described here.&lt;/p&gt;
&lt;!--  --&gt;
&lt;blockquote&gt;
&lt;p&gt;"A stochastic memoizer wraps a stochastic procedure [i.e a sampler]
in another distribution, called the memoization distribution, which
tells us when to reuse one of the previously computed values, and
when to compute a fresh value from the underlying procedure. To
accomplish this, we generalize the notion of a memotable so that it
stores a distribution for each procedure–plus–arguments
combination."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I like this description because it is immediately understandable to someone who has used dynamic programming.
We know the value of limiting recomputation (and, again, if you don't, the classic Fibonacci example is right in the paper!),
and now we see this generalised to probabilistically either using the cached value or resampling.
As the authors explain:&lt;/p&gt;
&lt;!--  --&gt;
&lt;blockquote&gt;
&lt;p&gt;"If we wrap such a random procedure in a deterministic memoizer, then
it will sample a value the first time it is applied to some arguments,
but forever after, it will return the same value by virtue of
memoization. It is natural to consider making the notion of
memoization itself stochastic, so that sometimes the memoizer returns
a value computed earlier, and sometimes it computes a fresh value."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have seen several different presentations of LDA, and not once was it described in this intuitive way.&lt;/p&gt;
&lt;p&gt;Further, we can see how using the Chinese Restaurant Process, which is biased to sample what has been sampled before as a "simplicity bias":&lt;/p&gt;
&lt;!--  --&gt;
&lt;blockquote&gt;
&lt;p&gt;"all else being equal, when we use the CRP as a stochastic memoizer
we favor reuse of previously computed values."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;An assumption that Gibbs sampling relies on was made clear to me in the explanation of &lt;em&gt;exchangeability&lt;/em&gt;.&lt;/p&gt;
&lt;!--  --&gt;
&lt;blockquote&gt;
&lt;p&gt;"Intuitively, exchangeability says that the order in which we observed
some data will not make a difference to our inferences about
it. Exchangeability is an important property in Bayesian statistics,
and our inference algorithms below will rely on it crucially. It is
also a desirable property in cognitive models."&lt;/p&gt;
&lt;p&gt;"Pitman-Yor processes, multinomial-Dirichlet distributions, and
beta-Binomial distributions are all exchangeable, which means that
we are free to treat any expression e(i) ∈ E as if it were the last
expression sampled during the creation of E.  Our sampling
algorithm leverages this fact by (re-)sampling each p(i) ∈ P
for each expression in turn."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Even though I knew that the exchangeability was necessary for taking products,
that is, that permutations don't effect the joint distributions,
I hadn't thought about the way this frees us in our sampling order.
If we wanted to add some kind of recency effects to our models, order would, of course, become important.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The real meat of the paper, though, is in describing&lt;/strong&gt; &lt;em&gt;Fragment Grammars&lt;/em&gt; &lt;strong&gt;as contrasted with&lt;/strong&gt; &lt;em&gt;Adaptor Grammars&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This will likely be the topic of the next post.&lt;/p&gt;</description><category>adaptor grammars</category><category>blog</category><category>fragment grammars</category><category>grammar induction</category><category>NLP</category><category>PCFG</category><guid>http://www.subsymbol.org/posts/notes-on-fragment-grammars.html</guid><pubDate>Mon, 02 Mar 2015 22:00:26 GMT</pubDate></item><item><title>Two inotify Pitfalls</title><link>http://www.subsymbol.org/posts/two-inotify-pitfalls.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;All I wanted was to track some files.&lt;/p&gt;
&lt;p&gt;I have a set of directories populated with files that are hardlinked from other places.
This serves as a kind of database for associating tags to files.
I wanted to write a daemon that notifies changes to the files that might affect the consistency of the database.
For example, if the file is removed, I want my database to let go of its reference.&lt;/p&gt;
&lt;p&gt;The linux kernel has a set of system calls for this called &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Inotify"&gt;inotify&lt;/a&gt;, and &lt;a class="reference external" href="http://twistedmatrix.com/documents/current/api/twisted.internet.inotify.html"&gt;Twisted has a module to support that API&lt;/a&gt;.
Not only that, but the module documentation has everything you need.&lt;/p&gt;
&lt;hr class="docutils"&gt;
&lt;div class="code"&gt;&lt;pre class="code python"&gt;&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-1" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-1"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;twisted.internet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;inotify&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-2" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-2"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;twisted.python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;filepath&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-3" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-3"&gt;&lt;/a&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-4" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-4" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-4"&gt;&lt;/a&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ignored&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filepath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-5" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-5" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;"""&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-6" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-6" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-6"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    For historical reasons, an opaque handle is passed as first&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-7" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-7" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-7"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    parameter. This object should never be used.&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-8" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-8" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-8"&gt;&lt;/a&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-9" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-9" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-9"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    @param filepath: FilePath on which the event happened.&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-10" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-10" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-10"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    @param mask: inotify event as hexadecimal masks&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-11" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-11" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-11"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    """&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-12" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-12" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-12"&gt;&lt;/a&gt;    &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;"event &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; on &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-13" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-13" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-13"&gt;&lt;/a&gt;        &lt;span class="s1"&gt;', '&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inotify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;humanReadableMask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;filepath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-14" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-14" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-14"&gt;&lt;/a&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-15" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-15" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-15"&gt;&lt;/a&gt;&lt;span class="n"&gt;notifier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;inotify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;INotify&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-16" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-16" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-16"&gt;&lt;/a&gt;&lt;span class="n"&gt;notifier&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;startReading&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;a id="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-17" name="rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-17" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_6db7b1832be04a6fa2ddc1ca44c92f41-17"&gt;&lt;/a&gt;&lt;span class="n"&gt;notifier&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filepath&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FilePath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/some/directory"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;hr class="docutils"&gt;
&lt;section id="pitfall-1"&gt;
&lt;h2&gt;Pitfall #1&lt;/h2&gt;
&lt;p&gt;Great!  I copy the code, change the path from "/some/directory" to "/home/amber/somedir", and start it up.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;I make a file, "f", and am notified of its creation, and some attribute change.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_b0f73ffdf2be40e49fbd3fe81eb012ab-1" name="rest_code_b0f73ffdf2be40e49fbd3fe81eb012ab-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_b0f73ffdf2be40e49fbd3fe81eb012ab-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;touch&lt;span class="w"&gt; &lt;/span&gt;f
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_e2fa61fe8e6548929190f8f5f950e9cb-1" name="rest_code_e2fa61fe8e6548929190f8f5f950e9cb-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_e2fa61fe8e6548929190f8f5f950e9cb-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/somedir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_e2fa61fe8e6548929190f8f5f950e9cb-2" name="rest_code_e2fa61fe8e6548929190f8f5f950e9cb-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_e2fa61fe8e6548929190f8f5f950e9cb-2"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/somedir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;I hard link it with another name&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_4bf668795bcb47939c1ea78c73bcdfe8-1" name="rest_code_4bf668795bcb47939c1ea78c73bcdfe8-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_4bf668795bcb47939c1ea78c73bcdfe8-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;h
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_4600ad3e9ff1487ab3c9e28617c04d91-1" name="rest_code_4600ad3e9ff1487ab3c9e28617c04d91-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_4600ad3e9ff1487ab3c9e28617c04d91-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/h'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ok.  It logged the creation of h for me, but hasn't this changed the links attribute of f?
Why wasn't I notified of that?&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;I try modifying it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_9fa582e942df483ea8f8b5cf610c4b21-1" name="rest_code_9fa582e942df483ea8f8b5cf610c4b21-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_9fa582e942df483ea8f8b5cf610c4b21-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hello&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;h
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_0248cdcb9a604829a3ac82e948f690f8-1" name="rest_code_0248cdcb9a604829a3ac82e948f690f8-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_0248cdcb9a604829a3ac82e948f690f8-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/h'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I'm further non-plussed.
This event should have modified both f and h, but I was only notified of the one used in the command.&lt;/p&gt;
&lt;p&gt;Finally I try what I really want.
* I make a hard link to f from outside of "somedir/", and modify it through there.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_9130c2cc51f342bb8a05857bf119083f-1" name="rest_code_9130c2cc51f342bb8a05857bf119083f-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_9130c2cc51f342bb8a05857bf119083f-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;../h
&lt;a id="rest_code_9130c2cc51f342bb8a05857bf119083f-2" name="rest_code_9130c2cc51f342bb8a05857bf119083f-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_9130c2cc51f342bb8a05857bf119083f-2"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hello&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;../h
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_b27b999541994959bd99ecca61c7f4b5-1" name="rest_code_b27b999541994959bd99ecca61c7f4b5-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_b27b999541994959bd99ecca61c7f4b5-1"&gt;&lt;/a&gt;&lt;span class="o"&gt;(&lt;/span&gt;no&lt;span class="w"&gt; &lt;/span&gt;response&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;section id="what-s-going-on"&gt;
&lt;h3&gt;What's going on?&lt;/h3&gt;
&lt;p&gt;Inotify takes a pathname.
If the pathname is a directory, then it watches the directory, but this is not the same as watching each file in the directory.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="pitfall-2"&gt;
&lt;h2&gt;Pitfall #2&lt;/h2&gt;
&lt;p&gt;Glad to have figured out my error, I try again, modifying the pathname argument in the daemon to "somedir/f".
I remove all those files, touch f, and start the daemon again.
This time it does what I want.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_29ad46b321be4ddd8d5f0b1645d7375e-1" name="rest_code_29ad46b321be4ddd8d5f0b1645d7375e-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_29ad46b321be4ddd8d5f0b1645d7375e-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;h
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_9466015713554259998b184754df5e1b-1" name="rest_code_9466015713554259998b184754df5e1b-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_9466015713554259998b184754df5e1b-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_928bbf009ca8486ab0441a54029a5ca0-1" name="rest_code_928bbf009ca8486ab0441a54029a5ca0-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_928bbf009ca8486ab0441a54029a5ca0-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;h
&lt;a id="rest_code_928bbf009ca8486ab0441a54029a5ca0-2" name="rest_code_928bbf009ca8486ab0441a54029a5ca0-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_928bbf009ca8486ab0441a54029a5ca0-2"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hello&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;h
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_10bfdc293b984aee837aee33028ed00e-1" name="rest_code_10bfdc293b984aee837aee33028ed00e-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_10bfdc293b984aee837aee33028ed00e-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_10bfdc293b984aee837aee33028ed00e-2" name="rest_code_10bfdc293b984aee837aee33028ed00e-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_10bfdc293b984aee837aee33028ed00e-2"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_1aedb76b75f54c0d86ada29c940b86f9-1" name="rest_code_1aedb76b75f54c0d86ada29c940b86f9-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1aedb76b75f54c0d86ada29c940b86f9-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;../h
&lt;a id="rest_code_1aedb76b75f54c0d86ada29c940b86f9-2" name="rest_code_1aedb76b75f54c0d86ada29c940b86f9-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1aedb76b75f54c0d86ada29c940b86f9-2"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;hello&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;../h
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_65f6bdbc61974926b094096cee04da7a-1" name="rest_code_65f6bdbc61974926b094096cee04da7a-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65f6bdbc61974926b094096cee04da7a-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_65f6bdbc61974926b094096cee04da7a-2" name="rest_code_65f6bdbc61974926b094096cee04da7a-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65f6bdbc61974926b094096cee04da7a-2"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;section id="but-wait"&gt;
&lt;h3&gt;But wait!&lt;/h3&gt;
&lt;p&gt;I was about to call it good, when I decided to try modifying the file with vim or emacs.
I deleted all those files again, touched f, and this time modified it with vim.
On saving the file, I get this:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_e50ba828c2984b598eb83c11e9d063b6-1" name="rest_code_e50ba828c2984b598eb83c11e9d063b6-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_e50ba828c2984b598eb83c11e9d063b6-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;move_self&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_e50ba828c2984b598eb83c11e9d063b6-2" name="rest_code_e50ba828c2984b598eb83c11e9d063b6-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_e50ba828c2984b598eb83c11e9d063b6-2"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_e50ba828c2984b598eb83c11e9d063b6-3" name="rest_code_e50ba828c2984b598eb83c11e9d063b6-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_e50ba828c2984b598eb83c11e9d063b6-3"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;delete_self&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="what-s-going-on-1"&gt;
&lt;h3&gt;What's going on?&lt;/h3&gt;
&lt;p&gt;It turns out that vim and emacs, and who knows what else, have a trick to save backups while in use.&lt;/p&gt;
&lt;p&gt;To see what happens, I edited the daemon to watch the directory again, and also to print some stats about the files:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code python"&gt;&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-1" name="rest_code_98d939e8c55a412da070d824dc25b3f4-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-1"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;twisted.internet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;inotify&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reactor&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-2" name="rest_code_98d939e8c55a412da070d824dc25b3f4-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-2"&gt;&lt;/a&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;twisted.python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;filepath&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-3" name="rest_code_98d939e8c55a412da070d824dc25b3f4-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-3"&gt;&lt;/a&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;os&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-4" name="rest_code_98d939e8c55a412da070d824dc25b3f4-4" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-4"&gt;&lt;/a&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-5" name="rest_code_98d939e8c55a412da070d824dc25b3f4-5" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-6" name="rest_code_98d939e8c55a412da070d824dc25b3f4-6" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-6"&gt;&lt;/a&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ignored&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filepath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-7" name="rest_code_98d939e8c55a412da070d824dc25b3f4-7" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;"""&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-8" name="rest_code_98d939e8c55a412da070d824dc25b3f4-8" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-8"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    For historical reasons, an opaque handle is passed as first&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-9" name="rest_code_98d939e8c55a412da070d824dc25b3f4-9" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-9"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    parameter. This object should never be used.&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-10" name="rest_code_98d939e8c55a412da070d824dc25b3f4-10" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-10"&gt;&lt;/a&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-11" name="rest_code_98d939e8c55a412da070d824dc25b3f4-11" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-11"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    @param filepath: FilePath on which the event happened.&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-12" name="rest_code_98d939e8c55a412da070d824dc25b3f4-12" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-12"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    @param mask: inotify event as hexadecimal masks&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-13" name="rest_code_98d939e8c55a412da070d824dc25b3f4-13" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-13"&gt;&lt;/a&gt;&lt;span class="sd"&gt;    """&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-14" name="rest_code_98d939e8c55a412da070d824dc25b3f4-14" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-14"&gt;&lt;/a&gt;    &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;"event &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; on &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;', '&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inotify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;humanReadableMask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;filepath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-15" name="rest_code_98d939e8c55a412da070d824dc25b3f4-15" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-15"&gt;&lt;/a&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-16" name="rest_code_98d939e8c55a412da070d824dc25b3f4-16" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-16"&gt;&lt;/a&gt;        &lt;span class="n"&gt;stat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-17" name="rest_code_98d939e8c55a412da070d824dc25b3f4-17" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-17"&gt;&lt;/a&gt;        &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"mode:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stat&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;st_mode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"inode:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stat&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;st_ino&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-18" name="rest_code_98d939e8c55a412da070d824dc25b3f4-18" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-18"&gt;&lt;/a&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-19" name="rest_code_98d939e8c55a412da070d824dc25b3f4-19" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-19"&gt;&lt;/a&gt;&lt;span class="n"&gt;fp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/home/amber/subdir"&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-20" name="rest_code_98d939e8c55a412da070d824dc25b3f4-20" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-20"&gt;&lt;/a&gt;&lt;span class="n"&gt;notifier&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;inotify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;INotify&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-21" name="rest_code_98d939e8c55a412da070d824dc25b3f4-21" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-21"&gt;&lt;/a&gt;&lt;span class="n"&gt;notifier&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;startReading&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-22" name="rest_code_98d939e8c55a412da070d824dc25b3f4-22" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-22"&gt;&lt;/a&gt;&lt;span class="n"&gt;notifier&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;watch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filepath&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FilePath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fp&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;callbacks&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;a id="rest_code_98d939e8c55a412da070d824dc25b3f4-23" name="rest_code_98d939e8c55a412da070d824dc25b3f4-23" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_98d939e8c55a412da070d824dc25b3f4-23"&gt;&lt;/a&gt;&lt;span class="n"&gt;reactor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now I run it and open f with vi.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_10cd2594700041e68975c8976bd60671-1" name="rest_code_10cd2594700041e68975c8976bd60671-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_10cd2594700041e68975c8976bd60671-1"&gt;&lt;/a&gt;$&lt;span class="w"&gt; &lt;/span&gt;vi&lt;span class="w"&gt; &lt;/span&gt;f
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-1" name="rest_code_1c19c07691d4427c9744c15b862c8595-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-2" name="rest_code_1c19c07691d4427c9744c15b862c8595-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-2"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-3" name="rest_code_1c19c07691d4427c9744c15b862c8595-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-3"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-4" name="rest_code_1c19c07691d4427c9744c15b862c8595-4" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-4"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swpx'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-5" name="rest_code_1c19c07691d4427c9744c15b862c8595-5" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-5"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-6" name="rest_code_1c19c07691d4427c9744c15b862c8595-6" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-6"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-7" name="rest_code_1c19c07691d4427c9744c15b862c8595-7" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-7"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;delete&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swpx'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-8" name="rest_code_1c19c07691d4427c9744c15b862c8595-8" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-8"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-9" name="rest_code_1c19c07691d4427c9744c15b862c8595-9" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-9"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-10" name="rest_code_1c19c07691d4427c9744c15b862c8595-10" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-10"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;delete&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-11" name="rest_code_1c19c07691d4427c9744c15b862c8595-11" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-11"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-12" name="rest_code_1c19c07691d4427c9744c15b862c8595-12" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-12"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-13" name="rest_code_1c19c07691d4427c9744c15b862c8595-13" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-13"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-14" name="rest_code_1c19c07691d4427c9744c15b862c8595-14" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-14"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-15" name="rest_code_1c19c07691d4427c9744c15b862c8595-15" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-15"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-16" name="rest_code_1c19c07691d4427c9744c15b862c8595-16" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-16"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-17" name="rest_code_1c19c07691d4427c9744c15b862c8595-17" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-17"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-18" name="rest_code_1c19c07691d4427c9744c15b862c8595-18" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-18"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-19" name="rest_code_1c19c07691d4427c9744c15b862c8595-19" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-19"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-20" name="rest_code_1c19c07691d4427c9744c15b862c8595-20" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-20"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_1c19c07691d4427c9744c15b862c8595-21" name="rest_code_1c19c07691d4427c9744c15b862c8595-21" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_1c19c07691d4427c9744c15b862c8595-21"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(pause)&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_7c66eaef5c314c4a85346f725a9efb6b-1" name="rest_code_7c66eaef5c314c4a85346f725a9efb6b-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_7c66eaef5c314c4a85346f725a9efb6b-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_7c66eaef5c314c4a85346f725a9efb6b-2" name="rest_code_7c66eaef5c314c4a85346f725a9efb6b-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_7c66eaef5c314c4a85346f725a9efb6b-2"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_7c66eaef5c314c4a85346f725a9efb6b-3" name="rest_code_7c66eaef5c314c4a85346f725a9efb6b-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_7c66eaef5c314c4a85346f725a9efb6b-3"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(modify manually)&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_65967f6787f9404986defc28841bbf8d-1" name="rest_code_65967f6787f9404986defc28841bbf8d-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65967f6787f9404986defc28841bbf8d-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_65967f6787f9404986defc28841bbf8d-2" name="rest_code_65967f6787f9404986defc28841bbf8d-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65967f6787f9404986defc28841bbf8d-2"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_65967f6787f9404986defc28841bbf8d-3" name="rest_code_65967f6787f9404986defc28841bbf8d-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65967f6787f9404986defc28841bbf8d-3"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_65967f6787f9404986defc28841bbf8d-4" name="rest_code_65967f6787f9404986defc28841bbf8d-4" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65967f6787f9404986defc28841bbf8d-4"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_65967f6787f9404986defc28841bbf8d-5" name="rest_code_65967f6787f9404986defc28841bbf8d-5" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65967f6787f9404986defc28841bbf8d-5"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_65967f6787f9404986defc28841bbf8d-6" name="rest_code_65967f6787f9404986defc28841bbf8d-6" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_65967f6787f9404986defc28841bbf8d-6"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(save manually)&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-1" name="rest_code_2cd27f2500904e0fb22eb804125587d3-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/4913'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-2" name="rest_code_2cd27f2500904e0fb22eb804125587d3-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-2"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-3" name="rest_code_2cd27f2500904e0fb22eb804125587d3-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-3"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-4" name="rest_code_2cd27f2500904e0fb22eb804125587d3-4" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-4"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/4913'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-5" name="rest_code_2cd27f2500904e0fb22eb804125587d3-5" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-5"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-6" name="rest_code_2cd27f2500904e0fb22eb804125587d3-6" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-6"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-7" name="rest_code_2cd27f2500904e0fb22eb804125587d3-7" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-7"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;delete&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/4913'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-8" name="rest_code_2cd27f2500904e0fb22eb804125587d3-8" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-8"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-9" name="rest_code_2cd27f2500904e0fb22eb804125587d3-9" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-9"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-10" name="rest_code_2cd27f2500904e0fb22eb804125587d3-10" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-10"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;moved_from&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-11" name="rest_code_2cd27f2500904e0fb22eb804125587d3-11" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-11"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-12" name="rest_code_2cd27f2500904e0fb22eb804125587d3-12" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-12"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-13" name="rest_code_2cd27f2500904e0fb22eb804125587d3-13" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-13"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;moved_to&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f~'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-14" name="rest_code_2cd27f2500904e0fb22eb804125587d3-14" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-14"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-15" name="rest_code_2cd27f2500904e0fb22eb804125587d3-15" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-15"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-16" name="rest_code_2cd27f2500904e0fb22eb804125587d3-16" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-16"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-17" name="rest_code_2cd27f2500904e0fb22eb804125587d3-17" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-17"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-18" name="rest_code_2cd27f2500904e0fb22eb804125587d3-18" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-18"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-19" name="rest_code_2cd27f2500904e0fb22eb804125587d3-19" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-19"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-20" name="rest_code_2cd27f2500904e0fb22eb804125587d3-20" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-20"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-21" name="rest_code_2cd27f2500904e0fb22eb804125587d3-21" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-21"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-22" name="rest_code_2cd27f2500904e0fb22eb804125587d3-22" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-22"&gt;&lt;/a&gt;f~&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307370&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-23" name="rest_code_2cd27f2500904e0fb22eb804125587d3-23" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-23"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-24" name="rest_code_2cd27f2500904e0fb22eb804125587d3-24" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-24"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;attrib&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-25" name="rest_code_2cd27f2500904e0fb22eb804125587d3-25" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-25"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-26" name="rest_code_2cd27f2500904e0fb22eb804125587d3-26" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-26"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-27" name="rest_code_2cd27f2500904e0fb22eb804125587d3-27" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-27"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-28" name="rest_code_2cd27f2500904e0fb22eb804125587d3-28" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-28"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-29" name="rest_code_2cd27f2500904e0fb22eb804125587d3-29" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-29"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-30" name="rest_code_2cd27f2500904e0fb22eb804125587d3-30" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-30"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;delete&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/f~'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-31" name="rest_code_2cd27f2500904e0fb22eb804125587d3-31" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-31"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;a id="rest_code_2cd27f2500904e0fb22eb804125587d3-32" name="rest_code_2cd27f2500904e0fb22eb804125587d3-32" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_2cd27f2500904e0fb22eb804125587d3-32"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(exit)&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_20a3196de34d4a8eb8a6378402381895-1" name="rest_code_20a3196de34d4a8eb8a6378402381895-1" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_20a3196de34d4a8eb8a6378402381895-1"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;modify&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_20a3196de34d4a8eb8a6378402381895-2" name="rest_code_20a3196de34d4a8eb8a6378402381895-2" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_20a3196de34d4a8eb8a6378402381895-2"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;a id="rest_code_20a3196de34d4a8eb8a6378402381895-3" name="rest_code_20a3196de34d4a8eb8a6378402381895-3" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_20a3196de34d4a8eb8a6378402381895-3"&gt;&lt;/a&gt;.f.swp&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33188&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307363&lt;/span&gt;
&lt;a id="rest_code_20a3196de34d4a8eb8a6378402381895-4" name="rest_code_20a3196de34d4a8eb8a6378402381895-4" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_20a3196de34d4a8eb8a6378402381895-4"&gt;&lt;/a&gt;event&lt;span class="w"&gt; &lt;/span&gt;delete&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;FilePath&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/home/amber/subdir/.f.swp'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;a id="rest_code_20a3196de34d4a8eb8a6378402381895-5" name="rest_code_20a3196de34d4a8eb8a6378402381895-5" href="http://www.subsymbol.org/posts/two-inotify-pitfalls.html#rest_code_20a3196de34d4a8eb8a6378402381895-5"&gt;&lt;/a&gt;f&lt;span class="w"&gt; &lt;/span&gt;mode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33204&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;inode:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2307371&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As far as I can tell, the result is as if they have renamed f to something else like f~, copied the contents of f~ to a new file named f, modified f, and finally deleted f~.
This is essentially &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Copy-on-write"&gt;copy-on write&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But inotify, while taking pathnames as arguments and returning pathnames, actually tracks inodes.
So simply using an editor has the effect of moving the file to a different inode and thereby breaks inotify!&lt;/p&gt;
&lt;p&gt;This is ultimately a consequence of using aliases to files (pathnames) as if they were canonical references to files (inodes).&lt;/p&gt;
&lt;!-- **It is a property of mutable objects that --&gt;
&lt;/section&gt;
&lt;section id="post-script-lucky-break"&gt;
&lt;h3&gt;Post Script: Lucky break?&lt;/h3&gt;
&lt;p&gt;As it happens, the behaviour of vim and emacs is different when the inode holding the file has more than one reference.
I can prevent the inode from disappearing by making a hardlink to the file before opening it with an editor.
The editor must have recognised that it can't move inodes willy-nilly when other pathnames depend on it.
This maps exactly to my original scenario, and therefore might make it safe for me to use.
On the other hand, my whole confidence in the bahaviour is undermined, and I am reluctant to rely on it.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;</description><category>blog</category><category>emacs</category><category>filesystems</category><category>inotify</category><category>links</category><category>linux</category><category>vim</category><guid>http://www.subsymbol.org/posts/two-inotify-pitfalls.html</guid><pubDate>Thu, 31 Jul 2014 19:35:05 GMT</pubDate></item><item><title>Pólya's Urn</title><link>http://www.subsymbol.org/posts/polyas-urn.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;Skip to interactive demo: &lt;a class="reference internal" href="http://www.subsymbol.org/posts/polyas-urn.html#try-it"&gt;Try it!&lt;/a&gt;&lt;/p&gt;
&lt;section id="balls-in-urns"&gt;
&lt;h2&gt;Balls in Urns&lt;/h2&gt;
&lt;p&gt;If you have studied probability, you are probably familiar with the canonical balls-in-an-urn allegory for understanding discrete probability distributions.
For example, you could imagine an urn containing 1 red ball and 3 green balls.
Drawing a ball from the urn at random represents sampling from a probability distribution where the probability of one outcome is &lt;span class="math"&gt;\(25\%\)&lt;/span&gt; and the probability of the other outcome is &lt;span class="math"&gt;\(75\%\)&lt;/span&gt;
We can extend this idea in a variety of ways.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="polya-s-urn"&gt;
&lt;h2&gt;Pólya's Urn&lt;/h2&gt;
&lt;p&gt;In &lt;em&gt;Pólya's Urn&lt;/em&gt;, the extension is that whenever you draw a ball from the urn, you not only replace it, but you add an extra ball of the same colour.
So if you happened to draw a green ball in the example above, then the ratio would change from &lt;span class="math"&gt;\(1:3\)&lt;/span&gt; to &lt;span class="math"&gt;\(1:4\)&lt;/span&gt;.
That means on the next draw, you would now have only a &lt;span class="math"&gt;\(20\%\)&lt;/span&gt; chance of drawing red.
On the other hand, if you happened to have drawn red, then the ratio would change to &lt;span class="math"&gt;\(2:3\)&lt;/span&gt;, giving red a probability of &lt;span class="math"&gt;\(40\%\)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This process is interesting, because it has the property that the more often you observe something, the more likely you are to observe it again.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="different-starting-conditions"&gt;
&lt;h2&gt;Different starting conditions&lt;/h2&gt;
&lt;p&gt;The way the distribution changes over time depends on the starting conditions.&lt;/p&gt;
&lt;section id="one-of-each"&gt;
&lt;h3&gt;One of each&lt;/h3&gt;
&lt;p&gt;Let's imagine the simplest case, in which we start with one each of two colours, red and green.
The following table shows the probabilities of getting red on the first three draws, and how each draw changes the probability of the next by changing the proportion of colours in the urn.&lt;/p&gt;
&lt;table&gt;
&lt;colgroup&gt;
&lt;col style="width: 33.3%"&gt;
&lt;col style="width: 33.3%"&gt;
&lt;col style="width: 33.3%"&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th class="head"&gt;&lt;/th&gt;
&lt;th class="head"&gt;&lt;p&gt;RRR&lt;/p&gt;&lt;/th&gt;
&lt;th class="head"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;strong&gt;Draw&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;strong&gt;p(Draw)&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;strong&gt;new R:G&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;R&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;2:1&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;R&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(2/3\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;3:1&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;R&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(3/4\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;4:1&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr class="docutils"&gt;
&lt;p&gt;There are more ways to have drawn two of one colour, and one of the other, than 3 of one colour.
However, because of the way drawing a particular colour reinforces itself,
there is a &lt;span class="math"&gt;\(50\%\)&lt;/span&gt; chance of drawing the same colour every time over the first three draws.&lt;/p&gt;
&lt;table&gt;
&lt;colgroup&gt;
&lt;col style="width: 50.0%"&gt;
&lt;col style="width: 50.0%"&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th class="head"&gt;&lt;p&gt;First three draws&lt;/p&gt;&lt;/th&gt;
&lt;th class="head"&gt;&lt;p&gt;probability&lt;/p&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;RRR&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 3/4 = 1/4\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;RRG&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 1/4 = 1/12\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;RGR&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 1/2 = 1/6\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;RGG&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 1/2 = 1/6\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;GRR&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 1/2 = 1/6\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;GRG&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 1/2 = 1/6\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;GGR&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 1/4 = 1/12\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;GGG&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;span class="math"&gt;\(1/2 \times 2/3 \times 3/4 = 1/4\)&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/section&gt;
&lt;section id="ten-of-each"&gt;
&lt;h3&gt;Ten of each&lt;/h3&gt;
&lt;p&gt;Now suppose that we start with 10 each of red and green balls.
In this case, simply drawing a red ball the first time does not change the probability that it will be drawn again nearly as significantly as with the &lt;span class="math"&gt;\(1:1\)&lt;/span&gt; starting conditions.
The probability of drawing 3 of the same colour in a row falls to &lt;span class="math"&gt;\(2 \times 10/20 \times 11/21 \times 12/22 = 2/7 \cong  29\%\)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We can view the starting conditions as a list of numbers, one for each starting colour, and call it &lt;em&gt;alpha&lt;/em&gt; (&lt;span class="math"&gt;\(\alpha\)&lt;/span&gt;).
So our first example had &lt;span class="math"&gt;\(\alpha = [1, 3]\)&lt;/span&gt;,
our second example had &lt;span class="math"&gt;\(\alpha = [1, 1]\)&lt;/span&gt;,
and our third example had &lt;span class="math"&gt;\(\alpha = [10, 10]\)&lt;/span&gt;,&lt;/p&gt;
&lt;/section&gt;
&lt;section id="higher-returns"&gt;
&lt;h3&gt;Higher returns&lt;/h3&gt;
&lt;p&gt;On the other hand, imagine if we started with 1 each of red and green, but instead of increasing the number of balls by 1 when we draw a colour, we increased it by 10.
Now every draw has a much stronger effect.
The probability of drawing the same colour 3 times in a row would now be &lt;span class="math"&gt;\(2 \times 1/2 \times 11/12 \times 21/22 = 7/8 \cong 88\%\)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We could even have a particular increase number for each colour, and have another list, called &lt;em&gt;beta&lt;/em&gt; (&lt;span class="math"&gt;\(\beta\)&lt;/span&gt;).&lt;/p&gt;
&lt;/section&gt;
&lt;section id="more-colours"&gt;
&lt;h3&gt;More colours&lt;/h3&gt;
&lt;p&gt;Another way to change the starting conditions is to increase the number of colours.
If our starting urn had one each of 10 different colours, then, again, when we draw the first ball, it has much less of an effect on the chance of drawing it again.
We can call the number of colours &lt;span class="math"&gt;\(n\)&lt;/span&gt;.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="try-it"&gt;
&lt;h2&gt;Try it!&lt;/h2&gt;
&lt;p&gt;Use the sliders to choose &lt;span class="math"&gt;\(n\)&lt;/span&gt; colours, and a single &lt;span class="math"&gt;\(\alpha\)&lt;/span&gt; and &lt;span class="math"&gt;\(\beta\)&lt;/span&gt; for all colours. Try drawing balls from the urn, and see how the urn changes.  At any time you can display the urn in rank order or reset to the current slider position.&lt;/p&gt;
n: &lt;b id="n-output"&gt;&lt;/b&gt;
&lt;input class="n-slider" type="range" min="1" max="8"&gt;
α: &lt;b id="alpha-output"&gt;&lt;/b&gt;
&lt;input class="alpha-slider" type="range" min="1" max="8"&gt;
β: &lt;b id="beta-output"&gt;&lt;/b&gt;
&lt;input class="beta-slider" type="range" min="1" max="8"&gt;
&lt;br&gt;
&lt;p id="urn"&gt;Urn&lt;/p&gt;
&lt;br&gt;
&lt;button id="draw"&gt;Draw!&lt;/button&gt;
&lt;button id="reset"&gt;Reset.&lt;/button&gt;
&lt;button id="rank"&gt;Order by rank.&lt;/button&gt;

&lt;script src="http://www.subsymbol.org/scripts/polya.js"&gt;
&lt;/script&gt;&lt;/section&gt;</description><category>blog</category><category>mathjax</category><category>probability</category><guid>http://www.subsymbol.org/posts/polyas-urn.html</guid><pubDate>Fri, 25 Jul 2014 17:24:37 GMT</pubDate></item><item><title>The Grammaticality Continuum</title><link>http://www.subsymbol.org/posts/the-grammaticality-continuum.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;Yesterday I was thinking about implementing &lt;em&gt;Latent Dirichlet Allocation&lt;/em&gt; (LDA).
LDA is used for &lt;em&gt;topic modelling&lt;/em&gt; — inducing a set of topics, such that a set of natural language documents can be represented by a mixture of those topics.
This is then used to estimate document similarity, and related information retrieval tasks.&lt;/p&gt;
&lt;p&gt;The first step in such a project is to &lt;em&gt;tokenise&lt;/em&gt; — to break up the text into words, removing attached punctuation, and regularising things like capitalisation.
When looking at the words in a document for the purposes of topic modelling,
it seems appropriate to merge word forms with the same root, or stem, instead of having each form of the "same" word represented individually.
The canonical way to tokenise for topic modelling involves stemming, and it also involves removing &lt;em&gt;stop words&lt;/em&gt; — words like "the", and "and" that are more syntactic than semantic.&lt;/p&gt;
&lt;p&gt;I am not entirely convinced that this latter is appropriate.
The reason is that the grammatically of words exists on a continuum.
Even the word "the" carries semantic weight, though its main function is probably to signal the boundaries of syntactic chunks.&lt;/p&gt;
&lt;hr class="docutils"&gt;
&lt;blockquote&gt;
&lt;p&gt;My favourite example of the syntactic function of "the" comes from &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Petr_Beckmann"&gt;Petr Beckmann&lt;/a&gt; 's book &lt;em&gt;The structure of language: a new approach&lt;/em&gt;, which has profoundly influenced me since my undergraduate days.
In it he shows how the following headline is disambiguated by the placement of "the" before or after "biting":&lt;/p&gt;
&lt;p&gt;"Man Refuses to Give up Biting Dog"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr class="docutils"&gt;
&lt;p&gt;A couple of years ago at &lt;a class="reference external" href="http://www.wikicfp.com/cfp/servlet/event.showcfp?eventid=18614"&gt;the NAACL conference&lt;/a&gt;,
there was a session where a few prominent computational linguists presented their favourite papers from the past.
Eugene Charniak presented Kenneth Church's 2000 COLING paper: &lt;em&gt;Empirical Estimates of Adaptation:&lt;/em&gt;
&lt;em&gt;The chance of Two Noriegas is closer to&lt;/em&gt; &lt;span class="math"&gt;\(p/2\)&lt;/span&gt; &lt;em&gt;than&lt;/em&gt; &lt;span class="math"&gt;\(p^2\)&lt;/span&gt;.
It introduced a measure of adaptation for language models based on how much a recent occurrence of a word increases its tendency to occur beyond what is already expected.&lt;/p&gt;
&lt;p&gt;Charniak used this paper as a background with which to present a new idea about the way the prior likelihood of a word predicts its future occurrences.
He divided words into sets according to how well their priors predicted them.
Stop words were most likely to be true to priors, and content words least, with verbs at the end of the spectrum.&lt;/p&gt;
&lt;p&gt;At the time I took this as evidence for the stratification of grammaticality.
Because of this stratification, treating stop words as a special set appears arbitrary and oversimplified.
I expect that leaving stop words in a topic model would simply result in having some topics that are distributed more evenly throughout the corpus of documents.
These topics would discriminate among documents poorly.
However, this result should also be part of a continuum.
It may be useful to account for the distribution of topics when using them in LDA, in a way analogous to &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Tf%E2%80%93idf"&gt;inverse document frequency&lt;/a&gt; in &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Latent_semantic_analysis"&gt;latent semantic analysis&lt;/a&gt;.&lt;/p&gt;
&lt;hr class="docutils"&gt;
&lt;p&gt;More generally, I am interested in the phenomenon that words vary in their semantic and syntactic load.
Even just within semantics, a morpheme may carry more than one meaning that cannot be decomposed linguistically.
For example, "uncle" is male, and while we could assign "uncle" a set of semantic features in a computer system in order to reason about its meaning, those features are only implicit in English.
In &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Logogram"&gt;logographic writing systems&lt;/a&gt; this is all the more apparent.&lt;/p&gt;
&lt;p&gt;This simultaneity of features in an apparently linear system is, to me, one of the most interesting aspects of language, and one of the reasons computational linguistics is difficult and rewarding.&lt;/p&gt;</description><category>blog</category><category>computational linguistics</category><category>lda</category><category>lsa</category><category>mathjax</category><guid>http://www.subsymbol.org/posts/the-grammaticality-continuum.html</guid><pubDate>Fri, 25 Jul 2014 15:20:07 GMT</pubDate></item><item><title>Productively Lost</title><link>http://www.subsymbol.org/posts/productively-lost.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;Yesterday Hacker School's resident &lt;a class="reference external" href="http://blog.melchua.com/about/"&gt;Mel Chua&lt;/a&gt; shared her work on educational psychology theory for Hacker School &lt;a class="brackets" href="http://www.subsymbol.org/posts/productively-lost.html#footnote-1" id="footnote-reference-1" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;1&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.
I had seen an earlier iteration of this talk from PyCon video archives, and it was useful to me then.
However, this time I had more relevant experience with which to understand it.
Hacker School is the first time I have had such a fluid and indeterminate educational experience.
Even graduate school was more structured, and with more fixed goals.&lt;/p&gt;
&lt;p&gt;I have previously compared Hacker School to a game of Tetris, in which new exciting things are constantly dropping from the sky, and you can't get them all and fit them all into your life.
Eventually you will lose, but it is fun to try, anyway.
I like this analogy, but in some ways it is too passive.
Hacker School (and life in general, if you let it) is more like a giant maze with more and more doors appearing all the time.
Many paths connect to each other, and you may find yourself back where you were before, but from a new perspective.
Here I can see more clearly than ever before the unboundedness of the space of learning, and this makes the idea of a best path through it almost laughable.
That's not to say that there are no poor ways to learn.
Only that that are many good ways.&lt;/p&gt;
&lt;p&gt;One central message from Mel's talk was the idea of being &lt;em&gt;Productively Lost&lt;/em&gt;.
Given that you are your own guide in an infinite maze makes being lost natural.
The question is how to make the best of your learning given that situation.&lt;/p&gt;
&lt;p&gt;Mel talked about using measurement to guide learning, in analogy with Test-Driven-Design.
She talked about how to most effectively join an open source project so that you can maximise your interactions and contributions for everyone's benefit, and for your own development.
There was also a section on motivation, self-efficacy, and attitudes.&lt;/p&gt;
&lt;p&gt;She mentioned different learning styles, and followed up later in the day with a workshop on the topic.
I found this enormously helpful, because instead of just coming out with a label, which I have done in the past with this kind of theory,
I was able to see strategies that make better use of my strengths.
By reviewing my experiences at Hacker School so far, and relating them to these axes, I feel I am in a better position to enhance my learning experiences deliberately.&lt;/p&gt;
&lt;p&gt;Mel also talked about the progression of learning.
Learning tends to follow a cyclical pattern of periods of &lt;em&gt;assimilation&lt;/em&gt; of new ideas into an existing mental model followed by a paradigm shift that requires &lt;em&gt;accommodation&lt;/em&gt;.
Accommodation is needed when new ideas are fitting less well into the existing model, and an extensive refactorisation makes everything fit more naturally.
This stage is slow and uncomfortable, and may even feel like a regression.
After this, there is a shorter period during which learning new things with the new model is fast and rewarding, before reaching another steadier state of assimilation.&lt;/p&gt;
&lt;hr class="docutils"&gt;
&lt;p&gt;Even though I have taken my own way on some critical aspects of my life,
much of my life is characterisable by following paths that were set by someone else, or were simply unexamined pursuit of "the way things are done".
Applying to Hacker School in the first place was a big, intimidating step away from this pattern that stretched my courage.
It rivals the most rewarding decisions of my life so far.
The increased autonomy and competence I am developing here feels like a new freedom, a tipping point into a feedback loop of self-expression and creative action that goes way beyond any particular programming concept I have learned while here.&lt;/p&gt;
&lt;p&gt;Becoming comfortable with this fundamental lostness, and yet feeling adequate to navigate it, is ultimately much more empowering than the security of excelling at following well-lit, paths sanctioned and rewarded by others.&lt;/p&gt;
&lt;hr class="docutils"&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;aside class="footnote-list brackets"&gt;
&lt;aside class="footnote brackets" id="footnote-1" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="http://www.subsymbol.org/posts/productively-lost.html#footnote-reference-1"&gt;1&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;Slides from last year's version here: &lt;a class="reference external" href="http://blog.melchua.com/2013/10/07/edupsych-for-hacker-schoolers-v-1-1-presentation-slides/"&gt;http://blog.melchua.com/2013/10/07/edupsych-for-hacker-schoolers-v-1-1-presentation-slides/&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
&lt;/aside&gt;</description><category>blog</category><category>courage</category><category>education</category><category>hacker school</category><category>Mel Chua</category><category>psychology</category><category>vulnerability</category><guid>http://www.subsymbol.org/posts/productively-lost.html</guid><pubDate>Wed, 23 Jul 2014 15:21:37 GMT</pubDate></item><item><title>Addresses and Contents</title><link>http://www.subsymbol.org/posts/addresses-and-contents.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;section id="what-are-we-naming"&gt;
&lt;h2&gt;What are we naming?&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;The name of the song is called "Haddocks' Eyes."'&lt;/p&gt;
&lt;p&gt;'Oh, that's the name of the song, is it?' Alice said, trying to feel interested.&lt;/p&gt;
&lt;p&gt;'No, you don't understand,' the Knight said, looking a little vexed. 'That's what the name is called. The name really is "The Aged Aged Man."'&lt;/p&gt;
&lt;p&gt;'Then I ought to have said "That's what the song is called"?' Alice corrected herself.&lt;/p&gt;
&lt;p&gt;'No, you oughtn't: that's quite another thing! The song is called "Ways and Means": but that's only what it's called, you know!'&lt;/p&gt;
&lt;p&gt;'Well, what is the song, then?' said Alice, who was by this time completely bewildered.&lt;/p&gt;
&lt;p&gt;'I was coming to that,' the Knight said. 'The song really is "A-sitting On A Gate": and the tune's my own invention.'&lt;/p&gt;
&lt;p class="attribution"&gt;—&lt;a class="reference external" href="http://www.alice-in-wonderland.net/books/2chpt8.html"&gt;Alice Through the Looking Glass&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/section&gt;
&lt;section id="mutability-applies-to-content"&gt;
&lt;h2&gt;Mutability applies to content&lt;/h2&gt;
&lt;p&gt;I have been designing a system that seeks to change the way we name our data:
instead of naming the hierarchical way, using directories (or folders), it will name the category way, using tags.
Because the system needed an ID for every file it tagged, and perhaps for no other good reason than that I am fond of content-based hashing,
I chose to use a content-based hash for the IDs.
However, this ID is not a good match for mutable files.
I had been putting off thinking about how to handle mutable files, figuring I could add that functionality later.&lt;/p&gt;
&lt;p&gt;When I was finally ready to confront mutable files, I realised that I was running up against a fundamental issue:&lt;/p&gt;
&lt;/section&gt;
&lt;section id="people-often-conflate-addresses-with-contents-when-naming-things"&gt;
&lt;h2&gt;People often conflate addresses with contents when naming things&lt;/h2&gt;
&lt;p&gt;Take for example the problem of citation.
If you cite a book or a research paper, then what you are citing is the contents.
When we first started wanting to cite URLs, we treated them as though we were addressing content, but we aren't.
URLs point to content that can change.&lt;/p&gt;
&lt;p&gt;Of course, this issue shows up in many areas of computer science whenever we use references.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="filesystems"&gt;
&lt;h2&gt;Filesystems&lt;/h2&gt;
&lt;p&gt;In a filesystem, we usually refer to files by their paths.
The relationships between paths, addresses (inodes), and contents are shown here:&lt;/p&gt;
&lt;img alt="https://lh5.googleusercontent.com/-0dFaK3jKirQ/U78BnodwrUI/AAAAAAAACPs/mGzaDJfLZk4/w426-h376-no/name_triangle.png" src="https://lh5.googleusercontent.com/-0dFaK3jKirQ/U78BnodwrUI/AAAAAAAACPs/mGzaDJfLZk4/w426-h376-no/name_triangle.png"&gt;
&lt;p&gt;That is, a pathname refers to a single inode, but not necessarily vice versa.
An inode has exactly one set of contents, but those contents may be replicated in many inodes in the system.
I didn't recognise at first that the problem of mutable and immutable files is the distinction between addresses and contents.&lt;/p&gt;
&lt;p&gt;As far as file systems go, I don't know of any that make the distinction between contents and addresses, except Tahoe-LAFS.
The reference to an immutable file in Tahoe is content based for integrity and deduplication.
The reference to a mutable file just specifies a unique "slot".&lt;/p&gt;
&lt;p&gt;I've decide to follow this paradigm in Protagonist.
Both addresses and contents should be eligible for tagging.
Tagging the box will use the inode.
Tagging the contents will use the hash.&lt;/p&gt;
&lt;!-- The fact that we make extensive use of links in our systems attests the fact that hierarchies are not a great model for naming things. --&gt;
&lt;/section&gt;</description><category>blog</category><category>cs</category><category>linguistics</category><category>names</category><category>storage</category><guid>http://www.subsymbol.org/posts/addresses-and-contents.html</guid><pubDate>Wed, 09 Jul 2014 21:42:03 GMT</pubDate></item><item><title>How I transformed a Blogger blog to a Nikola two-blog website</title><link>http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html</link><dc:creator>L. Amber O'Hearn</dc:creator><description>&lt;p&gt;In the last post I described why I wanted to move my blog, and what went into my choices.
My goal in exporting my site from Blogger to Nikola was to separate my content into two separate blogs on a single site:
one which is the primary blog, and the other which resides in the background.
I wanted them to be archived separately.
I also wanted there to be a front page that didn't change every time I wrote a new post.&lt;/p&gt;
&lt;section id="importing-the-blog"&gt;
&lt;h2&gt;Importing the blog&lt;/h2&gt;
&lt;p&gt;Nikola has a plugin to import a blog from Blogger, so the first step was to import the blog.
To import, I took the following steps:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;First, I exported my blog from Blogger, which gave me a file called &lt;cite&gt;blog-07-05-2014.xml&lt;/cite&gt;. Then,&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_df7dd6b80a96402099aa2cb1e59ea709-1" name="rest_code_df7dd6b80a96402099aa2cb1e59ea709-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_df7dd6b80a96402099aa2cb1e59ea709-1"&gt;&lt;/a&gt;$ sudo pip install nikola
&lt;a id="rest_code_df7dd6b80a96402099aa2cb1e59ea709-2" name="rest_code_df7dd6b80a96402099aa2cb1e59ea709-2" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_df7dd6b80a96402099aa2cb1e59ea709-2"&gt;&lt;/a&gt;$ nikola plugin -i import_blogger
&lt;a id="rest_code_df7dd6b80a96402099aa2cb1e59ea709-3" name="rest_code_df7dd6b80a96402099aa2cb1e59ea709-3" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_df7dd6b80a96402099aa2cb1e59ea709-3"&gt;&lt;/a&gt;$ nikola import_blogger -o site blog-07-05-2014.xml # The -o tells nikola what directory to make the site in.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After this, I had some cleanup to do.
For one thing, Nikola renamed all the Blogger files (in a sensible way).
Blogger has date-derived subdirectories for posts, whereas in Nikola all the posts are kept in one folder, called "posts"
So when the new site is up, redirects will be required for anyone with the old link.&lt;/p&gt;
&lt;p&gt;The import gave me a file called &lt;cite&gt;url_map.csv&lt;/cite&gt;, which contained all the information necessary to redirect the old links to their new locations, but as far as I could tell, those redirects still had to be encoded into the configuration file to take effect.
Since I only had a few, I did this manually.
For every line in the url_map, I inserted a tuple into the &lt;cite&gt;REDIRECTIONS&lt;/cite&gt; list in &lt;cite&gt;conf.py&lt;/cite&gt;.&lt;/p&gt;
&lt;p&gt;The result at this point was a Nikola blog that contained everything the old blog did.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="making-it-not-a-blog"&gt;
&lt;h2&gt;Making it not a blog&lt;/h2&gt;
&lt;p&gt;There is a document in the Nikola project describing &lt;a class="reference external" href="http://getnikola.com/creating-a-site-not-a-blog-with-nikola.html"&gt;how to make a non-blog site&lt;/a&gt;.
The instructions boil down to changing three lines of &lt;cite&gt;conf.py&lt;/cite&gt;.&lt;/p&gt;
&lt;section id="posts-and-pages"&gt;
&lt;h3&gt;Posts and Pages&lt;/h3&gt;
&lt;p&gt;As usual, Nikola distinguishes two different kinds of text-derived files.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Posts&lt;/em&gt; are blog files.
They are archived, indexed by tag, and ordered by date for display.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Pages&lt;/em&gt; are essentially independent.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So to make a blog into a non-blog, you simply manipulate the variable &lt;cite&gt;POSTS&lt;/cite&gt; defined in &lt;cite&gt;conf.py&lt;/cite&gt;.
&lt;cite&gt;POSTS&lt;/cite&gt; and &lt;cite&gt;PAGES&lt;/cite&gt; are lists describing where to find posts or pages respectively, where to render them, and what template to use for them.
We let the &lt;cite&gt;POSTS&lt;/cite&gt; list be empty, so everything on the site will be a page.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_841a555821944d5ebbc6bf526ecde7f5-1" name="rest_code_841a555821944d5ebbc6bf526ecde7f5-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_841a555821944d5ebbc6bf526ecde7f5-1"&gt;&lt;/a&gt;POSTS = []
&lt;a id="rest_code_841a555821944d5ebbc6bf526ecde7f5-2" name="rest_code_841a555821944d5ebbc6bf526ecde7f5-2" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_841a555821944d5ebbc6bf526ecde7f5-2"&gt;&lt;/a&gt;PAGES = [
&lt;a id="rest_code_841a555821944d5ebbc6bf526ecde7f5-3" name="rest_code_841a555821944d5ebbc6bf526ecde7f5-3" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_841a555821944d5ebbc6bf526ecde7f5-3"&gt;&lt;/a&gt;        ("pages/*.rst", "", "story.tmpl"),
&lt;a id="rest_code_841a555821944d5ebbc6bf526ecde7f5-4" name="rest_code_841a555821944d5ebbc6bf526ecde7f5-4" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_841a555821944d5ebbc6bf526ecde7f5-4"&gt;&lt;/a&gt;        ("pages/*.txt", "", "story.tmpl"),
&lt;a id="rest_code_841a555821944d5ebbc6bf526ecde7f5-5" name="rest_code_841a555821944d5ebbc6bf526ecde7f5-5" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_841a555821944d5ebbc6bf526ecde7f5-5"&gt;&lt;/a&gt;        ]
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The two entries for &lt;cite&gt;PAGES&lt;/cite&gt; are here to allow either txt or rst, but the one that comes first is what will be used when you use the &lt;cite&gt;new_post&lt;/cite&gt; command.&lt;/p&gt;
&lt;p&gt;So you can create a &lt;em&gt;page&lt;/em&gt; called "index.html" by running &lt;cite&gt;new_post -p&lt;/cite&gt;, and giving it the name &lt;cite&gt;index&lt;/cite&gt;.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-1" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-1"&gt;&lt;/a&gt;$ nikola new_post -p
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-2" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-2" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-2"&gt;&lt;/a&gt;
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-3" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-3" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-3"&gt;&lt;/a&gt;[...]
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-4" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-4" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-4"&gt;&lt;/a&gt;
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-5" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-5" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-5"&gt;&lt;/a&gt;Creating New Page
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-6" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-6" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-6"&gt;&lt;/a&gt;-----------------
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-7" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-7" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-8" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-8" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-8"&gt;&lt;/a&gt;Title: index
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-9" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-9" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-10" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-10" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-10"&gt;&lt;/a&gt;[...]
&lt;a id="rest_code_d1bd027cd56a4036a25bff7c91b34974-11" name="rest_code_d1bd027cd56a4036a25bff7c91b34974-11" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_d1bd027cd56a4036a25bff7c91b34974-11"&gt;&lt;/a&gt;INFO: new_page: Your page's text is at: pages/index.rst
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Since we put it at "", which is the top level of the site, it will be what you see on the "front page".&lt;/p&gt;
&lt;p&gt;Unfortunately, this creates a conflict, because when you build the site, the &lt;em&gt;blog&lt;/em&gt; part is already wired to make an index.html file in the top-level directory, since that's how blogs normally appear.
So you intercept this by adding to &lt;cite&gt;conf.py&lt;/cite&gt; the line:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_7e1c762fc3ba430d931d83beb9e5f312-1" name="rest_code_7e1c762fc3ba430d931d83beb9e5f312-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_7e1c762fc3ba430d931d83beb9e5f312-1"&gt;&lt;/a&gt;INDEX_PATH = "blog"
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This just makes it so the blog index is now created under the folder blog, instead of the top level, and it no longer conflicts.&lt;/p&gt;
&lt;p&gt;It also means that now you can have a regular blog under the subdirectory blog, by putting options back in for &lt;cite&gt;POSTS&lt;/cite&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_0b1ed77abfe94c0681a94971a9f14971-1" name="rest_code_0b1ed77abfe94c0681a94971a9f14971-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_0b1ed77abfe94c0681a94971a9f14971-1"&gt;&lt;/a&gt;POSTS = [("posts/*.rst", "blog", "post.tmpl")]
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But this is not enough for us, because we have imported posts from Blogger that were also being found from the &lt;cite&gt;POSTS&lt;/cite&gt; list.
There is another entry in &lt;cite&gt;POSTS&lt;/cite&gt; that we need back, that tells Nikola to also collect and render existing html files, such as those we imported.
So we need to add:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_04cecae7be9e4dd9ae52c57e84df78a8-1" name="rest_code_04cecae7be9e4dd9ae52c57e84df78a8-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_04cecae7be9e4dd9ae52c57e84df78a8-1"&gt;&lt;/a&gt;("posts/*.html", "blog", "post.tmpl")
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;back into the list.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="two-blogs"&gt;
&lt;h2&gt;Two blogs&lt;/h2&gt;
&lt;p&gt;At this point I had part of what I wanted.
I had a front page separate from my blog, and all of my previous blog reachable from the site.
But I still wanted to have two blogs, a primary one for themed entries, and a journal for unstructured reflections.&lt;/p&gt;
&lt;p&gt;Here are the steps I took to factor the blogs apart:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Made a new directory for the journal posts called "journal", and moved the appropriate files into it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Added ("journal/&lt;em&gt;.rst", "journal", "story.tmpl") and ("journal/&lt;/em&gt;.html", "journal", "story.tmpl") to the &lt;cite&gt;PAGES&lt;/cite&gt; list, so old and new journal entries can be found for rendering.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Updated the conf.py &lt;cite&gt;REDIRECTIONS&lt;/cite&gt; to reflect those&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This worked to render them and include them in the site, but the journal articles were not indexed.
That meant that if I knew the URL, I could go to the article, but a visitor to the site could never discover them.&lt;/p&gt;
&lt;p&gt;To add indexing I had to add to conf.py:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_b404b87e03f54998bca01e296dfd2fdf-1" name="rest_code_b404b87e03f54998bca01e296dfd2fdf-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_b404b87e03f54998bca01e296dfd2fdf-1"&gt;&lt;/a&gt;STORY_INDEX = True
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But again, this created a conflict with multiple files called "index.html" trying to go in the same folder.
So I also had to change the name of the index.  I chose "index.htm", so that the server would automatically redirect.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_6a62e87bb988496d9ff22a02aa68e625-1" name="rest_code_6a62e87bb988496d9ff22a02aa68e625-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_6a62e87bb988496d9ff22a02aa68e625-1"&gt;&lt;/a&gt;INDEX_FILE = "index.htm"
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Finally, I wanted the journal to be findable without knowing the directory name "journal", so I updated the navigation links:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-1" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-1" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-1"&gt;&lt;/a&gt;NAVIGATION_LINKS = {
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-2" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-2" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-2"&gt;&lt;/a&gt; DEFAULT_LANG: (
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-3" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-3" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-3"&gt;&lt;/a&gt;     ("/archive.html", "Archive"),
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-4" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-4" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-4"&gt;&lt;/a&gt;     ("/categories/", "Tags"),
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-5" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-5" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-5"&gt;&lt;/a&gt;     ("/blog/", "Blog"),
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-6" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-6" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-6"&gt;&lt;/a&gt;     ("/journal/", "Journal"),
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-7" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-7" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-7"&gt;&lt;/a&gt;     ("/rss.xml", "RSS feed"),
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-8" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-8" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-8"&gt;&lt;/a&gt;  ),
&lt;a id="rest_code_f21269b06a564b29af2b050cc69ce4f4-9" name="rest_code_f21269b06a564b29af2b050cc69ce4f4-9" href="http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html#rest_code_f21269b06a564b29af2b050cc69ce4f4-9"&gt;&lt;/a&gt; }
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As an extra configuration tweak, I set &lt;cite&gt;TAG_PAGES_ARE_INDEXES = True&lt;/cite&gt;, so that when you go to the page for a given tag, it renders the posts themselves, rather than a list.&lt;/p&gt;
&lt;p&gt;I would like to do that for my journal index as well, but that feature is not yet general, so if you navigate to "Journal" you will get a list of posts, and unfortunately, since it is a journal, they are named by date.
Moreover, their tags aren't collected.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="parting-thoughts"&gt;
&lt;h2&gt;Parting thoughts&lt;/h2&gt;
&lt;p&gt;All in all, I'm satisfied with the move.
I got a lot of help from the Nikola community, and my main requirements are fulfilled.&lt;/p&gt;
&lt;p&gt;There are a few remaining troubles.&lt;/p&gt;
&lt;section id="comments"&gt;
&lt;h3&gt;Comments&lt;/h3&gt;
&lt;p&gt;I signed up with Disqus, and think I have initiated the process of importing my old comments, which I was reluctant to lose.
It takes an unspecified amount of time to complete, so I'm hoping that will take care of itself now, but I'm uncertain.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="orphaned-rst"&gt;
&lt;h3&gt;Orphaned rst&lt;/h3&gt;
&lt;p&gt;Because of the way I built my Blogger site: writing in reStructuredText, converting to HTML, and uploading, I still have the original, pristine rst files on my local system, but Nikola doesn't use them.
It uses the backported HTML from Blogger.
In order to inject the old rst files into Nikola, however, would require manually editing them all to include the correct headers and timestamps.
This seems like a lot of work, and I'm not willing to do it right now.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;</description><category>blog</category><category>blogger</category><category>blogging</category><category>nikola</category><guid>http://www.subsymbol.org/posts/how-i-transformed-a-blogger-blog-to-a-nikola-two-blog-website.html</guid><pubDate>Tue, 08 Jul 2014 16:59:38 GMT</pubDate></item></channel></rss>