You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/05/02 21:40:54 UTC

[1/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Repository: incubator-quarks-website
Updated Branches:
  refs/heads/asf-site 89f336cfc -> 4fa5de59c


http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_source_function.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_source_function.html b/content/recipes/recipe_source_function.html
index e273fe2..25be6a0 100644
--- a/content/recipes/recipe_source_function.html
+++ b/content/recipes/recipe_source_function.html
@@ -579,76 +579,76 @@ $('#toc').on('click', 'a', function() {
 
     <a target="_blank" href="https://github.com/apache/incubator-quarks-website/blob/master/site/recipes/recipe_source_function.md" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
     
-  <p>In the previous <a href="recipe_hello_quarks">Hello Quarks!</a> example, we create a data source which only generates a single Java String and prints it to output. Yet Quarks sources support the ability generate any data type as a source, not just Java types such as Strings and Doubles. Moreover, because the user supplies the code which generates the data, the user has complete flexibility for <em>how</em> the data is generated. This recipe demonstrates how a user could write such a custom data source.</p>
+  <p>In the previous <a href="recipe_hello_quarks">Hello Quarks!</a> example, we create a data source which generates two Java <code>String</code>s and prints them to output. Yet Quarks sources support the ability generate any data type as a source, not just Java types such as <code>String</code>s and <code>Double</code>s. Moreover, because the user supplies the code which generates the data, the user has complete flexibility for <em>how</em> the data is generated. This recipe demonstrates how a user could write such a custom data source.</p>
 
 <h2 id="custom-source-reading-the-lines-of-a-web-page">Custom source: reading the lines of a web page</h2>
 
 <div class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note: </b> Quarks' API provides convenience methods for performing HTTP requests. For the sake of example we are writing a HTTP data source manually, but in principle there are easier methods. </div>
 
-<p>One example of a custom data source could be retrieving the contents of a web page and printing each line to output. For example, the user could be querying the Yahoo Finance website for the most recent stock price data of Bank of America, Cabot Oil &amp; Gas, and Freeport-McMoRan Inc:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+<p>One example of a custom data source could be retrieving the contents of a web page and printing each line to output. For example, the user could be querying the Yahoo Finance website for the most recent stock price data of Bank of America, Cabot Oil &amp; Gas, and Freeport-McMoRan Inc.:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 
-        <span class="kd">final</span> <span class="n">URL</span> <span class="n">url</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="s">"http://finance.yahoo.com/d/quotes.csv?s=BAC+COG+FCX&amp;f=snabl"</span><span class="o">);</span>
-    <span class="o">}</span>
+    <span class="kd">final</span> <span class="n">URL</span> <span class="n">url</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="s">"http://finance.yahoo.com/d/quotes.csv?s=BAC+COG+FCX&amp;f=snabl"</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
-<p>Given the correctly formatted URL to request the data, we can use the <em>Topology.source</em> method to generate each line of the page as a data item on the stream. <code>Topology.source</code> takes a Java Supplier that returns an Iterable. The supplier is invoked once, and the items returned from the Iterable are used as the stream&#39;s data items. For example, the following <code>queryWebsite</code> method returns a supplier which queries  a URL and returns an Iterable of its contents:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">private</span> <span class="kd">static</span> <span class="n">Supplier</span><span class="o">&lt;</span><span class="n">Iterable</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="o">&gt;</span> <span class="n">queryWebsite</span><span class="o">(</span><span class="n">URL</span> <span class="n">url</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span><span class="o">{</span>
-        <span class="k">return</span> <span class="o">()</span> <span class="o">-&gt;</span> <span class="o">{</span>
-            <span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="k">new</span> <span class="n">LinkedList</span><span class="o">&lt;&gt;();</span>
-            <span class="k">try</span> <span class="o">{</span>
-                <span class="n">InputStream</span> <span class="n">is</span> <span class="o">=</span> <span class="n">url</span><span class="o">.</span><span class="na">openStream</span><span class="o">();</span>
-                <span class="n">BufferedReader</span> <span class="n">br</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BufferedReader</span><span class="o">(</span>
-                        <span class="k">new</span> <span class="n">InputStreamReader</span><span class="o">(</span><span class="n">is</span><span class="o">));</span>
-
-                <span class="k">for</span><span class="o">(</span><span class="n">String</span> <span class="n">s</span> <span class="o">=</span> <span class="n">br</span><span class="o">.</span><span class="na">readLine</span><span class="o">();</span> <span class="n">s</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">;</span> <span class="n">s</span> <span class="o">=</span> <span class="n">br</span><span class="o">.</span><span class="na">readLine</span><span class="o">())</span>
-                    <span class="n">lines</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">s</span><span class="o">);</span>
-
-            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
-                <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
-            <span class="o">}</span>
-            <span class="k">return</span> <span class="n">lines</span><span class="o">;</span>
-        <span class="o">};</span>
-    <span class="o">}</span>
+<p>Given the correctly formatted URL to request the data, we can use the <em><code>Topology.source()</code></em> method to generate each line of the page as a data item on the stream. <code>Topology.source()</code> takes a Java <code>Supplier</code> that returns an <code>Iterable</code>. The supplier is invoked once, and the items returned from the Iterable are used as the stream&#39;s data items. For example, the following <code>queryWebsite</code> method returns a supplier which queries a URL and returns an <code>Iterable</code> of its contents:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">private</span> <span class="kd">static</span> <span class="n">Supplier</span><span class="o">&lt;</span><span class="n">Iterable</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="o">&gt;</span> <span class="n">queryWebsite</span><span class="o">(</span><span class="n">URL</span> <span class="n">url</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span><span class="o">{</span>
+    <span class="k">return</span> <span class="o">()</span> <span class="o">-&gt;</span> <span class="o">{</span>
+        <span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="k">new</span> <span class="n">LinkedList</span><span class="o">&lt;&gt;();</span>
+        <span class="k">try</span> <span class="o">{</span>
+            <span class="n">InputStream</span> <span class="n">is</span> <span class="o">=</span> <span class="n">url</span><span class="o">.</span><span class="na">openStream</span><span class="o">();</span>
+            <span class="n">BufferedReader</span> <span class="n">br</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BufferedReader</span><span class="o">(</span>
+                    <span class="k">new</span> <span class="n">InputStreamReader</span><span class="o">(</span><span class="n">is</span><span class="o">));</span>
+
+            <span class="k">for</span><span class="o">(</span><span class="n">String</span> <span class="n">s</span> <span class="o">=</span> <span class="n">br</span><span class="o">.</span><span class="na">readLine</span><span class="o">();</span> <span class="n">s</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">;</span> <span class="n">s</span> <span class="o">=</span> <span class="n">br</span><span class="o">.</span><span class="na">readLine</span><span class="o">())</span>
+                <span class="n">lines</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">s</span><span class="o">);</span>
+
+        <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
+        <span class="o">}</span>
+        <span class="k">return</span> <span class="n">lines</span><span class="o">;</span>
+    <span class="o">};</span>
+<span class="o">}</span>
 </code></pre></div>
-<p>When invoking <code>Topology.source</code>, we can use <code>queryWebsite</code> to return the required supplier, passing in the URL.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">     <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+<p>When invoking <code>Topology.source()</code>, we can use <code>queryWebsite</code> to return the required supplier, passing in the URL.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 
-        <span class="kd">final</span> <span class="n">URL</span> <span class="n">url</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="s">"http://finance.yahoo.com/d/quotes.csv?s=BAC+COG+FCX&amp;f=snabl"</span><span class="o">);</span>
+    <span class="kd">final</span> <span class="n">URL</span> <span class="n">url</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="s">"http://finance.yahoo.com/d/quotes.csv?s=BAC+COG+FCX&amp;f=snabl"</span><span class="o">);</span>
 
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">linesOfWebsite</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">source</span><span class="o">(</span><span class="n">queryWebsite</span><span class="o">(</span><span class="n">url</span><span class="o">));</span>
-    <span class="o">}</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">linesOfWebsite</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">source</span><span class="o">(</span><span class="n">queryWebsite</span><span class="o">(</span><span class="n">url</span><span class="o">));</span>
+<span class="o">}</span>
 </code></pre></div>
-<p>Source methods such as <code>Topology.source</code> and <code>Topology.strings</code> return a <code>TStream</code>. If we print the <code>linesOfWebsite</code> stream to standard output and run the application, we can see that it correctly generates the data and feeds it into the Quarks runtime:</p>
+<p>Source methods such as <code>Topology.source()</code> and <code>Topology.strings()</code> return a <code>TStream</code>. If we print the <code>linesOfWebsite</code> stream to standard output and run the application, we can see that it correctly generates the data and feeds it into the Quarks runtime:</p>
 
-<p>Output:</p>
+<p><strong>Output</strong>:</p>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="s">"BAC"</span><span class="o">,</span><span class="s">"Bank of America Corporation Com"</span><span class="o">,</span><span class="mf">13.150</span><span class="o">,</span><span class="mf">13.140</span><span class="o">,</span><span class="s">"12:00pm - &lt;b&gt;13.145&lt;/b&gt;"</span>
 <span class="s">"COG"</span><span class="o">,</span><span class="s">"Cabot Oil &amp; Gas Corporation Com"</span><span class="o">,</span><span class="mf">21.6800</span><span class="o">,</span><span class="mf">21.6700</span><span class="o">,</span><span class="s">"12:00pm - &lt;b&gt;21.6775&lt;/b&gt;"</span>
 <span class="s">"FCX"</span><span class="o">,</span><span class="s">"Freeport-McMoRan, Inc. Common S"</span><span class="o">,</span><span class="mf">8.8200</span><span class="o">,</span><span class="mf">8.8100</span><span class="o">,</span><span class="s">"12:00pm - &lt;b&gt;8.8035&lt;/b&gt;"</span>
 </code></pre></div>
 <h2 id="polling-source-reading-data-periodically">Polling source: reading data periodically</h2>
 
-<p>A much more common scenario for a developer is the periodic generation of data from a source operator -- a data source may need to be polled every 5 seconds, 3 hours, or any time frame. To this end, <code>Topology</code> exposes the <code>poll</code> method which can be used to call a function at the frequency of the user&#39;s choosing. For example, a user might want to query Yahoo Finance every two seconds to retrieve the most up to date ticker price for a stock:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+<p>A much more common scenario for a developer is the periodic generation of data from a source operator &mdash; a data source may need to be polled every 5 seconds, 3 hours, or any time frame. To this end, <code>Topology</code> exposes the <code>poll()</code> method which can be used to call a function at the frequency of the user&#39;s choosing. For example, a user might want to query Yahoo Finance every two seconds to retrieve the most up to date ticker price for a stock:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 
-        <span class="kd">final</span> <span class="n">URL</span> <span class="n">url</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="s">"http://finance.yahoo.com/d/quotes.csv?s=BAC+COG+FCX&amp;f=snabl"</span><span class="o">);</span>
+    <span class="kd">final</span> <span class="n">URL</span> <span class="n">url</span> <span class="o">=</span> <span class="k">new</span> <span class="n">URL</span><span class="o">(</span><span class="s">"http://finance.yahoo.com/d/quotes.csv?s=BAC+COG+FCX&amp;f=snabl"</span><span class="o">);</span>
 
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Iterable</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">source</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">queryWebsite</span><span class="o">(</span><span class="n">url</span><span class="o">),</span> <span class="mi">2</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
-        <span class="n">source</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Iterable</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">source</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">queryWebsite</span><span class="o">(</span><span class="n">url</span><span class="o">),</span> <span class="mi">2</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+    <span class="n">source</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
 
-        <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
-    <span class="o">}</span>
+    <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
-<p><strong>Output:</strong>
-<br>
-<img src="images/pollingSource.gif"></p>
+<p><strong>Output</strong>:</p>
 
-<p>It&#39;s important to note that calls to <code>DirectProvider.submit</code> are non-blocking; the main thread will exit, and the threads executing the topology will continue to run. (Also, to see changing stock prices, the above example needs to be run during open trading hours. Otherwise, it will simply return the same results every time the website is polled).</p>
+<p><img src="images/pollingSource.gif"></p>
+
+<p>It&#39;s important to note that calls to <code>DirectProvider.submit()</code> are non-blocking; the main thread will exit, and the threads executing the topology will continue to run. (Also, to see changing stock prices, the above example needs to be run during open trading hours. Otherwise, it will simply return the same results every time the website is polled).</p>
 
 
 <div class="tags">
@@ -681,7 +681,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_value_out_of_range.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_value_out_of_range.html b/content/recipes/recipe_value_out_of_range.html
index 9298a4f..2a04a2b 100644
--- a/content/recipes/recipe_value_out_of_range.html
+++ b/content/recipes/recipe_value_out_of_range.html
@@ -588,59 +588,59 @@ $('#toc').on('click', 'a', function() {
 <h2 id="setting-up-the-application">Setting up the application</h2>
 
 <p>We assume that the environment has been set up following the steps outlined in the <a href="../docs/quarks-getting-started">Getting started guide</a>. Let&#39;s begin by creating a <code>DirectProvider</code> and <code>Topology</code>. We also define the optimal temperature range.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">static</span> <span class="n">quarks</span><span class="o">.</span><span class="na">function</span><span class="o">.</span><span class="na">Functions</span><span class="o">.</span><span class="na">identity</span><span class="o">;</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">static</span> <span class="n">quarks</span><span class="o">.</span><span class="na">function</span><span class="o">.</span><span class="na">Functions</span><span class="o">.</span><span class="na">identity</span><span class="o">;</span>
 
-    <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
 
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Filters</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Range</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimulatedTemperatureSensor</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Filters</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Range</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimulatedTemperatureSensor</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
 
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">DetectValueOutOfRange</span> <span class="o">{</span>
-        <span class="cm">/**
-         * Optimal temperature range (in Fahrenheit)
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">=</span> <span class="mf">77.0</span><span class="o">;</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_HIGH</span> <span class="o">=</span> <span class="mf">91.0</span><span class="o">;</span>
-        <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">OPTIMAL_TEMP_LOW</span><span class="o">,</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">DetectValueOutOfRange</span> <span class="o">{</span>
+    <span class="cm">/**
+     * Optimal temperature range (in Fahrenheit)
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">=</span> <span class="mf">77.0</span><span class="o">;</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_HIGH</span> <span class="o">=</span> <span class="mf">91.0</span><span class="o">;</span>
+    <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">OPTIMAL_TEMP_LOW</span><span class="o">,</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
 
-        <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
 
-            <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 
-            <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"TemperatureSensor"</span><span class="o">);</span>
+        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"TemperatureSensor"</span><span class="o">);</span>
 
-            <span class="c1">// The rest of the code pieces belong here</span>
-        <span class="o">}</span>
+        <span class="c1">// The rest of the code pieces belong here</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 <h2 id="generating-temperature-sensor-readings">Generating temperature sensor readings</h2>
 
 <p>The next step is to simulate a stream of temperature readings using <a href="https://github.com/apache/incubator-quarks/blob/master/samples/utils/src/main/java/quarks/samples/utils/sensor/SimulatedTemperatureSensor.java"><code>SimulatedTemperatureSensor</code></a>. By default, the sensor sets the initial temperature to 80�F and ensures that new readings are between 28�F and 112�F. In our <code>main()</code>, we use the <code>poll()</code> method to generate a flow of tuples, where a new tuple (temperature reading) arrives every second.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Generate a stream of temperature sensor readings</span>
-    <span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">temp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Generate a stream of temperature sensor readings</span>
+<span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">temp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="simple-filtering">Simple filtering</h2>
 
 <p>If the corn grower is interested in determining when the temperature is strictly out of the optimal range of 77�F and 91�F, a simple filter can be used. The <code>filter</code> method can be applied to <code>TStream</code> objects, where a filter predicate determines which tuples to keep for further processing. For its method declaration, refer to the <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/topology/TStream.html#filter-quarks.function.Predicate-">Javadoc</a>.</p>
 
 <p>In this case, we want to keep temperatures below the lower range value <em>or</em> above the upper range value. This is expressed in the filter predicate, which follows Java&#39;s syntax for <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#syntax">lambda expressions</a>. Then, we terminate the stream (using <code>sink</code>) by printing out the warning to standard out. Note that <code>\u00b0</code> is the Unicode encoding for the degree (�) symbol.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">simpleFiltered</span> <span class="o">=</span> <span class="n">temp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
-            <span class="n">tuple</span> <span class="o">&lt;</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">||</span> <span class="n">tuple</span> <span class="o">&gt;</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
-    <span class="n">simpleFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature is out of range! "</span>
-            <span class="o">+</span> <span class="s">"It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">simpleFiltered</span> <span class="o">=</span> <span class="n">temp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
+        <span class="n">tuple</span> <span class="o">&lt;</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">||</span> <span class="n">tuple</span> <span class="o">&gt;</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
+<span class="n">simpleFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature is out of range! "</span>
+        <span class="o">+</span> <span class="s">"It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
 </code></pre></div>
 <h2 id="deadband-filter">Deadband filter</h2>
 
-<p>Alternatively, a deadband filter can be used to glean more information about temperature changes, such as extracting the in-range temperature immediately after a reported out-of-range temperature. For example, large temperature fluctuations could be investigated more thoroughly. </p>
+<p>Alternatively, a deadband filter can be used to glean more information about temperature changes, such as extracting the in-range temperature immediately after a reported out-of-range temperature. For example, large temperature fluctuations could be investigated more thoroughly.</p>
 
 <p>The <code>deadband</code> filter is a part of the <code>quarks.analytics</code> package focused on handling sensor data. Let&#39;s look more closely at the method declaration below.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">deadband</span><span class="o">(</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">stream</span><span class="o">,</span> <span class="n">Function</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span><span class="n">V</span><span class="o">&gt;</span> <span class="n">value</span><span class="o">,</span> <span class="n">Predicate</span><span class="o">&lt;</span><span class="n">V</span><span class="o">&gt;</span> <span class="n">inBand</span><span class="o">)</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">deadband</span><span class="o">(</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">stream</span><span class="o">,</span> <span class="n">Function</span><span class="o">&lt;</span><span class="n">T</span><span class="o">,</span><span class="n">V</span><span class="o">&gt;</span> <span class="n">value</span><span class="o">,</span> <span class="n">Predicate</span><span class="o">&lt;</span><span class="n">V</span><span class="o">&gt;</span> <span class="n">inBand</span><span class="o">)</span>
 </code></pre></div>
 <p>The first parameter is the stream to the filtered, which is <code>temp</code> in our scenario. The second parameter is the value to examine. Here, we use the <code>identity()</code> method to return a tuple on the stream. The last parameter is the predicate that defines the optimal range, that is, between 77�F and 91�F. it is important to note that this differs from the <code>TStream</code> version of <code>filter</code> in which one must explicitly specify the values that are out of range. The code snippet below demonstrates how the method call is pieced together. The <code>deadbandFiltered</code> stream contains temperature readings that follow the rules as described in the <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/analytics/sensors/Filters.html#deadband-quarks.topology.TStream-quarks.function.Function-quarks.function.Predicate-">Javadoc</a>:</p>
 
@@ -651,34 +651,34 @@ $('#toc').on('click', 'a', function() {
 </ul>
 
 <p>As with the simple filter, the stream is terminated by printing out the warnings.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadbandFiltered</span> <span class="o">=</span> <span class="n">Filters</span><span class="o">.</span><span class="na">deadband</span><span class="o">(</span><span class="n">temp</span><span class="o">,</span>
-            <span class="n">identity</span><span class="o">(),</span> <span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span> <span class="o">&gt;=</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span> <span class="o">&lt;=</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
-    <span class="n">deadbandFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature may not be "</span>
-            <span class="o">+</span> <span class="s">"optimal! It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadbandFiltered</span> <span class="o">=</span> <span class="n">Filters</span><span class="o">.</span><span class="na">deadband</span><span class="o">(</span><span class="n">temp</span><span class="o">,</span>
+        <span class="n">identity</span><span class="o">(),</span> <span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span> <span class="o">&gt;=</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span> <span class="o">&lt;=</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
+<span class="n">deadbandFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature may not be "</span>
+        <span class="o">+</span> <span class="s">"optimal! It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
 </code></pre></div>
 <p>We end our application by submitting the <code>Topology</code>.</p>
 
 <h2 id="observing-the-output">Observing the output</h2>
 
 <p>To see what the temperatures look like, we can print the stream to standard out.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">temp</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">temp</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
 </code></pre></div>
 <p>When the final application is run, the output looks something like the following:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    Temperature may not be optimal! It is 79.1�F!
-    79.1
-    79.4
-    79.0
-    78.8
-    78.0
-    78.3
-    77.4
-    Temperature is out of range! It is 76.5�F!
-    Temperature may not be optimal! It is 76.5�F!
-    76.5
-    Temperature may not be optimal! It is 77.5�F!
-    77.5
-    77.1
-    ...
+<div class="highlight"><pre><code class="language-" data-lang="">Temperature may not be optimal! It is 79.1�F!
+79.1
+79.4
+79.0
+78.8
+78.0
+78.3
+77.4
+Temperature is out of range! It is 76.5�F!
+Temperature may not be optimal! It is 76.5�F!
+76.5
+Temperature may not be optimal! It is 77.5�F!
+77.5
+77.1
+...
 </code></pre></div>
 <p>Note that the deadband filter outputs a warning message for the very first temperature reading of 79.1�F. When the temperature falls to 76.5�F (which is outside the optimal range), both the simple filter and deadband filter print out a warning message. However, when the temperature returns to normal at 77.5�F, only the deadband filter prints out a message as it is the first value inside the optimal range after a period of being outside it.</p>
 
@@ -686,85 +686,84 @@ $('#toc').on('click', 'a', function() {
 
 <p>Filtering against a range of values is such a common analytic activity that the <code>quarks.analytics.sensors.Range</code> class is provided to assist with that.</p>
 
-<p>Using a Range can simplify and clarify your application code and lessen mistakes that may occur when writing expressions to deal with ranges.
-Though not covered in this recipe, Ranges offer additional conveniences for creating applications with external range specifications and adaptable filters.</p>
+<p>Using a <code>Range</code> can simplify and clarify your application code and lessen mistakes that may occur when writing expressions to deal with ranges. Though not covered in this recipe, <code>Range</code>s offer additional conveniences for creating applications with external range specifications and adaptable filters.</p>
 
-<p>In the above examples, a single Range can be used in place of the two different expressions for the same logical range:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">=</span> <span class="mf">77.0</span><span class="o">;</span>
-    <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_HIGH</span> <span class="o">=</span> <span class="mf">91.0</span><span class="o">;</span>
-    <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">OPTIMAL_TEMP_LOW</span><span class="o">,</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
+<p>In the above examples, a single <code>Range</code> can be used in place of the two different expressions for the same logical range:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">=</span> <span class="mf">77.0</span><span class="o">;</span>
+<span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_HIGH</span> <span class="o">=</span> <span class="mf">91.0</span><span class="o">;</span>
+<span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">OPTIMAL_TEMP_LOW</span><span class="o">,</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
 </code></pre></div>
 <p>Using <code>optimalTempRange</code> in the Simple filter example code:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">simpleFiltered</span> <span class="o">=</span> <span class="n">temp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> 
-            <span class="o">!</span><span class="n">optimalTempRange</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">simpleFiltered</span> <span class="o">=</span> <span class="n">temp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
+        <span class="o">!</span><span class="n">optimalTempRange</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
 </code></pre></div>
 <p>Using <code>optimalTempRange</code> in the Deadband filter example code:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadbandFiltered</span> <span class="o">=</span> <span class="n">Filters</span><span class="o">.</span><span class="na">deadband</span><span class="o">(</span><span class="n">temp</span><span class="o">,</span>
-            <span class="n">identity</span><span class="o">(),</span> <span class="n">optimalTempRange</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadbandFiltered</span> <span class="o">=</span> <span class="n">Filters</span><span class="o">.</span><span class="na">deadband</span><span class="o">(</span><span class="n">temp</span><span class="o">,</span>
+        <span class="n">identity</span><span class="o">(),</span> <span class="n">optimalTempRange</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="the-final-application">The final application</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">static</span> <span class="n">quarks</span><span class="o">.</span><span class="na">function</span><span class="o">.</span><span class="na">Functions</span><span class="o">.</span><span class="na">identity</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Filters</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Range</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimulatedTemperatureSensor</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">static</span> <span class="n">quarks</span><span class="o">.</span><span class="na">function</span><span class="o">.</span><span class="na">Functions</span><span class="o">.</span><span class="na">identity</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Filters</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Range</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimulatedTemperatureSensor</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+
+<span class="cm">/**
+ * Detect a sensor value out of expected range.
+ */</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">DetectValueOutOfRange</span> <span class="o">{</span>
+    <span class="cm">/**
+     * Optimal temperature range (in Fahrenheit)
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">=</span> <span class="mf">77.0</span><span class="o">;</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_HIGH</span> <span class="o">=</span> <span class="mf">91.0</span><span class="o">;</span>
+    <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">OPTIMAL_TEMP_LOW</span><span class="o">,</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
 
     <span class="cm">/**
-     * Detect a sensor value out of expected range.
+     * Polls a simulated temperature sensor to periodically obtain
+     * temperature readings (in Fahrenheit). Use a simple filter
+     * and a deadband filter to determine when the temperature
+     * is out of the optimal range.
      */</span>
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">DetectValueOutOfRange</span> <span class="o">{</span>
-        <span class="cm">/**
-         * Optimal temperature range (in Fahrenheit)
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_LOW</span> <span class="o">=</span> <span class="mf">77.0</span><span class="o">;</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">OPTIMAL_TEMP_HIGH</span> <span class="o">=</span> <span class="mf">91.0</span><span class="o">;</span>
-        <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">OPTIMAL_TEMP_LOW</span><span class="o">,</span> <span class="n">OPTIMAL_TEMP_HIGH</span><span class="o">);</span>
-
-        <span class="cm">/**
-         * Polls a simulated temperature sensor to periodically obtain
-         * temperature readings (in Fahrenheit). Use a simple filter
-         * and a deadband filter to determine when the temperature
-         * is out of the optimal range.
-         */</span>
-        <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-
-            <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
-
-            <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"TemperatureSensor"</span><span class="o">);</span>
-
-            <span class="c1">// Generate a stream of temperature sensor readings</span>
-            <span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">temp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
-
-            <span class="c1">// Simple filter: Perform analytics on sensor readings to</span>
-            <span class="c1">// detect when the temperature is completely out of the</span>
-            <span class="c1">// optimal range and generate warnings</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">simpleFiltered</span> <span class="o">=</span> <span class="n">temp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
-                    <span class="o">!</span><span class="n">optimalTempRange</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
-            <span class="n">simpleFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature is out of range! "</span>
-                    <span class="o">+</span> <span class="s">"It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
-
-            <span class="c1">// Deadband filter: Perform analytics on sensor readings to</span>
-            <span class="c1">// output the first temperature, and to generate warnings</span>
-            <span class="c1">// when the temperature is out of the optimal range and</span>
-            <span class="c1">// when it returns to normal</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadbandFiltered</span> <span class="o">=</span> <span class="n">Filters</span><span class="o">.</span><span class="na">deadband</span><span class="o">(</span><span class="n">temp</span><span class="o">,</span>
-                    <span class="n">identity</span><span class="o">(),</span> <span class="n">optimalTempRange</span><span class="o">);</span>
-            <span class="n">deadbandFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature may not be "</span>
-                    <span class="o">+</span> <span class="s">"optimal! It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
-
-            <span class="c1">// See what the temperatures look like</span>
-            <span class="n">temp</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
-
-            <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
-        <span class="o">}</span>
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+
+        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"TemperatureSensor"</span><span class="o">);</span>
+
+        <span class="c1">// Generate a stream of temperature sensor readings</span>
+        <span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">temp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+
+        <span class="c1">// Simple filter: Perform analytics on sensor readings to</span>
+        <span class="c1">// detect when the temperature is completely out of the</span>
+        <span class="c1">// optimal range and generate warnings</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">simpleFiltered</span> <span class="o">=</span> <span class="n">temp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
+                <span class="o">!</span><span class="n">optimalTempRange</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
+        <span class="n">simpleFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature is out of range! "</span>
+                <span class="o">+</span> <span class="s">"It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
+
+        <span class="c1">// Deadband filter: Perform analytics on sensor readings to</span>
+        <span class="c1">// output the first temperature, and to generate warnings</span>
+        <span class="c1">// when the temperature is out of the optimal range and</span>
+        <span class="c1">// when it returns to normal</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadbandFiltered</span> <span class="o">=</span> <span class="n">Filters</span><span class="o">.</span><span class="na">deadband</span><span class="o">(</span><span class="n">temp</span><span class="o">,</span>
+                <span class="n">identity</span><span class="o">(),</span> <span class="n">optimalTempRange</span><span class="o">);</span>
+        <span class="n">deadbandFiltered</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Temperature may not be "</span>
+                <span class="o">+</span> <span class="s">"optimal! It is "</span> <span class="o">+</span> <span class="n">tuple</span> <span class="o">+</span> <span class="s">"\u00b0F!"</span><span class="o">));</span>
+
+        <span class="c1">// See what the temperatures look like</span>
+        <span class="n">temp</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+
+        <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 
 <div class="tags">
@@ -797,7 +796,7 @@ Though not covered in this recipe, Ranges offer additional conveniences for crea
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/titlepage.html
----------------------------------------------------------------------
diff --git a/content/titlepage.html b/content/titlepage.html
index 8375574..b63de5a 100644
--- a/content/titlepage.html
+++ b/content/titlepage.html
@@ -582,7 +582,7 @@ $('#toc').on('click', 'a', function() {
       <div class="printTitleArea">
         <div class="printTitle"></div>
         <div class="printSubtitle"></div>
-        <div class="lastGeneratedDate">Last generated: April 29, 2016</div>
+        <div class="lastGeneratedDate">Last generated: May 02, 2016</div>
         <hr />
 
         <div class="printTitleImage">
@@ -629,7 +629,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/tocpage.html
----------------------------------------------------------------------
diff --git a/content/tocpage.html b/content/tocpage.html
index 435772d..9790f88 100644
--- a/content/tocpage.html
+++ b/content/tocpage.html
@@ -793,7 +793,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[6/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/console.html
----------------------------------------------------------------------
diff --git a/content/docs/console.html b/content/docs/console.html
index 6fc9d3a..c19d348 100644
--- a/content/docs/console.html
+++ b/content/docs/console.html
@@ -581,63 +581,65 @@ $('#toc').on('click', 'a', function() {
     
   <h2 id="visualizing-and-monitoring-your-application">Visualizing and monitoring your application</h2>
 
-<p>The Quarks application console is a web application that enables you to visualize your application topology and monitor the tuples flowing through your application.  The kind of oplets used in the topology, as well as the stream tags included in the topology, are also visible in the console.</p>
+<p>The Quarks application console is a web application that enables you to visualize your application topology and monitor the tuples flowing through your application. The kind of oplets used in the topology, as well as the stream tags included in the topology, are also visible in the console.</p>
 
 <h2 id="adding-the-console-web-app-to-your-application">Adding the console web app to your application</h2>
 
 <p>To use the console, you must use the Quarks classes that provide the service to access the console web application or directly call the <code>HttpServer</code> class itself, start the server and then obtain the console URL.</p>
 
 <p>The easiest way to include the console in your application is to use the the <code>DevelopmentProvider</code> class. <code>DevelopmentProvider</code> is a subclass of <code>DirectProvider</code> and adds services such as access to the console web application and counter oplets used to determine tuple counts. You can get the URL for the console from the <code>DevelopmentProvider</code> using the <code>getService</code> method as shown in a hypothetical application shown below:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    import java.util.concurrent.TimeUnit;
-
-    import quarks.console.server.HttpServer;
-    import quarks.providers.development.DevelopmentProvider;
-    import quarks.topology.TStream;
-    import quarks.topology.Topology;
-
-    public class TempSensorApplication {
-        public static void main(String[] args) throws Exception {
-            TempSensor sensor = new TempSensor();
-            DevelopmentProvider dp = new DevelopmentProvider();
-            Topology topology = dp.newTopology();
-            TStream&lt;Double&gt; tempReadings = topology.poll(sensor, 1, TimeUnit.MILLISECONDS);
-            TStream&lt;Double&gt; filteredReadings = tempReadings.filter(reading -&gt; reading &lt; 50 || reading &gt; 80);
-            filteredReadings.print();
-
-            System.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());
-            dp.submit(topology);
-          }
-    }
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">TempSensorApplication</span> <span class="o">{</span>
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+        <span class="n">TempSensor</span> <span class="n">sensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TempSensor</span><span class="o">();</span>
+        <span class="n">DevelopmentProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
+        <span class="n">Topology</span> <span class="n">topology</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">tempReadings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">sensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">);</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">filteredReadings</span> <span class="o">=</span> <span class="n">tempReadings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">reading</span> <span class="o">-&gt;</span> <span class="n">reading</span> <span class="o">&lt;</span> <span class="mi">50</span> <span class="o">||</span> <span class="n">reading</span> <span class="o">&gt;</span> <span class="mi">80</span><span class="o">);</span>
+        <span class="n">filteredReadings</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
+        <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
+    <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
-<p>Note that the console URL is being printed to System.out. The filteredReadings are as well, since filteredReadings.print() is being called in the application.  You may need to scroll your terminal window up to see the output for the console URL.</p>
-
-<p>Optionally, you can modify the above code in the application to have a timeout before submitting the topology, which would allow you to see the console URL before any other output is shown.  The modification would look like this:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">// print the console URL and wait for 10 seconds before submitting the topology
-System.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());
-try {
-  TimeUnit.SECONDS.sleep(10);
-} catch (InterruptedException e) {
-  //do nothing
-}
-dp.submit(topology);
+<p>Note that the console URL is being printed to <code>System.out</code>. The <code>filteredReadings</code> are as well, since <code>filteredReadings.print()</code> is being called in the application. You may need to scroll your terminal window up to see the output for the console URL.</p>
+
+<p>Optionally, you can modify the above code in the application to have a timeout before submitting the topology, which would allow you to see the console URL before any other output is shown. The modification would look like this:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Print the console URL and wait for 10 seconds before submitting the topology</span>
+<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
+<span class="k">try</span> <span class="o">{</span>
+    <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">.</span><span class="na">sleep</span><span class="o">(</span><span class="mi">10</span><span class="o">);</span>
+<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">InterruptedException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
+    <span class="c1">// Do nothing</span>
+<span class="o">}</span>
+<span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
 </code></pre></div>
-<p>The other way to embed the console in your application is shown in the <code>HttpServerSample.java</code> example. It gets the HttpServer instance, starts it, and prints out the console URL.  Note that it does not submit a job, so when the console is displayed in the browser, there are no running jobs and therefore no Topology graph.  The example is meant to show how to get the <code>HttpServer</code> instance, start the console web app and get the URL of the console.</p>
+<p>The other way to embed the console in your application is shown in the <code>HttpServerSample.java</code> example (on <a href="https://github.com/apache/incubator-quarks/blob/master/samples/console/src/main/java/quarks/samples/console/HttpServerSample.java">GitHub</a>). It gets the <code>HttpServer</code> instance, starts it, and prints out the console URL. Note that it does not submit a job, so when the console is displayed in the browser, there are no running jobs and therefore no topology graph. The example is meant to show how to get the <code>HttpServer</code> instance, start the console web app and get the URL of the console.</p>
 
-<h1 id="accessing-the-console">Accessing the console</h1>
+<h2 id="accessing-the-console">Accessing the console</h2>
 
 <p>The console URL has the following format:</p>
 
-<p>http://host_name:port_number/console</p>
+<p><code>http://host_name:port_number/console</code></p>
 
-<p>Once it is obtained from <code>System.out</code>, enter it in a browser window.  </p>
+<p>Once it is obtained from <code>System.out</code>, enter it in a browser window.</p>
 
-<p>If you cannot access the console at this URL, ensure there is a <code>console.war</code> file in the <code>webapps</code> directory.  If the <code>console.war</code> file cannot be found, an exception will be thrown (in std.out) indicating <code>console.war</code> was not found.</p>
+<p>If you cannot access the console at this URL, ensure there is a <code>console.war</code> file in the <code>webapps</code> directory. If the <code>console.war</code> file cannot be found, an exception will be thrown (in <code>std.out</code>) indicating <code>console.war</code> was not found.</p>
 
 <h2 id="consolewaterdetector-sample">ConsoleWaterDetector sample</h2>
 
-<p>To see the features of the console in action and as a way to demonstrate how to monitor a topology in the console, let&#39;s look at the <code>ConsoleWaterDetector</code> sample.
-Prior to running any console applications, the <code>console.war</code> file must be built as mentioned above.  If you are building quarks from a Git repository, go to the top level Quarks directory and run <code>ant</code>.
-Here is an example in my environment:</p>
+<p>To see the features of the console in action and as a way to demonstrate how to monitor a topology in the console, let&#39;s look at the <code>ConsoleWaterDetector</code> sample (on <a href="https://github.com/apache/incubator-quarks/blob/master/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java">GitHub</a>).</p>
+
+<p>Prior to running any console applications, the <code>console.war</code> file must be built as mentioned above. If you are building quarks from a Git repository, go to the top level Quarks directory and run <code>ant</code>.</p>
+
+<p>Here is an example in my environment:</p>
 <div class="highlight"><pre><code class="language-" data-lang="">Susans-MacBook-Pro-247:quarks susancline$ pwd
 /Users/susancline/git/quarks
 Susans-MacBook-Pro-247:quarks susancline$ ant
@@ -674,13 +676,12 @@ Total time: 3 seconds
 <div class="highlight"><pre><code class="language-" data-lang="">Susans-MacBook-Pro-247:quarks susancline$ find . -name console.war -print
 ./target/java8/console/webapps/console.war
 </code></pre></div>
-<p>Now we know we have built <code>console.war</code>, so we&#39;re good to go.
-To run this sample from the command line:</p>
+<p>Now we know we have built <code>console.war</code>, so we&#39;re good to go. To run this sample from the command line:</p>
 <div class="highlight"><pre><code class="language-" data-lang="">Susans-MacBook-Pro-247:quarks susancline$ pwd
 /Users/susancline/git/quarks
 Susans-MacBook-Pro-247:quarks susancline$ java -cp target/java8/samples/lib/quarks.samples.console.jar:. quarks.samples.console.ConsoleWaterDetector
 </code></pre></div>
-<p>If everything is successful, you&#39;ll start seeing output.  You may have to scroll back up to get the URL of the console:</p>
+<p>If everything is successful, you&#39;ll start seeing output. You may have to scroll back up to get the URL of the console:</p>
 <div class="highlight"><pre><code class="language-" data-lang="">Susans-MacBook-Pro-247:quarks susancline$ java -cp target/java8/samples/lib/quarks.samples.console.jar:. quarks.samples.console.ConsoleWaterDetector
 Mar 07, 2016 12:04:52 PM org.eclipse.jetty.util.log.Log initialized
 INFO: Logging initialized @176ms
@@ -710,10 +711,11 @@ Well3 alert, ecoli value is 1
 
 <p><img src='images/console_overview.jpg' alt='First view of the ConsoleWaterDetector app in the console' width='100%'/></p>
 
-<h1 id="consolewaterdetector-application-scenario">ConsoleWaterDetector application scenario</h1>
+<h2 id="consolewaterdetector-application-scenario">ConsoleWaterDetector application scenario</h2>
 
-<p>The application is now running in your browser. Let&#39;s discuss the scenario for the application.
-A county agency is responsible for ensuring the safety of residents well water.  Each well they monitor has four different sensor types:</p>
+<p>The application is now running in your browser. Let&#39;s discuss the scenario for the application.</p>
+
+<p>A county agency is responsible for ensuring the safety of residents well water. Each well they monitor has four different sensor types:</p>
 
 <ul>
 <li>Temperature</li>
@@ -725,79 +727,74 @@ A county agency is responsible for ensuring the safety of residents well water.
 <p>The sample application topology monitors 3 wells:</p>
 
 <ul>
-<li><p>For the hypothetical scenario, Well1 and Well3 produce &#39;unhealthy&#39; values from their sensors on occasion.  Well2 always produces &#39;healthy&#39; values.  </p></li>
-<li><p>Each well that is to be measured is added to the topology.  The topology polls each sensor (temp, ecoli, etc) for each well as a unit.  A TStream&lt;Integer&gt; is returned from polling the toplogy and represents a sensor reading.  Each sensor reading for the well has a tag added to it with the reading type i.e, &quot;temp&quot;, and the well id.  Once all of the sensor readings are obtained and the tags added, each sensor reading is &#39;unioned&#39; into a single TStream&lt;JsonObject&gt;.  Look at the <code>waterDetector</code> method for details on this.</p></li>
-<li><p>Now, each well has a single stream with each of the sensors readings as a property with a name and value in the TStream&lt;JsonObject&gt;.  Next the <code>alertFilter</code> method is called on the TStream&lt;JsonObject&gt; representing each well.  This method checks the values for each well&#39;s sensors to determine if they are &#39;out of range&#39; for healthy values. The <code>filter</code> oplet is used to do this. If any of the sensor&#39;s readings are out of the acceptable range the tuple is passed along. Those that are within an acceptable range are discarded.</p></li>
-<li><p>Next the applications <code>splitAlert</code> method is called on each well&#39;s stream that contains the union of all the sensor readings that are out of range.  The <code>splitAlert</code> method uses the <code>split</code> oplet to split the incoming stream into 5 different streams.  Only those tuples that are out of range for each stream, which represents each sensor type, will be returned. The object returned from <code>splitAlert</code> is a list of TStream&lt;JsonObject&gt; objects. The <code>splitAlert</code> method is shown below:
-```
-public static List<TStream<JsonObject>&gt; splitAlert(TStream<JsonObject> alertStream, int wellId) {</p>
-<div class="highlight"><pre><code class="language-" data-lang="">List&lt;TStream&lt;JsonObject&gt;&gt; allStreams = alertStream.split(5, tuple -&gt; {
-    if (tuple.get("temp") != null) {
-        JsonObject tempObj = new JsonObject();
-        int temp = tuple.get("temp").getAsInt();
-        if (temp &lt;= TEMP_ALERT_MIN || temp &gt;= TEMP_ALERT_MAX) {
-            tempObj.addProperty("temp", temp);
-            return 0;
-        } else {
-            return -1;
-        }
-
-    } else if (tuple.get("acidity") != null){
-        JsonObject acidObj = new JsonObject();
-        int acid = tuple.get("acidity").getAsInt();
-        if (acid &lt;= ACIDITY_ALERT_MIN || acid &gt;= ACIDITY_ALERT_MAX) {
-            acidObj.addProperty("acidity", acid);
-            return 1;
-        } else {
-            return -1;
-        }
-    } else if (tuple.get("ecoli") != null) {
-        JsonObject ecoliObj = new JsonObject();
-        int ecoli = tuple.get("ecoli").getAsInt();
-        if (ecoli &gt;= ECOLI_ALERT) {
-            ecoliObj.addProperty("ecoli", ecoli);
-            return 2;
-        } else {
-            return -1;
-        }
-    } else if (tuple.get("lead") != null) {
-        JsonObject leadObj = new JsonObject();
-        int lead = tuple.get("lead").getAsInt();
-        if (lead &gt;= LEAD_ALERT_MAX) {
-            leadObj.addProperty("lead", lead);
-            return 3;
-        } else {
-            return -1;
-        }
-    } else {
-         return -1;
-    }
-});
-
-return allStreams;
-</code></pre></div>
-<p>}
-```</p></li>
-<li><p>Next we want to get the temperature stream from the first well and put a rate meter on it to determine the rate at which the out of range values are flowing in the stream.
-```
-List<TStream<JsonObject>&gt; individualAlerts1 = splitAlert(filteredReadings1, 1);</p></li>
+<li>For the hypothetical scenario, Well1 and Well3 produce &#39;unhealthy&#39; values from their sensors on occasion. Well2 always produces &#39;healthy&#39; values.</li>
+<li>Each well that is to be measured is added to the topology. The topology polls each sensor (temp, ecoli, etc.) for each well as a unit. A <code>TStream&lt;Integer&gt;</code> is returned from polling the toplogy and represents a sensor reading. Each sensor reading for the well has a tag added to it with the reading type i.e, &quot;temp&quot;, and the well id. Once all of the sensor readings are obtained and the tags added, each sensor reading is &#39;unioned&#39; into a single <code>TStream&lt;JsonObject&gt;</code>. Look at the <code>waterDetector</code> method for details on this.</li>
+<li>Now, each well has a single stream with each of the sensors readings as a property with a name and value in the <code>TStream&lt;JsonObject&gt;</code>. Next the <code>alertFilter</code> method is called on the <code>TStream&lt;JsonObject&gt;</code> representing each well. This method checks the values for each well&#39;s sensors to determine if they are &#39;out of range&#39; for healthy values. The <code>filter</code> oplet is used to do this. If any of the sensor&#39;s readings are out of the acceptable range the tuple is passed along. Those that are within an acceptable range are discarded.</li>
+<li><p>Next the applications&#39; <code>splitAlert</code> method is called on each well&#39;s stream that contains the union of all the sensor readings that are out of range. The <code>splitAlert</code> method uses the <code>split</code> oplet to split the incoming stream into 5 different streams. Only those tuples that are out of range for each stream, which represents each sensor type, will be returned. The object returned from <code>splitAlert</code> is a list of <code>TStream&lt;JsonObject&gt;</code> objects. The <code>splitAlert</code> method is shown below:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;&gt;</span> <span class="n">splitAlert</span><span class="o">(</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">alertStream</span><span class="o">,</span> <span class="kt">int</span> <span class="n">wellId</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;&gt;</span> <span class="n">allStreams</span> <span class="o">=</span> <span class="n">alertStream</span><span class="o">.</span><span class="na">split</span><span class="o">(</span><span class="mi">5</span><span class="o">,</span> <span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
+        <span class="k">if</span> <span class="o">(</span><span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"temp"</span><span class="o">)</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">JsonObject</span> <span class="n">tempObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+            <span class="kt">int</span> <span class="n">temp</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"temp"</span><span class="o">).</span><span class="na">getAsInt</span><span class="o">();</span>
+            <span class="k">if</span> <span class="o">(</span><span class="n">temp</span> <span class="o">&lt;=</span> <span class="n">TEMP_ALERT_MIN</span> <span class="o">||</span> <span class="n">temp</span> <span class="o">&gt;=</span> <span class="n">TEMP_ALERT_MAX</span><span class="o">)</span> <span class="o">{</span>
+                <span class="n">tempObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"temp"</span><span class="o">,</span> <span class="n">temp</span><span class="o">);</span>
+                <span class="k">return</span> <span class="mi">0</span><span class="o">;</span>
+            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
+                <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
+            <span class="o">}</span>
+        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"acidity"</span><span class="o">)</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">){</span>
+            <span class="n">JsonObject</span> <span class="n">acidObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+            <span class="kt">int</span> <span class="n">acid</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"acidity"</span><span class="o">).</span><span class="na">getAsInt</span><span class="o">();</span>
+            <span class="k">if</span> <span class="o">(</span><span class="n">acid</span> <span class="o">&lt;=</span> <span class="n">ACIDITY_ALERT_MIN</span> <span class="o">||</span> <span class="n">acid</span> <span class="o">&gt;=</span> <span class="n">ACIDITY_ALERT_MAX</span><span class="o">)</span> <span class="o">{</span>
+                <span class="n">acidObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"acidity"</span><span class="o">,</span> <span class="n">acid</span><span class="o">);</span>
+                <span class="k">return</span> <span class="mi">1</span><span class="o">;</span>
+            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
+                <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
+            <span class="o">}</span>
+        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"ecoli"</span><span class="o">)</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">JsonObject</span> <span class="n">ecoliObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+            <span class="kt">int</span> <span class="n">ecoli</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"ecoli"</span><span class="o">).</span><span class="na">getAsInt</span><span class="o">();</span>
+            <span class="k">if</span> <span class="o">(</span><span class="n">ecoli</span> <span class="o">&gt;=</span> <span class="n">ECOLI_ALERT</span><span class="o">)</span> <span class="o">{</span>
+                <span class="n">ecoliObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"ecoli"</span><span class="o">,</span> <span class="n">ecoli</span><span class="o">);</span>
+                <span class="k">return</span> <span class="mi">2</span><span class="o">;</span>
+            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
+                <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
+            <span class="o">}</span>
+        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"lead"</span><span class="o">)</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">JsonObject</span> <span class="n">leadObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+            <span class="kt">int</span> <span class="n">lead</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"lead"</span><span class="o">).</span><span class="na">getAsInt</span><span class="o">();</span>
+            <span class="k">if</span> <span class="o">(</span><span class="n">lead</span> <span class="o">&gt;=</span> <span class="n">LEAD_ALERT_MAX</span><span class="o">)</span> <span class="o">{</span>
+                <span class="n">leadObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"lead"</span><span class="o">,</span> <span class="n">lead</span><span class="o">);</span>
+                <span class="k">return</span> <span class="mi">3</span><span class="o">;</span>
+            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
+                <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
+            <span class="o">}</span>
+        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
+             <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
+        <span class="o">}</span>
+    <span class="o">});</span>
+
+    <span class="k">return</span> <span class="n">allStreams</span><span class="o">;</span>
+<span class="o">}</span>
+</code></pre></div></li>
+<li><p>Next we want to get the temperature stream from the first well and put a rate meter on it to determine the rate at which the out of range values are flowing in the stream</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;&gt;</span> <span class="n">individualAlerts1</span> <span class="o">=</span> <span class="n">splitAlert</span><span class="o">(</span><span class="n">filteredReadings1</span><span class="o">,</span> <span class="mi">1</span><span class="o">);</span>
+
+<span class="c1">// Put a rate meter on well1's temperature sensor output</span>
+<span class="n">Metrics</span><span class="o">.</span><span class="na">rateMeter</span><span class="o">(</span><span class="n">individualAlerts1</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">));</span>
+</code></pre></div></li>
+<li><p>Next all the sensors for well 1 have tags added to the stream indicating the stream is out of range for that sensor and the well id. Next a sink is added, passing the tuple to a <code>Consumer</code> that formats a string to <code>System.out</code> containing the well id, alert type (sensor type) and value of the sensor.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Put a rate meter on well1's temperature sensor output</span>
+<span class="n">Metrics</span><span class="o">.</span><span class="na">rateMeter</span><span class="o">(</span><span class="n">individualAlerts1</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">));</span>
+<span class="n">individualAlerts1</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="n">TEMP_ALERT_TAG</span><span class="o">,</span> <span class="s">"well1"</span><span class="o">).</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"\n"</span> <span class="o">+</span> <span class="n">formatAlertOutput</span><span class="o">(</span><span class="n">tuple</span><span class="o">,</span> <span class="s">"1"</span><span class="o">,</span> <span class="s">"temp"</span><span class="o">)));</span>
+<span class="n">individualAlerts1</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">1</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="n">ACIDITY_ALERT_TAG</span><span class="o">,</span> <span class="s">"well1"</span><span class="o">).</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">formatAlertOutput</span><span class="o">(</span><span class="n">tuple</span><span class="o">,</span> <span class="s">"1"</span><span class="o">,</span> <span class="s">"acidity"</span><span class="o">)));</span>
+<span class="n">individualAlerts1</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">2</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="n">ECOLI_ALERT_TAG</span><span class="o">,</span> <span class="s">"well1"</span><span class="o">).</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">formatAlertOutput</span><span class="o">(</span><span class="n">tuple</span><span class="o">,</span> <span class="s">"1"</span><span class="o">,</span> <span class="s">"ecoli"</span><span class="o">)));</span>
+<span class="n">individualAlerts1</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">3</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="n">LEAD_ALERT_TAG</span><span class="o">,</span> <span class="s">"well1"</span><span class="o">).</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">formatAlertOutput</span><span class="o">(</span><span class="n">tuple</span><span class="o">,</span> <span class="s">"1"</span><span class="o">,</span> <span class="s">"lead"</span><span class="o">)));</span>
+</code></pre></div></li>
 </ul>
 
-<p>// Put a rate meter on well1&#39;s temperature sensor output
-   Metrics.rateMeter(individualAlerts1.get(0));
-<code>
-* Next all the sensors for well 1 have tags added to the stream indicating the stream is out of range for that sensor and the well id.  Next a sink is added, passing the tuple to a `Consumer` that formats a string to `System.out` containing the well Id, alert type (sensor type) and value of the sensor.  
-</code>
-// Put a rate meter on well1&#39;s temperature sensor output
-Metrics.rateMeter(individualAlerts1.get(0));
-individualAlerts1.get(0).tag(TEMP_ALERT_TAG, &quot;well1&quot;).sink(tuple -&gt; System.out.println(&quot;\n&quot; + formatAlertOutput(tuple, &quot;1&quot;, &quot;temp&quot;)));
-individualAlerts1.get(1).tag(ACIDITY_ALERT_TAG, &quot;well1&quot;).sink(tuple -&gt; System.out.println(formatAlertOutput(tuple, &quot;1&quot;, &quot;acidity&quot;)));
-individualAlerts1.get(2).tag(ECOLI_ALERT_TAG, &quot;well1&quot;).sink(tuple -&gt; System.out.println(formatAlertOutput(tuple, &quot;1&quot;, &quot;ecoli&quot;)));
-individualAlerts1.get(3).tag(LEAD_ALERT_TAG, &quot;well1&quot;).sink(tuple -&gt; System.out.println(formatAlertOutput(tuple, &quot;1&quot;, &quot;lead&quot;)));
-<code>
-Output in the terminal window from the `formatAlertOutput` method will look like this:
-</code>
-Well1 alert, temp value is 86
+<p>Output in the terminal window from the <code>formatAlertOutput</code> method will look like this:</p>
+<div class="highlight"><pre><code class="language-" data-lang="">Well1 alert, temp value is 86
 Well3 alert, ecoli value is 2
 Well1 alert, ecoli value is 1
 Well3 alert, acidity value is 1
@@ -805,29 +802,28 @@ Well1 alert, lead value is 12
 Well1 alert, ecoli value is 2
 Well3 alert, lead value is 10
 Well3 alert, acidity value is 10
-```</p>
-
+</code></pre></div>
 <p>Notice how only those streams that are out of range for the temperature sensor type show output.</p>
 
 <h2 id="detecting-zero-tuple-counts">Detecting zero tuple counts</h2>
 
 <p>At the end of the <code>ConsoleWaterDetector</code> application is this snippet of code, added after the topology has been submitted:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">dp.submit(wellTopology);
-
-while (true) {
-                MetricRegistry metricRegistry = dp.getServices().getService(MetricRegistry.class);
-                SortedMap&lt;String, Counter&gt; counters = metricRegistry.getCounters();
-
-                Set&lt;Entry&lt;String, Counter&gt;&gt; values = counters.entrySet();
-                for (Entry&lt;String, Counter&gt; e : values) {
-                    if (e.getValue().getCount() == 0) {
-                        System.out.println("Counter Op:" + e.getKey() + " tuple count: " + e.getValue().getCount());
-                    }
-                }
-                Thread.sleep(2000);
-        }
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">wellTopology</span><span class="o">);</span>
+
+<span class="k">while</span> <span class="o">(</span><span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">MetricRegistry</span> <span class="n">metricRegistry</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">MetricRegistry</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+    <span class="n">SortedMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Counter</span><span class="o">&gt;</span> <span class="n">counters</span> <span class="o">=</span> <span class="n">metricRegistry</span><span class="o">.</span><span class="na">getCounters</span><span class="o">();</span>
+
+    <span class="n">Set</span><span class="o">&lt;</span><span class="n">Entry</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Counter</span><span class="o">&gt;&gt;</span> <span class="n">values</span> <span class="o">=</span> <span class="n">counters</span><span class="o">.</span><span class="na">entrySet</span><span class="o">();</span>
+    <span class="k">for</span> <span class="o">(</span><span class="n">Entry</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Counter</span><span class="o">&gt;</span> <span class="n">e</span> <span class="o">:</span> <span class="n">values</span><span class="o">)</span> <span class="o">{</span>
+        <span class="k">if</span> <span class="o">(</span><span class="n">e</span><span class="o">.</span><span class="na">getValue</span><span class="o">().</span><span class="na">getCount</span><span class="o">()</span> <span class="o">==</span> <span class="mi">0</span><span class="o">)</span> <span class="o">{</span>
+            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Counter Op:"</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="na">getKey</span><span class="o">()</span> <span class="o">+</span> <span class="s">" tuple count: "</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="na">getValue</span><span class="o">().</span><span class="na">getCount</span><span class="o">());</span>
+        <span class="o">}</span>
+    <span class="o">}</span>
+    <span class="n">Thread</span><span class="o">.</span><span class="na">sleep</span><span class="o">(</span><span class="mi">2000</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
-<p>What this does is get all the counters in the <code>MetricRegistry</code> class and print out the name of the counter oplet they are monitoring along with the tuple count if it is zero.  Here is some sample output:</p>
+<p>What this does is get all the counters in the <code>MetricRegistry</code> class and print out the name of the counter oplet they are monitoring along with the tuple count if it is zero. Here is some sample output:</p>
 <div class="highlight"><pre><code class="language-" data-lang="">Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_44 has a tuple count of zero!
 Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_45 has a tuple count of zero!
 Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_46 has a tuple count of zero!
@@ -841,45 +837,45 @@ Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_98 has a tuple count of zero!
 <p>To summarize what the application is doing:</p>
 
 <ul>
-<li>Unions all sensor type readings for a single well.</li>
-<li>Filters all sensor type readings for a single well, passing on an object that only contains tuples for the object that have at least one sensor type with out of range values.</li>
-<li>Splits the object that contained name/value pairs for sensor type and readings into individual sensor types returning only those streams that contain out of range values.</li>
-<li>Outputs to the command line the well id, sensor type and value that is out of range.</li>
-<li>Tags are added at various points in the topology for easier identification of either the well or some out of range condition.</li>
-<li>The topology contains counters to measure tuple counts since <code>DevelopmentProvider</code> was used.</li>
-<li>Individual rate meters were placed on well1 and well3&#39;s temperature sensors to determine the rate of &#39;unhealthy&#39; values.</li>
-<li>Prints out the name of the counter oplets whose tuple counts are zero.</li>
+<li>Unions all sensor type readings for a single well</li>
+<li>Filters all sensor type readings for a single well, passing on an object that only contains tuples for the object that have at least one sensor type with out of range values</li>
+<li>Splits the object that contained name/value pairs for sensor type and readings into individual sensor types returning only those streams that contain out of range values</li>
+<li>Outputs to the command line the well id, sensor type and value that is out of range</li>
+<li>Tags are added at various points in the topology for easier identification of either the well or some out of range condition</li>
+<li>The topology contains counters to measure tuple counts since <code>DevelopmentProvider</code> was used</li>
+<li>Individual rate meters were placed on <code>well1</code> and <code>well3</code>&#39;s temperature sensors to determine the rate of &#39;unhealthy&#39; values</li>
+<li>Prints out the name of the counter oplets whose tuple counts are zero</li>
 </ul>
 
-<h1 id="topology-graph-controls">Topology graph controls</h1>
+<h2 id="topology-graph-controls">Topology graph controls</h2>
 
-<p>Now that you have an understanding of what the application is doing, let&#39;s look at some of the controls in the console, so we can learn how to monitor the application.  Below is a screen shot of the top controls: the controls that affect the Topology Graph.</p>
+<p>Now that you have an understanding of what the application is doing, let&#39;s look at some of the controls in the console, so we can learn how to monitor the application. Below is a screen shot of the top controls: the controls that affect the Topology Graph.</p>
 
 <p><img src='images/console_top_controls.jpg' alt='The controls that impact the topology graph' width='100%'/></p>
 
 <ul>
-<li><strong>Job</strong>: A drop down to select which job is being displayed in the Topology Graph.  An application can contain multiple jobs.</li>
-<li><strong>State</strong>: Hovering over the &#39;State&#39; icon shows information about the selected job.  The current and next states of the job, the job id and the job name.</li>
-<li><strong>View by</strong>: This select is used to change how the topology graph is displayed.  The three options for this select are:
+<li><strong>Job</strong>: A drop down to select which job is being displayed in the Topology Graph. An application can contain multiple jobs.</li>
+<li><strong>State</strong>: Hovering over the &#39;State&#39; icon shows information about the selected job. The current and next states of the job, the job id and the job name.</li>
+<li><strong>View by</strong>: This select is used to change how the topology graph is displayed. The three options for this select are:
 
 <ul>
 <li>Static flow</li>
 <li>Tuple count</li>
 <li>Oplet kind</li>
-<li>Currently it is set to &#39;Static flow&#39;. This means the oplets (represented as circles in the topology graph) do not change size, nor do the lines or links (representing the edges of the topology graph) change width or position.  The graph is not being refreshed when it is in &#39;Static flow&#39; mode.</li>
+<li>Currently it is set to &#39;Static flow&#39;. This means the oplets (represented as circles in the topology graph) do not change size, nor do the lines or links (representing the edges of the topology graph) change width or position. The graph is not being refreshed when it is in &#39;Static flow&#39; mode.</li>
 </ul></li>
-<li><strong>Refresh interval</strong>: Allows the user to select an interval between 3 - 20 seconds to refresh the tuple count values in the graph. Every X seconds the metrics for the topology graph are refreshed.  More about metrics a little bit later.</li>
-<li><strong>Pause graph</strong>: Stops the refresh interval timer.  Once the &#39;Pause graph&#39; button is clicked, the user must push &#39;Resume graph&#39; for the graph to be updated, and then refreshed at the interval set in the &#39;Refresh interval&#39; timer.  It can be helpful to pause the graph if multiple oplets are occupying the same area on the graph, and their names become unreadable. Once the graph is paused, the user can drag an oplet off of another oplet to better view the name and see the edge(s) that connect them.</li>
+<li><strong>Refresh interval</strong>: Allows the user to select an interval between 3 - 20 seconds to refresh the tuple count values in the graph. Every X seconds the metrics for the topology graph are refreshed. More about metrics a little bit later.</li>
+<li><strong>Pause graph</strong>: Stops the refresh interval timer. Once the &#39;Pause graph&#39; button is clicked, the user must push &#39;Resume graph&#39; for the graph to be updated, and then refreshed at the interval set in the &#39;Refresh interval&#39; timer. It can be helpful to pause the graph if multiple oplets are occupying the same area on the graph, and their names become unreadable. Once the graph is paused, the user can drag an oplet off of another oplet to better view the name and see the edge(s) that connect them.</li>
 <li><strong>Show tags</strong>: If the checkbox appears in the top controls, it means:
 
 <ul>
-<li>The &#39;View by&#39; layer is capable of displaying stream tags.</li>
-<li>The topology currently shown in the topology graph has stream tags associated with it.</li>
+<li>The &#39;View by&#39; layer is capable of displaying stream tags</li>
+<li>The topology currently shown in the topology graph has stream tags associated with it</li>
 </ul></li>
-<li><strong>Show all tags</strong>: Selecting this checkbox shows all the tags present in the topology.  If you want to see only certain tags, uncheck this box and select the button labeled &#39;Select individual tags ...&#39;.  A dialog will appear, and you can select one or all of the tags listed in the dialog which are present in the topology.</li>
-</ul>
+<li><p><strong>Show all tags</strong>: Selecting this checkbox shows all the tags present in the topology. If you want to see only certain tags, uncheck this box and select the button labeled &#39;Select individual tags ...&#39;. A dialog will appear, and you can select one or all of the tags listed in the dialog which are present in the topology.</p>
 
-<p><img src='images/console_select_individual_tags.jpg' /></p>
+<p><img src='images/console_select_individual_tags.jpg'/></p></li>
+</ul>
 
 <p>The next aspect of the console we&#39;ll look at are the popups available when selecting &#39;View all oplet properties&#39;, hovering over an oplet and hovering over an edge (link).</p>
 
@@ -887,38 +883,39 @@ Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_98 has a tuple count of zero!
 
 <p><img src='images/console_oplet_properties.jpg' alt='Displays a table showing the relationship between the oplets and vertices' width='100%'/></p>
 
-<p>Looking at the sixth line in the table, where the Name is &#39;OP_5&#39;, we can see that the Oplet kind is a Map, a (quarks.oplet.functional.Map), the Tuple count is 0 (this is because the view is in Static flow mode - the graph does not show the number of tuples flowing in it), the source oplet is &#39;OP_55&#39;, the target oplet is &#39;OP_60&#39;, and there are no stream tags coming from the source or target streams.  Relationships for all oplets can be viewed in this manner.</p>
+<p>Looking at the sixth line in the table, where the Name is &#39;OP_5&#39;, we can see that the Oplet kind is a <code>Map</code>, a <code>quarks.oplet.functional.Map</code>, the Tuple count is 0 (this is because the view is in Static flow mode - the graph does not show the number of tuples flowing in it), the source oplet is &#39;OP_55&#39;, the target oplet is &#39;OP_60&#39;, and there are no stream tags coming from the source or target streams. Relationships for all oplets can be viewed in this manner.</p>
 
 <p>Now, looking at the graph, if we want to see the relationships for a single oplet, we can hover over it. The image below shows the hover when we are over &#39;OP_5&#39;.</p>
 
 <p><img src='images/console_hover_over_op.jpg' width='100%'/></p>
 
-<p>You can also hover over the edges of the topology graph to get information.  Hover over the edge (link) between &#39;OP_0&#39; and &#39;OP_55&#39;.  The image shows the name and kind of the oplet as the source, and the name and kind of oplet as the target.  Again the tuple count is 0 since this is the &#39;Static flow&#39; view.  The last item of information in the tooltip is the tags on the stream.
-One or many tags can be added to a stream.  In this case we see the tags &#39;temperature&#39; and &#39;well1&#39;.</p>
+<p>You can also hover over the edges of the topology graph to get information. Hover over the edge (link) between &#39;OP_0&#39; and &#39;OP_55&#39;. The image shows the name and kind of the oplet as the source, and the name and kind of oplet as the target. Again the tuple count is 0 since this is the &#39;Static flow&#39; view. The last item of information in the tooltip is the tags on the stream.</p>
 
-<p><img src='images/console_hover_over_link.jpg' /></p>
+<p>One or many tags can be added to a stream. In this case we see the tags &#39;temperature&#39; and &#39;well1&#39;.</p>
+
+<p><img src='images/console_hover_over_link.jpg'/></p>
 
 <p>The section of the code that adds the tags &#39;temperature&#39; and &#39;well1&#39; is in the <code>waterDetector</code> method of the <code>ConsoleWaterDetector</code> class.</p>
-<div class="highlight"><pre><code class="language-" data-lang="">public static TStream&lt;JsonObject&gt; waterDetector(Topology topology, int wellId) {
-  Random rNum = new Random();
-  TStream&lt;Integer&gt; temp = topology.poll(() -&gt; rNum.nextInt(TEMP_RANDOM_HIGH - TEMP_RANDOM_LOW) + TEMP_RANDOM_LOW, 1, TimeUnit.SECONDS);
-  TStream&lt;Integer&gt; acidity = topology.poll(() -&gt; rNum.nextInt(ACIDITY_RANDOM_HIGH - ACIDITY_RANDOM_LOW) + ACIDITY_RANDOM_LOW, 1, TimeUnit.SECONDS);
-  TStream&lt;Integer&gt; ecoli = topology.poll(() -&gt; rNum.nextInt(ECOLI_RANDOM_HIGH - ECOLI_RANDOM_LOW) + ECOLI_RANDOM_LOW, 1, TimeUnit.SECONDS);
-  TStream&lt;Integer&gt; lead = topology.poll(() -&gt; rNum.nextInt(LEAD_RANDOM_HIGH - LEAD_RANDOM_LOW) + LEAD_RANDOM_LOW, 1, TimeUnit.SECONDS);
-  TStream&lt;Integer&gt; id = topology.poll(() -&gt; wellId, 1, TimeUnit.SECONDS);
-
-  // add tags to each sensor
-  temp.tag("temperature", "well" + wellId);
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">waterDetector</span><span class="o">(</span><span class="n">Topology</span> <span class="n">topology</span><span class="o">,</span> <span class="kt">int</span> <span class="n">wellId</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">Random</span> <span class="n">rNum</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Random</span><span class="o">();</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">temp</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span> <span class="o">-&gt;</span> <span class="n">rNum</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="n">TEMP_RANDOM_HIGH</span> <span class="o">-</span> <span class="n">TEMP_RANDOM_LOW</span><span class="o">)</span> <span class="o">+</span> <span class="n">TEMP_RANDOM_LOW</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">acidity</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span> <span class="o">-&gt;</span> <span class="n">rNum</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="n">ACIDITY_RANDOM_HIGH</span> <span class="o">-</span> <span class="n">ACIDITY_RANDOM_LOW</span><span class="o">)</span> <span class="o">+</span> <span class="n">ACIDITY_RANDOM_LOW</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">ecoli</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span> <span class="o">-&gt;</span> <span class="n">rNum</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="n">ECOLI_RANDOM_HIGH</span> <span class="o">-</span> <span class="n">ECOLI_RANDOM_LOW</span><span class="o">)</span> <span class="o">+</span> <span class="n">ECOLI_RANDOM_LOW</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">lead</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span> <span class="o">-&gt;</span> <span class="n">rNum</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="n">LEAD_RANDOM_HIGH</span> <span class="o">-</span> <span class="n">LEAD_RANDOM_LOW</span><span class="o">)</span> <span class="o">+</span> <span class="n">LEAD_RANDOM_LOW</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">id</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span> <span class="o">-&gt;</span> <span class="n">wellId</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+
+    <span class="c1">// add tags to each sensor</span>
+    <span class="n">temp</span><span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"temperature"</span><span class="o">,</span> <span class="s">"well"</span> <span class="o">+</span> <span class="n">wellId</span><span class="o">);</span>
 </code></pre></div>
-<h1 id="legend">Legend</h1>
+<h3 id="legend">Legend</h3>
 
-<p>The legend(s) that appear in the console depend on the view currently displayed.  In the static flow mode, if no stream tags are present, there is no legend.  In this example we have stream tags in the topology, so the static flow mode gives us the option to select &#39;Show tags&#39;.  If selected, the result is the addition of the Stream tags legend:</p>
+<p>The legend(s) that appear in the console depend on the view currently displayed. In the static flow mode, if no stream tags are present, there is no legend. In this example we have stream tags in the topology, so the static flow mode gives us the option to select &#39;Show tags&#39;. If selected, the result is the addition of the stream tags legend:</p>
 
-<p><img src='images/console_stream_tags_legend.jpg' /></p>
+<p><img src='images/console_stream_tags_legend.jpg'/></p>
 
 <p>This legend shows all the tags that have been added to the topology, regardless of whether or not &#39;Show all tags&#39; is checked or specific tags have been selected from the dialog that appears when the &#39;Select individual tags ...&#39; button is clicked.</p>
 
-<h1 id="topology-graph">Topology graph</h1>
+<h3 id="topology-graph">Topology graph</h3>
 
 <p>Now that we&#39;ve covered most of the ways to modify the view of the topology graph and discussed the application, let&#39;s look at the topology graph as a way to understand our application.</p>
 
@@ -926,45 +923,43 @@ One or many tags can be added to a stream.  In this case we see the tags &#39;te
 
 <ul>
 <li>Topology of the application - how the edges and vertices of the graph are related</li>
-<li>Tuple flow  - tuple counts since the application was started</li>
+<li>Tuple flow - tuple counts since the application was started</li>
 <li>The affect of filters or maps on the downstream streams</li>
 <li>Stream tags - if tags are added dynamically based on a condition, where the streams with tags are displayed in the topology</li>
 </ul>
 
-<p>Let&#39;s start with the static flow view of the topology.  We can look at the graph, and we can also hover over any of the oplets or streams to better understand the connections.  Also, we can click &#39;View all oplet properties&#39; and see the relationships in a tabular format.</p>
+<p>Let&#39;s start with the static flow view of the topology. We can look at the graph, and we can also hover over any of the oplets or streams to better understand the connections. Also, we can click &#39;View all oplet properties&#39; and see the relationships in a tabular format.</p>
 
-<p>The other thing to notice in the static flow view are the tags.  Look for any colored edges (the links between the oplets).
-All of the left-most oplets have streams with tags.  Most of them have the color that corresponds to &#39;Multiple tags&#39;.  If you hover over the edges, you can see the tags.  It&#39;s obvious that we have tagged each sensor with the sensor type and the well id.</p>
+<p>The other thing to notice in the static flow view are the tags. Look for any colored edges (the links between the oplets). All of the left-most oplets have streams with tags. Most of them have the color that corresponds to &#39;Multiple tags&#39;. If you hover over the edges, you can see the tags. It&#39;s obvious that we have tagged each sensor with the sensor type and the well id.</p>
 
-<p>Now, if you look to the far right, you can see more tags on streams coming out of a <code>split</code> oplet.  They also have multiple tags, and hovering over them you can determine that they represent out of range values for each sensor type for the well.  Notice how the <code>split</code> oplet, OP_43, has no tags in the streams coming out of it.  If you follow that split oplet back, you can determine from the first tags that it is part of the well 2 stream.</p>
+<p>Now, if you look to the far right, you can see more tags on streams coming out of a <code>split</code> oplet. They also have multiple tags, and hovering over them you can determine that they represent out of range values for each sensor type for the well. Notice how the <code>split</code> oplet, OP_43, has no tags in the streams coming out of it. If you follow that split oplet back, you can determine from the first tags that it is part of the well 2 stream.</p>
 
-<p>If you refer back to the <code>ConsoleWaterDetector</code> source, you can see that no tags were placed on the streams coming out of well2&#39;s split because they contained no out of range values.</p>
+<p>If you refer back to the <code>ConsoleWaterDetector</code> source, you can see that no tags were placed on the streams coming out of <code>well2</code>&#39;s split because they contained no out of range values.</p>
 
-<p>Let&#39;s switch the view to Oplet kind now.  It will make more clear which oplets are producing the streams with the tags on them.
-Below is an image of how the graph looks after switching to the Oplet kind view.</p>
+<p>Let&#39;s switch the view to Oplet kind now. It will make more clear which oplets are producing the streams with the tags on them. Below is an image of how the graph looks after switching to the Oplet kind view.</p>
 
 <p><img src="images/console_oplet_kind.jpg" width='100%'/></p>
 
-<p>In the Oplet kind view the links are all the same width, but the circles representing the oplets are sized according to tuple flow.  Notice how the circles representing OP_10, OP_32 and OP_21 are large in relation to OP_80, OP_88 and OP_89.  As a matter of fact, we can&#39;t even see the circle representing OP_89.  Looking at OP_35 and then the Oplet kind legend, you can see by the color that it is a Filter oplet.  This is because the filter that we used against well2, which is the stream that OP_35 is part of returned no tuples.  This is a bit difficult to see. Let&#39;s look at the Tuple count view.</p>
+<p>In the Oplet kind view the links are all the same width, but the circles representing the oplets are sized according to tuple flow. Notice how the circles representing OP_10, OP_32 and OP_21 are large in relation to OP_80, OP_88 and OP_89. As a matter of fact, we can&#39;t even see the circle representing OP_89. Looking at OP_35 and then the Oplet kind legend, you can see by the color that it is a Filter oplet. This is because the filter that we used against <code>well2</code>, which is the stream that OP_35 is part of returned no tuples. This is a bit difficult to see. Let&#39;s look at the Tuple count view.</p>
 
-<p>The Tuple count view will make it more clear that no tuples are following out of OP_35, which represents the filter for well2 and only returns out of range values.  You may recall that in this example well2 returned no out of range values.  Below is the screen shot of the graph in &#39;Tuple count&#39; view mode.</p>
+<p>The Tuple count view will make it more clear that no tuples are following out of OP_35, which represents the filter for <code>well2</code> and only returns out of range values. You may recall that in this example <code>well2</code> returned no out of range values. Below is the screen shot of the graph in &#39;Tuple count&#39; view mode.</p>
 
 <p><img src="images/console_tuple_count.jpg" width='100%'/></p>
 
-<p>The topology graph oplets can sometimes sit on top of each other.  If this is the case, pause the refresh and use your mouse to pull down on the oplets that are in the same position. This will allow you to see their name.  Alternately, you can use the &#39;View all properties&#39; table to see the relationships between oplets.</p>
+<p>The topology graph oplets can sometimes sit on top of each other. If this is the case, pause the refresh and use your mouse to pull down on the oplets that are in the same position. This will allow you to see their name. Alternately, you can use the &#39;View all properties&#39; table to see the relationships between oplets.</p>
 
-<h1 id="metrics">Metrics</h1>
+<h3 id="metrics">Metrics</h3>
 
-<p>If you scroll the browser window down, you can see a Metrics section.  This section appears when the application contains the following:</p>
+<p>If you scroll the browser window down, you can see a Metrics section. This section appears when the application contains the following:</p>
 
 <ul>
-<li>A <code>DevelopmentProvider</code> is used; this automatically inserts counters on the streams of the topology.</li>
-<li>A <code>quarks.metrics.Metric.Counter</code> or <code>quarks.metrics.Metric.RateMeter</code> is added to an individual stream.</li>
+<li>A <code>DevelopmentProvider</code> is used; this automatically inserts counters on the streams of the topology</li>
+<li>A <code>quarks.metrics.Metric.Counter</code> or <code>quarks.metrics.Metric.RateMeter</code> is added to an individual stream</li>
 </ul>
 
 <h2 id="counters">Counters</h2>
 
-<p>In the <code>ConsoleWaterDetector</code> application we used a <code>DevelopmentProvider</code>.  Therefore, counters were added to most streams (edges) with the following exceptions (from the javadoc for <code>quarks.metrics.Metric.Counter</code>):</p>
+<p>In the <code>ConsoleWaterDetector</code> application we used a <code>DevelopmentProvider</code>. Therefore, counters were added to most streams (edges) with the following exceptions (from the <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/metrics/Metrics.html#counter-quarks.topology.TStream-">Javadoc</a> for <code>quarks.metrics.Metrics</code>):</p>
 
 <p><em>Oplets are only inserted upstream from a FanOut oplet.</em></p>
 
@@ -973,46 +968,47 @@ Below is an image of how the graph looks after switching to the Oplet kind view.
 <p><em>If a chain of Peek oplets is followed by a FanOut, a metric oplet is inserted between the last Peek and the FanOut oplet.
 The implementation is not idempotent; previously inserted metric oplets are treated as regular graph vertices. Calling the method twice will insert a new set of metric oplets into the graph.</em></p>
 
-<p>Also, the application inserts counters on well2&#39;s streams after the streams from the individual sensors were unioned and then split:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    List&lt;TStream&lt;JsonObject&gt;&gt; individualAlerts2 = splitAlert(filteredReadings2, 2);
+<p>Also, the application inserts counters on <code>well2</code>&#39;s streams after the streams from the individual sensors were unioned and then split:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;&gt;</span> <span class="n">individualAlerts2</span> <span class="o">=</span> <span class="n">splitAlert</span><span class="o">(</span><span class="n">filteredReadings2</span><span class="o">,</span> <span class="mi">2</span><span class="o">);</span>
 
-    TStream&lt;JsonObject&gt; alert0Well2 = individualAlerts2.get(0);
-    alert0Well2  = Metrics.counter(alert0Well2);
-    alert0Well2.tag("well2", "temp");
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">alert0Well2</span> <span class="o">=</span> <span class="n">individualAlerts2</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">);</span>
+<span class="n">alert0Well2</span>  <span class="o">=</span> <span class="n">Metrics</span><span class="o">.</span><span class="na">counter</span><span class="o">(</span><span class="n">alert0Well2</span><span class="o">);</span>
+<span class="n">alert0Well2</span><span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"well2"</span><span class="o">,</span> <span class="s">"temp"</span><span class="o">);</span>
 
-    TStream&lt;JsonObject&gt; alert1Well2 = individualAlerts2.get(1);
-    alert1Well2  = Metrics.counter(alert1Well2);
-    alert1Well2.tag("well2", "acidity");
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">alert1Well2</span> <span class="o">=</span> <span class="n">individualAlerts2</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">1</span><span class="o">);</span>
+<span class="n">alert1Well2</span>  <span class="o">=</span> <span class="n">Metrics</span><span class="o">.</span><span class="na">counter</span><span class="o">(</span><span class="n">alert1Well2</span><span class="o">);</span>
+<span class="n">alert1Well2</span><span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"well2"</span><span class="o">,</span> <span class="s">"acidity"</span><span class="o">);</span>
 
-    TStream&lt;JsonObject&gt; alert2Well2 = individualAlerts2.get(2);
-    alert2Well2  = Metrics.counter(alert2Well2);
-    alert2Well2.tag("well2", "ecoli");
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">alert2Well2</span> <span class="o">=</span> <span class="n">individualAlerts2</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">2</span><span class="o">);</span>
+<span class="n">alert2Well2</span>  <span class="o">=</span> <span class="n">Metrics</span><span class="o">.</span><span class="na">counter</span><span class="o">(</span><span class="n">alert2Well2</span><span class="o">);</span>
+<span class="n">alert2Well2</span><span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"well2"</span><span class="o">,</span> <span class="s">"ecoli"</span><span class="o">);</span>
 
-    TStream&lt;JsonObject&gt; alert3Well2 = individualAlerts2.get(3);
-    alert3Well2  = Metrics.counter(alert3Well2);
-    alert3Well2.tag("well2", "lead");
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">alert3Well2</span> <span class="o">=</span> <span class="n">individualAlerts2</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">3</span><span class="o">);</span>
+<span class="n">alert3Well2</span>  <span class="o">=</span> <span class="n">Metrics</span><span class="o">.</span><span class="na">counter</span><span class="o">(</span><span class="n">alert3Well2</span><span class="o">);</span>
+<span class="n">alert3Well2</span><span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"well2"</span><span class="o">,</span> <span class="s">"lead"</span><span class="o">);</span>
 </code></pre></div>
 <p>When looking at the select next to the label &#39;Metrics&#39;, make sure the &#39;Count, oplets OP_37, OP_49 ...&#39; is selected.  This select compares all of the counters in the topology visualized as a bar graph.  An image is shown below:</p>
 
 <p><img src="images/console_counter_metrics_bar.jpg" width='100%'/></p>
 
-<p>Hover over individual bars to get the value of the number of tuples flowing through that oplet since the application was started.  You can also see the oplet name.  You can see that some of the oplets have zero tuples flowing through them.
-The bars that are the tallest and therefore have the highest tuple count are OP_76, OP_67 and OP_65.  If you look back up to the topology graph, in the Tuple count view, you can see that the edges (streams) surrounding these oplets have the color that corresponds to the highest tuple count (in the pictures above that color is bright orange in the Tuple count legend).</p>
+<p>Hover over individual bars to get the value of the number of tuples flowing through that oplet since the application was started. You can also see the oplet name. You can see that some of the oplets have zero tuples flowing through them.</p>
+
+<p>The bars that are the tallest and therefore have the highest tuple count are OP_76, OP_67 and OP_65.  If you look back up to the topology graph, in the Tuple count view, you can see that the edges (streams) surrounding these oplets have the color that corresponds to the highest tuple count (in the pictures above that color is bright orange in the Tuple count legend).</p>
 
-<h2 id="ratemeters">RateMeters</h2>
+<h3 id="rate-meters">Rate meters</h3>
 
-<p>The other type of metric we can look at are <code>RateMeter</code> metrics.  In the <code>ConsoleWaterDetector</code> application we added two rate meters here with the objective of comparing the rate of out of range readings between well1 and well3:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    List&lt;TStream&lt;JsonObject&gt;&gt; individualAlerts1 = splitAlert(filteredReadings1, 1);
+<p>The other type of metric we can look at are rate meter metrics. In the <code>ConsoleWaterDetector</code> application we added two rate meters here with the objective of comparing the rate of out of range readings between <code>well1</code> and <code>well3</code>:</p>
+<div class="highlight"><pre><code class="language-" data-lang="">List&lt;TStream&lt;JsonObject&gt;&gt; individualAlerts1 = splitAlert(filteredReadings1, 1);
 
-    // Put a rate meter on well1's temperature sensor output
-    Metrics.rateMeter(individualAlerts1.get(0));
-    ...
-    List&lt;TStream&lt;JsonObject&gt;&gt; individualAlerts3 = splitAlert(filteredReadings3, 3);
+// Put a rate meter on well1's temperature sensor output
+Metrics.rateMeter(individualAlerts1.get(0));
+...
+List&lt;TStream&lt;JsonObject&gt;&gt; individualAlerts3 = splitAlert(filteredReadings3, 3);
 
-    // Put a rate meter on well3's temperature sensor output
-    Metrics.rateMeter(individualAlerts3.get(0));
+// Put a rate meter on well3's temperature sensor output
+Metrics.rateMeter(individualAlerts3.get(0));
 </code></pre></div>
-<p>RateMeters contain the following metrics for each stream they are added to:</p>
+<p>Rate meters contain the following metrics for each stream they are added to:</p>
 
 <ul>
 <li>Tuple count</li>
@@ -1026,17 +1022,17 @@ The bars that are the tallest and therefore have the highest tuple count are OP_
 </ul></li>
 </ul>
 
-<p>Now change the Metrics select to the &#39;MeanRate&#39;.  In our example these correspond to oplets OP_37 and OP_49:</p>
+<p>Now change the Metrics select to the &#39;MeanRate&#39;. In our example these correspond to oplets OP_37 and OP_49:</p>
 
 <p><img src="images/console_rate_metrics.jpg" width='100%'/></p>
 
-<p>Hovering over the slightly larger bar, the one to the right, the name is OP_49.  Looking at the topology graph and changing the view to &#39;Static flow&#39;, follow the edges back from OP_49 until you can see an edge with a tag on it. You can see that OP_49&#39;s source is OP_51, whose source is OP_99.  The edge between OP_99 and it&#39;s source OP_48 has multiple tags.  Hovering over this stream, the tags are &#39;TEMP out of range&#39; and &#39;well3&#39;.</p>
+<p>Hovering over the slightly larger bar, the one to the right, the name is OP_49. Looking at the topology graph and changing the view to &#39;Static flow&#39;, follow the edges back from OP_49 until you can see an edge with a tag on it. You can see that OP_49&#39;s source is OP_51, whose source is OP_99.  The edge between OP_99 and it&#39;s source OP_48 has multiple tags. Hovering over this stream, the tags are &#39;TEMP out of range&#39; and &#39;well3&#39;.</p>
 
-<p>If a single Rate Meter is placed on a stream, in addition to plotting a bar chart, a line chart over the last 20 measures can be viewed.  For example, if I comment out the addition of the rateMeter for well1 and then rerun the application, the Metrics section will look like the image below.  I selected the OneMinuteRate and &#39;Line chart&#39; for Chart type:</p>
+<p>If a single rate meter is placed on a stream, in addition to plotting a bar chart, a line chart over the last 20 measures can be viewed. For example, if I comment out the addition of the rate meter for <code>well1</code> and then rerun the application, the Metrics section will look like the image below. I selected the &#39;OneMinuteRate&#39; and &#39;Line chart&#39; for Chart type:</p>
 
 <p><img src="images/console_metrics_line_chart.jpg" width='100%'/></p>
 
-<h1 id="summary">Summary</h1>
+<h2 id="summary">Summary</h2>
 
 <p>The intent of the information on this page is to help you understand the following:</p>
 
@@ -1052,9 +1048,9 @@ The bars that are the tallest and therefore have the highest tuple count are OP_
 <li>How to correlate values from the metrics section with the topology graph</li>
 </ul>
 
-<p>The Quarks console will continue to evolve and improve.  Please open an issue if you see a problem with the existing console, but more importantly add an issue if you have an idea of how to make the console better.  </p>
+<p>The Quarks console will continue to evolve and improve. Please open an issue if you see a problem with the existing console, but more importantly add an issue if you have an idea of how to make the console better.</p>
 
-<p>The more folks write Quarks applications and view them in the console, the more information we can gather from the community about what is needed in the console.  Please consider making a contribution if there is a feature in the console that would really help you and others!</p>
+<p>The more folks write Quarks applications and view them in the console, the more information we can gather from the community about what is needed in the console. Please consider making a contribution if there is a feature in the console that would really help you and others!</p>
 
 
 <div class="tags">
@@ -1087,7 +1083,7 @@ The bars that are the tallest and therefore have the highest tuple count are OP_
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[2/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_different_processing_against_stream.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_different_processing_against_stream.html b/content/recipes/recipe_different_processing_against_stream.html
index 3cba65c..b06d763 100644
--- a/content/recipes/recipe_different_processing_against_stream.html
+++ b/content/recipes/recipe_different_processing_against_stream.html
@@ -588,186 +588,186 @@ $('#toc').on('click', 'a', function() {
 <h2 id="setting-up-the-application">Setting up the application</h2>
 
 <p>We assume that the environment has been set up following the steps outlined in the <a href="../docs/quarks-getting-started">Getting started guide</a>. Let&#39;s begin by creating a <code>DirectProvider</code> and <code>Topology</code>. We choose a <code>DevelopmentProvider</code> so that we can view the topology graph using the console URL (refer to the <a href="../docs/console">Application console</a> page for a more detailed explanation of this provider). The gas mileage bounds, initial gas mileage value, and the number of miles in a typical delivery route have also been defined.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">java.text.DecimalFormat</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">com.google.gson.JsonObject</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimpleSimulatedSensor</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
-
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">ApplyDifferentProcessingAgainstStream</span> <span class="o">{</span>
-        <span class="cm">/**
-         * Gas mileage (in miles per gallon, or mpg) value bounds
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_LOW</span> <span class="o">=</span> <span class="mf">7.0</span><span class="o">;</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_HIGH</span> <span class="o">=</span> <span class="mf">14.0</span><span class="o">;</span>
-        <span class="cm">/**
-         * Initial gas mileage sensor value
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">INITIAL_MPG</span> <span class="o">=</span> <span class="mf">10.5</span><span class="o">;</span>
-        <span class="cm">/**
-         * Hypothetical value for the number of miles in a typical delivery route
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">ROUTE_MILES</span> <span class="o">=</span> <span class="mi">80</span><span class="o">;</span>
-
-        <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-
-            <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
-
-            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
-
-            <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"GasMileageSensor"</span><span class="o">);</span>
-
-            <span class="c1">// The rest of the code pieces belong here</span>
-        <span class="o">}</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.text.DecimalFormat</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">com.google.gson.JsonObject</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimpleSimulatedSensor</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">ApplyDifferentProcessingAgainstStream</span> <span class="o">{</span>
+    <span class="cm">/**
+     * Gas mileage (in miles per gallon, or mpg) value bounds
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_LOW</span> <span class="o">=</span> <span class="mf">7.0</span><span class="o">;</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_HIGH</span> <span class="o">=</span> <span class="mf">14.0</span><span class="o">;</span>
+    <span class="cm">/**
+     * Initial gas mileage sensor value
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">INITIAL_MPG</span> <span class="o">=</span> <span class="mf">10.5</span><span class="o">;</span>
+    <span class="cm">/**
+     * Hypothetical value for the number of miles in a typical delivery route
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">ROUTE_MILES</span> <span class="o">=</span> <span class="mi">80</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
+
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
+
+        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"GasMileageSensor"</span><span class="o">);</span>
+
+        <span class="c1">// The rest of the code pieces belong here</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 <h2 id="generating-gas-mileage-sensor-readings">Generating gas mileage sensor readings</h2>
 
 <p>The next step is to simulate a stream of gas mileage readings using <a href="https://github.com/apache/incubator-quarks/blob/master/samples/utils/src/main/java/quarks/samples/utils/sensor/SimpleSimulatedSensor.java"><code>SimpleSimulatedSensor</code></a>. We set the initial gas mileage and delta factor in the first two arguments. The last argument ensures that the sensor reading falls in an acceptable range (between 7.0 mpg and 14.0 mpg). In our <code>main()</code>, we use the <code>poll()</code> method to generate a flow of tuples (readings), where each tuple arrives every second.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Generate a stream of gas mileage sensor readings</span>
-    <span class="n">SimpleSimulatedSensor</span> <span class="n">mpgSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimpleSimulatedSensor</span><span class="o">(</span><span class="n">INITIAL_MPG</span><span class="o">,</span>
-            <span class="mf">0.4</span><span class="o">,</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">MPG_LOW</span><span class="o">,</span> <span class="n">MPG_HIGH</span><span class="o">));</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">mpgReadings</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">mpgSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Generate a stream of gas mileage sensor readings</span>
+<span class="n">SimpleSimulatedSensor</span> <span class="n">mpgSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimpleSimulatedSensor</span><span class="o">(</span><span class="n">INITIAL_MPG</span><span class="o">,</span>
+        <span class="mf">0.4</span><span class="o">,</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">MPG_LOW</span><span class="o">,</span> <span class="n">MPG_HIGH</span><span class="o">));</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">mpgReadings</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">mpgSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="applying-different-processing-to-the-stream">Applying different processing to the stream</h2>
 
 <p>The company can now perform analytics on the <code>mpgReadings</code> stream and feed it to different functions.</p>
 
 <p>First, we can filter out gas mileage values that are considered poor and tag the resulting stream for easier viewing in the console.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Filter out the poor gas mileage readings</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">poorMpg</span> <span class="o">=</span> <span class="n">mpgReadings</span>
-            <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">mpg</span> <span class="o">&lt;=</span> <span class="mf">9.0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"filtered"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Filter out the poor gas mileage readings</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">poorMpg</span> <span class="o">=</span> <span class="n">mpgReadings</span>
+        <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">mpg</span> <span class="o">&lt;=</span> <span class="mf">9.0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"filtered"</span><span class="o">);</span>
 </code></pre></div>
 <p>If the company also wants the readings to be in JSON, we can easily create a new stream and convert from type <code>Double</code> to <code>JsonObject</code>.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Map Double to JsonObject</span>
-     <span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">json</span> <span class="o">=</span> <span class="n">mpgReadings</span>
-            <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="o">{</span>
-                <span class="n">JsonObject</span> <span class="n">jObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
-                <span class="n">jObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"gasMileage"</span><span class="o">,</span> <span class="n">mpg</span><span class="o">);</span>
-                <span class="k">return</span> <span class="n">jObj</span><span class="o">;</span>
-            <span class="o">}).</span><span class="na">tag</span><span class="o">(</span><span class="s">"mapped"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Map Double to JsonObject</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">json</span> <span class="o">=</span> <span class="n">mpgReadings</span>
+        <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="o">{</span>
+            <span class="n">JsonObject</span> <span class="n">jObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+            <span class="n">jObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"gasMileage"</span><span class="o">,</span> <span class="n">mpg</span><span class="o">);</span>
+            <span class="k">return</span> <span class="n">jObj</span><span class="o">;</span>
+        <span class="o">}).</span><span class="na">tag</span><span class="o">(</span><span class="s">"mapped"</span><span class="o">);</span>
 </code></pre></div>
 <p>In addition, we can calculate the estimated gallons of gas used based on the current gas mileage using <code>modify</code>.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Modify gas mileage stream to obtain a stream containing the estimated gallons of gas used</span>
-    <span class="n">DecimalFormat</span> <span class="n">df</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DecimalFormat</span><span class="o">(</span><span class="s">"#.#"</span><span class="o">);</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">gallonsUsed</span> <span class="o">=</span> <span class="n">mpgReadings</span>
-            <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">Double</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">df</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="n">ROUTE_MILES</span> <span class="o">/</span> <span class="n">mpg</span><span class="o">))).</span><span class="na">tag</span><span class="o">(</span><span class="s">"modified"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Modify gas mileage stream to obtain a stream containing the estimated gallons of gas used</span>
+<span class="n">DecimalFormat</span> <span class="n">df</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DecimalFormat</span><span class="o">(</span><span class="s">"#.#"</span><span class="o">);</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">gallonsUsed</span> <span class="o">=</span> <span class="n">mpgReadings</span>
+        <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">Double</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">df</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="n">ROUTE_MILES</span> <span class="o">/</span> <span class="n">mpg</span><span class="o">))).</span><span class="na">tag</span><span class="o">(</span><span class="s">"modified"</span><span class="o">);</span>
 </code></pre></div>
 <p>The three examples demonstrated here are a small subset of the many other possibilities of stream processing.</p>
 
 <p>With each of these resulting streams, the company can perform further analytics, but at this point, we terminate the streams by printing out the tuples on each stream.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Terminate the streams</span>
-    <span class="n">poorMpg</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Poor gas mileage! "</span> <span class="o">+</span> <span class="n">mpg</span> <span class="o">+</span> <span class="s">" mpg"</span><span class="o">));</span>
-    <span class="n">json</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"JSON: "</span> <span class="o">+</span> <span class="n">mpg</span><span class="o">));</span>
-    <span class="n">gallonsUsed</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">gas</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Gallons of gas: "</span> <span class="o">+</span> <span class="n">gas</span> <span class="o">+</span> <span class="s">"\n"</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Terminate the streams</span>
+<span class="n">poorMpg</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Poor gas mileage! "</span> <span class="o">+</span> <span class="n">mpg</span> <span class="o">+</span> <span class="s">" mpg"</span><span class="o">));</span>
+<span class="n">json</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"JSON: "</span> <span class="o">+</span> <span class="n">mpg</span><span class="o">));</span>
+<span class="n">gallonsUsed</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">gas</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Gallons of gas: "</span> <span class="o">+</span> <span class="n">gas</span> <span class="o">+</span> <span class="s">"\n"</span><span class="o">));</span>
 </code></pre></div>
 <p>We end our application by submitting the <code>Topology</code>.</p>
 
 <h2 id="observing-the-output">Observing the output</h2>
 
 <p>When the final application is run, the output looks something like the following:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    JSON: {"gasMileage":9.5}
-    Gallons of gas: 8.4
+<div class="highlight"><pre><code class="language-" data-lang="">JSON: {"gasMileage":9.5}
+Gallons of gas: 8.4
 
-    JSON: {"gasMileage":9.2}
-    Gallons of gas: 8.7
+JSON: {"gasMileage":9.2}
+Gallons of gas: 8.7
 
-    Poor gas mileage! 9.0 mpg
-    JSON: {"gasMileage":9.0}
-    Gallons of gas: 8.9
+Poor gas mileage! 9.0 mpg
+JSON: {"gasMileage":9.0}
+Gallons of gas: 8.9
 
-    Poor gas mileage! 8.8 mpg
-    JSON: {"gasMileage":8.8}
-    Gallons of gas: 9.1
+Poor gas mileage! 8.8 mpg
+JSON: {"gasMileage":8.8}
+Gallons of gas: 9.1
 </code></pre></div>
 <h2 id="a-look-at-the-topology-graph">A look at the topology graph</h2>
 
 <p>Let&#39;s see what the topology graph looks like. We can view it using the console URL that was printed to standard output at the start of the application. We see that original stream is fanned out to three separate streams, and the <code>filter</code>, <code>map</code>, and <code>modify</code> operations are applied.</p>
 
-<p><img src="images/different_processing_against_stream_topology_graph.jpg"></p>
+<p><img src="images/different_processing_against_stream_topology_graph.jpg" alt="Image of the topology graph"></p>
 
 <h2 id="the-final-application">The final application</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">java.text.DecimalFormat</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.text.DecimalFormat</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">com.google.gson.JsonObject</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimpleSimulatedSensor</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+
+ <span class="cm">/**
+ * Fan out stream and perform different analytics on the resulting streams.
+ */</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">ApplyDifferentProcessingAgainstStream</span> <span class="o">{</span>
+    <span class="cm">/**
+     * Gas mileage (in miles per gallon, or mpg) value bounds
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_LOW</span> <span class="o">=</span> <span class="mf">7.0</span><span class="o">;</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_HIGH</span> <span class="o">=</span> <span class="mf">14.0</span><span class="o">;</span>
+    <span class="cm">/**
+     * Initial gas mileage sensor value
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">INITIAL_MPG</span> <span class="o">=</span> <span class="mf">10.5</span><span class="o">;</span>
+    <span class="cm">/**
+     * Hypothetical value for the number of miles in a typical delivery route
+     */</span>
+    <span class="kd">static</span> <span class="kt">double</span> <span class="n">ROUTE_MILES</span> <span class="o">=</span> <span class="mi">80</span><span class="o">;</span>
 
-    <span class="kn">import</span> <span class="nn">com.google.gson.JsonObject</span><span class="o">;</span>
+    <span class="cm">/**
+     * Polls a simulated delivery truck sensor to periodically obtain
+     * gas mileage readings (in miles/gallon). Feed the stream of sensor
+     * readings to different functions (filter, map, and modify).
+     */</span>
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
 
-    <span class="kn">import</span> <span class="nn">quarks.analytics.sensors.Ranges</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimpleSimulatedSensor</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
 
-     <span class="cm">/**
-     * Fan out stream and perform different analytics on the resulting streams.
-     */</span>
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">ApplyDifferentProcessingAgainstStream</span> <span class="o">{</span>
-        <span class="cm">/**
-         * Gas mileage (in miles per gallon, or mpg) value bounds
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_LOW</span> <span class="o">=</span> <span class="mf">7.0</span><span class="o">;</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">MPG_HIGH</span> <span class="o">=</span> <span class="mf">14.0</span><span class="o">;</span>
-        <span class="cm">/**
-         * Initial gas mileage sensor value
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">INITIAL_MPG</span> <span class="o">=</span> <span class="mf">10.5</span><span class="o">;</span>
-        <span class="cm">/**
-         * Hypothetical value for the number of miles in a typical delivery route
-         */</span>
-        <span class="kd">static</span> <span class="kt">double</span> <span class="n">ROUTE_MILES</span> <span class="o">=</span> <span class="mi">80</span><span class="o">;</span>
-
-        <span class="cm">/**
-         * Polls a simulated delivery truck sensor to periodically obtain
-         * gas mileage readings (in miles/gallon). Feed the stream of sensor
-         * readings to different functions (filter, map, and modify).
-         */</span>
-        <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-
-            <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
-
-            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
-
-            <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"GasMileageSensor"</span><span class="o">);</span>
-
-            <span class="c1">// Generate a stream of gas mileage sensor readings</span>
-            <span class="n">SimpleSimulatedSensor</span> <span class="n">mpgSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimpleSimulatedSensor</span><span class="o">(</span><span class="n">INITIAL_MPG</span><span class="o">,</span>
-                    <span class="mf">0.4</span><span class="o">,</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">MPG_LOW</span><span class="o">,</span> <span class="n">MPG_HIGH</span><span class="o">));</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">mpgReadings</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">mpgSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
-
-            <span class="c1">// Filter out the poor gas mileage readings</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">poorMpg</span> <span class="o">=</span> <span class="n">mpgReadings</span>
-                    <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">mpg</span> <span class="o">&lt;=</span> <span class="mf">9.0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"filtered"</span><span class="o">);</span>
-
-            <span class="c1">// Map Double to JsonObject</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">json</span> <span class="o">=</span> <span class="n">mpgReadings</span>
-                    <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="o">{</span>
-                        <span class="n">JsonObject</span> <span class="n">jObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
-                        <span class="n">jObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"gasMileage"</span><span class="o">,</span> <span class="n">mpg</span><span class="o">);</span>
-                        <span class="k">return</span> <span class="n">jObj</span><span class="o">;</span>
-                    <span class="o">}).</span><span class="na">tag</span><span class="o">(</span><span class="s">"mapped"</span><span class="o">);</span>
-
-            <span class="c1">// Modify gas mileage stream to obtain a stream containing the estimated gallons of gas used</span>
-            <span class="n">DecimalFormat</span> <span class="n">df</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DecimalFormat</span><span class="o">(</span><span class="s">"#.#"</span><span class="o">);</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">gallonsUsed</span> <span class="o">=</span> <span class="n">mpgReadings</span>
-                    <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">Double</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">df</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="n">ROUTE_MILES</span> <span class="o">/</span> <span class="n">mpg</span><span class="o">))).</span><span class="na">tag</span><span class="o">(</span><span class="s">"modified"</span><span class="o">);</span>
-
-            <span class="c1">// Terminate the streams</span>
-            <span class="n">poorMpg</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Poor gas mileage! "</span> <span class="o">+</span> <span class="n">mpg</span> <span class="o">+</span> <span class="s">" mpg"</span><span class="o">));</span>
-            <span class="n">json</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"JSON: "</span> <span class="o">+</span> <span class="n">mpg</span><span class="o">));</span>
-            <span class="n">gallonsUsed</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">gas</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Gallons of gas: "</span> <span class="o">+</span> <span class="n">gas</span> <span class="o">+</span> <span class="s">"\n"</span><span class="o">));</span>
-
-            <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
-        <span class="o">}</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
+
+        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"GasMileageSensor"</span><span class="o">);</span>
+
+        <span class="c1">// Generate a stream of gas mileage sensor readings</span>
+        <span class="n">SimpleSimulatedSensor</span> <span class="n">mpgSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimpleSimulatedSensor</span><span class="o">(</span><span class="n">INITIAL_MPG</span><span class="o">,</span>
+                <span class="mf">0.4</span><span class="o">,</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">closed</span><span class="o">(</span><span class="n">MPG_LOW</span><span class="o">,</span> <span class="n">MPG_HIGH</span><span class="o">));</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">mpgReadings</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">mpgSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+
+        <span class="c1">// Filter out the poor gas mileage readings</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">poorMpg</span> <span class="o">=</span> <span class="n">mpgReadings</span>
+                <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">mpg</span> <span class="o">&lt;=</span> <span class="mf">9.0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"filtered"</span><span class="o">);</span>
+
+        <span class="c1">// Map Double to JsonObject</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">json</span> <span class="o">=</span> <span class="n">mpgReadings</span>
+                <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="o">{</span>
+                    <span class="n">JsonObject</span> <span class="n">jObj</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+                    <span class="n">jObj</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"gasMileage"</span><span class="o">,</span> <span class="n">mpg</span><span class="o">);</span>
+                    <span class="k">return</span> <span class="n">jObj</span><span class="o">;</span>
+                <span class="o">}).</span><span class="na">tag</span><span class="o">(</span><span class="s">"mapped"</span><span class="o">);</span>
+
+        <span class="c1">// Modify gas mileage stream to obtain a stream containing the estimated gallons of gas used</span>
+        <span class="n">DecimalFormat</span> <span class="n">df</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DecimalFormat</span><span class="o">(</span><span class="s">"#.#"</span><span class="o">);</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">gallonsUsed</span> <span class="o">=</span> <span class="n">mpgReadings</span>
+                <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">Double</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">df</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="n">ROUTE_MILES</span> <span class="o">/</span> <span class="n">mpg</span><span class="o">))).</span><span class="na">tag</span><span class="o">(</span><span class="s">"modified"</span><span class="o">);</span>
+
+        <span class="c1">// Terminate the streams</span>
+        <span class="n">poorMpg</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Poor gas mileage! "</span> <span class="o">+</span> <span class="n">mpg</span> <span class="o">+</span> <span class="s">" mpg"</span><span class="o">));</span>
+        <span class="n">json</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">mpg</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"JSON: "</span> <span class="o">+</span> <span class="n">mpg</span><span class="o">));</span>
+        <span class="n">gallonsUsed</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">gas</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Gallons of gas: "</span> <span class="o">+</span> <span class="n">gas</span> <span class="o">+</span> <span class="s">"\n"</span><span class="o">));</span>
+
+        <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 
 <div class="tags">
@@ -800,7 +800,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_dynamic_analytic_control.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_dynamic_analytic_control.html b/content/recipes/recipe_dynamic_analytic_control.html
index 3ff2809..1975036 100644
--- a/content/recipes/recipe_dynamic_analytic_control.html
+++ b/content/recipes/recipe_dynamic_analytic_control.html
@@ -581,43 +581,43 @@ $('#toc').on('click', 'a', function() {
     
   <p>This recipe addresses the question: How can I dynamically enable or disable entire portions of my application&#39;s analytics?</p>
 
-<p>Imagine a topology that has a variety of analytics that it can perform.  Each analytic flow comes with certain costs in terms of demands on the CPU or memory and implications for power consumption.  Hence an application may wish to dynamically control whether or not an analytic flow is currently enabled.</p>
+<p>Imagine a topology that has a variety of analytics that it can perform. Each analytic flow comes with certain costs in terms of demands on the CPU or memory and implications for power consumption. Hence an application may wish to dynamically control whether or not an analytic flow is currently enabled.</p>
 
 <h2 id="valve">Valve</h2>
 
-<p>A <code>quarks.topology.plumbing.Valve</code> is a simple construct that can be inserted in stream flows to dynamically enable or disable downstream processing.  A valve is either open or closed.  When used as a Predicate to <code>TStream.filter()</code>, filter passes tuples only when the valve is open. Hence downstream processing is enabled when the valve is open and effectively disabled when the valve is closed.</p>
+<p>A <code>quarks.topology.plumbing.Valve</code> is a simple construct that can be inserted in stream flows to dynamically enable or disable downstream processing. A valve is either open or closed. When used as a <code>Predicate</code> to <code>TStream.filter()</code>, <code>filter</code> passes tuples only when the valve is open. Hence downstream processing is enabled when the valve is open and effectively disabled when the valve is closed.</p>
 
 <p>For example, consider a a topology consisting of 3 analytic processing flows that want to be dynamically enabled or disabled:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">Valve</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">flow1Valve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Valve</span><span class="o">&lt;&gt;();</span>  <span class="c1">// default is open</span>
-    <span class="n">Valve</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">flow2Valve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Valve</span><span class="o">&lt;&gt;(</span><span class="kc">false</span><span class="o">);</span>  <span class="c1">// closed</span>
-    <span class="n">Valve</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">flow3Valve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Valve</span><span class="o">&lt;&gt;(</span><span class="kc">false</span><span class="o">);</span>
-
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">readings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">mySensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
-    <span class="n">addAnalyticFlow1</span><span class="o">(</span><span class="n">readings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">flow1Valve</span><span class="o">));</span>
-    <span class="n">addAnalyticFlow2</span><span class="o">(</span><span class="n">readings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">flow2Valve</span><span class="o">));</span>
-    <span class="n">addAnalyticFlow3</span><span class="o">(</span><span class="n">readings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">flow3Valve</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">Valve</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">flow1Valve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Valve</span><span class="o">&lt;&gt;();</span>  <span class="c1">// default is open</span>
+<span class="n">Valve</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">flow2Valve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Valve</span><span class="o">&lt;&gt;(</span><span class="kc">false</span><span class="o">);</span>  <span class="c1">// closed</span>
+<span class="n">Valve</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">flow3Valve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Valve</span><span class="o">&lt;&gt;(</span><span class="kc">false</span><span class="o">);</span>
+
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Readings</span><span class="o">&gt;</span> <span class="n">readings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">mySensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+<span class="n">addAnalyticFlow1</span><span class="o">(</span><span class="n">readings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">flow1Valve</span><span class="o">));</span>
+<span class="n">addAnalyticFlow2</span><span class="o">(</span><span class="n">readings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">flow2Valve</span><span class="o">));</span>
+<span class="n">addAnalyticFlow3</span><span class="o">(</span><span class="n">readings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">flow3Valve</span><span class="o">));</span>
 </code></pre></div>
-<p>Elsewhere in the application, perhaps as a result of processing some device command from an external service such as when using an IotProvider or IotDevice, valves may be opened and closed dynamically to achieve the desired effects.  For example:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">   <span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">cmds</span> <span class="o">=</span> <span class="n">simulatedValveCommands</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
-   <span class="n">cmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">json</span> <span class="o">-&gt;</span> <span class="o">{</span>
-       <span class="n">String</span> <span class="n">valveId</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="na">getPrimitive</span><span class="o">(</span><span class="s">"valve"</span><span class="o">).</span><span class="na">getAsString</span><span class="o">();</span>
-       <span class="kt">boolean</span> <span class="n">isOpen</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="na">getPrimitive</span><span class="o">(</span><span class="s">"isOpen"</span><span class="o">).</span><span class="na">getAsBoolean</span><span class="o">();</span>
-       <span class="k">switch</span><span class="o">(</span><span class="n">valveId</span><span class="o">)</span> <span class="o">{</span>
-         <span class="k">case</span> <span class="s">"flow1"</span><span class="o">:</span> <span class="n">flow1Valve</span><span class="o">.</span><span class="na">setOpen</span><span class="o">(</span><span class="n">isOpen</span><span class="o">);</span> <span class="k">break</span><span class="o">;</span>
-         <span class="k">case</span> <span class="s">"flow2"</span><span class="o">:</span> <span class="n">flow2Valve</span><span class="o">.</span><span class="na">setOpen</span><span class="o">(</span><span class="n">isOpen</span><span class="o">);</span> <span class="k">break</span><span class="o">;</span>
-         <span class="k">case</span> <span class="s">"flow3"</span><span class="o">:</span> <span class="n">flow3Valve</span><span class="o">.</span><span class="na">setOpen</span><span class="o">(</span><span class="n">isOpen</span><span class="o">);</span> <span class="k">break</span><span class="o">;</span>
-       <span class="o">}</span>
-   <span class="o">});</span>
+<p>Elsewhere in the application, perhaps as a result of processing some device command from an external service such as when using an <code>IotProvider</code> or <code>IotDevice</code>, valves may be opened and closed dynamically to achieve the desired effects. For example:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">cmds</span> <span class="o">=</span> <span class="n">simulatedValveCommands</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
+<span class="n">cmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">json</span> <span class="o">-&gt;</span> <span class="o">{</span>
+    <span class="n">String</span> <span class="n">valveId</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="na">getPrimitive</span><span class="o">(</span><span class="s">"valve"</span><span class="o">).</span><span class="na">getAsString</span><span class="o">();</span>
+    <span class="kt">boolean</span> <span class="n">isOpen</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="na">getPrimitive</span><span class="o">(</span><span class="s">"isOpen"</span><span class="o">).</span><span class="na">getAsBoolean</span><span class="o">();</span>
+    <span class="k">switch</span><span class="o">(</span><span class="n">valveId</span><span class="o">)</span> <span class="o">{</span>
+        <span class="k">case</span> <span class="s">"flow1"</span><span class="o">:</span> <span class="n">flow1Valve</span><span class="o">.</span><span class="na">setOpen</span><span class="o">(</span><span class="n">isOpen</span><span class="o">);</span> <span class="k">break</span><span class="o">;</span>
+        <span class="k">case</span> <span class="s">"flow2"</span><span class="o">:</span> <span class="n">flow2Valve</span><span class="o">.</span><span class="na">setOpen</span><span class="o">(</span><span class="n">isOpen</span><span class="o">);</span> <span class="k">break</span><span class="o">;</span>
+        <span class="k">case</span> <span class="s">"flow3"</span><span class="o">:</span> <span class="n">flow3Valve</span><span class="o">.</span><span class="na">setOpen</span><span class="o">(</span><span class="n">isOpen</span><span class="o">);</span> <span class="k">break</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">});</span>
 </code></pre></div>
-<h2 id="loosely-coupled-quarks-applications">Loosely Coupled Quarks Applications</h2>
+<h2 id="loosely-coupled-quarks-applications">Loosely coupled Quarks applications</h2>
 
 <p>Another approach for achieving dynamic control over what analytics flows are running is to utilize loosely coupled applications.</p>
 
-<p>In this approach, the overall application is partitioned into multiple applications (topologies). In the above example there could be four applications: one that publishes the sensor Readings stream, and one for each of the analytic flows.</p>
+<p>In this approach, the overall application is partitioned into multiple applications (topologies). In the above example there could be four applications: one that publishes the sensor <code>readings</code> stream, and one for each of the analytic flows.</p>
 
 <p>The separate applications can connect to each other&#39;s streams using the <code>quarks.connectors.pubsub.PublishSubscribe</code> connector.</p>
 
-<p>Rather than having all of the analytic applications running all of the time, applications can be registered with a <code>quarks.topology.services.ApplicationService</code>.  Registered applications can then be started and stopped dynamically.</p>
+<p>Rather than having all of the analytic applications running all of the time, applications can be registered with a <code>quarks.topology.services.ApplicationService</code>. Registered applications can then be started and stopped dynamically.</p>
 
 <p>The <code>quarks.providers.iot.IotProvider</code> is designed to facilitate this style of use.</p>
 
@@ -652,7 +652,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_external_filter_range.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_external_filter_range.html b/content/recipes/recipe_external_filter_range.html
index 5923a29..54dd341 100644
--- a/content/recipes/recipe_external_filter_range.html
+++ b/content/recipes/recipe_external_filter_range.html
@@ -583,14 +583,13 @@ $('#toc').on('click', 'a', function() {
 
 <p>Oftentimes, a user wants to initialize a range specification from an external configuration file so the application code is more easily configured and reusable.</p>
 
-<p>The string form of a <code>Range</code> is natural, consise, and easy to use.  As such it&#39;s a convenient form to use in configuration files or for users to enter.  The range string can easily be converted back into a <code>Range</code>.</p>
+<p>The string form of a <code>Range</code> is natural, consise, and easy to use. As such it&#39;s a convenient form to use in configuration files or for users to enter. The range string can easily be converted back into a <code>Range</code>.</p>
 
 <p>We&#39;re going to assume familiarity with that earlier recipe and those concepts and focus on just the &quot;external range specification&quot; aspect of this recipe.</p>
 
 <h2 id="create-a-configuration-file">Create a configuration file</h2>
 
-<p>The file&#39;s syntax is that for a <code>java.util.Properties</code> object.
-See the <code>Range</code> documentation for its string syntax.</p>
+<p>The file&#39;s syntax is that for a <code>java.util.Properties</code> object. See the <code>Range</code> <a href="https://github.com/apache/incubator-quarks/blob/master/analytics/sensors/src/main/java/quarks/analytics/sensors/Range.java">documentation</a> for its string syntax.</p>
 
 <p>Put this into a file:</p>
 <div class="highlight"><pre><code class="language-" data-lang=""># the Range string for the temperature sensor optimal range
@@ -600,18 +599,17 @@ optimalTempRange=[77.0..91.0]
 
 <h2 id="loading-the-configuration-file">Loading the configuration file</h2>
 
-<p>A <code>java.util.Properties</code> object is often used for configuration parameters
-and it is easy to load the properties from a file.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Load the configuration file with the path string in configFilePath</span>
-    <span class="n">Properties</span> <span class="n">props</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Properties</span><span class="o">();</span>
-    <span class="n">props</span><span class="o">.</span><span class="na">load</span><span class="o">(</span><span class="n">Files</span><span class="o">.</span><span class="na">newBufferedReader</span><span class="o">(</span><span class="k">new</span> <span class="n">File</span><span class="o">(</span><span class="n">configFilePath</span><span class="o">).</span><span class="na">toPath</span><span class="o">()));</span>
+<p>A <code>java.util.Properties</code> object is often used for configuration parameters and it is easy to load the properties from a file.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Load the configuration file with the path string in configFilePath</span>
+<span class="n">Properties</span> <span class="n">props</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Properties</span><span class="o">();</span>
+<span class="n">props</span><span class="o">.</span><span class="na">load</span><span class="o">(</span><span class="n">Files</span><span class="o">.</span><span class="na">newBufferedReader</span><span class="o">(</span><span class="k">new</span> <span class="n">File</span><span class="o">(</span><span class="n">configFilePath</span><span class="o">).</span><span class="na">toPath</span><span class="o">()));</span>
 </code></pre></div>
-<h2 id="initializing-the-range">Initializing the Range</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// initialize the range from a Range string in the properties.</span>
-    <span class="c1">// Use a default value if a range isn't present.</span>
-    <span class="kd">static</span> <span class="n">String</span> <span class="n">DEFAULT_TEMP_RANGE_STR</span> <span class="o">=</span> <span class="s">"[60.0..100.0]"</span><span class="o">;</span>                                                                                
-    <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">valueOfDouble</span><span class="o">(</span>
-            <span class="n">props</span><span class="o">.</span><span class="na">getProperty</span><span class="o">(</span><span class="s">"optimalTempRange"</span><span class="o">,</span> <span class="n">defaultRange</span><span class="o">));</span>
+<h2 id="initializing-the-range">Initializing the <code>Range</code></h2>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// initialize the range from a Range string in the properties.</span>
+<span class="c1">// Use a default value if a range isn't present.</span>
+<span class="kd">static</span> <span class="n">String</span> <span class="n">DEFAULT_TEMP_RANGE_STR</span> <span class="o">=</span> <span class="s">"[60.0..100.0]"</span><span class="o">;</span>
+<span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">optimalTempRange</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">valueOfDouble</span><span class="o">(</span>
+        <span class="n">props</span><span class="o">.</span><span class="na">getProperty</span><span class="o">(</span><span class="s">"optimalTempRange"</span><span class="o">,</span> <span class="n">defaultRange</span><span class="o">));</span>
 </code></pre></div>
 <h2 id="the-final-application">The final application</h2>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.io.File</span><span class="o">;</span>
@@ -624,12 +622,12 @@ and it is easy to load the properties from a file.</p>
 <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
 <span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.SimulatedTemperatureSensor</span><span class="o">;</span>
 <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>                                                                                                           
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
 
 <span class="cm">/**
  * Detect a sensor value out of expected range.
  * Get the range specification from a configuration file.
- */</span>                                                                                                                                        
+ */</span>
 <span class="kd">public</span> <span class="kd">class</span> <span class="nc">ExternalFilterRange</span> <span class="o">{</span>
     <span class="cm">/**
      * Optimal temperatures (in Fahrenheit)
@@ -660,7 +658,7 @@ and it is easy to load the properties from a file.</p>
             <span class="k">throw</span> <span class="k">new</span> <span class="n">Exception</span><span class="o">(</span><span class="s">"missing pathname to configuration file"</span><span class="o">);</span>
         <span class="n">String</span> <span class="n">configFilePath</span> <span class="o">=</span> <span class="n">args</span><span class="o">[</span><span class="mi">0</span><span class="o">];</span>
 
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>                                                                                          
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 
         <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"TemperatureSensor"</span><span class="o">);</span>
 
@@ -716,7 +714,7 @@ and it is easy to load the properties from a file.</p>
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_hello_quarks.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_hello_quarks.html b/content/recipes/recipe_hello_quarks.html
index 2737414..d851681 100644
--- a/content/recipes/recipe_hello_quarks.html
+++ b/content/recipes/recipe_hello_quarks.html
@@ -579,59 +579,59 @@ $('#toc').on('click', 'a', function() {
 
     <a target="_blank" href="https://github.com/apache/incubator-quarks-website/blob/master/site/recipes/recipe_hello_quarks.md" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
     
-  <p>Quarks&#39; pure Java implementation is a powerful feature which allows it to be run on the majority of JVM-compatible systems. It also has the added benefit of enabling the developer to develop applications entirely within the Eclipse and Intellij ecosystems. For the purposes of this recipe, it will be assumed that the developer is using Eclipse. To begin the Hello World recipe, create a new project and import the necessary libraries as outlined in the <a href="../docs/quarks-getting-started">Getting started guide</a>. Next, write the following template application:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+  <p>Quarks&#39; pure Java implementation is a powerful feature which allows it to be run on the majority of JVM-compatible systems. It also has the added benefit of enabling the developer to develop applications entirely within the Eclipse and IntelliJ ecosystems. For the purposes of this recipe, it will be assumed that the developer is using Eclipse. To begin the Hello Quarks recipe, create a new project and import the necessary libraries as outlined in the <a href="../docs/quarks-getting-started">Getting started guide</a>. Next, write the following template application:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
 
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
-    <span class="o">}</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+<span class="o">}</span>
 </code></pre></div>
-<p>The <em>DirectProvider</em> is an object which allows the user to submit and run the final application. It also creates the <em>Topology</em> object, which gives the developer the ability to define a stream of strings.</p>
+<p>The <em><code>DirectProvider</code></em> is an object which allows the user to submit and run the final application. It also creates the <em><code>Topology</code></em> object, which gives the developer the ability to define a stream of strings.</p>
 
-<h2 id="using-topology-strings">Using Topology.strings</h2>
+<h2 id="using-topology-strings">Using <code>Topology.strings()</code></h2>
 
-<p>The primary abstraction in Quarks is the <code>TStream</code>. A <em>TStream</em> represents the flow of data in a Quarks application; for example, the periodic floating point readings from a temperature sensor. The data items which are sent through a <code>TStream</code> are Java objects -- in the &quot;Hello Quarks!&quot; example, we are sending two strings. There are a number of ways to create a <code>TStream</code>, and <code>Topology.strings</code> is the simplest. The user specifies a number of strings which will be used as the stream&#39;s data items.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+<p>The primary abstraction in Quarks is the <code>TStream</code>. A <em><code>TStream</code></em> represents the flow of data in a Quarks application; for example, the periodic floating point readings from a temperature sensor. The data items which are sent through a <code>TStream</code> are Java objects &mdash; in the &quot;Hello Quarks!&quot; example, we are sending two strings. There are a number of ways to create a <code>TStream</code>, and <code>Topology.strings()</code> is the simplest. The user specifies a number of strings which will be used as the stream&#39;s data items.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
 
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">helloStream</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span><span class="s">"Hello"</span><span class="o">,</span> <span class="s">"Quarks!"</span><span class="o">);</span>
-    <span class="o">}</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">helloStream</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span><span class="s">"Hello"</span><span class="o">,</span> <span class="s">"Quarks!"</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
 <p>The <code>helloStream</code> stream is created, and the &quot;Hello&quot; and &quot;Quarks!&quot; strings will be sent as its two data items.</p>
 
 <h2 id="printing-to-output">Printing to output</h2>
 
-<p><code>TStream.print</code> can be used to print the data items of a stream to standard output by invoking the <code>toString</code> method of each data item. In this case the data items are already strings, but in principle <code>TStream.print</code> can be called on any stream, regardless of the datatype carried by the stream.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+<p><code>TStream.print()</code> can be used to print the data items of a stream to standard output by invoking the <code>toString()</code> method of each data item. In this case the data items are already strings, but in principle <code>TStream.print()</code> can be called on any stream, regardless of the datatype carried by the stream.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
 
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">helloStream</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span><span class="s">"Hello"</span><span class="o">,</span> <span class="s">"Quarks!"</span><span class="o">);</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">helloStream</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span><span class="s">"Hello"</span><span class="o">,</span> <span class="s">"Quarks!"</span><span class="o">);</span>
 
-        <span class="n">helloStream</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
-    <span class="o">}</span>
+    <span class="n">helloStream</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+<span class="o">}</span>
 </code></pre></div>
 <h2 id="submitting-the-application">Submitting the application</h2>
 
 <p>The only remaining step is to submit the application, which is performed by the <code>DirectProvider</code>. Submitting a Quarks application initializes the threads which execute the <code>Topology</code>, and begins processing its data sources.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
 
-        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 
-        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+    <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">helloStream</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span><span class="s">"Hello"</span><span class="o">,</span> <span class="s">"Quarks!"</span><span class="o">);</span>
+    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">helloStream</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span><span class="s">"Hello"</span><span class="o">,</span> <span class="s">"Quarks!"</span><span class="o">);</span>
 
-        <span class="n">helloStream</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+    <span class="n">helloStream</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
 
-        <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
-    <span class="o">}</span>
+    <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">top</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
 <p>After running the application, the output is &quot;Hello Quarks!&quot;:</p>
 <div class="highlight"><pre><code class="language-" data-lang="">Hello
@@ -668,7 +668,7 @@ Quarks!
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[5/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/faq.html
----------------------------------------------------------------------
diff --git a/content/docs/faq.html b/content/docs/faq.html
index 2c0632f..1612ee0 100644
--- a/content/docs/faq.html
+++ b/content/docs/faq.html
@@ -589,23 +589,23 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="how-is-apache-quarks-used">How is Apache Quarks used?</h2>
 
-<p>Quarks can be used at the edge of the Internet of Things, for example, to analyze data on devices, engines, connected cars, etc.  Quarks could be on the device itself, or a gateway device collecting data from local devices.  You can write an edge application on Quarks and connect it to a Cloud service, such as the IBM Watson IoT Platform. It can also be used for enterprise data collection and analysis; for example log collectors, application data, and data center analytics.</p>
+<p>Quarks can be used at the edge of the Internet of Things, for example, to analyze data on devices, engines, connected cars, etc. Quarks could be on the device itself, or a gateway device collecting data from local devices. You can write an edge application on Quarks and connect it to a Cloud service, such as the IBM Watson IoT Platform. It can also be used for enterprise data collection and analysis; for example log collectors, application data, and data center analytics.</p>
 
 <h2 id="how-are-applications-developed">How are applications developed?</h2>
 
-<p>Applications are developed using a functional flow API to define operations on data streams that are executed as a graph of &quot;oplets&quot; in a lightweight embeddable runtime.  The SDK provides capabilities like windowing, aggregation and connectors with an extensible model for the community to expand its capabilities.</p>
+<p>Applications are developed using a functional flow API to define operations on data streams that are executed as a graph of &quot;oplets&quot; in a lightweight embeddable runtime. The SDK provides capabilities like windowing, aggregation and connectors with an extensible model for the community to expand its capabilities.</p>
 
 <h2 id="what-apis-does-apache-quarks-support">What APIs does Apache Quarks support?</h2>
 
-<p>Currently, Quarks supports APIs for Java and Android. Support for additional languages, such as Python, is likely as more developers get involved.  Please consider joining the Quarks open source development community to accelerate the contributions of additional APIs.</p>
+<p>Currently, Quarks supports APIs for Java and Android. Support for additional languages, such as Python, is likely as more developers get involved. Please consider joining the Quarks open source development community to accelerate the contributions of additional APIs.</p>
 
 <h2 id="what-type-of-analytics-can-be-done-with-apache-quarks">What type of analytics can be done with Apache Quarks?</h2>
 
-<p>Quarks provides windowing, aggregation and simple filtering. It uses Apache Common Math to provide simple analytics aimed at device sensors.  Quarks is also extensible, so you can call existing libraries from within your Quarks application.  In the future, Quarks will include more analytics, either exposing more functionality from Apache Common Math, other libraries or hand-coded analytics.</p>
+<p>Quarks provides windowing, aggregation and simple filtering. It uses Apache Common Math to provide simple analytics aimed at device sensors. Quarks is also extensible, so you can call existing libraries from within your Quarks application. In the future, Quarks will include more analytics, either exposing more functionality from Apache Common Math, other libraries or hand-coded analytics.</p>
 
 <h2 id="what-connectors-does-apache-quarks-support">What connectors does Apache Quarks support?</h2>
 
-<p>Quarks supports connectors for MQTT, HTTP, JDBC, File, Apache Kafka and IBM Watson IoT Platform.  Quarks is extensible; you can add the connector of your choice.</p>
+<p>Quarks supports connectors for MQTT, HTTP, JDBC, File, Apache Kafka and IBM Watson IoT Platform. Quarks is extensible; you can add the connector of your choice.</p>
 
 <h2 id="what-centralized-streaming-analytic-systems-does-apache-quarks-support">What centralized streaming analytic systems does Apache Quarks support?</h2>
 
@@ -613,7 +613,7 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="why-do-i-need-apache-quarks-on-the-edge-rather-than-my-streaming-analytic-system">Why do I need Apache Quarks on the edge, rather than my streaming analytic system?</h2>
 
-<p>Quarks is designed for the edge, rather than a more centralized system.  It has a small footprint, suitable for running on devices.  Quarks provides simple analytics, allowing a device to analyze data locally and to only send to the centralized system if there is a need, reducing communication costs.</p>
+<p>Quarks is designed for the edge, rather than a more centralized system. It has a small footprint, suitable for running on devices. Quarks provides simple analytics, allowing a device to analyze data locally and to only send to the centralized system if there is a need, reducing communication costs.</p>
 
 <h2 id="why-do-i-need-apache-quarks-rather-than-coding-the-complete-application-myself">Why do I need Apache Quarks, rather than coding the complete application myself?</h2>
 
@@ -621,7 +621,7 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="where-can-i-download-apache-quarks-to-try-it-out">Where can I download Apache Quarks to try it out?</h2>
 
-<p>Quarks is migrating from github quarks-edge to Apache. You can download the source from Apache and build it yourself <a href="https://github.com/apache/incubator-quarks">here</a>.  You can also  find already built pre-Apache releases of Quarks for download <a href="https://github.com/quarks-edge/quarks/releases/latest">here</a>. These releases are not associated with Apache.</p>
+<p>Quarks is migrating from github quarks-edge to Apache. You can download the source from Apache and build it yourself <a href="https://github.com/apache/incubator-quarks">here</a>. You can also find already built pre-Apache releases of Quarks for download <a href="https://github.com/quarks-edge/quarks/releases/latest">here</a>. These releases are not associated with Apache.</p>
 
 <h2 id="how-do-i-get-started">How do I get started?</h2>
 
@@ -633,7 +633,7 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="how-can-i-contribute-code">How can I contribute code?</h2>
 
-<p>Just submit a <a href="https://github.com/apache/incubator-quarks">pull request</a> and wait for a committer to review.  For more information, visit our <a href="committers">committer page</a> and read <a href="https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md">DEVELOPMENT.md</a> at the top of the code tree.</p>
+<p>Just submit a <a href="https://github.com/apache/incubator-quarks">pull request</a> and wait for a committer to review. For more information, visit our <a href="committers">committer page</a> and read <a href="https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md">DEVELOPMENT.md</a> at the top of the code tree.</p>
 
 <h2 id="can-i-become-a-committer">Can I become a committer?</h2>
 
@@ -645,12 +645,11 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="can-i-take-a-copy-of-the-code-and-fork-it-for-my-own-use">Can I take a copy of the code and fork it for my own use?</h2>
 
-<p>Yes. Quarks is available under the Apache 2.0 license which allows you to fork the code.  We hope you will contribute your changes back to the Quarks community.</p>
+<p>Yes. Quarks is available under the Apache 2.0 license which allows you to fork the code. We hope you will contribute your changes back to the Quarks community.</p>
 
 <h2 id="how-do-i-suggest-new-features">How do I suggest new features?</h2>
 
-<p>Click <a href="https://issues.apache.org/jira/browse/QUARKS">Issues</a>
- to submit requests for new features. You may browse or query the Issues database to see what other members of the Quarks community have already requested.</p>
+<p>Click <a href="https://issues.apache.org/jira/browse/QUARKS">Issues</a> to submit requests for new features. You may browse or query the Issues database to see what other members of the Quarks community have already requested.</p>
 
 <h2 id="how-do-i-submit-bug-reports">How do I submit bug reports?</h2>
 
@@ -662,7 +661,7 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="why-is-apache-quarks-open-source">Why is Apache Quarks open source?</h2>
 
-<p>With the growth of the Internet of Things there is a need to execute analytics at the edge. Quarks was developed to address requirements for analytics at the edge for IoT use cases that were not addressed by central analytic solutions.  These capabilities will be useful to many organizations and that the diverse nature of edge devices and use cases is best addressed by an open community.  Our goal is to develop a vibrant community of developers and users to expand the capabilities and real-world use of Quarks by companies and individuals to enable edge analytics and further innovation for the IoT space.</p>
+<p>With the growth of the Internet of Things there is a need to execute analytics at the edge. Quarks was developed to address requirements for analytics at the edge for IoT use cases that were not addressed by central analytic solutions. These capabilities will be useful to many organizations and that the diverse nature of edge devices and use cases is best addressed by an open community. Our goal is to develop a vibrant community of developers and users to expand the capabilities and real-world use of Quarks by companies and individuals to enable edge analytics and further innovation for the IoT space.</p>
 
 
 <div class="tags">
@@ -695,7 +694,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/home.html
----------------------------------------------------------------------
diff --git a/content/docs/home.html b/content/docs/home.html
index 732e9f5..d49b36b 100644
--- a/content/docs/home.html
+++ b/content/docs/home.html
@@ -592,21 +592,21 @@ $('#toc').on('click', 'a', function() {
 
 <p>A Quarks application uses analytics to determine when data needs to be sent to a back-end system for further analysis, action, or storage. For example, you can use Quarks to determine whether a system is running outside of normal parameters, such as an engine that is running too hot.</p>
 
-<p>If the system is running normally, you don\u2019t need to send this data to your back-end system; it\u2019s an added cost and an additional load on your system to process and store. However, if Quarks detects an issue, you can transmit that data to your back-end system to determine why the issue is occurring and how to resolve the issue.   </p>
+<p>If the system is running normally, you don\u2019t need to send this data to your back-end system; it\u2019s an added cost and an additional load on your system to process and store. However, if Quarks detects an issue, you can transmit that data to your back-end system to determine why the issue is occurring and how to resolve the issue.</p>
 
 <p>Quarks enables you to shift from sending a continuous flow of trivial data to the server to sending only essential and meaningful data as it occurs. This is especially important when the cost of communication is high, such as when using a cellular network to transmit data, or when bandwidth is limited.</p>
 
 <p>The following use cases describe the primary situations in which you would use Quarks:</p>
 
 <ul>
-<li><em>Internet of Things (IoT):</em> Analyze data on distributed edge devices and mobile devices to:
+<li><strong>Internet of Things (IoT)</strong>: Analyze data on distributed edge devices and mobile devices to:
 
 <ul>
 <li>Reduce the cost of transmitting data</li>
 <li>Provide local feedback at the devices</li>
 </ul></li>
-<li><em>Embedded in an application server instance:</em> Analyze application server error logs in real time without impacting network traffic</li>
-<li><em>Server rooms and machine rooms:</em> Analyze machine health in real time without impacting network traffic or when bandwidth is limited</li>
+<li><strong>Embedded in an application server instance</strong>: Analyze application server error logs in real time without impacting network traffic</li>
+<li><strong>Server rooms and machine rooms</strong>: Analyze machine health in real time without impacting network traffic or when bandwidth is limited</li>
 </ul>
 
 <h3 id="deployment-environments">Deployment environments</h3>
@@ -624,9 +624,8 @@ $('#toc').on('click', 'a', function() {
 <p>You can send data from an Apache Quarks application to your back-end system when you need to perform analysis that cannot be performed on the edge device, such as:</p>
 
 <ul>
-<li>Running a complex analytic algorithm that requires more resources, such as CPU or memory, than are available on the edge device.</li>
-<li>Maintaining large amounts of state information about a device, such as several hours worth of state information for a patient\u2019s
-medical device.</li>
+<li>Running a complex analytic algorithm that requires more resources, such as CPU or memory, than are available on the edge device</li>
+<li>Maintaining large amounts of state information about a device, such as several hours worth of state information for a patient\u2019s medical device</li>
 <li>Correlating data from the device with data from other sources, such as:
 
 <ul>
@@ -700,7 +699,7 @@ medical device.</li>
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/overview.html
----------------------------------------------------------------------
diff --git a/content/docs/overview.html b/content/docs/overview.html
index e11ed9d..b886497 100644
--- a/content/docs/overview.html
+++ b/content/docs/overview.html
@@ -684,7 +684,7 @@ medical device.</li>
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/quarks-getting-started.html
----------------------------------------------------------------------
diff --git a/content/docs/quarks-getting-started.html b/content/docs/quarks-getting-started.html
index abe7d5a..388d7ed 100644
--- a/content/docs/quarks-getting-started.html
+++ b/content/docs/quarks-getting-started.html
@@ -584,8 +584,8 @@ $('#toc').on('click', 'a', function() {
 <p>Quarks is an open source programming model and runtime for edge devices that enables you to analyze streaming data on your edge devices. When you analyze on the edge, you can:</p>
 
 <ul>
-<li><p>Reduce the amount of data that you transmit to your analytics server</p></li>
-<li><p>Reduce the amount of data that you store</p></li>
+<li>Reduce the amount of data that you transmit to your analytics server</li>
+<li>Reduce the amount of data that you store</li>
 </ul>
 
 <p>For more information, see the <a href="home">Quarks overview</a>.</p>
@@ -623,107 +623,104 @@ $('#toc').on('click', 'a', function() {
 <p><img src="images/Build_Path_Jars.JPG" style="width:661px;height:444px;"></p></li>
 </ol>
 
-<p><br/>
-Your environment is set up! You can start writing your first Quarks application.</p>
+<p>Your environment is set up! You can start writing your first Quarks application.</p>
 
 <h2 id="creating-a-simple-application">Creating a simple application</h2>
 
 <p>If you&#39;re new to Quarks or to writing streaming applications, the best way to get started is to write a simple program.</p>
 
-<p>Quarks is a framework that pushes data analytics and machine learning to <em>edge devices</em>. (Edge devices include things like routers, gateways, machines, equipment, sensors, appliances, or vehicles that are connected to a network.) Quarks enables you to process data locally---such as, in a car engine, on an Android phone, or Raspberry Pi---before you send data over a network.</p>
+<p>Quarks is a framework that pushes data analytics and machine learning to <em>edge devices</em>. (Edge devices include things like routers, gateways, machines, equipment, sensors, appliances, or vehicles that are connected to a network.) Quarks enables you to process data locally&mdash;such as, in a car engine, on an Android phone, or Raspberry Pi&mdash;before you send data over a network.</p>
 
 <p>For example, if your device takes temperature readings from a sensor 1,000 times per second, it is more efficient to process the data locally and send only interesting or unexpected results over the network. To simulate this, let&#39;s define a (simulated) TempSensor class:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">java.util.Random</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">quarks.function.Supplier</span><span class="o">;</span>
-
-    <span class="cm">/**
-     * Every time get() is called, TempSensor generates a temperature reading.
-     */</span>
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">TempSensor</span> <span class="kd">implements</span> <span class="n">Supplier</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="o">{</span>
-        <span class="kt">double</span> <span class="n">currentTemp</span> <span class="o">=</span> <span class="mf">65.0</span><span class="o">;</span>
-        <span class="n">Random</span> <span class="n">rand</span><span class="o">;</span>
-
-        <span class="n">TempSensor</span><span class="o">(){</span>
-            <span class="n">rand</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Random</span><span class="o">();</span>
-        <span class="o">}</span>
-
-        <span class="nd">@Override</span>
-        <span class="kd">public</span> <span class="n">Double</span> <span class="n">get</span><span class="o">()</span> <span class="o">{</span>
-            <span class="c1">// Change the current temperature some random amount</span>
-            <span class="kt">double</span> <span class="n">newTemp</span> <span class="o">=</span> <span class="n">rand</span><span class="o">.</span><span class="na">nextGaussian</span><span class="o">()</span> <span class="o">+</span> <span class="n">currentTemp</span><span class="o">;</span>
-            <span class="n">currentTemp</span> <span class="o">=</span> <span class="n">newTemp</span><span class="o">;</span>
-            <span class="k">return</span> <span class="n">currentTemp</span><span class="o">;</span>
-        <span class="o">}</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.Random</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.function.Supplier</span><span class="o">;</span>
+
+<span class="cm">/**
+ * Every time get() is called, TempSensor generates a temperature reading.
+ */</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">TempSensor</span> <span class="kd">implements</span> <span class="n">Supplier</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="o">{</span>
+    <span class="kt">double</span> <span class="n">currentTemp</span> <span class="o">=</span> <span class="mf">65.0</span><span class="o">;</span>
+    <span class="n">Random</span> <span class="n">rand</span><span class="o">;</span>
+
+    <span class="n">TempSensor</span><span class="o">(){</span>
+        <span class="n">rand</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Random</span><span class="o">();</span>
+    <span class="o">}</span>
+
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">Double</span> <span class="n">get</span><span class="o">()</span> <span class="o">{</span>
+        <span class="c1">// Change the current temperature some random amount</span>
+        <span class="kt">double</span> <span class="n">newTemp</span> <span class="o">=</span> <span class="n">rand</span><span class="o">.</span><span class="na">nextGaussian</span><span class="o">()</span> <span class="o">+</span> <span class="n">currentTemp</span><span class="o">;</span>
+        <span class="n">currentTemp</span> <span class="o">=</span> <span class="n">newTemp</span><span class="o">;</span>
+        <span class="k">return</span> <span class="n">currentTemp</span><span class="o">;</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 <p>Every time you call <code>TempSensor.get()</code>, it returns a new temperature reading. The continuous temperature readings are a stream of data that a Quarks application can process.</p>
 
 <p>Our sample Quarks application processes this stream by filtering the data and printing the results. Let&#39;s define a TempSensorApplication class for the application:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
-
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">TempSensorApplication</span> <span class="o">{</span>
-        <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
-            <span class="n">TempSensor</span> <span class="n">sensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TempSensor</span><span class="o">();</span>
-            <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>      
-            <span class="n">Topology</span> <span class="n">topology</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">tempReadings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">sensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">);</span>
-            <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">filteredReadings</span> <span class="o">=</span> <span class="n">tempReadings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">reading</span> <span class="o">-&gt;</span> <span class="n">reading</span> <span class="o">&lt;</span> <span class="mi">50</span> <span class="o">||</span> <span class="n">reading</span> <span class="o">&gt;</span> <span class="mi">80</span><span class="o">);</span>
-
-            <span class="n">filteredReadings</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
-            <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
-          <span class="o">}</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">TempSensorApplication</span> <span class="o">{</span>
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+        <span class="n">TempSensor</span> <span class="n">sensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TempSensor</span><span class="o">();</span>
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+        <span class="n">Topology</span> <span class="n">topology</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">tempReadings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">sensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">);</span>
+        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">filteredReadings</span> <span class="o">=</span> <span class="n">tempReadings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">reading</span> <span class="o">-&gt;</span> <span class="n">reading</span> <span class="o">&lt;</span> <span class="mi">50</span> <span class="o">||</span> <span class="n">reading</span> <span class="o">&gt;</span> <span class="mi">80</span><span class="o">);</span>
+
+        <span class="n">filteredReadings</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+        <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 <p>To understand how the application processes the stream, let&#39;s review each line.</p>
 
 <h3 id="specifying-a-provider">Specifying a provider</h3>
 
-<p>Your first step when you write a Quarks application is to create a
-<a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/providers/direct/DirectProvider.html"><code>DirectProvider</code></a> :</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
+<p>Your first step when you write a Quarks application is to create a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/providers/direct/DirectProvider.html"><code>DirectProvider</code></a>:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DirectProvider</span><span class="o">();</span>
 </code></pre></div>
-<p>A <strong>Provider</strong> is an object that contains information on how and where your Quarks application will run. A <strong>DirectProvider</strong> is a type of Provider that runs your application directly within the current virtual machine when its <code>submit()</code> method is called.</p>
+<p>A <code>Provider</code> is an object that contains information on how and where your Quarks application will run. A <code>DirectProvider</code> is a type of Provider that runs your application directly within the current virtual machine when its <code>submit()</code> method is called.</p>
 
 <h3 id="creating-a-topology">Creating a topology</h3>
 
-<p>Additionally a Provider is used to create a
-<a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/topology/Topology.html"><code>Topology</code></a> instance :</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">Topology</span> <span class="n">topology</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
+<p>Additionally a Provider is used to create a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/topology/Topology.html"><code>Topology</code></a> instance:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">Topology</span> <span class="n">topology</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">();</span>
 </code></pre></div>
-<p>In Quarks, <strong>Topology</strong> is a container that describes the structure of your application:</p>
+<p>In Quarks, <code>Topology</code> is a container that describes the structure of your application:</p>
 
 <ul>
-<li><p>Where the streams in the application come from</p></li>
-<li><p>How the data in the stream is modified</p></li>
+<li>Where the streams in the application come from</li>
+<li>How the data in the stream is modified</li>
 </ul>
 
-<p>In the TempSensor application above, we have exactly one data source: the <code>TempSensor</code> object. We define the source stream by calling <code>topology.poll()</code>, which takes both a Supplier function and a time parameter to indicate how frequently readings should be taken. In our case, we read from the sensor every millisecond:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">tempReadings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">sensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">);</span>
+<p>In the TempSensor application above, we have exactly one data source: the <code>TempSensor</code> object. We define the source stream by calling <code>topology.poll()</code>, which takes both a <code>Supplier</code> function and a time parameter to indicate how frequently readings should be taken. In our case, we read from the sensor every millisecond:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">tempReadings</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">sensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">);</span>
 </code></pre></div>
-<h3 id="defining-the-tstream-object">Defining the TStream object</h3>
+<h3 id="defining-the-tstream-object">Defining the <code>TStream</code> object</h3>
 
 <p>Calling <code>topology.poll()</code> to define a source stream creates a <code>TStream&lt;Double&gt;</code> instance, which represents the series of readings taken from the temperature sensor.</p>
 
-<p>A streaming application can run indefinitely, so the TStream might see an arbitrarily large number of readings pass through it. Because a TStream represents the flow of your data, it supports a number of operations which allow you to modify your data.</p>
+<p>A streaming application can run indefinitely, so the <code>TStream</code> might see an arbitrarily large number of readings pass through it. Because a <code>TStream</code> represents the flow of your data, it supports a number of operations which allow you to modify your data.</p>
 
-<h2 id="filtering-a-tstream">Filtering a TStream</h2>
+<h3 id="filtering-a-tstream">Filtering a <code>TStream</code></h3>
 
-<p>In our example, we want to filter the stream of temperature readings, and remove any &quot;uninteresting&quot; or expected readings---specifically readings which are above 50 degrees and below 80 degrees. To do this, we call the TStream&#39;s <code>filter</code> method and pass in a function that returns <em>true</em> if the data is interesting and <em>false</em> if the data is uninteresting:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">filteredReadings</span> <span class="o">=</span> <span class="n">tempReadings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">reading</span> <span class="o">-&gt;</span> <span class="n">reading</span> <span class="o">&lt;</span> <span class="mi">50</span> <span class="o">||</span> <span class="n">reading</span> <span class="o">&gt;</span> <span class="mi">80</span><span class="o">);</span>
+<p>In our example, we want to filter the stream of temperature readings, and remove any &quot;uninteresting&quot; or expected readings&mdash;specifically readings which are above 50 degrees and below 80 degrees. To do this, we call the <code>TStream</code>&#39;s <code>filter</code> method and pass in a function that returns <em>true</em> if the data is interesting and <em>false</em> if the data is uninteresting:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">filteredReadings</span> <span class="o">=</span> <span class="n">tempReadings</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">reading</span> <span class="o">-&gt;</span> <span class="n">reading</span> <span class="o">&lt;</span> <span class="mi">50</span> <span class="o">||</span> <span class="n">reading</span> <span class="o">&gt;</span> <span class="mi">80</span><span class="o">);</span>
 </code></pre></div>
-<p>As you can see, the function that is passed to <code>filter</code> operates on each tuple individually. Unlike data streaming frameworks like <a href="https://spark.apache.org/">Apache Spark</a>, which operate on a collection of data in batch mode, Quarks achieves low latency processing by manipulating each piece of data as soon as it becomes available. Filtering a TStream produces another TStream that contains only the filtered tuples; for example, the <code>filteredReadings</code> stream.</p>
+<p>As you can see, the function that is passed to <code>filter</code> operates on each tuple individually. Unlike data streaming frameworks like <a href="https://spark.apache.org/">Apache Spark</a>, which operate on a collection of data in batch mode, Quarks achieves low latency processing by manipulating each piece of data as soon as it becomes available. Filtering a <code>TStream</code> produces another <code>TStream</code> that contains only the filtered tuples; for example, the <code>filteredReadings</code> stream.</p>
 
 <h3 id="printing-to-output">Printing to output</h3>
 
 <p>When our application detects interesting data (data outside of the expected parameters), we want to print results. You can do this by calling the <code>TStream.print()</code> method, which prints using  <code>.toString()</code> on each tuple that passes through the stream:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">filteredReadings</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">filteredReadings</span><span class="o">.</span><span class="na">print</span><span class="o">();</span>
 </code></pre></div>
-<p>Unlike <code>TStream.filter()</code>, <code>TStream.print()</code> does not produce another TStream. This is because <code>TStream.print()</code> is a <strong>sink</strong>, which represents the terminus of a stream.</p>
+<p>Unlike <code>TStream.filter()</code>, <code>TStream.print()</code> does not produce another <code>TStream</code>. This is because <code>TStream.print()</code> is a <strong>sink</strong>, which represents the terminus of a stream.</p>
 
 <p>In addition to <code>TStream.print()</code> there are other sink operations that send tuples to an MQTT server, JDBC connection, file, or Kafka cluster. Additionally, you can define your own sink by invoking <code>TStream.sink()</code> and passing in your own function.</p>
 
@@ -732,15 +729,15 @@ Your environment is set up! You can start writing your first Quarks application.
 <p>Now that your application has been completely declared, the final step is to run your application.</p>
 
 <p><code>DirectProvider</code> contains a <code>submit()</code> method, which runs your application directly within the current virtual machine:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">dp</span><span class="o">.</span><span class="na">submit</span><span class="o">(</span><span class="n">topology</span><span class="o">);</span>
 </code></pre></div>
 <p>After you run your program, you should see output containing only &quot;interesting&quot; data coming from your sensor:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    49.904032311772596
-    47.97837504039084
-    46.59272336309031
-    46.681544551652934
-    47.400819234155236
-    ...
+<div class="highlight"><pre><code class="language-" data-lang="">49.904032311772596
+47.97837504039084
+46.59272336309031
+46.681544551652934
+47.400819234155236
+...
 </code></pre></div>
 <p>As you can see, all temperatures are outside the 50-80 degree range. In terms of a real-world application, this would prevent a device from sending superfluous data over a network, thereby reducing communication costs.</p>
 
@@ -786,7 +783,7 @@ Your environment is set up! You can start writing your first Quarks application.
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/quarks_index.html
----------------------------------------------------------------------
diff --git a/content/docs/quarks_index.html b/content/docs/quarks_index.html
index eb620a5..2160504 100644
--- a/content/docs/quarks_index.html
+++ b/content/docs/quarks_index.html
@@ -581,35 +581,30 @@ $('#toc').on('click', 'a', function() {
     
   <h2 id="new-documentation">New documentation</h2>
 
-<p>Apache Quarks is evolving, and so is the documentation. If the existing documentation hasn&#39;t answered your questions, you can request new or updated documentation by opening an issue.</p>
-
-<p>Click on &quot;New Documentation&quot; to open an issue:</p>
-
-<p><a href="https://github.com/quarks-edge/quarks.documentation/issues/new"><button type="button" class="btn btn-primary">New Documentation</button></a>
-<br></p>
+<p>Apache Quarks is evolving, and so is the documentation. If the existing documentation hasn&#39;t answered your questions, you can request new or updated documentation by opening a <a href="https://issues.apache.org/jira/browse/QUARKS">Jira</a> issue.</p>
 
 <h2 id="providing-feedback">Providing feedback</h2>
 
 <p>To provide feedback on our documentation:</p>
 
 <ol>
-<li> Navigate to the documentation page for which you are providing feedback.</li>
-<li> Click on the <strong>Feedback</strong> button in the top right corner.</li>
+<li>Navigate to the documentation page for which you are providing feedback</li>
+<li>Click on the <strong>Feedback</strong> button in the top right corner</li>
 </ol>
 
-<p>This will open an issue for the page that you are currently visiting.  </p>
+<p>This will open an issue for the page that you are currently visiting.</p>
 
 <h2 id="contributing-documentation">Contributing documentation</h2>
 
-<p>If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution!  The quarks.documentation site uses GitHub&#39;s flavor of Markdown and Jekyll markdown for our documentation.</p>
+<p>If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution! This site uses GitHub&#39;s flavor of Markdown and Jekyll markdown for our documentation.</p>
 
-<p>Refer to this documentation on GitHub&#39;s flavor of Markdown:  <a href="https://help.github.com/categories/writing-on-github">Writing on GitHub</a></p>
+<p>Refer to this documentation on GitHub&#39;s flavor of Markdown: <a href="https://help.github.com/categories/writing-on-github">Writing on GitHub</a>.</p>
 
-<p>Refer to this documentation to get started:  <a href="https://help.github.com/articles/using-jekyll-with-pages/">Using Jekyll with Pages</a>  </p>
+<p>Refer to this documentation to get started: <a href="https://help.github.com/articles/using-jekyll-with-pages/">Using Jekyll with Pages</a>.</p>
 
-<p>To contribute, clone this project locally, make your changes, and create a <a href="https://github.com/quarks-edge/quarks/pulls">pull request</a>.</p>
+<p>To contribute, clone this project locally, make your changes, and create a <a href="https://github.com/apache/incubator-quarks-website/pulls">pull request</a>.</p>
 
-<p>To learn more, visit <a href="getinvolved">Get Involved</a></p>
+<p>To learn more, visit <a href="getinvolved">Get Involved</a>.</p>
 
 
 <div class="tags">
@@ -642,7 +637,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/quickstart.html
----------------------------------------------------------------------
diff --git a/content/docs/quickstart.html b/content/docs/quickstart.html
index c2ada7a..e9bcef8 100644
--- a/content/docs/quickstart.html
+++ b/content/docs/quickstart.html
@@ -581,11 +581,9 @@ $('#toc').on('click', 'a', function() {
     
   <h2 id="quarks-to-quickstart-quickly">Quarks to Quickstart quickly!</h2>
 
-<p>IoT devices running quarks applications typically connect to back-end analytic systems through a message hub.
-Message hubs are used to isolate the back-end system from having to handle connections from thousands to millions of devices.</p>
+<p>IoT devices running quarks applications typically connect to back-end analytic systems through a message hub. Message hubs are used to isolate the back-end system from having to handle connections from thousands to millions of devices.</p>
 
-<p>An example of such a message hub designed for the Internet of Things is
-<a href="https://internetofthings.ibmcloud.com/">IBM Watson IoT Platform</a>. This cloud service runs on IBM&#39;s Bluemix cloud platform
+<p>An example of such a message hub designed for the Internet of Things is <a href="https://internetofthings.ibmcloud.com/">IBM Watson IoT Platform</a>. This cloud service runs on IBM&#39;s Bluemix cloud platform
 and Quarks provides a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/connectors/iotf/IotfDevice.html">connector</a>.</p>
 
 <p>You can test out the service without any registration by using its Quickstart service and the Quarks sample application: <a href="https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java">code</a>, <a href="http://quarks-edge.github.io/quarks/docs/javadoc/index.html?quarks/samples/connectors/iotf/IotfQuickstart.html">JavaDocs</a>.</p>
@@ -596,9 +594,7 @@ and Quarks provides a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/
 
 <p><img border="0" alt="Quickstart sample output" src="images/Quickstart_device.png"></p>
 
-<p>Pointing any browser on any machine to that URL takes you to a view of the data coming from the sample application.
-This view is executing in Bluemix, thus the device events from this sample are being sent over the public internet
-to the Quickstart Bluemix service.</p>
+<p>Pointing any browser on any machine to that URL takes you to a view of the data coming from the sample application. This view is executing in Bluemix, thus the device events from this sample are being sent over the public internet to the Quickstart Bluemix service.</p>
 
 <p>Here&#39;s an example view:</p>
 
@@ -606,28 +602,26 @@ to the Quickstart Bluemix service.</p>
 
 <h2 id="quarks-code">Quarks code</h2>
 
-<p>The full source is at:
-<a href="https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java">IotfQuickstart.java</a></p>
+<p>The full source is at: <a href="https://github.com/apache/incubator-quarks/blob/master/samples/connectors/src/main/java/quarks/samples/connectors/iotf/IotfQuickstart.java">IotfQuickstart.java</a>.</p>
 
-<p>The first step to is to create a <code>IotDevice</code> instance that represents the connection to IBM Watson IoT Platform Qucikstart service.</p>
+<p>The first step to is to create a <code>IotDevice</code> instance that represents the connection to IBM Watson IoT Platform Quickstart service.</p>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Declare a connection to IoTF Quickstart service</span>
 <span class="n">String</span> <span class="n">deviceId</span> <span class="o">=</span> <span class="s">"qs"</span> <span class="o">+</span> <span class="n">Long</span><span class="o">.</span><span class="na">toHexString</span><span class="o">(</span><span class="k">new</span> <span class="n">Random</span><span class="o">().</span><span class="na">nextLong</span><span class="o">());</span>
 <span class="n">IotDevice</span> <span class="n">device</span> <span class="o">=</span> <span class="n">IotfDevice</span><span class="o">.</span><span class="na">quickstart</span><span class="o">(</span><span class="n">topology</span><span class="o">,</span> <span class="n">deviceId</span><span class="o">);</span>
 </code></pre></div>
-<p>Now any stream can send device events to the Quickstart service by simply calling its <code>events()</code> method.
-Here we map a stream of random numbers into JSON as the payload for a device event is typically JSON.</p>
+<p>Now any stream can send device events to the Quickstart service by simply calling its <code>events()</code> method. Here we map a stream of random numbers into JSON as the payload for a device event is typically JSON.</p>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">JsonObject</span><span class="o">&gt;</span> <span class="n">json</span> <span class="o">=</span> <span class="n">raw</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">v</span> <span class="o">-&gt;</span> <span class="o">{</span>
-  <span class="n">JsonObject</span> <span class="n">j</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
-  <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"temp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">0</span><span class="o">]);</span>
-  <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"humidity"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">1</span><span class="o">]);</span>
-  <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"objectTemp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">2</span><span class="o">]);</span>
-  <span class="k">return</span> <span class="n">j</span><span class="o">;</span>
+    <span class="n">JsonObject</span> <span class="n">j</span> <span class="o">=</span> <span class="k">new</span> <span class="n">JsonObject</span><span class="o">();</span>
+    <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"temp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">0</span><span class="o">]);</span>
+    <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"humidity"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">1</span><span class="o">]);</span>
+    <span class="n">j</span><span class="o">.</span><span class="na">addProperty</span><span class="o">(</span><span class="s">"objectTemp"</span><span class="o">,</span> <span class="n">v</span><span class="o">[</span><span class="mi">2</span><span class="o">]);</span>
+    <span class="k">return</span> <span class="n">j</span><span class="o">;</span>
 <span class="o">});</span>
 </code></pre></div>
 <p>Now we have a stream of simulated sensor reading events as JSON tuples (<code>json</code>) we send them as events with event identifer (type) <code>sensors</code>  using <code>device</code>.</p>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">device</span><span class="o">.</span><span class="na">events</span><span class="o">(</span><span class="n">json</span><span class="o">,</span> <span class="s">"sensors"</span><span class="o">,</span> <span class="n">QoS</span><span class="o">.</span><span class="na">FIRE_AND_FORGET</span><span class="o">);</span>
 </code></pre></div>
-<p>It&#39;s that simple to send a Quarks stream to IBM Watson IoT Platform as device events.</p>
+<p>It&#39;s that simple to send tuples on a Quarks stream to IBM Watson IoT Platform as device events.</p>
 
 
 <div class="tags">
@@ -660,7 +654,7 @@ Here we map a stream of random numbers into JSON as the payload for a device eve
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/samples.html
----------------------------------------------------------------------
diff --git a/content/docs/samples.html b/content/docs/samples.html
index c620e71..02d7a2a 100644
--- a/content/docs/samples.html
+++ b/content/docs/samples.html
@@ -590,8 +590,8 @@ $('#toc').on('click', 'a', function() {
 <p>The samples are currently available only for Java 8 environments. To use the samples, you&#39;ll need the resources in the following subdirectories of the Quarks package.:</p>
 
 <ul>
-<li><p>The <code>java8/samples</code> directory contains the Java code for the samples.</p></li>
-<li><p>The <code>java8/scripts</code> directory contains the shell scripts that you need to run the samples.</p></li>
+<li>The <code>java8/samples</code> directory contains the Java code for the samples</li>
+<li>The <code>java8/scripts</code> directory contains the shell scripts that you need to run the samples</li>
 </ul>
 
 <p>If you use any of the samples in your own applications, ensure that you include the related Quarks JAR files in your <code>classpath</code>.</p>
@@ -601,22 +601,22 @@ $('#toc').on('click', 'a', function() {
 <p>In addition to the sample application in the <a href="quarks-getting-started">Getting started guide</a>, the following samples can help you start developing with Quarks:</p>
 
 <ul>
-<li><p><strong>HelloQuarks</strong></p>
+<li><strong>HelloQuarks</strong>
 
 <ul>
-<li>This simple program demonstrates the basic mechanics of declaring and executing a topology.</li>
+<li>This simple program demonstrates the basic mechanics of declaring and executing a topology</li>
 </ul></li>
-<li><p><strong>PeriodicSource</strong></p>
+<li><strong>PeriodicSource</strong>
 
 <ul>
-<li>This simple program demonstrates how to periodically poll a source for data to create a source stream.</li>
+<li>This simple program demonstrates how to periodically poll a source for data to create a source stream</li>
 </ul></li>
-<li><p><strong>SimpleFilterTransform</strong></p>
+<li><strong>SimpleFilterTransform</strong>
 
 <ul>
-<li>This simple program demonstrates a simple analytics pipeline: <code>source -&gt; filter -&gt; transform -&gt; sink</code>.</li>
+<li>This simple program demonstrates a simple analytics pipeline: <code>source -&gt; filter -&gt; transform -&gt; sink</code></li>
 </ul></li>
-<li><p><strong>SensorAnalytics</strong></p>
+<li><strong>SensorAnalytics</strong>
 
 <ul>
 <li>This more complex program demonstrates multiple facets of a Quarks application, including:
@@ -631,7 +631,7 @@ $('#toc').on('click', 'a', function() {
 <li>Conditional stream tracing</li>
 </ul></li>
 </ul></li>
-<li><p><strong>IBM Watson IoT Platform</strong> </p>
+<li><strong>IBM Watson IoT Platform</strong>
 
 <ul>
 <li>Samples that demonstrate how to use IBM Watson IoT Platform as the IoT scale message hub between Quarks and back-end analytic systems:
@@ -675,7 +675,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/search.html
----------------------------------------------------------------------
diff --git a/content/docs/search.html b/content/docs/search.html
index e20f22d..b07bfdc 100644
--- a/content/docs/search.html
+++ b/content/docs/search.html
@@ -602,7 +602,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_collaboration.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_collaboration.html b/content/docs/tag_collaboration.html
index 4667c8c..51a1b62 100644
--- a/content/docs/tag_collaboration.html
+++ b/content/docs/tag_collaboration.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_content_types.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_content_types.html b/content/docs/tag_content_types.html
index 49aa597..7405d5f 100644
--- a/content/docs/tag_content_types.html
+++ b/content/docs/tag_content_types.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_formatting.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_formatting.html b/content/docs/tag_formatting.html
index df2cd63..61bf0b9 100644
--- a/content/docs/tag_formatting.html
+++ b/content/docs/tag_formatting.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_getting_started.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_getting_started.html b/content/docs/tag_getting_started.html
index 6b015c4..88af5f5 100644
--- a/content/docs/tag_getting_started.html
+++ b/content/docs/tag_getting_started.html
@@ -704,7 +704,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_mobile.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_mobile.html b/content/docs/tag_mobile.html
index ef36ca3..db9117b 100644
--- a/content/docs/tag_mobile.html
+++ b/content/docs/tag_mobile.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_navigation.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_navigation.html b/content/docs/tag_navigation.html
index cdb8d31..39ca499 100644
--- a/content/docs/tag_navigation.html
+++ b/content/docs/tag_navigation.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_publishing.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_publishing.html b/content/docs/tag_publishing.html
index d4af8f4..245e170 100644
--- a/content/docs/tag_publishing.html
+++ b/content/docs/tag_publishing.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_single_sourcing.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_single_sourcing.html b/content/docs/tag_single_sourcing.html
index a1cdbb8..b8acddc 100644
--- a/content/docs/tag_single_sourcing.html
+++ b/content/docs/tag_single_sourcing.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/tag_special_layouts.html
----------------------------------------------------------------------
diff --git a/content/docs/tag_special_layouts.html b/content/docs/tag_special_layouts.html
index 07dc2df..dbf1011 100644
--- a/content/docs/tag_special_layouts.html
+++ b/content/docs/tag_special_layouts.html
@@ -699,7 +699,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_adaptable_deadtime_filter.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_adaptable_deadtime_filter.html b/content/recipes/recipe_adaptable_deadtime_filter.html
index c9b6112..dd52356 100644
--- a/content/recipes/recipe_adaptable_deadtime_filter.html
+++ b/content/recipes/recipe_adaptable_deadtime_filter.html
@@ -581,51 +581,51 @@ $('#toc').on('click', 'a', function() {
     
   <p>Oftentimes, an application wants to control the frequency that continuously generated analytic results are made available to other parts of the application or published to other applications or an event hub.</p>
 
-<p>For example, an application polls an engine temperature sensor every second and performs various analytics on each reading - an analytic result is generated every second.  By default, the application only wants to publish a (healthy) analytic result every 30 minutes.  However, under certain conditions, the desire is to publish every per-second analytic result.</p>
+<p>For example, an application polls an engine temperature sensor every second and performs various analytics on each reading &mdash; an analytic result is generated every second. By default, the application only wants to publish a (healthy) analytic result every 30 minutes. However, under certain conditions, the desire is to publish every per-second analytic result.</p>
 
 <p>Such a condition may be locally detected, such as detecting a sudden rise in the engine temperature or it may be as a result of receiving some external command to change the publishing frequency.</p>
 
 <p>Note this is a different case than simply changing the polling frequency for the sensor as doing that would disable local continuous monitoring and analysis of the engine temperature.</p>
 
-<p>This case needs a <em>deadtime filter</em> and Quarks provides one for your use!  In contrast to a <em>deadband filter</em>, which skips tuples based on a deadband value range, a deadtime filter skips tuples based on a <em>deadtime period</em> following a tuple that is allowed to pass through.  E.g., if the deadtime period is 30 minutes, after allowing a tuple to pass, the filter skips any tuples received for the next 30 minutes.  The next tuple received after that is allowed to pass through, and a new deadtime period is begun.</p>
+<p>This case needs a <em>deadtime filter</em> and Quarks provides one for your use! In contrast to a <em>deadband filter</em>, which skips tuples based on a deadband value range, a deadtime filter skips tuples based on a <em>deadtime period</em> following a tuple that is allowed to pass through. For example, if the deadtime period is 30 minutes, after allowing a tuple to pass, the filter skips any tuples received for the next 30 minutes. The next tuple received after that is allowed to pass through, and a new deadtime period is begun.</p>
 
-<p>See <code>quarks.analytics.sensors.Filters.deadtime()</code> and <code>quarks.analytics.sensors.Deadtime</code>.</p>
+<p>See <code>quarks.analytics.sensors.Filters.deadtime()</code> (on <a href="https://github.com/apache/incubator-quarks/blob/master/analytics/sensors/src/main/java/quarks/analytics/sensors/Filters.java">GitHub</a>) and <code>quarks.analytics.sensors.Deadtime</code> (on <a href="https://github.com/apache/incubator-quarks/blob/master/analytics/sensors/src/main/java/quarks/analytics/sensors/Deadtime.java">GitHub</a>).</p>
 
 <p>This recipe demonstrates how to use an adaptable deadtime filter.</p>
 
-<p>A Quarks <code>IotProvider</code> and <code>IoTDevice</code> with its command streams would be a natural way to control the application.  In this recipe we will just simulate a &quot;set deadtime period&quot; command stream.</p>
+<p>A Quarks <code>IotProvider</code> ad <code>IoTDevice</code> with its command streams would be a natural way to control the application. In this recipe we will just simulate a &quot;set deadtime period&quot; command stream.</p>
 
 <h2 id="create-a-polled-sensor-readings-stream">Create a polled sensor readings stream</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="o">...;</span>
-        <span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">engineTemp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">)</span>
-                                      <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"engineTemp"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="o">...;</span>
+<span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">engineTemp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">)</span>
+                              <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"engineTemp"</span><span class="o">);</span>
 </code></pre></div>
 <p>It&#39;s also a good practice to add tags to streams to improve the usability of the development mode Quarks console.</p>
 
-<h2 id="create-a-deadtime-filtered-stream-initially-no-deadtime">Create a deadtime filtered stream - initially no deadtime</h2>
+<h2 id="create-a-deadtime-filtered-stream-mdash-initially-no-deadtime">Create a deadtime filtered stream&mdash;initially no deadtime</h2>
 
-<p>In this recipe we&#39;ll just filter the direct <code>engineTemp</code> sensor reading stream.  In practice this filtering would be performed after some analytics stages and used as the input to <code>IotDevice.event()</code> or some other connector publish operation.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">        <span class="n">Deadtime</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadtime</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Deadtime</span><span class="o">&lt;&gt;();</span>
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadtimeFilteredEngineTemp</span> <span class="o">=</span> <span class="n">engineTemp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">deadtime</span><span class="o">)</span>
-                                      <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"deadtimeFilteredEngineTemp"</span><span class="o">);</span>
+<p>In this recipe we&#39;ll just filter the direct <code>engineTemp</code> sensor reading stream. In practice this filtering would be performed after some analytics stages and used as the input to <code>IotDevice.event()</code> or some other connector publish operation.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">Deadtime</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadtime</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Deadtime</span><span class="o">&lt;&gt;();</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">deadtimeFilteredEngineTemp</span> <span class="o">=</span> <span class="n">engineTemp</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">deadtime</span><span class="o">)</span>
+                              <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"deadtimeFilteredEngineTemp"</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="define-a-quot-set-deadtime-period-quot-method">Define a &quot;set deadtime period&quot; method</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">static</span> <span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="kt">void</span> <span class="n">setDeadtimePeriod</span><span class="o">(</span><span class="n">Deadtime</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">deadtime</span><span class="o">,</span> <span class="kt">long</span> <span class="n">period</span><span class="o">,</span> <span class="n">TimeUnit</span> <span class="n">unit</span><span class="o">)</span> <span class="o">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Setting deadtime period="</span><span class="o">+</span><span class="n">period</span><span class="o">+</span><span class="s">" "</span><span class="o">+</span><span class="n">unit</span><span class="o">);</span>
-        <span class="n">deadtime</span><span class="o">.</span><span class="na">setPeriod</span><span class="o">(</span><span class="n">period</span><span class="o">,</span> <span class="n">unit</span><span class="o">);</span>
-    <span class="o">}</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">static</span> <span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="kt">void</span> <span class="n">setDeadtimePeriod</span><span class="o">(</span><span class="n">Deadtime</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">deadtime</span><span class="o">,</span> <span class="kt">long</span> <span class="n">period</span><span class="o">,</span> <span class="n">TimeUnit</span> <span class="n">unit</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Setting deadtime period="</span><span class="o">+</span><span class="n">period</span><span class="o">+</span><span class="s">" "</span><span class="o">+</span><span class="n">unit</span><span class="o">);</span>
+    <span class="n">deadtime</span><span class="o">.</span><span class="na">setPeriod</span><span class="o">(</span><span class="n">period</span><span class="o">,</span> <span class="n">unit</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
 <h2 id="process-the-quot-set-deadtime-period-quot-command-stream">Process the &quot;set deadtime period&quot; command stream</h2>
 
-<p>Our commands are on the <code>TStream&lt;JsonObject&gt; cmds</code> stream.  Each <code>JsonObject</code> tuple is a command with the properties &quot;period&quot; and &quot;unit&quot;.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">        <span class="n">cmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">json</span> <span class="o">-&gt;</span> <span class="n">setDeadtimePeriod</span><span class="o">(</span><span class="n">deadtimeFilteredEngineTemp</span><span class="o">,</span>
-            <span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"period"</span><span class="o">).</span><span class="na">getAsLong</span><span class="o">(),</span>
-            <span class="n">TimeUnit</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"unit"</span><span class="o">).</span><span class="na">getAsString</span><span class="o">())));</span>
+<p>Our commands are on the <code>TStream&lt;JsonObject&gt; cmds</code> stream. Each <code>JsonObject</code> tuple is a command with the properties &quot;period&quot; and &quot;unit&quot;.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">cmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">json</span> <span class="o">-&gt;</span> <span class="n">setDeadtimePeriod</span><span class="o">(</span><span class="n">deadtimeFilteredEngineTemp</span><span class="o">,</span>
+    <span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"period"</span><span class="o">).</span><span class="na">getAsLong</span><span class="o">(),</span>
+    <span class="n">TimeUnit</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"unit"</span><span class="o">).</span><span class="na">getAsString</span><span class="o">())));</span>
 </code></pre></div>
 <h2 id="the-final-application">The final application</h2>
 
-<p>When the application is run it will initially print out temperature sensor readings every second for 15 seconds - the deadtime period is 0.  Then every 15 seconds the application will toggle the deadtime period between 5 seconds and 0 seconds, resulting in a reduction in tuples being printed during the 5 second deadtime period.</p>
+<p>When the application is run it will initially print out temperature sensor readings every second for 15 seconds&mdash;the deadtime period is 0. Then every 15 seconds the application will toggle the deadtime period between 5 seconds and 0 seconds, resulting in a reduction in tuples being printed during the 5 second deadtime period.</p>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.Date</span><span class="o">;</span>
 <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
 <span class="kn">import</span> <span class="nn">java.util.concurrent.atomic.AtomicInteger</span><span class="o">;</span>
@@ -650,7 +650,7 @@ $('#toc').on('click', 'a', function() {
      * Create a "deadtime" filtered stream: after passing a tuple,
      * any tuples received during the "deadtime" are filtered out.
      * Then the next tuple is passed through and a new deadtime period begun.
-     * 
+     *
      * Respond to a simulated command stream to change the deadtime window
      * duration.
      */</span>
@@ -714,7 +714,6 @@ $('#toc').on('click', 'a', function() {
     <span class="o">}</span>
 
 <span class="o">}</span>
-
 </code></pre></div>
 
 <div class="tags">
@@ -747,7 +746,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[9/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779


Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/commit/4fa5de59
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/tree/4fa5de59
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/diff/4fa5de59

Branch: refs/heads/asf-site
Commit: 4fa5de59c0b8521b251440a7846b52972a367a66
Parents: 89f336c
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Mon May 2 15:37:30 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Mon May 2 15:37:30 2016 -0400

----------------------------------------------------------------------
 content/404.html                                |   2 +-
 content/algolia_search.json                     |  40 +-
 content/docs/committers.html                    |   4 +-
 content/docs/common-quarks-operations.html      |  58 +--
 content/docs/community.html                     |  42 +-
 content/docs/console.html                       | 440 +++++++++----------
 content/docs/faq.html                           |  25 +-
 content/docs/home.html                          |  15 +-
 content/docs/overview.html                      |   2 +-
 content/docs/quarks-getting-started.html        | 141 +++---
 content/docs/quarks_index.html                  |  25 +-
 content/docs/quickstart.html                    |  32 +-
 content/docs/samples.html                       |  22 +-
 content/docs/search.html                        |   2 +-
 content/docs/tag_collaboration.html             |   2 +-
 content/docs/tag_content_types.html             |   2 +-
 content/docs/tag_formatting.html                |   2 +-
 content/docs/tag_getting_started.html           |   2 +-
 content/docs/tag_mobile.html                    |   2 +-
 content/docs/tag_navigation.html                |   2 +-
 content/docs/tag_publishing.html                |   2 +-
 content/docs/tag_single_sourcing.html           |   2 +-
 content/docs/tag_special_layouts.html           |   2 +-
 .../recipe_adaptable_deadtime_filter.html       |  49 +--
 .../recipes/recipe_adaptable_filter_range.html  |  44 +-
 .../recipe_adaptable_polling_source.html        |  51 ++-
 ...pe_combining_streams_processing_results.html | 328 +++++++-------
 ...ipe_different_processing_against_stream.html | 284 ++++++------
 .../recipe_dynamic_analytic_control.html        |  50 +--
 .../recipes/recipe_external_filter_range.html   |  34 +-
 content/recipes/recipe_hello_quarks.html        |  56 +--
 content/recipes/recipe_source_function.html     |  96 ++--
 content/recipes/recipe_value_out_of_range.html  | 237 +++++-----
 content/titlepage.html                          |   4 +-
 content/tocpage.html                            |   2 +-
 35 files changed, 1038 insertions(+), 1065 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/404.html
----------------------------------------------------------------------
diff --git a/content/404.html b/content/404.html
index aeb06f5..ad03750 100644
--- a/content/404.html
+++ b/content/404.html
@@ -612,7 +612,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[7/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/committers.html
----------------------------------------------------------------------
diff --git a/content/docs/committers.html b/content/docs/committers.html
index 210bde3..8787919 100644
--- a/content/docs/committers.html
+++ b/content/docs/committers.html
@@ -588,7 +588,7 @@ $('#toc').on('click', 'a', function() {
 <p>You can become a committer by contributing to Quarks. Qualifications for a new committer include:</p>
 
 <ul>
-<li><p><strong>Sustained Contributions</strong>: Potential committers should have a history of contributions to Quarks. They will create pull requests over a period of time.  </p></li>
+<li><p><strong>Sustained Contributions</strong>: Potential committers should have a history of contributions to Quarks. They will create pull requests over a period of time.</p></li>
 <li><p><strong>Quality of Contributions</strong>: Potential committers should submit code that adds value to Quarks, including tests and documentation as needed. They should comment in a positive way on issues and pull requests, providing guidance and input to improve Quarks.</p></li>
 <li><p><strong>Community Involvement</strong>: Committers should participate in discussions in a positive way, triage and fix bugs, and interact with users who submit questions. They will remain courteous, and helpful, and encourage new members to join the Quarks community.</p></li>
 </ul>
@@ -624,7 +624,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/common-quarks-operations.html
----------------------------------------------------------------------
diff --git a/content/docs/common-quarks-operations.html b/content/docs/common-quarks-operations.html
index 4a896ea..78334bd 100644
--- a/content/docs/common-quarks-operations.html
+++ b/content/docs/common-quarks-operations.html
@@ -583,48 +583,48 @@ $('#toc').on('click', 'a', function() {
 
 <h2 id="tstream-map">TStream.map()</h2>
 
-<p>TStream.map() is arguably the most used method in the Quarks API. Its two main purposes are to perform stateful or stateless operations on a stream&#39;s tuples, and to produce a TStream with tuples of a different type from that of the calling stream.</p>
+<p><code>TStream.map()</code> is arguably the most used method in the Quarks API. Its two main purposes are to perform stateful or stateless operations on a stream&#39;s tuples, and to produce a <code>TStream</code> with tuples of a different type from that of the calling stream.</p>
 
 <h3 id="changing-a-tstream-39-s-tuple-type">Changing a TStream&#39;s tuple type</h3>
 
-<p>In addition to filtering tuples, TStreams support operations that <em>transform</em> tuples from one Java type to another by invoking the TStream.map() method.</p>
+<p>In addition to filtering tuples, <code>TStream</code>s support operations that <em>transform</em> tuples from one Java type to another by invoking the <code>TStream.map()</code> method.</p>
 
-<p><img src="images/Map_Type_Change.jpg" style="width:750px;height:150px;"></p>
+<p><img src="images/Map_Type_Change.jpg" alt="Image of a type change" style="width:750px; height:150px;"></p>
 
-<p>This is useful in cases such as calculating the floating point average of a list of Integers, or tokenizing a Java String into a list of Strings. To demonstrate this, let&#39;s say we have a TStream which contains a few lines, each of which contains multiple words:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span>
-            <span class="s">"this is a line"</span><span class="o">,</span>
-            <span class="s">"this is another line"</span><span class="o">,</span>
-            <span class="s">"there are three lines now"</span><span class="o">,</span>
-            <span class="s">"and now four"</span>
-        <span class="o">);</span>
+<p>This is useful in cases such as calculating the floating point average of a list of <code>Integer</code>s, or tokenizing a Java String into a list of <code>String</code>s. To demonstrate this, let&#39;s say we have a <code>TStream</code> which contains a few lines, each of which contains multiple words:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">lines</span> <span class="o">=</span> <span class="n">topology</span><span class="o">.</span><span class="na">strings</span><span class="o">(</span>
+    <span class="s">"this is a line"</span><span class="o">,</span>
+    <span class="s">"this is another line"</span><span class="o">,</span>
+    <span class="s">"there are three lines now"</span><span class="o">,</span>
+    <span class="s">"and now four"</span>
+<span class="o">);</span>
 </code></pre></div>
-<p>We then want to print the third word in each line. The best way to do this is to convert each line to a list of Strings by tokenizing them. We can do this in one line of code with the TStream.map() method:</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="o">&gt;</span> <span class="n">wordsInLine</span> <span class="o">=</span> <span class="n">lines</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span><span class="n">tuple</span><span class="o">.</span><span class="na">split</span><span class="o">(</span><span class="s">" "</span><span class="o">)));</span>
+<p>We then want to print the third word in each line. The best way to do this is to convert each line to a list of <code>String</code>s by tokenizing them. We can do this in one line of code with the <code>TStream.map()</code> method:</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">List</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="o">&gt;</span> <span class="n">wordsInLine</span> <span class="o">=</span> <span class="n">lines</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span><span class="n">tuple</span><span class="o">.</span><span class="na">split</span><span class="o">(</span><span class="s">" "</span><span class="o">)));</span>
 </code></pre></div>
-<p>Since each tuple is now a list of strings, the <em>wordsInLine</em> stream is of type List<String>. As you can see, the map() method has the ability to change the type of the TStream. Finally, we can use the <em>wordsInLine</em> stream to print the third word in each line.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">wordsInLine</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">list</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">list</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">2</span><span class="o">)));</span>
+<p>Since each tuple is now a list of strings, the <code>wordsInLine</code> stream is of type <code>List&lt;String&gt;</code>. As you can see, the <code>map()</code> method has the ability to change the type of the <code>TStream</code>. Finally, we can use the <code>wordsInLine</code> stream to print the third word in each line.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">wordsInLine</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">list</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">list</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">2</span><span class="o">)));</span>
 </code></pre></div>
-<p>As mentioned in the <a href="quarks-getting-started">Getting started guide</a>, a TStream can be parameterized to any serializable Java type, including ones created by the user.</p>
+<p>As mentioned in the <a href="quarks-getting-started">Getting started guide</a>, a <code>TStream</code> can be parameterized to any serializable Java type, including ones created by the user.</p>
 
 <h3 id="performing-stateful-operations">Performing stateful operations</h3>
 
-<p>In all previous examples, the operations performed on a TStream have been stateless; keeping track of information over multiple invocations of the same operation has not been necessary. What if we want to keep track of the number of Strings sent over a stream? To do this, we need our TStream.map() method to contain a counter as state.</p>
+<p>In all previous examples, the operations performed on a <code>TStream</code> have been stateless; keeping track of information over multiple invocations of the same operation has not been necessary. What if we want to keep track of the number of Strings sent over a stream? To do this, we need our <code>TStream.map()</code> method to contain a counter as state.</p>
 
-<p><img src="images/Map_Stateful.jpg" style="width:750px;height:150px;"></p>
+<p><img src="images/Map_Stateful.jpg" alt="Image of a stateful operation" style="width:750px; height:150px;"></p>
 
-<p>This can be achieved by creating an anonymous Function class, and giving it the required fields.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">streamOfStrings</span> <span class="o">=</span> <span class="o">...;</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">counts</span> <span class="o">=</span> <span class="n">streamOfStrings</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="k">new</span> <span class="n">Function</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;(){</span>
-            <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span>
-            <span class="nd">@Override</span>
-            <span class="kd">public</span> <span class="n">Integer</span> <span class="n">apply</span><span class="o">(</span><span class="n">String</span> <span class="n">arg0</span><span class="o">)</span> <span class="o">{</span>
-                <span class="n">count</span> <span class="o">=</span> <span class="n">count</span> <span class="o">+</span> <span class="mi">1</span><span class="o">;</span>
-                <span class="k">return</span> <span class="n">count</span><span class="o">;</span>
-            <span class="o">}</span>
-        <span class="o">});</span>
+<p>This can be achieved by creating an anonymous <code>Function</code> class, and giving it the required fields.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">streamOfStrings</span> <span class="o">=</span> <span class="o">...;</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span> <span class="n">counts</span> <span class="o">=</span> <span class="n">streamOfStrings</span><span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="k">new</span> <span class="n">Function</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;()</span> <span class="o">{</span>
+    <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">Integer</span> <span class="n">apply</span><span class="o">(</span><span class="n">String</span> <span class="n">arg0</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">count</span> <span class="o">=</span> <span class="n">count</span> <span class="o">+</span> <span class="mi">1</span><span class="o">;</span>
+        <span class="k">return</span> <span class="n">count</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">});</span>
 </code></pre></div>
-<p>The <em>count</em> field will now contain the number of Strings which were sent over streamOfStrings. Although this is a simple example, the anonymous Function passed to TStream.map() can contain any kind of state! This could be a HashMap<K, T>, a running list of tuples, or any serializable Java type. The state will be maintained throughout the entire runtime of your application.</p>
+<p>The <code>count</code> field will now contain the number of <code>String</code>s which were sent over <code>streamOfStrings</code>. Although this is a simple example, the anonymous <code>Function</code> passed to <code>TStream.map()</code> can contain any kind of state! This could be a <code>HashMap&lt;K,V&gt;</code>, a running list of tuples, or any serializable Java type. The state will be maintained throughout the entire runtime of your application.</p>
 
 
 <div class="tags">
@@ -657,7 +657,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/docs/community.html
----------------------------------------------------------------------
diff --git a/content/docs/community.html b/content/docs/community.html
index e353d19..083db9b 100644
--- a/content/docs/community.html
+++ b/content/docs/community.html
@@ -594,9 +594,9 @@ $('#toc').on('click', 'a', function() {
 <li>Contribute code, javadocs, documentation.</li>
 </ul>
 
-<p>Visit the <a href="http://www.apache.org/foundation/getinvolved.html">Contributing</a> page for general Apache contribution information. If you plan to make any significant contribution, you will need to have an Individual Contributor License Agreement <a href="https://www.apache.org/licenses/icla.txt">(ICLA)</a>  on file with Apache.</p>
+<p>Visit the <a href="http://www.apache.org/foundation/getinvolved.html">Contributing</a> page for general Apache contribution information. If you plan to make any significant contribution, you will need to have an Individual Contributor License Agreement <a href="https://www.apache.org/licenses/icla.txt">(ICLA)</a> on file with Apache.</p>
 
-<h3 id="mailing-list">Mailing list</h3>
+<h2 id="mailing-list">Mailing list</h2>
 
 <p>Get help using Quarks or contribute to the project on our mailing lists:</p>
 
@@ -605,48 +605,46 @@ $('#toc').on('click', 'a', function() {
 <li><a href="mailto:commits@quarks.incubator.apache.org">commits@quarks.incubator.apache.org</a> is for commit messages and patches to Quarks. <a href="mailto:commits-subscribe@quarks.incubator.apache.org?subject=send%20this%20email%20to%20subscribe">subscribe</a>, <a href="mailto:commits-unsubscribe@quarks.incubator.apache.org?subject=send%20this%20email%20to%20unsubscribe">unsubscribe</a>, <a href="http://mail-archives.apache.org/mod_mbox/incubator-quarks-commits/">Apache archives</a>, <a href="https://www.mail-archive.com/commits@quarks.incubator.apache.org/">mail-archive.com archives</a></li>
 </ul>
 
-<h3 id="issue-tracker">Issue tracker</h3>
+<h2 id="issue-tracker">Issue tracker</h2>
 
 <p>We use Jira here: <a href="https://issues.apache.org/jira/browse/QUARKS">https://issues.apache.org/jira/browse/QUARKS</a></p>
 
-<h4 id="bug-reports">Bug reports</h4>
+<h3 id="bug-reports">Bug reports</h3>
 
-<p>Found bug? Enter an issue in  <a href="https://issues.apache.org/jira/browse/QUARKS">Jira</a>.</p>
+<p>Found bug? Create an issue in <a href="https://issues.apache.org/jira/browse/QUARKS">Jira</a>.</p>
 
 <p>Before submitting an issue, please:</p>
 
 <ul>
-<li>Verify that the bug does in fact exist.</li>
-<li>Search the issue tracker to verify there is no existing issue reporting the bug you&#39;ve found.</li>
-<li>Consider tracking down the bug yourself in the Quarks source and submitting a pull request  along with your bug report. This is a great time saver for the  Quarks developers and helps ensure the bug will be fixed quickly.</li>
+<li>Verify that the bug does in fact exist</li>
+<li>Search the issue tracker to verify there is no existing issue reporting the bug you&#39;ve found</li>
+<li>Consider tracking down the bug yourself in the Quarks source and submitting a pull request along with your bug report. This is a great time saver for the Quarks developers and helps ensure the bug will be fixed quickly.</li>
 </ul>
 
-<h4 id="feature-requests">Feature requests</h4>
+<h3 id="feature-requests">Feature requests</h3>
 
-<p>Enhancement requests for new features are also welcome. The more concrete the request is and the better rationale you provide, the greater the chance it will incorporated into future releases.</p>
+<p>Enhancement requests for new features are also welcome. The more concrete the request is and the better rationale you provide, the greater the chance it will incorporated into future releases. To make a request, create an issue in <a href="https://issues.apache.org/jira/browse/QUARKS">Jira</a>.</p>
 
-<p><a href="https://issues.apache.org/jira/browse/QUARKS">https://issues.apache.org/jira/browse/QUARKS</a></p>
+<h2 id="source-code">Source code</h2>
 
-<h3 id="source-code">Source code</h3>
+<p>The project sources are accessible via the <a href="https://git-wip-us.apache.org/repos/asf/incubator-quarks.git">source code repository</a> which is also mirrored in <a href="https://github.com/apache/incubator-quarks">GitHub</a>.</p>
 
-<p>The project sources are accessible via the <a href="https://git-wip-us.apache.org/repos/asf/incubator-quarks.git">source code repository</a> which is also mirrored in <a href="https://github.com/apache/incubator-quarks">GitHub</a>. </p>
+<p>When you are considering a code contribution, make sure there is an <a href="https://issues.apache.org/jira/browse/QUARKS">Jira issue</a> that describes your work or the bug you are fixing. For significant contributions, please discuss your proposed changes in the issue so that others can comment on your plans. Someone else may be working on the same functionality, so it&#39;s good to communicate early and often. A committer is more likely to accept your change if there is clear information in the issue.</p>
 
-<p>When you are considering a code contribution, make sure there is an <a href="https://issues.apache.org/jira/browse/QUARKS">Issue</a> that describes your work or the bug you are fixing.  For significant contributions, please discuss your proposed changes in the Issue so that others can comment on your plans.  Someone else may be working on the same functionality, so it&#39;s good to communicate early and often.  A committer is more likely to accept your change if there is clear information in the Issue. </p>
-
-<p>To contribute, <a href="https://help.github.com/articles/fork-a-repo/">fork</a> the <a href="https://github.com/apache/incubator-quarks">mirror</a> and issue a pull request. Put the Jira issue number, e.g. QUARKS-100 in the pull request title. The tag [WIP] can also be used in the title of pull requests to indicate that you are not ready to merge but want feedback. Remove [WIP] when you are ready for merge. Make sure you document your code and contribute tests along with the code.</p>
+<p>To contribute, <a href="https://help.github.com/articles/fork-a-repo/">fork</a> the <a href="https://github.com/apache/incubator-quarks">mirror</a> and issue a <a href="https://help.github.com/articles/using-pull-requests/">pull request</a>. Put the Jira issue number, e.g. QUARKS-100 in the pull request title. The tag [WIP] can also be used in the title of pull requests to indicate that you are not ready to merge but want feedback. Remove [WIP] when you are ready for merge. Make sure you document your code and contribute tests along with the code.</p>
 
 <p>Read <a href="https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md">DEVELOPMENT.md</a> at the top of the code tree for details on setting up your development environment.</p>
 
-<h3 id="web-site-and-documentation-source-code">Web site and documentation source code</h3>
+<h2 id="web-site-and-documentation-source-code">Web site and documentation source code</h2>
 
-<p>The project website and documentation sources are accessible via the <a href="https://git-wip-us.apache.org/repos/asf/incubator-quarks-website.git">website source code repository</a> which is also mirrored in <a href="https://github.com/apache/incubator-quarks-website">GitHub</a>. Contributing changes to the web site and documentation is similar to contributing code.  Follow the instructions in the Source Code section above, but fork and issue a pull request against the <a href="https://github.com/apache/incubator-quarks-website">web site mirror</a>. Follow the instructions in the top level <a href="https://github.com/apache/incubator-quarks-website/blob/master/README.md">README.md</a> for details on contributing to the web site and documentation.</p>
+<p>The project website and documentation sources are accessible via the <a href="https://git-wip-us.apache.org/repos/asf/incubator-quarks-website.git">website source code repository</a> which is also mirrored in <a href="https://github.com/apache/incubator-quarks-website">GitHub</a>. Contributing changes to the web site and documentation is similar to contributing code. Follow the instructions in the <em>Source Code</em> section above, but fork and issue a pull request against the <a href="https://github.com/apache/incubator-quarks-website">web site mirror</a>. Follow the instructions in the top-level <a href="https://github.com/apache/incubator-quarks-website/blob/master/README.md">README.md</a> for details on contributing to the web site and documentation.</p>
 
-<p>You will need to use Markdown and Jekyll to develop pages. See:</p>
+<p>You will need to use <a href="https://daringfireball.net/projects/markdown/">Markdown</a> and <a href="http://jekyllrb.com">Jekyll</a> to develop pages. See:</p>
 
 <ul>
 <li><a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">Markdown Cheat Sheet</a></li>
-<li> <a href="https://jekyllrb.com/">Jekyll on linux and Mac</a></li>
-<li> <a href="https://jekyllrb.com/docs/windows/">Jekyll on Windows</a> is not officially supported but people have gotten it to work.</li>
+<li><a href="https://jekyllrb.com/">Jekyll on linux and Mac</a></li>
+<li><a href="https://jekyllrb.com/docs/windows/">Jekyll on Windows</a> is not officially supported but people have gotten it to work</li>
 </ul>
 
 
@@ -680,7 +678,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[3/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_combining_streams_processing_results.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_combining_streams_processing_results.html b/content/recipes/recipe_combining_streams_processing_results.html
index 714cb30..83c5d17 100644
--- a/content/recipes/recipe_combining_streams_processing_results.html
+++ b/content/recipes/recipe_combining_streams_processing_results.html
@@ -590,177 +590,177 @@ $('#toc').on('click', 'a', function() {
 <p>We assume that the environment has been set up following the steps outlined in the <a href="../docs/quarks-getting-started">Getting started guide</a>.</p>
 
 <p>First, we need to define a class for a heart monitor. We generate random blood pressure readings, each consisting of the systolic pressure (the top number) and the diastolic pressure (the bottom number). For example, with a blood pressure of 115/75 (read as &quot;115 over 75&quot;), the systolic pressure is 115 and the diastolic pressure is 75. These two pressures are stored in a <code>map</code>, and each call to <code>get()</code> returns new values.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">java.util.HashMap</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.Map</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.Random</span><span class="o">;</span>
-
-    <span class="kn">import</span> <span class="nn">quarks.function.Supplier</span><span class="o">;</span>
-
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">HeartMonitorSensor</span> <span class="kd">implements</span> <span class="n">Supplier</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span><span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="o">{</span>
-        <span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="kt">long</span> <span class="n">serialVersionUID</span> <span class="o">=</span> <span class="mi">1L</span><span class="o">;</span>
-        <span class="c1">// Initial blood pressure</span>
-        <span class="kd">public</span> <span class="n">Integer</span> <span class="n">currentSystolic</span> <span class="o">=</span> <span class="mi">115</span><span class="o">;</span>
-        <span class="kd">public</span> <span class="n">Integer</span> <span class="n">currentDiastolic</span> <span class="o">=</span> <span class="mi">75</span><span class="o">;</span>
-        <span class="n">Random</span> <span class="n">rand</span><span class="o">;</span>
-
-        <span class="kd">public</span> <span class="n">HeartMonitorSensor</span><span class="o">()</span> <span class="o">{</span>
-            <span class="n">rand</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Random</span><span class="o">();</span>
-        <span class="o">}</span>
-
-        <span class="cm">/**
-         * Every call to this method returns a map containing a random systolic
-         * pressure and a random diastolic pressure.
-         */</span>
-        <span class="nd">@Override</span>
-        <span class="kd">public</span> <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;</span> <span class="n">get</span><span class="o">()</span> <span class="o">{</span>
-            <span class="c1">// Change the current pressure by some random amount between -2 and 2</span>
-            <span class="n">Integer</span> <span class="n">newSystolic</span> <span class="o">=</span> <span class="n">rand</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="mi">2</span><span class="o">)</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">+</span> <span class="n">currentSystolic</span><span class="o">;</span>
-            <span class="n">currentSystolic</span> <span class="o">=</span> <span class="n">newSystolic</span><span class="o">;</span>
-
-            <span class="n">Integer</span> <span class="n">newDiastolic</span> <span class="o">=</span> <span class="n">rand</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="mi">2</span><span class="o">)</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">+</span> <span class="n">currentDiastolic</span><span class="o">;</span>
-            <span class="n">currentDiastolic</span> <span class="o">=</span> <span class="n">newDiastolic</span><span class="o">;</span>
-
-            <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;</span> <span class="n">pressures</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;();</span>
-            <span class="n">pressures</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">,</span> <span class="n">currentSystolic</span><span class="o">);</span>
-            <span class="n">pressures</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">,</span> <span class="n">currentDiastolic</span><span class="o">);</span>
-            <span class="k">return</span> <span class="n">pressures</span><span class="o">;</span>
-        <span class="o">}</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.HashMap</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.Map</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.Random</span><span class="o">;</span>
+
+<span class="kn">import</span> <span class="nn">quarks.function.Supplier</span><span class="o">;</span>
+
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">HeartMonitorSensor</span> <span class="kd">implements</span> <span class="n">Supplier</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span><span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="o">{</span>
+    <span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="kt">long</span> <span class="n">serialVersionUID</span> <span class="o">=</span> <span class="mi">1L</span><span class="o">;</span>
+    <span class="c1">// Initial blood pressure</span>
+    <span class="kd">public</span> <span class="n">Integer</span> <span class="n">currentSystolic</span> <span class="o">=</span> <span class="mi">115</span><span class="o">;</span>
+    <span class="kd">public</span> <span class="n">Integer</span> <span class="n">currentDiastolic</span> <span class="o">=</span> <span class="mi">75</span><span class="o">;</span>
+    <span class="n">Random</span> <span class="n">rand</span><span class="o">;</span>
+
+    <span class="kd">public</span> <span class="n">HeartMonitorSensor</span><span class="o">()</span> <span class="o">{</span>
+        <span class="n">rand</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Random</span><span class="o">();</span>
     <span class="o">}</span>
+
+    <span class="cm">/**
+     * Every call to this method returns a map containing a random systolic
+     * pressure and a random diastolic pressure.
+     */</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;</span> <span class="n">get</span><span class="o">()</span> <span class="o">{</span>
+        <span class="c1">// Change the current pressure by some random amount between -2 and 2</span>
+        <span class="n">Integer</span> <span class="n">newSystolic</span> <span class="o">=</span> <span class="n">rand</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="mi">2</span><span class="o">)</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">+</span> <span class="n">currentSystolic</span><span class="o">;</span>
+        <span class="n">currentSystolic</span> <span class="o">=</span> <span class="n">newSystolic</span><span class="o">;</span>
+
+        <span class="n">Integer</span> <span class="n">newDiastolic</span> <span class="o">=</span> <span class="n">rand</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="mi">2</span><span class="o">)</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">+</span> <span class="n">currentDiastolic</span><span class="o">;</span>
+        <span class="n">currentDiastolic</span> <span class="o">=</span> <span class="n">newDiastolic</span><span class="o">;</span>
+
+        <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;</span> <span class="n">pressures</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;();</span>
+        <span class="n">pressures</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">,</span> <span class="n">currentSystolic</span><span class="o">);</span>
+        <span class="n">pressures</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">,</span> <span class="n">currentDiastolic</span><span class="o">);</span>
+        <span class="k">return</span> <span class="n">pressures</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 <p>Now, let&#39;s start our application by creating a <code>DirectProvider</code> and <code>Topology</code>. We choose a <code>DevelopmentProvider</code> so that we can view the topology graph using the console URL. We have also created a <code>HeartMonitor</code>.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kn">import</span> <span class="nn">java.util.HashSet</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.Map</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.Set</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.HashSet</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.List</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.Map</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.Set</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
 
-    <span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.function.ToIntFunction</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.HeartMonitorSensor</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
-    <span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.console.server.HttpServer</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.function.ToIntFunction</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.development.DevelopmentProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.providers.direct.DirectProvider</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.samples.utils.sensor.HeartMonitorSensor</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.TStream</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">quarks.topology.Topology</span><span class="o">;</span>
 
-    <span class="kd">public</span> <span class="kd">class</span> <span class="nc">CombiningStreamsProcessingResults</span> <span class="o">{</span>
-        <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
-            <span class="n">HeartMonitorSensor</span> <span class="n">monitor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HeartMonitorSensor</span><span class="o">();</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">CombiningStreamsProcessingResults</span> <span class="o">{</span>
+    <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="n">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span>
+        <span class="n">HeartMonitorSensor</span> <span class="n">monitor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HeartMonitorSensor</span><span class="o">();</span>
 
-            <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
+        <span class="n">DirectProvider</span> <span class="n">dp</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DevelopmentProvider</span><span class="o">();</span>
 
-            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
+        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">dp</span><span class="o">.</span><span class="na">getServices</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpServer</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">getConsoleUrl</span><span class="o">());</span>
 
-            <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"heartMonitor"</span><span class="o">);</span>
+        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="na">newTopology</span><span class="o">(</span><span class="s">"heartMonitor"</span><span class="o">);</span>
 
-            <span class="c1">// The rest of the code pieces belong here</span>
-        <span class="o">}</span>
+        <span class="c1">// The rest of the code pieces belong here</span>
     <span class="o">}</span>
+<span class="o">}</span>
 </code></pre></div>
 <h2 id="generating-heart-monitor-sensor-readings">Generating heart monitor sensor readings</h2>
 
 <p>The next step is to simulate a stream of readings. In our <code>main()</code>, we use the <code>poll()</code> method to generate a flow of tuples (readings), where each tuple arrives every millisecond. Unlikely readings are filtered out.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Generate a stream of heart monitor readings</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">readings</span> <span class="o">=</span> <span class="n">top</span>
-            <span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">monitor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">50</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">30</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&lt;</span> <span class="mi">200</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&lt;</span> <span class="mi">130</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Generate a stream of heart monitor readings</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">readings</span> <span class="o">=</span> <span class="n">top</span>
+        <span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">monitor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">MILLISECONDS</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">50</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">30</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&lt;</span> <span class="mi">200</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&lt;</span> <span class="mi">130</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="splitting-the-readings">Splitting the readings</h2>
 
 <p>We are now ready to split the <code>readings</code> stream by the blood pressure category. Let&#39;s look more closely at the method declaration of <code>split</code> below. For more details about <code>split</code>, refer to the <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/topology/TStream.html#split-int-quarks.function.ToIntFunction-">Javadoc</a>.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">java</span><span class="o">.</span><span class="na">util</span><span class="o">.</span><span class="na">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;</span> <span class="n">split</span><span class="o">(</span><span class="kt">int</span> <span class="n">n</span><span class="o">,</span> <span class="n">ToIntFunction</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">splitter</span><span class="o">)</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">java</span><span class="o">.</span><span class="na">util</span><span class="o">.</span><span class="na">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;</span> <span class="n">split</span><span class="o">(</span><span class="kt">int</span> <span class="n">n</span><span class="o">,</span> <span class="n">ToIntFunction</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">splitter</span><span class="o">)</span>
 </code></pre></div>
 <p><code>split</code> returns a <code>List</code> of <code>TStream</code> objects, where each item in the list is one of the resulting output streams. In this case, one stream in the list will contain a flow of tuples where the blood pressure reading belongs to one of the five blood pressure categories. Another stream will contain a flow of tuples where the blood pressure reading belongs to a different blood pressure category, and so on.</p>
 
 <p>There are two input parameters. You must specify <code>n</code>, the number of output streams, as well as a <code>splitter</code> method. <code>splitter</code> processes each incoming tuple individually and determines on which of the output streams the tuple will be placed. In this method, you can break down your placement rules into different branches, where each branch returns an integer indicating the index of the output stream in the list.</p>
 
 <p>Going back to our example, let&#39;s see how we can use <code>split</code> to achieve our goal. We pass in <code>6</code> as the first argument, as we want five output streams (i.e., a stream for each of the five different blood pressure categories) in addition one stream for invalid values. Our <code>splitter</code> method should then define how tuples will be placed on each of the five streams. We define a rule for each category, such that if the systolic and diastolic pressures of a reading fall in a certain range, then that reading belongs to a specific category. For example, if we are processing a tuple with a blood pressure reading of 150/95 (<em>High Blood Pressure (Hypertension) Stage 1</em> category), then we return <code>2</code>, meaning that the tuple will be placed in the stream at index <code>2</code> in the <code>categories</code> list. We follow a similar process for the other 4 categories, ordering the streams from lowest to highest severity.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="n">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;&gt;</span> <span class="n">categories</span> <span class="o">=</span> <span class="n">readings</span><span class="o">.</span><span class="na">split</span><span class="o">(</span><span class="mi">6</span><span class="o">,</span> <span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
-        <span class="kt">int</span> <span class="n">s</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">);</span>
-        <span class="kt">int</span> <span class="n">d</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">);</span>
-        <span class="k">if</span> <span class="o">(</span><span class="n">s</span> <span class="o">&lt;</span> <span class="mi">120</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;</span> <span class="mi">80</span><span class="o">)</span> <span class="o">{</span>
-            <span class="c1">// Normal</span>
-            <span class="k">return</span> <span class="mi">0</span><span class="o">;</span>
-        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">120</span> <span class="o">&amp;&amp;</span> <span class="n">s</span> <span class="o">&lt;=</span> <span class="mi">139</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">80</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;=</span> <span class="mi">89</span><span class="o">))</span> <span class="o">{</span>
-            <span class="c1">// Prehypertension</span>
-            <span class="k">return</span> <span class="mi">1</span><span class="o">;</span>
-        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">140</span> <span class="o">&amp;&amp;</span> <span class="n">s</span> <span class="o">&lt;=</span> <span class="mi">159</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">90</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;=</span> <span class="mi">99</span><span class="o">))</span> <span class="o">{</span>
-            <span class="c1">// High Blood Pressure (Hypertension) Stage 1</span>
-            <span class="k">return</span> <span class="mi">2</span><span class="o">;</span>
-        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">160</span> <span class="o">&amp;&amp;</span> <span class="n">s</span> <span class="o">&lt;=</span> <span class="mi">179</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">100</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;=</span> <span class="mi">109</span><span class="o">))</span> <span class="o">{</span>
-            <span class="c1">// High Blood Pressure (Hypertension) Stage 2</span>
-            <span class="k">return</span> <span class="mi">3</span><span class="o">;</span>
-        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">180</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">110</span><span class="o">)</span>  <span class="o">{</span>
-            <span class="c1">// Hypertensive Crisis</span>
-            <span class="k">return</span> <span class="mi">4</span><span class="o">;</span>
-        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
-            <span class="c1">// Invalid</span>
-            <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
-        <span class="o">}</span>
-    <span class="o">});</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">List</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;&gt;</span> <span class="n">categories</span> <span class="o">=</span> <span class="n">readings</span><span class="o">.</span><span class="na">split</span><span class="o">(</span><span class="mi">6</span><span class="o">,</span> <span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
+    <span class="kt">int</span> <span class="n">s</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">);</span>
+    <span class="kt">int</span> <span class="n">d</span> <span class="o">=</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">);</span>
+    <span class="k">if</span> <span class="o">(</span><span class="n">s</span> <span class="o">&lt;</span> <span class="mi">120</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;</span> <span class="mi">80</span><span class="o">)</span> <span class="o">{</span>
+        <span class="c1">// Normal</span>
+        <span class="k">return</span> <span class="mi">0</span><span class="o">;</span>
+    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">120</span> <span class="o">&amp;&amp;</span> <span class="n">s</span> <span class="o">&lt;=</span> <span class="mi">139</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">80</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;=</span> <span class="mi">89</span><span class="o">))</span> <span class="o">{</span>
+        <span class="c1">// Prehypertension</span>
+        <span class="k">return</span> <span class="mi">1</span><span class="o">;</span>
+    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">140</span> <span class="o">&amp;&amp;</span> <span class="n">s</span> <span class="o">&lt;=</span> <span class="mi">159</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">90</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;=</span> <span class="mi">99</span><span class="o">))</span> <span class="o">{</span>
+        <span class="c1">// High Blood Pressure (Hypertension) Stage 1</span>
+        <span class="k">return</span> <span class="mi">2</span><span class="o">;</span>
+    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">160</span> <span class="o">&amp;&amp;</span> <span class="n">s</span> <span class="o">&lt;=</span> <span class="mi">179</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">100</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&lt;=</span> <span class="mi">109</span><span class="o">))</span> <span class="o">{</span>
+        <span class="c1">// High Blood Pressure (Hypertension) Stage 2</span>
+        <span class="k">return</span> <span class="mi">3</span><span class="o">;</span>
+    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">s</span> <span class="o">&gt;=</span> <span class="mi">180</span> <span class="o">&amp;&amp;</span> <span class="n">d</span> <span class="o">&gt;=</span> <span class="mi">110</span><span class="o">)</span>  <span class="o">{</span>
+        <span class="c1">// Hypertensive Crisis</span>
+        <span class="k">return</span> <span class="mi">4</span><span class="o">;</span>
+    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
+        <span class="c1">// Invalid</span>
+        <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">});</span>
 </code></pre></div>
 <p>Note that instead of <code>split</code>, we could have performed five different <code>filter</code> operations. However, <code>split</code> is favored for cleaner code and more efficient processing as each tuple is only analyzed once.</p>
 
 <h2 id="applying-different-processing-against-the-streams-to-generate-alerts">Applying different processing against the streams to generate alerts</h2>
 
 <p>At this point, we have 6 output streams, one for each blood pressure category and one for invalid values (which we will ignore). We can easily retrieve a stream by using the standard <code>List</code> operation <code>get()</code>. For instance, we can retrieve all heart monitor readings with a blood pressure reading in the <em>Normal</em> category by retrieving the <code>TStream</code> at index <code>0</code> as we defined previously. Similarly, we can retrieve the other streams associated with the other four categories. The streams are tagged so that we can easily locate them in the topology graph.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Get each individual stream</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">normal</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"normal"</span><span class="o">);</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">prehypertension</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">1</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"prehypertension"</span><span class="o">);</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">hypertension_stage1</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">2</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage1"</span><span class="o">);</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">hypertension_stage2</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">3</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">);</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">hypertensive</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">4</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Get each individual stream</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">normal</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">0</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"normal"</span><span class="o">);</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">prehypertension</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">1</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"prehypertension"</span><span class="o">);</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">hypertension_stage1</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">2</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage1"</span><span class="o">);</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">hypertension_stage2</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">3</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">);</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">&gt;&gt;</span> <span class="n">hypertensive</span> <span class="o">=</span> <span class="n">categories</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="mi">4</span><span class="o">).</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">);</span>
 </code></pre></div>
 <p>The hospital can then use these streams to perform analytics on each stream and generate alerts based on the blood pressure category. For this simple example, a different number of transformations/filters is applied to each stream (known as a processing pipeline) to illustrate that very different processing can be achieved that is specific to the category at hand.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Category: Normal</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">normalAlerts</span> <span class="o">=</span> <span class="n">normal</span>
-            <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">80</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">50</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"normal"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
-                <span class="k">return</span> <span class="s">"All is normal. BP is "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span>
-                        <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">".\n"</span><span class="o">;</span> <span class="o">})</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"normal"</span><span class="o">);</span>
-
-    <span class="c1">// Category: Prehypertension category</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">prehypertensionAlerts</span> <span class="o">=</span> <span class="n">prehypertension</span>
-            <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
-                <span class="k">return</span> <span class="s">"At high risk for developing hypertension. BP is "</span> <span class="o">+</span>
-                        <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">".\n"</span><span class="o">;</span> <span class="o">})</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"prehypertension"</span><span class="o">);</span>
-
-    <span class="c1">// Category: High Blood Pressure (Hypertension) Stage 1</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">hypertension_stage1Alerts</span> <span class="o">=</span> <span class="n">hypertension_stage1</span>
-            <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
-                <span class="k">return</span> <span class="s">"Monitor closely, patient has high blood pressure. "</span> <span class="o">+</span>
-                       <span class="s">"BP is "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">".\n"</span><span class="o">;</span> <span class="o">})</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage1"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="s">"High Blood Pressure (Hypertension) Stage 1\n"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage1"</span><span class="o">);</span>
-
-    <span class="c1">// Category: High Blood Pressure (Hypertension) Stage 2</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">hypertension_stage2Alerts</span> <span class="o">=</span> <span class="n">hypertension_stage2</span>
-            <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;=</span> <span class="mi">170</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&gt;=</span> <span class="mi">105</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">peek</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
-                <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"BP: "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)))</span>
-            <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
-                <span class="k">return</span> <span class="s">"Warning! Monitor closely, patient is at risk of a hypertensive crisis!\n"</span><span class="o">;</span> <span class="o">})</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="s">"High Blood Pressure (Hypertension) Stage 2\n"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">);</span>
-
-    <span class="c1">// Category: Hypertensive Crisis</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">hypertensiveAlerts</span> <span class="o">=</span> <span class="n">hypertensive</span>
-            <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;=</span> <span class="mi">180</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">peek</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
-                <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"BP: "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)))</span>
-            <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span> <span class="k">return</span> <span class="s">"Emergency! See to patient immediately!\n"</span><span class="o">;</span> <span class="o">})</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">toUpperCase</span><span class="o">())</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="s">"Hypertensive Crisis!!!\n"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">)</span>
-            <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Category: Normal</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">normalAlerts</span> <span class="o">=</span> <span class="n">normal</span>
+        <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">80</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&gt;</span> <span class="mi">50</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"normal"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
+            <span class="k">return</span> <span class="s">"All is normal. BP is "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span>
+                    <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">".\n"</span><span class="o">;</span> <span class="o">})</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"normal"</span><span class="o">);</span>
+
+<span class="c1">// Category: Prehypertension category</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">prehypertensionAlerts</span> <span class="o">=</span> <span class="n">prehypertension</span>
+        <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
+            <span class="k">return</span> <span class="s">"At high risk for developing hypertension. BP is "</span> <span class="o">+</span>
+                    <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">".\n"</span><span class="o">;</span> <span class="o">})</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"prehypertension"</span><span class="o">);</span>
+
+<span class="c1">// Category: High Blood Pressure (Hypertension) Stage 1</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">hypertension_stage1Alerts</span> <span class="o">=</span> <span class="n">hypertension_stage1</span>
+        <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
+            <span class="k">return</span> <span class="s">"Monitor closely, patient has high blood pressure. "</span> <span class="o">+</span>
+                   <span class="s">"BP is "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">".\n"</span><span class="o">;</span> <span class="o">})</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage1"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="s">"High Blood Pressure (Hypertension) Stage 1\n"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage1"</span><span class="o">);</span>
+
+<span class="c1">// Category: High Blood Pressure (Hypertension) Stage 2</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">hypertension_stage2Alerts</span> <span class="o">=</span> <span class="n">hypertension_stage2</span>
+        <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;=</span> <span class="mi">170</span> <span class="o">&amp;&amp;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)</span> <span class="o">&gt;=</span> <span class="mi">105</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">peek</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
+            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"BP: "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)))</span>
+        <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span>
+            <span class="k">return</span> <span class="s">"Warning! Monitor closely, patient is at risk of a hypertensive crisis!\n"</span><span class="o">;</span> <span class="o">})</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="s">"High Blood Pressure (Hypertension) Stage 2\n"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertension_stage2"</span><span class="o">);</span>
+
+<span class="c1">// Category: Hypertensive Crisis</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">hypertensiveAlerts</span> <span class="o">=</span> <span class="n">hypertensive</span>
+        <span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">&gt;=</span> <span class="mi">180</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">peek</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span>
+            <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"BP: "</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Systolic"</span><span class="o">)</span> <span class="o">+</span> <span class="s">"/"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"Diastolic"</span><span class="o">)))</span>
+        <span class="o">.</span><span class="na">map</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="o">{</span> <span class="k">return</span> <span class="s">"Emergency! See to patient immediately!\n"</span><span class="o">;</span> <span class="o">})</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">tuple</span><span class="o">.</span><span class="na">toUpperCase</span><span class="o">())</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">modify</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="s">"Hypertensive Crisis!!!\n"</span> <span class="o">+</span> <span class="n">tuple</span><span class="o">)</span>
+        <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"hypertensive"</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="combining-the-alert-streams">Combining the alert streams</h2>
 
@@ -769,16 +769,16 @@ $('#toc').on('click', 'a', function() {
 <p>There are two ways to define a union. You can either union a <code>TStream</code> with another <code>TStream</code>, or with a set of streams (<code>Set&lt;TStream&lt;T&gt;&gt;</code>). In both cases, a single <code>TStream</code> is returned containing the tuples that flow on the input stream(s).</p>
 
 <p>Let&#39;s look at the first case, unioning a stream with a single stream. We can create a stream containing <em>Normal</em> alerts and <em>Prehypertension</em> alerts by unioning <code>normalAlerts</code> with <code>prehypertensionAlerts</code>.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Additional processing for these streams could go here. In this case, union two streams</span>
-    <span class="c1">// to obtain a single stream containing alerts from the normal and prehypertension alert streams.</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">normalAndPrehypertensionAlerts</span> <span class="o">=</span> <span class="n">normalAlerts</span><span class="o">.</span><span class="na">union</span><span class="o">(</span><span class="n">prehypertensionAlerts</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Additional processing for these streams could go here. In this case, union two streams</span>
+<span class="c1">// to obtain a single stream containing alerts from the normal and prehypertension alert streams.</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">normalAndPrehypertensionAlerts</span> <span class="o">=</span> <span class="n">normalAlerts</span><span class="o">.</span><span class="na">union</span><span class="o">(</span><span class="n">prehypertensionAlerts</span><span class="o">);</span>
 </code></pre></div>
 <p>We can also create a stream containing alerts from all categories by looking at the other case, unioning a stream with a set of streams. We&#39;ll first create a set of <code>TStream</code> objects containing the alerts from the other three categories.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Set of streams containing alerts from the other categories</span>
-    <span class="n">Set</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">otherAlerts</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashSet</span><span class="o">&lt;&gt;();</span>
-    <span class="n">otherAlerts</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">hypertension_stage1Alerts</span><span class="o">);</span>
-    <span class="n">otherAlerts</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">hypertension_stage2Alerts</span><span class="o">);</span>
-    <span class="n">otherAlerts</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">hypertensiveAlerts</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Set of streams containing alerts from the other categories</span>
+<span class="n">Set</span><span class="o">&lt;</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;&gt;</span> <span class="n">otherAlerts</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashSet</span><span class="o">&lt;&gt;();</span>
+<span class="n">otherAlerts</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">hypertension_stage1Alerts</span><span class="o">);</span>
+<span class="n">otherAlerts</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">hypertension_stage2Alerts</span><span class="o">);</span>
+<span class="n">otherAlerts</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">hypertensiveAlerts</span><span class="o">);</span>
 </code></pre></div>
 <p>We can then create an <code>allAlerts</code> stream by calling <code>union</code> on <code>normalAndPrehypertensionAlerts</code> and <code>otherAlerts</code>. <code>allAlerts</code> will contain all of the tuples from:</p>
 
@@ -789,36 +789,36 @@ $('#toc').on('click', 'a', function() {
 <li><code>hypertension_stage2Alerts</code></li>
 <li><code>hypertensiveAlerts</code></li>
 </ol>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Union a stream with a set of streams to obtain a single stream containing alerts from</span>
-    <span class="c1">// all alert streams</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">allAlerts</span> <span class="o">=</span> <span class="n">normalAndPrehypertensionAlerts</span><span class="o">.</span><span class="na">union</span><span class="o">(</span><span class="n">otherAlerts</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Union a stream with a set of streams to obtain a single stream containing alerts from</span>
+<span class="c1">// all alert streams</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">allAlerts</span> <span class="o">=</span> <span class="n">normalAndPrehypertensionAlerts</span><span class="o">.</span><span class="na">union</span><span class="o">(</span><span class="n">otherAlerts</span><span class="o">);</span>
 </code></pre></div>
 <p>Finally, we can terminate the stream and print out all alerts.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Terminate the stream by printing out alerts from all categories</span>
-    <span class="n">allAlerts</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Terminate the stream by printing out alerts from all categories</span>
+<span class="n">allAlerts</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
 </code></pre></div>
-<p>We end our application by submitting the <code>Topology</code>. Note that this application is available as a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/samples/topology/package-summary.html">sample</a>.</p>
+<p>We end our application by submitting the <code>Topology</code>. Note that this application is available as a <a href="https://github.com/apache/incubator-quarks/blob/master/samples/topology/src/main/java/quarks/samples/topology/CombiningStreamsProcessingResults.java">sample</a>.</p>
 
 <h2 id="observing-the-output">Observing the output</h2>
 
 <p>When the final application is run, the output looks something like the following:</p>
-<div class="highlight"><pre><code class="language-" data-lang="">    BP: 176/111
-    High Blood Pressure (Hypertension) Stage 2
-    Warning! Monitor closely, patient is at risk of a hypertensive crisis!
+<div class="highlight"><pre><code class="language-" data-lang="">BP: 176/111
+High Blood Pressure (Hypertension) Stage 2
+Warning! Monitor closely, patient is at risk of a hypertensive crisis!
 
-    BP: 178/111
-    High Blood Pressure (Hypertension) Stage 2
-    Warning! Monitor closely, patient is at risk of a hypertensive crisis!
+BP: 178/111
+High Blood Pressure (Hypertension) Stage 2
+Warning! Monitor closely, patient is at risk of a hypertensive crisis!
 
-    BP: 180/110
-    Hypertensive Crisis!!!
-    EMERGENCY! SEE TO PATIENT IMMEDIATELY!
+BP: 180/110
+Hypertensive Crisis!!!
+EMERGENCY! SEE TO PATIENT IMMEDIATELY!
 </code></pre></div>
 <h2 id="a-look-at-the-topology-graph">A look at the topology graph</h2>
 
 <p>Let&#39;s see what the topology graph looks like. We can view it using the console URL that was printed to standard output at the start of the application. Notice how the graph makes it easier to visualize the resulting flow of the application.</p>
 
-<p><img src="images/combining_streams_processing_results_topology_graph.jpg"></p>
+<p><img src="images/combining_streams_processing_results_topology_graph.jpg" alt="Image of the topology graph"></p>
 
 
 <div class="tags">
@@ -851,7 +851,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>


[8/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/algolia_search.json
----------------------------------------------------------------------
diff --git a/content/algolia_search.json b/content/algolia_search.json
index 4d0a280..b24dd92 100644
--- a/content/algolia_search.json
+++ b/content/algolia_search.json
@@ -13,7 +13,7 @@
 "keywords": "",
 "url": "../docs/committers",
 "summary": "",
-"body": "## Commit activityTo see commit activity for Quarks, click [here](https://github.com/apache/incubator-quarks/pulse).## How to become a committerYou can become a committer by contributing to Quarks. Qualifications for a new committer include:* **Sustained Contributions**: Potential committers should have a history of contributions to Quarks. They will create pull requests over a period of time.  * **Quality of Contributions**: Potential committers should submit code that adds value to Quarks, including tests and documentation as needed. They should comment in a positive way on issues and pull requests, providing guidance and input to improve Quarks.* **Community Involvement**: Committers should participate in discussions in a positive way, triage and fix bugs, and interact with users who submit questions. They will remain courteous, and helpful, and encourage new members to join the Quarks community."
+"body": "## Commit activityTo see commit activity for Quarks, click [here](https://github.com/apache/incubator-quarks/pulse).## How to become a committerYou can become a committer by contributing to Quarks. Qualifications for a new committer include:* **Sustained Contributions**: Potential committers should have a history of contributions to Quarks. They will create pull requests over a period of time.* **Quality of Contributions**: Potential committers should submit code that adds value to Quarks, including tests and documentation as needed. They should comment in a positive way on issues and pull requests, providing guidance and input to improve Quarks.* **Community Involvement**: Committers should participate in discussions in a positive way, triage and fix bugs, and interact with users who submit questions. They will remain courteous, and helpful, and encourage new members to join the Quarks community."
 
 },
 
@@ -26,7 +26,7 @@
 "keywords": "",
 "url": "../docs/common-quarks-operations",
 "summary": "",
-"body": "In the [Getting started guide](quarks-getting-started), we covered a Quarks application where we read from a device's simulated temperature sensor. Yet Quarks supports more operations than simple filtering. Data analysis and streaming require a suite of functionality, the most important components of which will be outlined below.## TStream.map()TStream.map() is arguably the most used method in the Quarks API. Its two main purposes are to perform stateful or stateless operations on a stream's tuples, and to produce a TStream with tuples of a different type from that of the calling stream.### Changing a TStream's tuple typeIn addition to filtering tuples, TStreams support operations that *transform* tuples from one Java type to another by invoking the TStream.map() method.This is useful in cases such as calculating the floating point average of a list of Integers, or tokenizing a Java String into a list of Strings. To demonstrate this, let's say we have a TStream which contai
 ns a few lines, each of which contains multiple words:```java    TStream lines = topology.strings(            \"this is a line\",            \"this is another line\",            \"there are three lines now\",            \"and now four\"        );```We then want to print the third word in each line. The best way to do this is to convert each line to a list of Strings by tokenizing them. We can do this in one line of code with the TStream.map() method:```java    TStream > wordsInLine = lines.map(tuple -> Arrays.asList(tuple.split(\" \")));```Since each tuple is now a list of strings, the *wordsInLine* stream is of type List. As you can see, the map() method has the ability to change the type of the TStream. Finally, we can use the *wordsInLine* stream to print the third word in each line.```java    wordsInLine.sink(list -> System.out.println(list.get(2)));```As mentioned in the [Getting started guide](quarks-getting-started), a TStream can be parameterized to any serializable Java typ
 e, including ones created by the user.### Performing stateful operationsIn all previous examples, the operations performed on a TStream have been stateless; keeping track of information over multiple invocations of the same operation has not been necessary. What if we want to keep track of the number of Strings sent over a stream? To do this, we need our TStream.map() method to contain a counter as state.This can be achieved by creating an anonymous Function class, and giving it the required fields.```java    TStream streamOfStrings = ...;    TStream counts = streamOfStrings.map(new Function(){            int count = 0;            @Override            public Integer apply(String arg0) {                count = count + 1;                return count;            }        });```The *count* field will now contain the number of Strings which were sent over streamOfStrings. Although this is a simple example, the anonymous Function passed to TStream.map() can contain any kind of state! This
  could be a HashMap, a running list of tuples, or any serializable Java type. The state will be maintained throughout the entire runtime of your application."
+"body": "In the [Getting started guide](quarks-getting-started), we covered a Quarks application where we read from a device's simulated temperature sensor. Yet Quarks supports more operations than simple filtering. Data analysis and streaming require a suite of functionality, the most important components of which will be outlined below.## TStream.map()`TStream.map()` is arguably the most used method in the Quarks API. Its two main purposes are to perform stateful or stateless operations on a stream's tuples, and to produce a `TStream` with tuples of a different type from that of the calling stream.### Changing a TStream's tuple typeIn addition to filtering tuples, `TStream`s support operations that *transform* tuples from one Java type to another by invoking the `TStream.map()` method.This is useful in cases such as calculating the floating point average of a list of `Integer`s, or tokenizing a Java String into a list of `String`s. To demonstrate this, let's say we have a `TStream
 ` which contains a few lines, each of which contains multiple words:```javaTStream lines = topology.strings(    \"this is a line\",    \"this is another line\",    \"there are three lines now\",    \"and now four\");```We then want to print the third word in each line. The best way to do this is to convert each line to a list of `String`s by tokenizing them. We can do this in one line of code with the `TStream.map()` method:```javaTStream > wordsInLine = lines.map(tuple -> Arrays.asList(tuple.split(\" \")));```Since each tuple is now a list of strings, the `wordsInLine` stream is of type `List`. As you can see, the `map()` method has the ability to change the type of the `TStream`. Finally, we can use the `wordsInLine` stream to print the third word in each line.```javawordsInLine.sink(list -> System.out.println(list.get(2)));```As mentioned in the [Getting started guide](quarks-getting-started), a `TStream` can be parameterized to any serializable Java type, including ones created 
 by the user.### Performing stateful operationsIn all previous examples, the operations performed on a `TStream` have been stateless; keeping track of information over multiple invocations of the same operation has not been necessary. What if we want to keep track of the number of Strings sent over a stream? To do this, we need our `TStream.map()` method to contain a counter as state.This can be achieved by creating an anonymous `Function` class, and giving it the required fields.```javaTStream streamOfStrings = ...;TStream counts = streamOfStrings.map(new Function() {    int count = 0;    @Override    public Integer apply(String arg0) {        count = count + 1;        return count;    }});```The `count` field will now contain the number of `String`s which were sent over `streamOfStrings`. Although this is a simple example, the anonymous `Function` passed to `TStream.map()` can contain any kind of state! This could be a `HashMap`, a running list of tuples, or any serializable Java t
 ype. The state will be maintained throughout the entire runtime of your application."
 
 },
 
@@ -39,7 +39,7 @@
 "keywords": "",
 "url": "../docs/community",
 "summary": "",
-"body": "Every volunteer project obtains its strength from the people involved in it. We invite you to participate as much or as little as you choose.You can:* Use our project and provide a feedback.* Provide us with the use-cases.* Report bugs and submit patches.* Contribute code, javadocs, documentation.Visit the [Contributing](http://www.apache.org/foundation/getinvolved.html) page for general Apache contribution information. If you plan to make any significant contribution, you will need to have an Individual Contributor License Agreement [\\(ICLA\\)](https://www.apache.org/licenses/icla.txt)  on file with Apache.### Mailing listGet help using {{ site.data.project.short_name }} or contribute to the project on our mailing lists:{% if site.data.project.user_list %}* [site.data.project.user_list](mailto:{{ site.data.project.user_list }}) is for usage questions, help, and announcements. [subscribe](mailto:{{ site.data.project.user_list_subscribe }}?subject=send this email to subscri
 be),     [unsubscribe](mailto:{{ site.data.project.dev_list_unsubscribe }}?subject=send this email to unsubscribe), [archives]({{ site.data.project.user_list_archive_mailarchive }}){% endif %}* [{{ site.data.project.dev_list }}](mailto:{{ site.data.project.dev_list }}) is for people who want to contribute code to {{ site.data.project.short_name }}. [subscribe](mailto:{{ site.data.project.dev_list_subscribe }}?subject=send this email to subscribe), [unsubscribe](mailto:{{ site.data.project.dev_list_unsubscribe }}?subject=send this email to unsubscribe), [Apache archives]({{ site.data.project.dev_list_archive }}), [mail-archive.com archives]({{ site.data.project.dev_list_archive_mailarchive }})* [{{ site.data.project.commits_list }}](mailto:{{ site.data.project.commits_list }}) is for commit messages and patches to {{ site.data.project.short_name }}. [subscribe](mailto:{{ site.data.project.commits_list_subscribe }}?subject=send this email to subscribe), [unsubscribe](mailto:{{ site.da
 ta.project.commits_list_unsubscribe }}?subject=send this email to unsubscribe), [Apache archives]({{ site.data.project.commits_list_archive }}), [mail-archive.com archives]({{ site.data.project.commits_list_archive_mailarchive }})### Issue trackerWe use Jira here: [https://issues.apache.org/jira/browse/{{ site.data.project.jira }}](https://issues.apache.org/jira/browse/{{ site.data.project.jira }})#### Bug reportsFound bug? Enter an issue in  [Jira](https://issues.apache.org/jira/browse/{{ site.data.project.jira }}).Before submitting an issue, please:* Verify that the bug does in fact exist.* Search the issue tracker to verify there is no existing issue reporting the bug you've found.* Consider tracking down the bug yourself in the {{ site.data.project.short_name }} source and submitting a pull request  along with your bug report. This is a great time saver for the  {{ site.data.project.short_name }} developers and helps ensure the bug will be fixed quickly.#### Feature requestsEnha
 ncement requests for new features are also welcome. The more concrete the request is and the better rationale you provide, the greater the chance it will incorporated into future releases.  [https://issues.apache.org/jira/browse/{{ site.data.project.jira }}](https://issues.apache.org/jira/browse/{{ site.data.project.jira }})### Source codeThe project sources are accessible via the [source code repository]({{ site.data.project.source_repository }}) which is also mirrored in [GitHub]({{ site.data.project.source_repository_mirror }}). When you are considering a code contribution, make sure there is an [Issue](https://issues.apache.org/jira/browse/{{ site.data.project.jira }}) that describes your work or the bug you are fixing.  For significant contributions, please discuss your proposed changes in the Issue so that others can comment on your plans.  Someone else may be working on the same functionality, so it's good to communicate early and often.  A committer is more likely to accept 
 your change if there is clear information in the Issue. To contribute, [fork](https://help.github.com/articles/fork-a-repo/) the [mirror]({{ site.data.project.source_repository_mirror }}) and issue a pull request. Put the Jira issue number, e.g. {{ site.data.project.jira }}-100 in the pull request title. The tag [WIP] can also be used in the title of pull requests to indicate that you are not ready to merge but want feedback. Remove [WIP] when you are ready for merge. Make sure you document your code and contribute tests along with the code.Read [DEVELOPMENT.md](https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md) at the top of the code tree for details on setting up your development environment. ### Web site and documentation source codeThe project website and documentation sources are accessible via the [website source code repository]({{ site.data.project.website_repository }}) which is also mirrored in [GitHub]({{ site.data.project.website_repository_mirror }})
 . Contributing changes to the web site and documentation is similar to contributing code.  Follow the instructions in the Source Code section above, but fork and issue a pull request against the [web site mirror]({{ site.data.project.website_repository_mirror }}). Follow the instructions in the top level [README.md]({{ site.data.project.website_repository_mirror }}/blob/master/README.md) for details on contributing to the web site and documentation.  You will need to use Markdown and Jekyll to develop pages. See:* [Markdown Cheat Sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)*  [Jekyll on linux and Mac](https://jekyllrb.com/)*  [Jekyll on Windows](https://jekyllrb.com/docs/windows/) is not officially supported but people have gotten it to work."
+"body": "Every volunteer project obtains its strength from the people involved in it. We invite you to participate as much or as little as you choose.You can:* Use our project and provide a feedback.* Provide us with the use-cases.* Report bugs and submit patches.* Contribute code, javadocs, documentation.Visit the [Contributing](http://www.apache.org/foundation/getinvolved.html) page for general Apache contribution information. If you plan to make any significant contribution, you will need to have an Individual Contributor License Agreement [\\(ICLA\\)](https://www.apache.org/licenses/icla.txt) on file with Apache.## Mailing listGet help using {{ site.data.project.short_name }} or contribute to the project on our mailing lists:{% if site.data.project.user_list %}* [site.data.project.user_list](mailto:{{ site.data.project.user_list }}) is for usage questions, help, and announcements. [subscribe](mailto:{{ site.data.project.user_list_subscribe }}?subject=send this email to subscribe
 ), [unsubscribe](mailto:{{ site.data.project.dev_list_unsubscribe }}?subject=send this email to unsubscribe), [archives]({{ site.data.project.user_list_archive_mailarchive }}){% endif %}* [{{ site.data.project.dev_list }}](mailto:{{ site.data.project.dev_list }}) is for people who want to contribute code to {{ site.data.project.short_name }}. [subscribe](mailto:{{ site.data.project.dev_list_subscribe }}?subject=send this email to subscribe), [unsubscribe](mailto:{{ site.data.project.dev_list_unsubscribe }}?subject=send this email to unsubscribe), [Apache archives]({{ site.data.project.dev_list_archive }}), [mail-archive.com archives]({{ site.data.project.dev_list_archive_mailarchive }})* [{{ site.data.project.commits_list }}](mailto:{{ site.data.project.commits_list }}) is for commit messages and patches to {{ site.data.project.short_name }}. [subscribe](mailto:{{ site.data.project.commits_list_subscribe }}?subject=send this email to subscribe), [unsubscribe](mailto:{{ site.data.pro
 ject.commits_list_unsubscribe }}?subject=send this email to unsubscribe), [Apache archives]({{ site.data.project.commits_list_archive }}), [mail-archive.com archives]({{ site.data.project.commits_list_archive_mailarchive }})## Issue trackerWe use Jira here: [https://issues.apache.org/jira/browse/{{ site.data.project.jira }}](https://issues.apache.org/jira/browse/{{ site.data.project.jira }})### Bug reportsFound bug? Create an issue in [Jira](https://issues.apache.org/jira/browse/{{ site.data.project.jira }}).Before submitting an issue, please:* Verify that the bug does in fact exist* Search the issue tracker to verify there is no existing issue reporting the bug you've found* Consider tracking down the bug yourself in the {{ site.data.project.short_name }} source and submitting a pull request along with your bug report. This is a great time saver for the {{ site.data.project.short_name }} developers and helps ensure the bug will be fixed quickly.### Feature requestsEnhancement reque
 sts for new features are also welcome. The more concrete the request is and the better rationale you provide, the greater the chance it will incorporated into future releases. To make a request, create an issue in [Jira](https://issues.apache.org/jira/browse/{{ site.data.project.jira }}).## Source codeThe project sources are accessible via the [source code repository]({{ site.data.project.source_repository }}) which is also mirrored in [GitHub]({{ site.data.project.source_repository_mirror }}).When you are considering a code contribution, make sure there is an [Jira issue](https://issues.apache.org/jira/browse/{{ site.data.project.jira }}) that describes your work or the bug you are fixing. For significant contributions, please discuss your proposed changes in the issue so that others can comment on your plans. Someone else may be working on the same functionality, so it's good to communicate early and often. A committer is more likely to accept your change if there is clear informa
 tion in the issue.To contribute, [fork](https://help.github.com/articles/fork-a-repo/) the [mirror]({{ site.data.project.source_repository_mirror }}) and issue a [pull request](https://help.github.com/articles/using-pull-requests/). Put the Jira issue number, e.g. {{ site.data.project.jira }}-100 in the pull request title. The tag [WIP] can also be used in the title of pull requests to indicate that you are not ready to merge but want feedback. Remove [WIP] when you are ready for merge. Make sure you document your code and contribute tests along with the code.Read [DEVELOPMENT.md](https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md) at the top of the code tree for details on setting up your development environment.## Web site and documentation source codeThe project website and documentation sources are accessible via the [website source code repository]({{ site.data.project.website_repository }}) which is also mirrored in [GitHub]({{ site.data.project.website_repo
 sitory_mirror }}). Contributing changes to the web site and documentation is similar to contributing code. Follow the instructions in the *Source Code* section above, but fork and issue a pull request against the [web site mirror]({{ site.data.project.website_repository_mirror }}). Follow the instructions in the top-level [README.md]({{ site.data.project.website_repository_mirror }}/blob/master/README.md) for details on contributing to the web site and documentation.You will need to use [Markdown](https://daringfireball.net/projects/markdown/) and [Jekyll](http://jekyllrb.com) to develop pages. See:* [Markdown Cheat Sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)* [Jekyll on linux and Mac](https://jekyllrb.com/)* [Jekyll on Windows](https://jekyllrb.com/docs/windows/) is not officially supported but people have gotten it to work"
 
 },
 
@@ -52,7 +52,7 @@
 "keywords": "",
 "url": "../docs/console",
 "summary": "",
-"body": "## Visualizing and monitoring your applicationThe Quarks application console is a web application that enables you to visualize your application topology and monitor the tuples flowing through your application.  The kind of oplets used in the topology, as well as the stream tags included in the topology, are also visible in the console.## Adding the console web app to your applicationTo use the console, you must use the Quarks classes that provide the service to access the console web application or directly call the `HttpServer` class itself, start the server and then obtain the console URL.The easiest way to include the console in your application is to use the the `DevelopmentProvider` class. `DevelopmentProvider` is a subclass of `DirectProvider` and adds services such as access to the console web application and counter oplets used to determine tuple counts. You can get the URL for the console from the `DevelopmentProvider` using the `getService` method as shown in a h
 ypothetical application shown below:```    import java.util.concurrent.TimeUnit;    import quarks.console.server.HttpServer;    import quarks.providers.development.DevelopmentProvider;    import quarks.topology.TStream;    import quarks.topology.Topology;    public class TempSensorApplication {        public static void main(String[] args) throws Exception {            TempSensor sensor = new TempSensor();            DevelopmentProvider dp = new DevelopmentProvider();            Topology topology = dp.newTopology();            TStream tempReadings = topology.poll(sensor, 1, TimeUnit.MILLISECONDS);            TStream filteredReadings = tempReadings.filter(reading -> reading  80);            filteredReadings.print();            System.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());            dp.submit(topology);          }    }```Note that the console URL is being printed to System.out. The filteredReadings are as well, since filteredReadings.print() is be
 ing called in the application.  You may need to scroll your terminal window up to see the output for the console URL.Optionally, you can modify the above code in the application to have a timeout before submitting the topology, which would allow you to see the console URL before any other output is shown.  The modification would look like this:```// print the console URL and wait for 10 seconds before submitting the topologySystem.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());try {  TimeUnit.SECONDS.sleep(10);} catch (InterruptedException e) {  //do nothing}dp.submit(topology);```The other way to embed the console in your application is shown in the `HttpServerSample.java` example. It gets the HttpServer instance, starts it, and prints out the console URL.  Note that it does not submit a job, so when the console is displayed in the browser, there are no running jobs and therefore no Topology graph.  The example is meant to show how to get the `HttpServer
 ` instance, start the console web app and get the URL of the console.# Accessing the consoleThe console URL has the following format:http://host_name:port_number/consoleOnce it is obtained from `System.out`, enter it in a browser window.  If you cannot access the console at this URL, ensure there is a `console.war` file in the `webapps` directory.  If the `console.war` file cannot be found, an exception will be thrown (in std.out) indicating `console.war` was not found.## ConsoleWaterDetector sampleTo see the features of the console in action and as a way to demonstrate how to monitor a topology in the console, let's look at the `ConsoleWaterDetector` sample.Prior to running any console applications, the `console.war` file must be built as mentioned above.  If you are building quarks from a Git repository, go to the top level Quarks directory and run `ant`.Here is an example in my environment:```Susans-MacBook-Pro-247:quarks susancline$ pwd/Users/susancline/git/quarksSusans-MacBook-
 Pro-247:quarks susancline$ antBuildfile: /Users/susancline/git/quarks/build.xmlsetcommitversion:init:suball:init:project.component:compile:...[javadoc] Constructing Javadoc information...[javadoc] Standard Doclet version 1.8.0_71[javadoc] Building tree for all the packages and classes...[javadoc] Generating /Users/susancline/git/quarks/target/docs/javadoc/quarks/analytics/sensors/package-summary.html...[javadoc] Copying file /Users/susancline/git/quarks/analytics/sensors/src/main/java/quarks/analytics/sensors/doc-files/deadband.png to directory /Users/susancline/git/quarks/target/docs/javadoc/quarks/analytics/sensors/doc-files...[javadoc] Generating /Users/susancline/git/quarks/target/docs/javadoc/quarks/topology/package-summary.html...[javadoc] Copying file /Users/susancline/git/quarks/api/topology/src/main/java/quarks/topology/doc-files/sources.html to directory /Users/susancline/git/quarks/target/docs/javadoc/quarks/topology/doc-files...[javadoc] Building index for all the packag
 es and classes...[javadoc] Building index for all classes...all:BUILD SUCCESSFULTotal time: 3 seconds```This command will let you know that `console.war` was built and is in the correct place, under the `webapps` directory.```Susans-MacBook-Pro-247:quarks susancline$ find . -name console.war -print./target/java8/console/webapps/console.war```Now we know we have built `console.war`, so we're good to go.To run this sample from the command line:```Susans-MacBook-Pro-247:quarks susancline$ pwd/Users/susancline/git/quarksSusans-MacBook-Pro-247:quarks susancline$ java -cp target/java8/samples/lib/quarks.samples.console.jar:. quarks.samples.console.ConsoleWaterDetector```If everything is successful, you'll start seeing output.  You may have to scroll back up to get the URL of the console:```Susans-MacBook-Pro-247:quarks susancline$ java -cp target/java8/samples/lib/quarks.samples.console.jar:. quarks.samples.console.ConsoleWaterDetectorMar 07, 2016 12:04:52 PM org.eclipse.jetty.util.log.Lo
 g initializedINFO: Logging initialized @176msMar 07, 2016 12:04:53 PM org.eclipse.jetty.server.Server doStartINFO: jetty-9.3.6.v20151106Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.handler.ContextHandler doStartINFO: Started o.e.j.s.ServletContextHandler@614c5515{/jobs,null,AVAILABLE}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.handler.ContextHandler doStartINFO: Started o.e.j.s.ServletContextHandler@77b52d12{/metrics,null,AVAILABLE}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServletINFO: NO JSP Support for /console, did not find org.eclipse.jetty.jsp.JettyJspServletMar 07, 2016 12:04:53 PM org.eclipse.jetty.server.handler.ContextHandler doStartINFO: Started o.e.j.w.WebAppContext@2d554825{/console,file:///private/var/folders/0c/pb4rznhj7sbc886t30w4vpxh0000gn/T/jetty-0.0.0.0-0-console.war-_console-any-3101338829524954950.dir/webapp/,AVAILABLE}{/console.war}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.AbstractConnector doStartINFO:
  Started ServerConnector@66480dd7{HTTP/1.1,[http/1.1]}{0.0.0.0:57964}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.Server doStartINFO: Started @426mshttp://localhost:57964/consoleWell1 alert, ecoli value is 1Well1 alert, temp value is 48Well3 alert, ecoli value is 1```Now point your browser to the URL displayed above in the output from running the Java command to launch the `ConsoleWaterDetector` application. In this case, the URL is `http://localhost:57964/console`.Below is a screen shot of what you should see if everything is working properly:# ConsoleWaterDetector application scenarioThe application is now running in your browser. Let's discuss the scenario for the application.A county agency is responsible for ensuring the safety of residents well water.  Each well they monitor has four different sensor types:* Temperature* Acidity* Ecoli* LeadThe sample application topology monitors 3 wells:* For the hypothetical scenario, Well1 and Well3 produce 'unhealthy' values from the
 ir sensors on occasion.  Well2 always produces 'healthy' values.  * Each well that is to be measured is added to the topology.  The topology polls each sensor (temp, ecoli, etc) for each well as a unit.  A TStream&lt;Integer&gt; is returned from polling the toplogy and represents a sensor reading.  Each sensor reading for the well has a tag added to it with the reading type i.e, \"temp\", and the well id.  Once all of the sensor readings are obtained and the tags added, each sensor reading is 'unioned' into a single TStream&lt;JsonObject&gt;.  Look at the `waterDetector` method for details on this.* Now, each well has a single stream with each of the sensors readings as a property with a name and value in the TStream&lt;JsonObject&gt;.  Next the `alertFilter` method is called on the TStream&lt;JsonObject&gt; representing each well.  This method checks the values for each well's sensors to determine if they are 'out of range' for healthy values. The `filter` oplet is used to do this.
  If any of the sensor's readings are out of the acceptable range the tuple is passed along. Those that are within an acceptable range are discarded.* Next the applications `splitAlert` method is called on each well's stream that contains the union of all the sensor readings that are out of range.  The `splitAlert` method uses the `split` oplet to split the incoming stream into 5 different streams.  Only those tuples that are out of range for each stream, which represents each sensor type, will be returned. The object returned from `splitAlert` is a list of TStream&lt;JsonObject&gt; objects. The `splitAlert` method is shown below:```public static List> splitAlert(TStream alertStream, int wellId) {        List> allStreams = alertStream.split(5, tuple -> {            if (tuple.get(\"temp\") != null) {                JsonObject tempObj = new JsonObject();                int temp = tuple.get(\"temp\").getAsInt();                if (temp = TEMP_ALERT_MAX) {                    tempObj.addP
 roperty(\"temp\", temp);                    return 0;                } else {                    return -1;                }            } else if (tuple.get(\"acidity\") != null){                JsonObject acidObj = new JsonObject();                int acid = tuple.get(\"acidity\").getAsInt();                if (acid = ACIDITY_ALERT_MAX) {                    acidObj.addProperty(\"acidity\", acid);                    return 1;                } else {                    return -1;                }            } else if (tuple.get(\"ecoli\") != null) {                JsonObject ecoliObj = new JsonObject();                int ecoli = tuple.get(\"ecoli\").getAsInt();                if (ecoli >= ECOLI_ALERT) {                    ecoliObj.addProperty(\"ecoli\", ecoli);                    return 2;                } else {                    return -1;                }            } else if (tuple.get(\"lead\") != null) {                JsonObject leadObj = new JsonObject();                int
  lead = tuple.get(\"lead\").getAsInt();                if (lead >= LEAD_ALERT_MAX) {                    leadObj.addProperty(\"lead\", lead);                    return 3;                } else {                    return -1;                }            } else {                 return -1;            }        });        return allStreams;    }```* Next we want to get the temperature stream from the first well and put a rate meter on it to determine the rate at which the out of range values are flowing in the stream.```   List> individualAlerts1 = splitAlert(filteredReadings1, 1);   // Put a rate meter on well1's temperature sensor output   Metrics.rateMeter(individualAlerts1.get(0));```* Next all the sensors for well 1 have tags added to the stream indicating the stream is out of range for that sensor and the well id.  Next a sink is added, passing the tuple to a `Consumer` that formats a string to `System.out` containing the well Id, alert type (sensor type) and value of the sensor.  
 ```// Put a rate meter on well1's temperature sensor outputMetrics.rateMeter(individualAlerts1.get(0));individualAlerts1.get(0).tag(TEMP_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(\"\\n\" + formatAlertOutput(tuple, \"1\", \"temp\")));individualAlerts1.get(1).tag(ACIDITY_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(formatAlertOutput(tuple, \"1\", \"acidity\")));individualAlerts1.get(2).tag(ECOLI_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(formatAlertOutput(tuple, \"1\", \"ecoli\")));individualAlerts1.get(3).tag(LEAD_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(formatAlertOutput(tuple, \"1\", \"lead\")));```Output in the terminal window from the `formatAlertOutput` method will look like this:```Well1 alert, temp value is 86Well3 alert, ecoli value is 2Well1 alert, ecoli value is 1Well3 alert, acidity value is 1Well1 alert, lead value is 12Well1 alert, ecoli value is 2Well3 alert, lead value is 10Well3 alert, acidity value is 10```Notice how o
 nly those streams that are out of range for the temperature sensor type show output.## Detecting zero tuple countsAt the end of the `ConsoleWaterDetector` application is this snippet of code, added after the topology has been submitted:```dp.submit(wellTopology);while (true) {                MetricRegistry metricRegistry = dp.getServices().getService(MetricRegistry.class);                SortedMap counters = metricRegistry.getCounters();                Set> values = counters.entrySet();                for (Entry e : values) {                    if (e.getValue().getCount() == 0) {                        System.out.println(\"Counter Op:\" + e.getKey() + \" tuple count: \" + e.getValue().getCount());                    }                }                Thread.sleep(2000);        }```What this does is get all the counters in the `MetricRegistry` class and print out the name of the counter oplet they are monitoring along with the tuple count if it is zero.  Here is some sample output:```
 Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_44 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_45 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_46 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_47 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_89 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_95 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_96 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_97 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_98 has a tuple count of zero!```To summarize what the application is doing:- Unions all sensor type readings for a single well.- Filters all sensor type readings for a single well, passing on an object that only contains tuples for the object that have at least one sensor type with out of range values.- Splits the object that contained name/value pa
 irs for sensor type and readings into individual sensor types returning only those streams that contain out of range values.- Outputs to the command line the well id, sensor type and value that is out of range.- Tags are added at various points in the topology for easier identification of either the well or some out of range condition.- The topology contains counters to measure tuple counts since `DevelopmentProvider` was used.- Individual rate meters were placed on well1 and well3's temperature sensors to determine the rate of 'unhealthy' values.- Prints out the name of the counter oplets whose tuple counts are zero.# Topology graph controlsNow that you have an understanding of what the application is doing, let's look at some of the controls in the console, so we can learn how to monitor the application.  Below is a screen shot of the top controls: the controls that affect the Topology Graph.* **Job**: A drop down to select which job is being displayed in the Topology Graph.  An a
 pplication can contain multiple jobs.* **State**: Hovering over the 'State' icon shows information about the selected job.  The current and next states of the job, the job id and the job name.* **View by**: This select is used to change how the topology graph is displayed.  The three options for this select are:  - Static flow  - Tuple count  - Oplet kind  - Currently it is set to 'Static flow'. This means the oplets (represented as circles in the topology graph) do not change size, nor do the lines or links (representing the edges of the topology graph) change width or position.  The graph is not being refreshed when it is in 'Static flow' mode.* **Refresh interval**: Allows the user to select an interval between 3 - 20 seconds to refresh the tuple count values in the graph. Every X seconds the metrics for the topology graph are refreshed.  More about metrics a little bit later.* **Pause graph**: Stops the refresh interval timer.  Once the 'Pause graph' button is clicked, the user 
 must push 'Resume graph' for the graph to be updated, and then refreshed at the interval set in the 'Refresh interval' timer.  It can be helpful to pause the graph if multiple oplets are occupying the same area on the graph, and their names become unreadable. Once the graph is paused, the user can drag an oplet off of another oplet to better view the name and see the edge(s) that connect them.* **Show tags**: If the checkbox appears in the top controls, it means:  - The 'View by' layer is capable of displaying stream tags.  - The topology currently shown in the topology graph has stream tags associated with it.* **Show all tags**: Selecting this checkbox shows all the tags present in the topology.  If you want to see only certain tags, uncheck this box and select the button labeled 'Select individual tags ...'.  A dialog will appear, and you can select one or all of the tags listed in the dialog which are present in the topology.The next aspect of the console we'll look at are the p
 opups available when selecting 'View all oplet properties', hovering over an oplet and hovering over an edge (link).The screen shot below shows the output from clicking on the 'View all oplet properties' link directly below the job selector:Looking at the sixth line in the table, where the Name is 'OP_5', we can see that the Oplet kind is a Map, a (quarks.oplet.functional.Map), the Tuple count is 0 (this is because the view is in Static flow mode - the graph does not show the number of tuples flowing in it), the source oplet is 'OP_55', the target oplet is 'OP_60', and there are no stream tags coming from the source or target streams.  Relationships for all oplets can be viewed in this manner.Now, looking at the graph, if we want to see the relationships for a single oplet, we can hover over it. The image below shows the hover when we are over 'OP_5'.You can also hover over the edges of the topology graph to get information.  Hover over the edge (link) between 'OP_0' and 'OP_55'.  T
 he image shows the name and kind of the oplet as the source, and the name and kind of oplet as the target.  Again the tuple count is 0 since this is the 'Static flow' view.  The last item of information in the tooltip is the tags on the stream.One or many tags can be added to a stream.  In this case we see the tags 'temperature' and 'well1'.The section of the code that adds the tags 'temperature' and 'well1' is in the `waterDetector` method of the `ConsoleWaterDetector` class.```public static TStream waterDetector(Topology topology, int wellId) {  Random rNum = new Random();  TStream temp = topology.poll(() -> rNum.nextInt(TEMP_RANDOM_HIGH - TEMP_RANDOM_LOW) + TEMP_RANDOM_LOW, 1, TimeUnit.SECONDS);  TStream acidity = topology.poll(() -> rNum.nextInt(ACIDITY_RANDOM_HIGH - ACIDITY_RANDOM_LOW) + ACIDITY_RANDOM_LOW, 1, TimeUnit.SECONDS);  TStream ecoli = topology.poll(() -> rNum.nextInt(ECOLI_RANDOM_HIGH - ECOLI_RANDOM_LOW) + ECOLI_RANDOM_LOW, 1, TimeUnit.SECONDS);  TStream lead = topol
 ogy.poll(() -> rNum.nextInt(LEAD_RANDOM_HIGH - LEAD_RANDOM_LOW) + LEAD_RANDOM_LOW, 1, TimeUnit.SECONDS);  TStream id = topology.poll(() -> wellId, 1, TimeUnit.SECONDS);  // add tags to each sensor  temp.tag(\"temperature\", \"well\" + wellId);  ```# LegendThe legend(s) that appear in the console depend on the view currently displayed.  In the static flow mode, if no stream tags are present, there is no legend.  In this example we have stream tags in the topology, so the static flow mode gives us the option to select 'Show tags'.  If selected, the result is the addition of the Stream tags legend:This legend shows all the tags that have been added to the topology, regardless of whether or not 'Show all tags' is checked or specific tags have been selected from the dialog that appears when the 'Select individual tags ...' button is clicked.# Topology graphNow that we've covered most of the ways to modify the view of the topology graph and discussed the application, let's look at the top
 ology graph as a way to understand our application.When analyzing what is happening in your application, here are some ways you might use the console to help you understand it:* Topology of the application - how the edges and vertices of the graph are related* Tuple flow  - tuple counts since the application was started* The affect of filters or maps on the downstream streams* Stream tags - if tags are added dynamically based on a condition, where the streams with tags are displayed in the topologyLet's start with the static flow view of the topology.  We can look at the graph, and we can also hover over any of the oplets or streams to better understand the connections.  Also, we can click 'View all oplet properties' and see the relationships in a tabular format.The other thing to notice in the static flow view are the tags.  Look for any colored edges (the links between the oplets).All of the left-most oplets have streams with tags.  Most of them have the color that corresponds to 
 'Multiple tags'.  If you hover over the edges, you can see the tags.  It's obvious that we have tagged each sensor with the sensor type and the well id.Now, if you look to the far right, you can see more tags on streams coming out of a `split` oplet.  They also have multiple tags, and hovering over them you can determine that they represent out of range values for each sensor type for the well.  Notice how the `split` oplet, OP_43, has no tags in the streams coming out of it.  If you follow that split oplet back, you can determine from the first tags that it is part of the well 2 stream.If you refer back to the `ConsoleWaterDetector` source, you can see that no tags were placed on the streams coming out of well2's split because they contained no out of range values.Let's switch the view to Oplet kind now.  It will make more clear which oplets are producing the streams with the tags on them.Below is an image of how the graph looks after switching to the Oplet kind view.In the Oplet k
 ind view the links are all the same width, but the circles representing the oplets are sized according to tuple flow.  Notice how the circles representing OP_10, OP_32 and OP_21 are large in relation to OP_80, OP_88 and OP_89.  As a matter of fact, we can't even see the circle representing OP_89.  Looking at OP_35 and then the Oplet kind legend, you can see by the color that it is a Filter oplet.  This is because the filter that we used against well2, which is the stream that OP_35 is part of returned no tuples.  This is a bit difficult to see. Let's look at the Tuple count view.The Tuple count view will make it more clear that no tuples are following out of OP_35, which represents the filter for well2 and only returns out of range values.  You may recall that in this example well2 returned no out of range values.  Below is the screen shot of the graph in 'Tuple count' view mode.The topology graph oplets can sometimes sit on top of each other.  If this is the case, pause the refresh
  and use your mouse to pull down on the oplets that are in the same position. This will allow you to see their name.  Alternately, you can use the 'View all properties' table to see the relationships between oplets.# MetricsIf you scroll the browser window down, you can see a Metrics section.  This section appears when the application contains the following:* A ```DevelopmentProvider``` is used; this automatically inserts counters on the streams of the topology.* A ```quarks.metrics.Metric.Counter``` or ```quarks.metrics.Metric.RateMeter``` is added to an individual stream.## CountersIn the ```ConsoleWaterDetector``` application we used a ```DevelopmentProvider```.  Therefore, counters were added to most streams (edges) with the following exceptions (from the javadoc for ```quarks.metrics.Metric.Counter```):*Oplets are only inserted upstream from a FanOut oplet.**If a chain of Peek oplets exists between oplets A and B, a Metric oplet is inserted after the last Peek, right upstream f
 rom oplet B.**If a chain of Peek oplets is followed by a FanOut, a metric oplet is inserted between the last Peek and the FanOut oplet.The implementation is not idempotent; previously inserted metric oplets are treated as regular graph vertices. Calling the method twice will insert a new set of metric oplets into the graph.*Also, the application inserts counters on well2's streams after the streams from the individual sensors were unioned and then split:```    List> individualAlerts2 = splitAlert(filteredReadings2, 2);    TStream alert0Well2 = individualAlerts2.get(0);    alert0Well2  = Metrics.counter(alert0Well2);    alert0Well2.tag(\"well2\", \"temp\");    TStream alert1Well2 = individualAlerts2.get(1);    alert1Well2  = Metrics.counter(alert1Well2);    alert1Well2.tag(\"well2\", \"acidity\");    TStream alert2Well2 = individualAlerts2.get(2);    alert2Well2  = Metrics.counter(alert2Well2);    alert2Well2.tag(\"well2\", \"ecoli\");    TStream alert3Well2 = individualAlerts2.get(3
 );    alert3Well2  = Metrics.counter(alert3Well2);    alert3Well2.tag(\"well2\", \"lead\");```When looking at the select next to the label 'Metrics', make sure the 'Count, oplets OP_37, OP_49 ...' is selected.  This select compares all of the counters in the topology visualized as a bar graph.  An image is shown below:Hover over individual bars to get the value of the number of tuples flowing through that oplet since the application was started.  You can also see the oplet name.  You can see that some of the oplets have zero tuples flowing through them.The bars that are the tallest and therefore have the highest tuple count are OP_76, OP_67 and OP_65.  If you look back up to the topology graph, in the Tuple count view, you can see that the edges (streams) surrounding these oplets have the color that corresponds to the highest tuple count (in the pictures above that color is bright orange in the Tuple count legend).## RateMetersThe other type of metric we can look at are ```RateMeter
 ``` metrics.  In the ```ConsoleWaterDetector``` application we added two rate meters here with the objective of comparing the rate of out of range readings between well1 and well3:```    List> individualAlerts1 = splitAlert(filteredReadings1, 1);    // Put a rate meter on well1's temperature sensor output    Metrics.rateMeter(individualAlerts1.get(0));    ...    List> individualAlerts3 = splitAlert(filteredReadings3, 3);    // Put a rate meter on well3's temperature sensor output    Metrics.rateMeter(individualAlerts3.get(0));```RateMeters contain the following metrics for each stream they are added to:  * Tuple count  * The rate of change in the tuple count. The following rates are available for a single stream:    * 1 minute rate change    * 5 minute rate change    * 15 minute rate change    * Mean rate changeNow change the Metrics select to the 'MeanRate'.  In our example these correspond to oplets OP_37 and OP_49:Hovering over the slightly larger bar, the one to the right, the n
 ame is OP_49.  Looking at the topology graph and changing the view to 'Static flow', follow the edges back from OP_49 until you can see an edge with a tag on it. You can see that OP_49's source is OP_51, whose source is OP_99.  The edge between OP_99 and it's source OP_48 has multiple tags.  Hovering over this stream, the tags are 'TEMP out of range' and 'well3'.If a single Rate Meter is placed on a stream, in addition to plotting a bar chart, a line chart over the last 20 measures can be viewed.  For example, if I comment out the addition of the rateMeter for well1 and then rerun the application, the Metrics section will look like the image below.  I selected the OneMinuteRate and 'Line chart' for Chart type:#SummaryThe intent of the information on this page is to help you understand the following:* How to add the console application to a Quarks application* How to run the `ConsoleWaterDetector` sample* The design/architecture in the `ConsoleWaterDetector` application* The controls
  for the Topology graph are and what they do, including the different views of the graph* The legend for the graph* How to interpret the graph and use the tooltips over the edges and vertices, as well as the 'View all properties' link* How to add counters and rate meters to a topology* How to use the metrics section to understand tuple counters and rate meters* How to correlate values from the metrics section with the topology graphThe Quarks console will continue to evolve and improve.  Please open an issue if you see a problem with the existing console, but more importantly add an issue if you have an idea of how to make the console better.  The more folks write Quarks applications and view them in the console, the more information we can gather from the community about what is needed in the console.  Please consider making a contribution if there is a feature in the console that would really help you and others!"
+"body": "## Visualizing and monitoring your applicationThe Quarks application console is a web application that enables you to visualize your application topology and monitor the tuples flowing through your application. The kind of oplets used in the topology, as well as the stream tags included in the topology, are also visible in the console.## Adding the console web app to your applicationTo use the console, you must use the Quarks classes that provide the service to access the console web application or directly call the `HttpServer` class itself, start the server and then obtain the console URL.The easiest way to include the console in your application is to use the the `DevelopmentProvider` class. `DevelopmentProvider` is a subclass of `DirectProvider` and adds services such as access to the console web application and counter oplets used to determine tuple counts. You can get the URL for the console from the `DevelopmentProvider` using the `getService` method as shown in a hy
 pothetical application shown below:```javaimport java.util.concurrent.TimeUnit;import quarks.console.server.HttpServer;import quarks.providers.development.DevelopmentProvider;import quarks.topology.TStream;import quarks.topology.Topology;public class TempSensorApplication {    public static void main(String[] args) throws Exception {        TempSensor sensor = new TempSensor();        DevelopmentProvider dp = new DevelopmentProvider();        Topology topology = dp.newTopology();        TStream tempReadings = topology.poll(sensor, 1, TimeUnit.MILLISECONDS);        TStream filteredReadings = tempReadings.filter(reading -> reading  80);        filteredReadings.print();        System.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());        dp.submit(topology);    }}```Note that the console URL is being printed to `System.out`. The `filteredReadings` are as well, since `filteredReadings.print()` is being called in the application. You may need to scroll your te
 rminal window up to see the output for the console URL.Optionally, you can modify the above code in the application to have a timeout before submitting the topology, which would allow you to see the console URL before any other output is shown. The modification would look like this:```java// Print the console URL and wait for 10 seconds before submitting the topologySystem.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());try {    TimeUnit.SECONDS.sleep(10);} catch (InterruptedException e) {    // Do nothing}dp.submit(topology);```The other way to embed the console in your application is shown in the `HttpServerSample.java` example (on [GitHub](https://github.com/apache/incubator-quarks/blob/master/samples/console/src/main/java/quarks/samples/console/HttpServerSample.java)). It gets the `HttpServer` instance, starts it, and prints out the console URL. Note that it does not submit a job, so when the console is displayed in the browser, there are no running jo
 bs and therefore no topology graph. The example is meant to show how to get the `HttpServer` instance, start the console web app and get the URL of the console.## Accessing the consoleThe console URL has the following format:`http://host_name:port_number/console`Once it is obtained from `System.out`, enter it in a browser window.If you cannot access the console at this URL, ensure there is a `console.war` file in the `webapps` directory. If the `console.war` file cannot be found, an exception will be thrown (in `std.out`) indicating `console.war` was not found.## ConsoleWaterDetector sampleTo see the features of the console in action and as a way to demonstrate how to monitor a topology in the console, let's look at the `ConsoleWaterDetector` sample (on [GitHub](https://github.com/apache/incubator-quarks/blob/master/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java)).Prior to running any console applications, the `console.war` file must be built as menti
 oned above. If you are building quarks from a Git repository, go to the top level Quarks directory and run `ant`.Here is an example in my environment:```Susans-MacBook-Pro-247:quarks susancline$ pwd/Users/susancline/git/quarksSusans-MacBook-Pro-247:quarks susancline$ antBuildfile: /Users/susancline/git/quarks/build.xmlsetcommitversion:init:suball:init:project.component:compile:...[javadoc] Constructing Javadoc information...[javadoc] Standard Doclet version 1.8.0_71[javadoc] Building tree for all the packages and classes...[javadoc] Generating /Users/susancline/git/quarks/target/docs/javadoc/quarks/analytics/sensors/package-summary.html...[javadoc] Copying file /Users/susancline/git/quarks/analytics/sensors/src/main/java/quarks/analytics/sensors/doc-files/deadband.png to directory /Users/susancline/git/quarks/target/docs/javadoc/quarks/analytics/sensors/doc-files...[javadoc] Generating /Users/susancline/git/quarks/target/docs/javadoc/quarks/topology/package-summary.html...[javadoc] 
 Copying file /Users/susancline/git/quarks/api/topology/src/main/java/quarks/topology/doc-files/sources.html to directory /Users/susancline/git/quarks/target/docs/javadoc/quarks/topology/doc-files...[javadoc] Building index for all the packages and classes...[javadoc] Building index for all classes...all:BUILD SUCCESSFULTotal time: 3 seconds```This command will let you know that `console.war` was built and is in the correct place, under the `webapps` directory.```Susans-MacBook-Pro-247:quarks susancline$ find . -name console.war -print./target/java8/console/webapps/console.war```Now we know we have built `console.war`, so we're good to go. To run this sample from the command line:```Susans-MacBook-Pro-247:quarks susancline$ pwd/Users/susancline/git/quarksSusans-MacBook-Pro-247:quarks susancline$ java -cp target/java8/samples/lib/quarks.samples.console.jar:. quarks.samples.console.ConsoleWaterDetector```If everything is successful, you'll start seeing output. You may have to scroll ba
 ck up to get the URL of the console:```Susans-MacBook-Pro-247:quarks susancline$ java -cp target/java8/samples/lib/quarks.samples.console.jar:. quarks.samples.console.ConsoleWaterDetectorMar 07, 2016 12:04:52 PM org.eclipse.jetty.util.log.Log initializedINFO: Logging initialized @176msMar 07, 2016 12:04:53 PM org.eclipse.jetty.server.Server doStartINFO: jetty-9.3.6.v20151106Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.handler.ContextHandler doStartINFO: Started o.e.j.s.ServletContextHandler@614c5515{/jobs,null,AVAILABLE}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.handler.ContextHandler doStartINFO: Started o.e.j.s.ServletContextHandler@77b52d12{/metrics,null,AVAILABLE}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServletINFO: NO JSP Support for /console, did not find org.eclipse.jetty.jsp.JettyJspServletMar 07, 2016 12:04:53 PM org.eclipse.jetty.server.handler.ContextHandler doStartINFO: Started o.e.j.w.WebAppContext@2d554825{/console,
 file:///private/var/folders/0c/pb4rznhj7sbc886t30w4vpxh0000gn/T/jetty-0.0.0.0-0-console.war-_console-any-3101338829524954950.dir/webapp/,AVAILABLE}{/console.war}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.AbstractConnector doStartINFO: Started ServerConnector@66480dd7{HTTP/1.1,[http/1.1]}{0.0.0.0:57964}Mar 07, 2016 12:04:53 PM org.eclipse.jetty.server.Server doStartINFO: Started @426mshttp://localhost:57964/consoleWell1 alert, ecoli value is 1Well1 alert, temp value is 48Well3 alert, ecoli value is 1```Now point your browser to the URL displayed above in the output from running the Java command to launch the `ConsoleWaterDetector` application. In this case, the URL is `http://localhost:57964/console`.Below is a screen shot of what you should see if everything is working properly:## ConsoleWaterDetector application scenarioThe application is now running in your browser. Let's discuss the scenario for the application.A county agency is responsible for ensuring the safety of resi
 dents well water. Each well they monitor has four different sensor types:* Temperature* Acidity* Ecoli* LeadThe sample application topology monitors 3 wells:* For the hypothetical scenario, Well1 and Well3 produce 'unhealthy' values from their sensors on occasion. Well2 always produces 'healthy' values.* Each well that is to be measured is added to the topology. The topology polls each sensor (temp, ecoli, etc.) for each well as a unit. A `TStream` is returned from polling the toplogy and represents a sensor reading. Each sensor reading for the well has a tag added to it with the reading type i.e, \"temp\", and the well id. Once all of the sensor readings are obtained and the tags added, each sensor reading is 'unioned' into a single `TStream`. Look at the `waterDetector` method for details on this.* Now, each well has a single stream with each of the sensors readings as a property with a name and value in the `TStream`. Next the `alertFilter` method is called on the `TStream` repre
 senting each well. This method checks the values for each well's sensors to determine if they are 'out of range' for healthy values. The `filter` oplet is used to do this. If any of the sensor's readings are out of the acceptable range the tuple is passed along. Those that are within an acceptable range are discarded.* Next the applications' `splitAlert` method is called on each well's stream that contains the union of all the sensor readings that are out of range. The `splitAlert` method uses the `split` oplet to split the incoming stream into 5 different streams. Only those tuples that are out of range for each stream, which represents each sensor type, will be returned. The object returned from `splitAlert` is a list of `TStream` objects. The `splitAlert` method is shown below:    ```java    public static List> splitAlert(TStream alertStream, int wellId) {        List> allStreams = alertStream.split(5, tuple -> {            if (tuple.get(\"temp\") != null) {                JsonOb
 ject tempObj = new JsonObject();                int temp = tuple.get(\"temp\").getAsInt();                if (temp = TEMP_ALERT_MAX) {                    tempObj.addProperty(\"temp\", temp);                    return 0;                } else {                    return -1;                }            } else if (tuple.get(\"acidity\") != null){                JsonObject acidObj = new JsonObject();                int acid = tuple.get(\"acidity\").getAsInt();                if (acid = ACIDITY_ALERT_MAX) {                    acidObj.addProperty(\"acidity\", acid);                    return 1;                } else {                    return -1;                }            } else if (tuple.get(\"ecoli\") != null) {                JsonObject ecoliObj = new JsonObject();                int ecoli = tuple.get(\"ecoli\").getAsInt();                if (ecoli >= ECOLI_ALERT) {                    ecoliObj.addProperty(\"ecoli\", ecoli);                    return 2;                } else {       
              return -1;                }            } else if (tuple.get(\"lead\") != null) {                JsonObject leadObj = new JsonObject();                int lead = tuple.get(\"lead\").getAsInt();                if (lead >= LEAD_ALERT_MAX) {                    leadObj.addProperty(\"lead\", lead);                    return 3;                } else {                    return -1;                }            } else {                 return -1;            }        });        return allStreams;    }    ```* Next we want to get the temperature stream from the first well and put a rate meter on it to determine the rate at which the out of range values are flowing in the stream    ```java    List> individualAlerts1 = splitAlert(filteredReadings1, 1);    // Put a rate meter on well1's temperature sensor output    Metrics.rateMeter(individualAlerts1.get(0));    ```* Next all the sensors for well 1 have tags added to the stream indicating the stream is out of range for that sensor and
  the well id. Next a sink is added, passing the tuple to a `Consumer` that formats a string to `System.out` containing the well id, alert type (sensor type) and value of the sensor.    ```java    // Put a rate meter on well1's temperature sensor output    Metrics.rateMeter(individualAlerts1.get(0));    individualAlerts1.get(0).tag(TEMP_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(\"\\n\" + formatAlertOutput(tuple, \"1\", \"temp\")));    individualAlerts1.get(1).tag(ACIDITY_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(formatAlertOutput(tuple, \"1\", \"acidity\")));    individualAlerts1.get(2).tag(ECOLI_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(formatAlertOutput(tuple, \"1\", \"ecoli\")));    individualAlerts1.get(3).tag(LEAD_ALERT_TAG, \"well1\").sink(tuple -> System.out.println(formatAlertOutput(tuple, \"1\", \"lead\")));    ```Output in the terminal window from the `formatAlertOutput` method will look like this:```Well1 alert, temp value is 86Well3 
 alert, ecoli value is 2Well1 alert, ecoli value is 1Well3 alert, acidity value is 1Well1 alert, lead value is 12Well1 alert, ecoli value is 2Well3 alert, lead value is 10Well3 alert, acidity value is 10```Notice how only those streams that are out of range for the temperature sensor type show output.## Detecting zero tuple countsAt the end of the `ConsoleWaterDetector` application is this snippet of code, added after the topology has been submitted:```javadp.submit(wellTopology);while (true) {    MetricRegistry metricRegistry = dp.getServices().getService(MetricRegistry.class);    SortedMap counters = metricRegistry.getCounters();    Set> values = counters.entrySet();    for (Entry e : values) {        if (e.getValue().getCount() == 0) {            System.out.println(\"Counter Op:\" + e.getKey() + \" tuple count: \" + e.getValue().getCount());        }    }    Thread.sleep(2000);}```What this does is get all the counters in the `MetricRegistry` class and print out the name of the co
 unter oplet they are monitoring along with the tuple count if it is zero. Here is some sample output:```Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_44 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_45 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_46 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_47 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_89 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_95 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_96 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_97 has a tuple count of zero!Counter Op:TupleCounter.quarks.oplet.JOB_0.OP_98 has a tuple count of zero!```To summarize what the application is doing:* Unions all sensor type readings for a single well* Filters all sensor type readings for a single well, passing on an object that only contains tuples for the object that 
 have at least one sensor type with out of range values* Splits the object that contained name/value pairs for sensor type and readings into individual sensor types returning only those streams that contain out of range values* Outputs to the command line the well id, sensor type and value that is out of range* Tags are added at various points in the topology for easier identification of either the well or some out of range condition* The topology contains counters to measure tuple counts since `DevelopmentProvider` was used* Individual rate meters were placed on `well1` and `well3`'s temperature sensors to determine the rate of 'unhealthy' values* Prints out the name of the counter oplets whose tuple counts are zero## Topology graph controlsNow that you have an understanding of what the application is doing, let's look at some of the controls in the console, so we can learn how to monitor the application. Below is a screen shot of the top controls: the controls that affect the Topol
 ogy Graph.* **Job**: A drop down to select which job is being displayed in the Topology Graph. An application can contain multiple jobs.* **State**: Hovering over the 'State' icon shows information about the selected job. The current and next states of the job, the job id and the job name.* **View by**: This select is used to change how the topology graph is displayed. The three options for this select are:  - Static flow  - Tuple count  - Oplet kind  - Currently it is set to 'Static flow'. This means the oplets (represented as circles in the topology graph) do not change size, nor do the lines or links (representing the edges of the topology graph) change width or position. The graph is not being refreshed when it is in 'Static flow' mode.* **Refresh interval**: Allows the user to select an interval between 3 - 20 seconds to refresh the tuple count values in the graph. Every X seconds the metrics for the topology graph are refreshed. More about metrics a little bit later.* **Pause 
 graph**: Stops the refresh interval timer. Once the 'Pause graph' button is clicked, the user must push 'Resume graph' for the graph to be updated, and then refreshed at the interval set in the 'Refresh interval' timer. It can be helpful to pause the graph if multiple oplets are occupying the same area on the graph, and their names become unreadable. Once the graph is paused, the user can drag an oplet off of another oplet to better view the name and see the edge(s) that connect them.* **Show tags**: If the checkbox appears in the top controls, it means:  - The 'View by' layer is capable of displaying stream tags  - The topology currently shown in the topology graph has stream tags associated with it* **Show all tags**: Selecting this checkbox shows all the tags present in the topology. If you want to see only certain tags, uncheck this box and select the button labeled 'Select individual tags ...'. A dialog will appear, and you can select one or all of the tags listed in the dialog
  which are present in the topology.    The next aspect of the console we'll look at are the popups available when selecting 'View all oplet properties', hovering over an oplet and hovering over an edge (link).The screen shot below shows the output from clicking on the 'View all oplet properties' link directly below the job selector:Looking at the sixth line in the table, where the Name is 'OP_5', we can see that the Oplet kind is a `Map`, a `quarks.oplet.functional.Map`, the Tuple count is 0 (this is because the view is in Static flow mode - the graph does not show the number of tuples flowing in it), the source oplet is 'OP_55', the target oplet is 'OP_60', and there are no stream tags coming from the source or target streams. Relationships for all oplets can be viewed in this manner.Now, looking at the graph, if we want to see the relationships for a single oplet, we can hover over it. The image below shows the hover when we are over 'OP_5'.You can also hover over the edges of the
  topology graph to get information. Hover over the edge (link) between 'OP_0' and 'OP_55'. The image shows the name and kind of the oplet as the source, and the name and kind of oplet as the target. Again the tuple count is 0 since this is the 'Static flow' view. The last item of information in the tooltip is the tags on the stream.One or many tags can be added to a stream. In this case we see the tags 'temperature' and 'well1'.The section of the code that adds the tags 'temperature' and 'well1' is in the `waterDetector` method of the `ConsoleWaterDetector` class.```javapublic static TStream waterDetector(Topology topology, int wellId) {    Random rNum = new Random();    TStream temp = topology.poll(() -> rNum.nextInt(TEMP_RANDOM_HIGH - TEMP_RANDOM_LOW) + TEMP_RANDOM_LOW, 1, TimeUnit.SECONDS);    TStream acidity = topology.poll(() -> rNum.nextInt(ACIDITY_RANDOM_HIGH - ACIDITY_RANDOM_LOW) + ACIDITY_RANDOM_LOW, 1, TimeUnit.SECONDS);    TStream ecoli = topology.poll(() -> rNum.nextInt(
 ECOLI_RANDOM_HIGH - ECOLI_RANDOM_LOW) + ECOLI_RANDOM_LOW, 1, TimeUnit.SECONDS);    TStream lead = topology.poll(() -> rNum.nextInt(LEAD_RANDOM_HIGH - LEAD_RANDOM_LOW) + LEAD_RANDOM_LOW, 1, TimeUnit.SECONDS);    TStream id = topology.poll(() -> wellId, 1, TimeUnit.SECONDS);    // add tags to each sensor    temp.tag(\"temperature\", \"well\" + wellId);```### LegendThe legend(s) that appear in the console depend on the view currently displayed. In the static flow mode, if no stream tags are present, there is no legend. In this example we have stream tags in the topology, so the static flow mode gives us the option to select 'Show tags'. If selected, the result is the addition of the stream tags legend:This legend shows all the tags that have been added to the topology, regardless of whether or not 'Show all tags' is checked or specific tags have been selected from the dialog that appears when the 'Select individual tags ...' button is clicked.### Topology graphNow that we've covered mo
 st of the ways to modify the view of the topology graph and discussed the application, let's look at the topology graph as a way to understand our application.When analyzing what is happening in your application, here are some ways you might use the console to help you understand it:* Topology of the application - how the edges and vertices of the graph are related* Tuple flow - tuple counts since the application was started* The affect of filters or maps on the downstream streams* Stream tags - if tags are added dynamically based on a condition, where the streams with tags are displayed in the topologyLet's start with the static flow view of the topology. We can look at the graph, and we can also hover over any of the oplets or streams to better understand the connections. Also, we can click 'View all oplet properties' and see the relationships in a tabular format.The other thing to notice in the static flow view are the tags. Look for any colored edges (the links between the oplet
 s). All of the left-most oplets have streams with tags. Most of them have the color that corresponds to 'Multiple tags'. If you hover over the edges, you can see the tags. It's obvious that we have tagged each sensor with the sensor type and the well id.Now, if you look to the far right, you can see more tags on streams coming out of a `split` oplet. They also have multiple tags, and hovering over them you can determine that they represent out of range values for each sensor type for the well. Notice how the `split` oplet, OP_43, has no tags in the streams coming out of it. If you follow that split oplet back, you can determine from the first tags that it is part of the well 2 stream.If you refer back to the `ConsoleWaterDetector` source, you can see that no tags were placed on the streams coming out of `well2`'s split because they contained no out of range values.Let's switch the view to Oplet kind now. It will make more clear which oplets are producing the streams with the tags on
  them. Below is an image of how the graph looks after switching to the Oplet kind view.In the Oplet kind view the links are all the same width, but the circles representing the oplets are sized according to tuple flow. Notice how the circles representing OP_10, OP_32 and OP_21 are large in relation to OP_80, OP_88 and OP_89. As a matter of fact, we can't even see the circle representing OP_89. Looking at OP_35 and then the Oplet kind legend, you can see by the color that it is a Filter oplet. This is because the filter that we used against `well2`, which is the stream that OP_35 is part of returned no tuples. This is a bit difficult to see. Let's look at the Tuple count view.The Tuple count view will make it more clear that no tuples are following out of OP_35, which represents the filter for `well2` and only returns out of range values. You may recall that in this example `well2` returned no out of range values. Below is the screen shot of the graph in 'Tuple count' view mode.The t
 opology graph oplets can sometimes sit on top of each other. If this is the case, pause the refresh and use your mouse to pull down on the oplets that are in the same position. This will allow you to see their name. Alternately, you can use the 'View all properties' table to see the relationships between oplets.### MetricsIf you scroll the browser window down, you can see a Metrics section. This section appears when the application contains the following:* A `DevelopmentProvider` is used; this automatically inserts counters on the streams of the topology* A `quarks.metrics.Metric.Counter` or `quarks.metrics.Metric.RateMeter` is added to an individual stream## CountersIn the `ConsoleWaterDetector` application we used a `DevelopmentProvider`. Therefore, counters were added to most streams (edges) with the following exceptions (from the [Javadoc](http://quarks-edge.github.io/quarks/docs/javadoc/quarks/metrics/Metrics.html#counter-quarks.topology.TStream-) for `quarks.metrics.Metrics`):
 *Oplets are only inserted upstream from a FanOut oplet.**If a chain of Peek oplets exists between oplets A and B, a Metric oplet is inserted after the last Peek, right upstream from oplet B.**If a chain of Peek oplets is followed by a FanOut, a metric oplet is inserted between the last Peek and the FanOut oplet.The implementation is not idempotent; previously inserted metric oplets are treated as regular graph vertices. Calling the method twice will insert a new set of metric oplets into the graph.*Also, the application inserts counters on `well2`'s streams after the streams from the individual sensors were unioned and then split:```javaList> individualAlerts2 = splitAlert(filteredReadings2, 2);TStream alert0Well2 = individualAlerts2.get(0);alert0Well2  = Metrics.counter(alert0Well2);alert0Well2.tag(\"well2\", \"temp\");TStream alert1Well2 = individualAlerts2.get(1);alert1Well2  = Metrics.counter(alert1Well2);alert1Well2.tag(\"well2\", \"acidity\");TStream alert2Well2 = individualAl
 erts2.get(2);alert2Well2  = Metrics.counter(alert2Well2);alert2Well2.tag(\"well2\", \"ecoli\");TStream alert3Well2 = individualAlerts2.get(3);alert3Well2  = Metrics.counter(alert3Well2);alert3Well2.tag(\"well2\", \"lead\");```When looking at the select next to the label 'Metrics', make sure the 'Count, oplets OP_37, OP_49 ...' is selected.  This select compares all of the counters in the topology visualized as a bar graph.  An image is shown below:Hover over individual bars to get the value of the number of tuples flowing through that oplet since the application was started. You can also see the oplet name. You can see that some of the oplets have zero tuples flowing through them.The bars that are the tallest and therefore have the highest tuple count are OP_76, OP_67 and OP_65.  If you look back up to the topology graph, in the Tuple count view, you can see that the edges (streams) surrounding these oplets have the color that corresponds to the highest tuple count (in the pictures 
 above that color is bright orange in the Tuple count legend).### Rate metersThe other type of metric we can look at are rate meter metrics. In the `ConsoleWaterDetector` application we added two rate meters here with the objective of comparing the rate of out of range readings between `well1` and `well3`:```List> individualAlerts1 = splitAlert(filteredReadings1, 1);// Put a rate meter on well1's temperature sensor outputMetrics.rateMeter(individualAlerts1.get(0));...List> individualAlerts3 = splitAlert(filteredReadings3, 3);// Put a rate meter on well3's temperature sensor outputMetrics.rateMeter(individualAlerts3.get(0));```Rate meters contain the following metrics for each stream they are added to:  * Tuple count  * The rate of change in the tuple count. The following rates are available for a single stream:    - 1 minute rate change    - 5 minute rate change    - 15 minute rate change    - Mean rate changeNow change the Metrics select to the 'MeanRate'. In our example these corre
 spond to oplets OP_37 and OP_49:Hovering over the slightly larger bar, the one to the right, the name is OP_49. Looking at the topology graph and changing the view to 'Static flow', follow the edges back from OP_49 until you can see an edge with a tag on it. You can see that OP_49's source is OP_51, whose source is OP_99.  The edge between OP_99 and it's source OP_48 has multiple tags. Hovering over this stream, the tags are 'TEMP out of range' and 'well3'.If a single rate meter is placed on a stream, in addition to plotting a bar chart, a line chart over the last 20 measures can be viewed. For example, if I comment out the addition of the rate meter for `well1` and then rerun the application, the Metrics section will look like the image below. I selected the 'OneMinuteRate' and 'Line chart' for Chart type:## SummaryThe intent of the information on this page is to help you understand the following:* How to add the console application to a Quarks application* How to run the `ConsoleW
 aterDetector` sample* The design/architecture in the `ConsoleWaterDetector` application* The controls for the Topology graph are and what they do, including the different views of the graph* The legend for the graph* How to interpret the graph and use the tooltips over the edges and vertices, as well as the 'View all properties' link* How to add counters and rate meters to a topology* How to use the metrics section to understand tuple counters and rate meters* How to correlate values from the metrics section with the topology graphThe Quarks console will continue to evolve and improve. Please open an issue if you see a problem with the existing console, but more importantly add an issue if you have an idea of how to make the console better.The more folks write Quarks applications and view them in the console, the more information we can gather from the community about what is needed in the console. Please consider making a contribution if there is a feature in the console that would
  really help you and others!"
 
 },
 
@@ -65,7 +65,7 @@
 "keywords": "",
 "url": "../docs/faq",
 "summary": "",
-"body": "## What is Apache Quarks?Quarks provides APIs and a lightweight runtime to analyze streaming data at the edge.## What do you mean by the edge?The edge includes devices, gateways, equipment, vehicles, systems, appliances and sensors of all kinds as part of the Internet of Things.## How is Apache Quarks used?Quarks can be used at the edge of the Internet of Things, for example, to analyze data on devices, engines, connected cars, etc.  Quarks could be on the device itself, or a gateway device collecting data from local devices.  You can write an edge application on Quarks and connect it to a Cloud service, such as the IBM Watson IoT Platform. It can also be used for enterprise data collection and analysis; for example log collectors, application data, and data center analytics.## How are applications developed?Applications are developed using a functional flow API to define operations on data streams that are executed as a graph of \"oplets\" in a lightweight embeddable runti
 me.  The SDK provides capabilities like windowing, aggregation and connectors with an extensible model for the community to expand its capabilities.## What APIs does Apache Quarks support?Currently, Quarks supports APIs for Java and Android. Support for additional languages, such as Python, is likely as more developers get involved.  Please consider joining the Quarks open source development community to accelerate the contributions of additional APIs.## What type of analytics can be done with Apache Quarks?Quarks provides windowing, aggregation and simple filtering. It uses Apache Common Math to provide simple analytics aimed at device sensors.  Quarks is also extensible, so you can call existing libraries from within your Quarks application.  In the future, Quarks will include more analytics, either exposing more functionality from Apache Common Math, other libraries or hand-coded analytics.## What connectors does Apache Quarks support?Quarks supports connectors for MQTT, HTTP, JD
 BC, File, Apache Kafka and IBM Watson IoT Platform.  Quarks is extensible; you can add the connector of your choice.## What centralized streaming analytic systems does Apache Quarks support?Quarks supports open source technology (such as Apache Spark, Apache Storm, Flink and samza), IBM Streams (on-premises or IBM Streaming Analytics on Bluemix), or any custom application of your choice.## Why do I need Apache Quarks on the edge, rather than my streaming analytic system?Quarks is designed for the edge, rather than a more centralized system.  It has a small footprint, suitable for running on devices.  Quarks provides simple analytics, allowing a device to analyze data locally and to only send to the centralized system if there is a need, reducing communication costs.## Why do I need Apache Quarks, rather than coding the complete application myself?Quarks is a tool for edge analytics that allows you to be more productive. Quarks provides a consistent data model (streams and windows) a
 nd provides useful functionality, such as aggregations, joins, etc. Using Quarks lets you to take advantage of this functionality, allowing you to focus on your application needs.## Where can I download Apache Quarks to try it out?Quarks is migrating from github quarks-edge to Apache. You can download the source from Apache and build it yourself [here](https://github.com/apache/incubator-quarks).  You can also  find already built pre-Apache releases of Quarks for download [here](https://github.com/quarks-edge/quarks/releases/latest). These releases are not associated with Apache.## How do I get started?Getting started is simple. Once you have downloaded Quarks, everything you need to know to get up and running, you will find [here](quarks-getting-started). We suggest you also run the [Quarks sample programs](samples) to familiarize yourselves with the code base.## How can I get involved? We would love to have your help! Visit [Get Involved](community) to learn more about how to get 
 involved.## How can I contribute code?Just submit a [pull request](https://github.com/apache/incubator-quarks) and wait for a committer to review.  For more information, visit our [committer page](committers) and read [DEVELOPMENT.md] (https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md) at the top of the code tree.## Can I become a committer?Read about Quarks committers and how to become a committer [here](committers).## Where can I get the code?The source code is available [here](https://github.com/apache/incubator-quarks).## Can I take a copy of the code and fork it for my own use?Yes. Quarks is available under the Apache 2.0 license which allows you to fork the code.  We hope you will contribute your changes back to the Quarks community.## How do I suggest new features?Click [Issues](https://issues.apache.org/jira/browse/QUARKS) to submit requests for new features. You may browse or query the Issues database to see what other members of the Quarks community hav
 e already requested.## How do I submit bug reports?Click [Issues](https://issues.apache.org/jira/browse/QUARKS) to submit a bug report.## How do I ask questions about Apache Quarks?Use [site.data.project.user_list](mailto:{{ site.data.project.user_list }}) to submit questions to the Quarks community.## Why is Apache Quarks open source?With the growth of the Internet of Things there is a need to execute analytics at the edge. Quarks was developed to address requirements for analytics at the edge for IoT use cases that were not addressed by central analytic solutions.  These capabilities will be useful to many organizations and that the diverse nature of edge devices and use cases is best addressed by an open community.  Our goal is to develop a vibrant community of developers and users to expand the capabilities and real-world use of Quarks by companies and individuals to enable edge analytics and further innovation for the IoT space."
+"body": "## What is Apache Quarks?Quarks provides APIs and a lightweight runtime to analyze streaming data at the edge.## What do you mean by the edge?The edge includes devices, gateways, equipment, vehicles, systems, appliances and sensors of all kinds as part of the Internet of Things.## How is Apache Quarks used?Quarks can be used at the edge of the Internet of Things, for example, to analyze data on devices, engines, connected cars, etc. Quarks could be on the device itself, or a gateway device collecting data from local devices. You can write an edge application on Quarks and connect it to a Cloud service, such as the IBM Watson IoT Platform. It can also be used for enterprise data collection and analysis; for example log collectors, application data, and data center analytics.## How are applications developed?Applications are developed using a functional flow API to define operations on data streams that are executed as a graph of \"oplets\" in a lightweight embeddable runtime
 . The SDK provides capabilities like windowing, aggregation and connectors with an extensible model for the community to expand its capabilities.## What APIs does Apache Quarks support?Currently, Quarks supports APIs for Java and Android. Support for additional languages, such as Python, is likely as more developers get involved. Please consider joining the Quarks open source development community to accelerate the contributions of additional APIs.## What type of analytics can be done with Apache Quarks?Quarks provides windowing, aggregation and simple filtering. It uses Apache Common Math to provide simple analytics aimed at device sensors. Quarks is also extensible, so you can call existing libraries from within your Quarks application. In the future, Quarks will include more analytics, either exposing more functionality from Apache Common Math, other libraries or hand-coded analytics.## What connectors does Apache Quarks support?Quarks supports connectors for MQTT, HTTP, JDBC, Fi
 le, Apache Kafka and IBM Watson IoT Platform. Quarks is extensible; you can add the connector of your choice.## What centralized streaming analytic systems does Apache Quarks support?Quarks supports open source technology (such as Apache Spark, Apache Storm, Flink and samza), IBM Streams (on-premises or IBM Streaming Analytics on Bluemix), or any custom application of your choice.## Why do I need Apache Quarks on the edge, rather than my streaming analytic system?Quarks is designed for the edge, rather than a more centralized system. It has a small footprint, suitable for running on devices. Quarks provides simple analytics, allowing a device to analyze data locally and to only send to the centralized system if there is a need, reducing communication costs.## Why do I need Apache Quarks, rather than coding the complete application myself?Quarks is a tool for edge analytics that allows you to be more productive. Quarks provides a consistent data model (streams and windows) and provid
 es useful functionality, such as aggregations, joins, etc. Using Quarks lets you to take advantage of this functionality, allowing you to focus on your application needs.## Where can I download Apache Quarks to try it out?Quarks is migrating from github quarks-edge to Apache. You can download 

<TRUNCATED>


[4/9] incubator-quarks-website git commit: from 207ee433ccbfc15f06b7d9e5fdb18d30d743a779

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_adaptable_filter_range.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_adaptable_filter_range.html b/content/recipes/recipe_adaptable_filter_range.html
index ba06e55..5a8bd4b 100644
--- a/content/recipes/recipe_adaptable_filter_range.html
+++ b/content/recipes/recipe_adaptable_filter_range.html
@@ -581,43 +581,43 @@ $('#toc').on('click', 'a', function() {
     
   <p>The <a href="recipe_value_out_of_range.html">Detecting a sensor value out of range</a> recipe introduced the basics of filtering as well as the use of a <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/analytics/sensors/Range.html">Range</a>.</p>
 
-<p>Oftentimes, a user wants a filter&#39;s behavior to be adaptable rather than static.  A filter&#39;s range can be made changeable via commands from some external source or just changed as a result of some other local analytics.</p>
+<p>Oftentimes, a user wants a filter&#39;s behavior to be adaptable rather than static. A filter&#39;s range can be made changeable via commands from some external source or just changed as a result of some other local analytics.</p>
 
-<p>A Quarks <code>IotProvider</code> and <code>IoTDevice</code> with its command streams would be a natural way to control the application.  In this recipe we will just simulate a &quot;set optimal temp range&quot; command stream.</p>
+<p>A Quarks <code>IotProvider</code> and <code>IoTDevice</code> with its command streams would be a natural way to control the application. In this recipe we will just simulate a &quot;set optimal temp range&quot; command stream.</p>
 
-<p>The string form of a <code>Range</code> is natural, consise, and easy to use.  As such it&#39;s a convenient form to use as external range format. The range string can easily be converted back into a <code>Range</code>.</p>
+<p>The string form of a <code>Range</code> is natural, consise, and easy to use. As such it&#39;s a convenient form to use as external range format. The range string can easily be converted back into a <code>Range</code>.</p>
 
 <p>We&#39;re going to assume familiarity with that earlier recipe and those concepts and focus on just the &quot;adaptable range specification&quot; aspect of this recipe.</p>
 
 <h2 id="define-the-range">Define the range</h2>
 
 <p>A <code>java.util.concurrent.atomic.AtomicReference</code> is used to provide the necessary thread synchronization.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">DEFAULT_TEMP_RANGE</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">valueOfDouble</span><span class="o">(</span><span class="s">"[77.0..91.0]"</span><span class="o">);</span>
-    <span class="kd">static</span> <span class="n">AtomicReference</span><span class="o">&lt;</span><span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;&gt;</span> <span class="n">optimalTempRangeRef</span> <span class="o">=</span>
-            <span class="k">new</span> <span class="n">AtomicReference</span><span class="o">&lt;&gt;(</span><span class="n">DEFAULT_TEMP_RANGE</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">static</span> <span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">DEFAULT_TEMP_RANGE</span> <span class="o">=</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">valueOfDouble</span><span class="o">(</span><span class="s">"[77.0..91.0]"</span><span class="o">);</span>
+<span class="kd">static</span> <span class="n">AtomicReference</span><span class="o">&lt;</span><span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;&gt;</span> <span class="n">optimalTempRangeRef</span> <span class="o">=</span>
+        <span class="k">new</span> <span class="n">AtomicReference</span><span class="o">&lt;&gt;(</span><span class="n">DEFAULT_TEMP_RANGE</span><span class="o">);</span>
 </code></pre></div>
 <h2 id="define-a-method-to-change-the-range">Define a method to change the range</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">static</span> <span class="kt">void</span> <span class="nf">setOptimalTempRange</span><span class="p">(</span><span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">range</span><span class="o">)</span> <span class="o">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Using optimal temperature range: "</span> <span class="o">+</span> <span class="n">range</span><span class="o">);</span>
-        <span class="n">optimalTempRangeRef</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="n">range</span><span class="o">);</span>
-    <span class="o">}</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">static</span> <span class="kt">void</span> <span class="nf">setOptimalTempRange</span><span class="p">(</span><span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">range</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Using optimal temperature range: "</span> <span class="o">+</span> <span class="n">range</span><span class="o">);</span>
+    <span class="n">optimalTempRangeRef</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="n">range</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
 <p>The filter just uses <code>optimalTempRangeRef.get()</code> to use the current range setting.</p>
 
 <h2 id="simulate-a-command-stream">Simulate a command stream</h2>
 
 <p>A <code>TStream&lt;Range&lt;Double&gt;&gt; setRangeCmds</code> stream is created and a new range specification tuple is generated every 10 seconds.  A <code>sink()</code> on the stream calls <code>setOptimalTempRange()</code> to change the range and hence the filter&#39;s bahavior.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="c1">// Simulate a command stream to change the optimal range.</span>
-    <span class="c1">// Such a stream might be from an IotDevice command.</span>
-    <span class="n">String</span><span class="o">[]</span> <span class="n">ranges</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span>
-        <span class="s">"[70.0..120.0]"</span><span class="o">,</span> <span class="s">"[80.0..130.0]"</span><span class="o">,</span> <span class="s">"[90.0..140.0]"</span><span class="o">,</span>
-    <span class="o">};</span>
-    <span class="n">AtomicInteger</span> <span class="n">count</span> <span class="o">=</span> <span class="k">new</span> <span class="n">AtomicInteger</span><span class="o">(</span><span class="mi">0</span><span class="o">);</span>
-    <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;&gt;</span> <span class="n">setRangeCmds</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span> 
-            <span class="o">-&gt;</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">valueOfDouble</span><span class="o">(</span><span class="n">ranges</span><span class="o">[</span><span class="n">count</span><span class="o">.</span><span class="na">incrementAndGet</span><span class="o">()</span> <span class="o">%</span> <span class="n">ranges</span><span class="o">.</span><span class="na">length</span><span class="o">]),</span>
-            <span class="mi">10</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
-
-    <span class="n">setRangeCmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">setOptimalTempRange</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="c1">// Simulate a command stream to change the optimal range.</span>
+<span class="c1">// Such a stream might be from an IotDevice command.</span>
+<span class="n">String</span><span class="o">[]</span> <span class="n">ranges</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]</span> <span class="o">{</span>
+    <span class="s">"[70.0..120.0]"</span><span class="o">,</span> <span class="s">"[80.0..130.0]"</span><span class="o">,</span> <span class="s">"[90.0..140.0]"</span><span class="o">,</span>
+<span class="o">};</span>
+<span class="n">AtomicInteger</span> <span class="n">count</span> <span class="o">=</span> <span class="k">new</span> <span class="n">AtomicInteger</span><span class="o">(</span><span class="mi">0</span><span class="o">);</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Range</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;&gt;</span> <span class="n">setRangeCmds</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(()</span>
+        <span class="o">-&gt;</span> <span class="n">Ranges</span><span class="o">.</span><span class="na">valueOfDouble</span><span class="o">(</span><span class="n">ranges</span><span class="o">[</span><span class="n">count</span><span class="o">.</span><span class="na">incrementAndGet</span><span class="o">()</span> <span class="o">%</span> <span class="n">ranges</span><span class="o">.</span><span class="na">length</span><span class="o">]),</span>
+        <span class="mi">10</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">);</span>
+
+<span class="n">setRangeCmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">tuple</span> <span class="o">-&gt;</span> <span class="n">setOptimalTempRange</span><span class="o">(</span><span class="n">tuple</span><span class="o">));</span>
 </code></pre></div>
 <h2 id="the-final-application">The final application</h2>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.concurrent.TimeUnit</span><span class="o">;</span>
@@ -720,7 +720,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/incubator-quarks-website/blob/4fa5de59/content/recipes/recipe_adaptable_polling_source.html
----------------------------------------------------------------------
diff --git a/content/recipes/recipe_adaptable_polling_source.html b/content/recipes/recipe_adaptable_polling_source.html
index d40255c..76b3512 100644
--- a/content/recipes/recipe_adaptable_polling_source.html
+++ b/content/recipes/recipe_adaptable_polling_source.html
@@ -579,47 +579,47 @@ $('#toc').on('click', 'a', function() {
 
     <a target="_blank" href="https://github.com/apache/incubator-quarks-website/blob/master/site/recipes/recipe_adaptable_polling_source.md" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
     
-  <p>The <a href="recipe_source_function.html">Writing a Source Function</a> recipe introduced the basics of creating a source stream by polling a data source periodically.</p>
+  <p>The <a href="recipe_source_function.html">Writing a source function</a> recipe introduced the basics of creating a source stream by polling a data source periodically.</p>
 
-<p>Oftentimes, a user wants the poll frequency to be adaptable rather than static.  For example, an event such as a sudden rise in a temperature sensor may motivate more frequent polling of the sensor and analysis of the data until the condition subsides.  A change in the poll frequency may be driven by locally performed analytics or via a command from an external source.</p>
+<p>Oftentimes, a user wants the poll frequency to be adaptable rather than static. For example, an event such as a sudden rise in a temperature sensor may motivate more frequent polling of the sensor and analysis of the data until the condition subsides. A change in the poll frequency may be driven by locally performed analytics or via a command from an external source.</p>
 
-<p>A Quarks <code>IotProvider</code> and <code>IoTDevice</code> with its command streams would be a natural way to control the application.  In this recipe we will just simulate a &quot;set poll period&quot; command stream.</p>
+<p>A Quarks <code>IotProvider</code> and <code>IoTDevice</code> with its command streams would be a natural way to control the application. In this recipe we will just simulate a &quot;set poll period&quot; command stream.</p>
 
-<p>The <code>Topology.poll()</code> documentation describes how the poll period may be changed at runtime.</p>
+<p>The <code>Topology.poll()</code> <a href="http://quarks-edge.github.io/quarks/docs/javadoc/quarks/topology/Topology.html#poll-quarks.function.Supplier-long-java.util.concurrent.TimeUnit-">documentation</a> describes how the poll period may be changed at runtime.</p>
 
-<p>The mechanism is based on a more general Quarks runtime <code>quarks.execution.services.ControlService</code> service.  The runtime registers &quot;control beans&quot; for entities that are controllable.  These controls can be retrieved at runtime via the service.</p>
+<p>The mechanism is based on a more general Quarks runtime <code>quarks.execution.services.ControlService</code> service. The runtime registers &quot;control beans&quot; for entities that are controllable. These controls can be retrieved at runtime via the service.</p>
 
 <p>At runtime, <code>Topology.poll()</code> registers a <code>quarks.execution.mbeans.PeriodMXBean</code> control. <strong>Retrieving the control at runtime requires setting an alias on the poll generated stream using <code>TStream.alias()</code>.</strong></p>
 
 <h2 id="create-the-polled-stream-and-set-its-alias">Create the polled stream and set its alias</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">        <span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="o">...;</span>
-        <span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
-        <span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">engineTemp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">)</span>
-                                      <span class="o">.</span><span class="na">alias</span><span class="o">(</span><span class="s">"engineTemp"</span><span class="o">)</span>
-                                      <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"engineTemp"</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">Topology</span> <span class="n">top</span> <span class="o">=</span> <span class="o">...;</span>
+<span class="n">SimulatedTemperatureSensor</span> <span class="n">tempSensor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SimulatedTemperatureSensor</span><span class="o">();</span>
+<span class="n">TStream</span><span class="o">&lt;</span><span class="n">Double</span><span class="o">&gt;</span> <span class="n">engineTemp</span> <span class="o">=</span> <span class="n">top</span><span class="o">.</span><span class="na">poll</span><span class="o">(</span><span class="n">tempSensor</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">TimeUnit</span><span class="o">.</span><span class="na">SECONDS</span><span class="o">)</span>
+                              <span class="o">.</span><span class="na">alias</span><span class="o">(</span><span class="s">"engineTemp"</span><span class="o">)</span>
+                              <span class="o">.</span><span class="na">tag</span><span class="o">(</span><span class="s">"engineTemp"</span><span class="o">);</span>
 </code></pre></div>
 <p>It&#39;s also a good practice to add tags to streams to improve the usability of the development mode Quarks console.</p>
 
 <h2 id="define-a-quot-set-poll-period-quot-method">Define a &quot;set poll period&quot; method</h2>
-<div class="highlight"><pre><code class="language-java" data-lang="java">    <span class="kd">static</span> <span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="kt">void</span> <span class="n">setPollPeriod</span><span class="o">(</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">pollStream</span><span class="o">,</span> <span class="kt">long</span> <span class="n">period</span><span class="o">,</span> <span class="n">TimeUnit</span> <span class="n">unit</span><span class="o">)</span> <span class="o">{</span>
-        <span class="c1">// get the topology's runtime ControlService service</span>
-        <span class="n">ControlService</span> <span class="n">cs</span> <span class="o">=</span> <span class="n">pollStream</span><span class="o">.</span><span class="na">topology</span><span class="o">().</span><span class="na">getRuntimeServiceSupplier</span><span class="o">()</span>
-                                    <span class="o">.</span><span class="na">get</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">ControlService</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">static</span> <span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="kt">void</span> <span class="n">setPollPeriod</span><span class="o">(</span><span class="n">TStream</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="n">pollStream</span><span class="o">,</span> <span class="kt">long</span> <span class="n">period</span><span class="o">,</span> <span class="n">TimeUnit</span> <span class="n">unit</span><span class="o">)</span> <span class="o">{</span>
+    <span class="c1">// get the topology's runtime ControlService service</span>
+    <span class="n">ControlService</span> <span class="n">cs</span> <span class="o">=</span> <span class="n">pollStream</span><span class="o">.</span><span class="na">topology</span><span class="o">().</span><span class="na">getRuntimeServiceSupplier</span><span class="o">()</span>
+                                <span class="o">.</span><span class="na">get</span><span class="o">().</span><span class="na">getService</span><span class="o">(</span><span class="n">ControlService</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
 
-        <span class="c1">// using the the stream's alias, get its PeriodMXBean control</span>
-        <span class="n">PeriodMXBean</span> <span class="n">control</span> <span class="o">=</span> <span class="n">cs</span><span class="o">.</span><span class="na">getControl</span><span class="o">(</span><span class="n">TStream</span><span class="o">.</span><span class="na">TYPE</span><span class="o">,</span> <span class="n">pollStream</span><span class="o">.</span><span class="na">getAlias</span><span class="o">(),</span> <span class="n">PeriodMXBean</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+    <span class="c1">// using the the stream's alias, get its PeriodMXBean control</span>
+    <span class="n">PeriodMXBean</span> <span class="n">control</span> <span class="o">=</span> <span class="n">cs</span><span class="o">.</span><span class="na">getControl</span><span class="o">(</span><span class="n">TStream</span><span class="o">.</span><span class="na">TYPE</span><span class="o">,</span> <span class="n">pollStream</span><span class="o">.</span><span class="na">getAlias</span><span class="o">(),</span> <span class="n">PeriodMXBean</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
 
-        <span class="c1">// change the poll period using the control</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Setting period="</span><span class="o">+</span><span class="n">period</span><span class="o">+</span><span class="s">" "</span><span class="o">+</span><span class="n">unit</span><span class="o">+</span><span class="s">" stream="</span><span class="o">+</span><span class="n">pollStream</span><span class="o">);</span>
-        <span class="n">control</span><span class="o">.</span><span class="na">setPeriod</span><span class="o">(</span><span class="n">period</span><span class="o">,</span> <span class="n">unit</span><span class="o">);</span>
-    <span class="o">}</span>
+    <span class="c1">// change the poll period using the control</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Setting period="</span><span class="o">+</span><span class="n">period</span><span class="o">+</span><span class="s">" "</span><span class="o">+</span><span class="n">unit</span><span class="o">+</span><span class="s">" stream="</span><span class="o">+</span><span class="n">pollStream</span><span class="o">);</span>
+    <span class="n">control</span><span class="o">.</span><span class="na">setPeriod</span><span class="o">(</span><span class="n">period</span><span class="o">,</span> <span class="n">unit</span><span class="o">);</span>
+<span class="o">}</span>
 </code></pre></div>
 <h2 id="process-the-quot-set-poll-period-quot-command-stream">Process the &quot;set poll period&quot; command stream</h2>
 
-<p>Our commands are on the <code>TStream&lt;JsonObject&gt; cmds</code> stream.  Each <code>JsonObject</code> tuple is a command with the properties &quot;period&quot; and &quot;unit&quot;.</p>
-<div class="highlight"><pre><code class="language-java" data-lang="java">        <span class="n">cmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">json</span> <span class="o">-&gt;</span> <span class="n">setPollPeriod</span><span class="o">(</span><span class="n">engineTemp</span><span class="o">,</span>
-            <span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"period"</span><span class="o">).</span><span class="na">getAsLong</span><span class="o">(),</span>
-            <span class="n">TimeUnit</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"unit"</span><span class="o">).</span><span class="na">getAsString</span><span class="o">())));</span>
+<p>Our commands are on the <code>TStream&lt;JsonObject&gt; cmds</code> stream. Each <code>JsonObject</code> tuple is a command with the properties &quot;period&quot; and &quot;unit&quot;.</p>
+<div class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">cmds</span><span class="o">.</span><span class="na">sink</span><span class="o">(</span><span class="n">json</span> <span class="o">-&gt;</span> <span class="n">setPollPeriod</span><span class="o">(</span><span class="n">engineTemp</span><span class="o">,</span>
+    <span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"period"</span><span class="o">).</span><span class="na">getAsLong</span><span class="o">(),</span>
+    <span class="n">TimeUnit</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">json</span><span class="o">.</span><span class="na">getAsJsonPrimitive</span><span class="o">(</span><span class="s">"unit"</span><span class="o">).</span><span class="na">getAsString</span><span class="o">())));</span>
 </code></pre></div>
 <h2 id="the-final-application">The final application</h2>
 <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kn">import</span> <span class="nn">java.util.Date</span><span class="o">;</span>
@@ -700,7 +700,6 @@ $('#toc').on('click', 'a', function() {
     <span class="o">}</span>
 
 <span class="o">}</span>
-
 </code></pre></div>
 
 <div class="tags">
@@ -733,7 +732,7 @@ $('#toc').on('click', 'a', function() {
         <div class="col-lg-12 footer">
 
              Site last
-            generated: Apr 29, 2016 <br/>
+            generated: May 2, 2016 <br/>
 
         </div>
     </div>