relpipe-data/classic-example.xml
branchv_0
changeset 318 137f63652fa2
parent 172 793aedbbe1c3
child 329 5bc2bb8b7946
equal deleted inserted replaced
317:fce3d6290c40 318:137f63652fa2
    47 		</p>
    47 		</p>
    48 
    48 
    49 		<h2>The great parts</h2>
    49 		<h2>The great parts</h2>
    50 		
    50 		
    51 		<p>
    51 		<p>
    52 			The authors of <code>cat</code>, <code>grep</code>, <code>cut</code> or <code>tr</code> programs don't have to know anything about cats<m:podČarou>n.b. the cat in the command name is a different cat than in our text file</m:podČarou> and dogs and our business domain.
    52 			The authors of <code>cat</code>, <code>grep</code>, <code>cut</code> or <code>tr</code> programs do not have to know anything about cats<m:podČarou>n.b. the cat in the command name is a different cat than in our text file</m:podČarou> and dogs and our business domain.
    53 			They can focus on their tasks which are reading files, filtering by regular expressions, doing some substrings and text conversions. And they do it well without being distracted by any animals.
    53 			They can focus on their tasks which are reading files, filtering by regular expressions, doing some substrings and text conversions. And they do it well without being distracted by any animals.
    54 		</p>
    54 		</p>
    55 		
    55 		
    56 		<p>
    56 		<p>
    57 			And we don't have to know anything about the low-level programming in the C language or compile anything.
    57 			And we do not have to know anything about the low-level programming in the C language or compile anything.
    58 			We just simply build a pipeline in a shell (e.g. GNU Bash) from existing programs and focus on our business logic.
    58 			We just simply build a pipeline in a shell (e.g. GNU Bash) from existing programs and focus on our business logic.
    59 			And we do it well without being distracted by any low-level issues.
    59 			And we do it well without being distracted by any low-level issues.
    60 		</p>
    60 		</p>
    61 		
    61 		
    62 		<p>
    62 		<p>
    92 		
    92 		
    93 		<pre><![CDATA[RED
    93 		<pre><![CDATA[RED
    94 YELLOW
    94 YELLOW
    95 WHITE]]></pre>
    95 WHITE]]></pre>
    96 
    96 
    97 		<p>Which is really unexpected and unwanted result. We don't have a RED dog and this is just an accident. The same would happen if we have a monkey of a <em>doggish</em> color.</p>
    97 		<p>Which is really unexpected and unwanted result. We do not have a RED dog and this is just an accident. The same would happen if we have a monkey of a <em>doggish</em> color.</p>
    98 		
    98 		
    99 		<p>
    99 		<p>
   100 			This problem is caused by the fact that the <code>grep dog</code> filters lines containing the word <em>dog</em> regardless its position (first, second or third field).
   100 			This problem is caused by the fact that the <code>grep dog</code> filters lines containing the word <em>dog</em> regardless its position (first, second or third field).
   101 			Sometimes we could avoid such problems by a bit more complicated regular expression and/or by using Perl, but our pipeline wouldn't be as simple and legible as before.
   101 			Sometimes we could avoid such problems by a bit more complicated regular expression and/or by using Perl, but our pipeline would not be as simple and legible as before.
   102 		</p>
   102 		</p>
   103 		
   103 		
   104 		<p>
   104 		<p>
   105 			What if we have a turtle that has lighter color than other turtles?
   105 			What if we have a turtle that has lighter color than other turtles?
   106 		</p>
   106 		</p>
   115 		<pre><![CDATA[GREEN
   115 		<pre><![CDATA[GREEN
   116 LIGHT]]></pre>
   116 LIGHT]]></pre>
   117 		
   117 		
   118 		<p>
   118 		<p>
   119 			Which is definitively wrong because the second turtle is not LIGHT, it is LIGHT GREEN.
   119 			Which is definitively wrong because the second turtle is not LIGHT, it is LIGHT GREEN.
   120 			This problem is caused by the fact that we don't have a well-defined separators between fields.
   120 			This problem is caused by the fact that we do not have a well-defined separators between fields.
   121 			Sometimes we could avoid such problems by restrictions/presumptions e.g. <em>the color must not contain a space character</em> (we could replace spaces by hyphens).
   121 			Sometimes we could avoid such problems by restrictions/presumptions e.g. <em>the color must not contain a space character</em> (we could replace spaces by hyphens).
   122 			Or we could use some other field delimiter e.g. ; or | or ,. But still we would not be able to use such character in the field values.
   122 			Or we could use some other field delimiter e.g. ; or | or ,. But still we would not be able to use such character in the field values.
   123 			So we must invent some kind of escaping (like <code>\;</code> is not a separator but a part of the field value)
   123 			So we must invent some kind of escaping (like <i><code>\;</code> is not a separator but a part of the field value</i>)
   124 			or add some quotes/apostrophes (which still requires escaping, because what if we have e.g. name field containing an apostrophe?).
   124 			or add some quotes/apostrophes (which still requires escaping, because what if we have e.g. name field containing an apostrophe?).
   125 			And parsing such inputs by classic tools and regular expressions is not easy and sometimes even not possible.
   125 			And parsing such inputs by classic tools and regular expressions is not easy and sometimes even not possible.
   126 		</p>
   126 		</p>
   127 		
   127 		
   128 		<p>
   128 		<p>