http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c3b8e903/templates/productranking/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html 
b/templates/productranking/quickstart/index.html
index 8a6cc13..0c824d0 100644
--- a/templates/productranking/quickstart/index.html
+++ b/templates/productranking/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp1 |    1 | 
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp2 |    2 | 
io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span 
class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Product Ranking Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. A user can view an item. This template requires 
&#39;$set&#39; user event, &#39;$set&#39; item event and user-view-item 
events.</p> <p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
 Note that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-84a5a71b-b368-414a-8f03-b6a5da7aa148">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-ebec236f-b3b8-4fa6-b205-a4683a779fe2">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-14674315-13cb-4b67-b0bb-762bd5ab9640">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-715862f0-d8b4-45a8-a4f1-68f9cc1b347b">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-8c230f01-0c7f-4899
 -97b6-529c9d11ab0a">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-84a5a71b-b368-414a-8f03-b6a5da7aa148"> <div 
class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Product Ranking Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. A user can view an item. This template requires 
&#39;$set&#39; user event, &#39;$set&#39; item event and user-view-item 
events.</p> <p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
 Note that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-adcd3682-f0ac-4de3-9af6-de01b59eaece">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-70ef8c07-5077-4568-84e9-92a81d1494d8">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-f4988eba-58df-4438-8c0a-5c4c6517b626">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-e4c886a5-e889-48a1-bf52-e84df986cc26">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-059ed826-1ee4-40b9
 -9cf7-db2d1bd9f3e7">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-adcd3682-f0ac-4de3-9af6-de01b59eaece"> <div 
class="highlight shell"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -47,7 +47,7 @@ Your system is all ready to go.
   "entityId" : "u0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-ebec236f-b3b8-4fa6-b205-a4683a779fe2"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-70ef8c07-5077-4568-84e9-92a81d1494d8"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -78,7 +78,7 @@ Your system is all ready to go.
   <span class="n">entity_type</span><span class="o">=</span><span 
class="s">"user"</span><span class="p">,</span>
   <span class="n">entity_id</span><span class="o">=&lt;</span><span 
class="n">USER_ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-14674315-13cb-4b67-b0bb-762bd5ab9640"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-f4988eba-58df-4438-8c0a-5c4c6517b626"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -103,7 +103,7 @@ Your system is all ready to go.
   <span class="s1">'entityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">USER</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-715862f0-d8b4-45a8-a4f1-68f9cc1b347b"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-e4c886a5-e889-48a1-bf52-e84df986cc26"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -120,7 +120,7 @@ Your system is all ready to go.
   <span class="s1">'user'</span><span class="p">,</span>
   <span class="o">&lt;</span><span class="no">USER</span> <span 
class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-8c230f01-0c7f-4899-97b6-529c9d11ab0a"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-059ed826-1ee4-40b9-9cf7-db2d1bd9f3e7"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -145,7 +145,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span 
class="o">(</span><span class="s">"user"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">USER_ID</span><span 
class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">userEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-c0cca4d7-c1ae-40a2-8a43-10abbfa1ab7a">REST API</a></li> <li 
data-lang="python"><a href="#tab-a4c19da8-7906-437a-8f10-41bd185f4177">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-356b2f30-ee9a-444c-a01a-7104f9abe4b2">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-4b2da283-244b-48ba-8d01-ea6993cffeaa">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-a3b381d6-dec5-49e8-83ce-0ab13d64d506">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-c0cca4d7-c1ae-40a2-8a43-10abbfa1ab7a"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td cla
 ss="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-964c3169-c841-4c21-a4a1-ce318ee595a8">REST API</a></li> <li 
data-lang="python"><a href="#tab-1c2477cb-da73-48da-bfb3-1989bbd4901e">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-d8d4298b-e46d-49aa-8561-ab29c3fc9002">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-5e013f4a-4f28-42e4-b962-b230f43691fe">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-b8c0acba-b75c-4353-892b-96b7cd5b7b24">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-964c3169-c841-4c21-a4a1-ce318ee595a8"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td cla
 ss="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -160,7 +160,7 @@ Your system is all ready to go.
   "entityId" : "i0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-a4c19da8-7906-437a-8f10-41bd185f4177"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-1c2477cb-da73-48da-bfb3-1989bbd4901e"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -173,7 +173,7 @@ Your system is all ready to go.
   <span class="n">entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
   <span class="n">entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM_ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-356b2f30-ee9a-444c-a01a-7104f9abe4b2"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-d8d4298b-e46d-49aa-8561-ab29c3fc9002"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -190,7 +190,7 @@ Your system is all ready to go.
 <span class="p">));</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-4b2da283-244b-48ba-8d01-ea6993cffeaa"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-5e013f4a-4f28-42e4-b962-b230f43691fe"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -203,7 +203,7 @@ Your system is all ready to go.
   <span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-a3b381d6-dec5-49e8-83ce-0ab13d64d506"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-b8c0acba-b75c-4353-892b-96b7cd5b7b24"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span 
class="o">(</span><span class="s">"item"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">ITEM_ID</span><span 
class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">itemEvent</span><span class="o">)</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-b06ed700-40c7-47b3-bbb4-354442301885">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-a560650e-c3ee-49ff-91db-c8b2af1f15f7">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-6353b60d-d8eb-4226-95b9-bf71da0d145a">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-f250dd93-2ce5-48c9-8170-878a01efeec3">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-399499af-d941-4601-9dd1-cb94060696fa">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-b06ed700-40c7-47b3-bbb4-354442301885"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-179ccc96-56b8-4b2e-800c-fcf52f29adee">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-bc7e8405-45d3-4790-9b64-ef5062d2aad0">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-5f73b3f6-1fb7-40cc-be74-b1a43800a45f">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-06429b18-7e0c-4fbe-98b3-6bf6793ebebb">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-3105326b-2a01-4ffb-9ace-af74eff07e6d">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-179ccc96-56b8-4b2e-800c-fcf52f29adee"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
 2
 3
 4
@@ -233,7 +233,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-a560650e-c3ee-49ff-91db-c8b2af1f15f7"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-bc7e8405-45d3-4790-9b64-ef5062d2aad0"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -250,7 +250,7 @@ Your system is all ready to go.
   <span class="n">target_entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-6353b60d-d8eb-4226-95b9-bf71da0d145a"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-5f73b3f6-1fb7-40cc-be74-b1a43800a45f"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -269,7 +269,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">ITEM</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-f250dd93-2ce5-48c9-8170-878a01efeec3"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-06429b18-7e0c-4fbe-98b3-6bf6793ebebb"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -286,7 +286,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> 
<span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-399499af-d941-4601-9dd1-cb94060696fa"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-3105326b-2a01-4ffb-9ace-af74eff07e6d"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -344,14 +344,14 @@ User u10 views item i7
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed 
successfully and running, you should see a console message similar to the 
following:</p><div class="highlight shell"><table style="border-spacing: 
0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span 
class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind 
successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To rank items with IDs &quot;i1&quot;, &quot;i3&quot;, 
&quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, 
&quot;i9&quot; for user &quot;u2&quot;. You send this JSON <code>{ 
&quot;user&quot;: &quot;u2&quot;, &quot;items&quot;: [&quot;i1&quot;, 
&quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, 
&quot;i31&quot;, &quot;i9&quot;] }</code> to the deployed engine and it will 
return a JSON of the ranked items. Simply send a query by making a HTTP request 
or through the <code>EngineCl
 ient</code> of an SDK.</p><p>With the deployed engine running, open another 
terminal and run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a 
href="#tab-3dc656a0-7d56-496a-b200-f4b61d67e907">REST API</a></li> <li 
data-lang="python"><a href="#tab-bd5035ef-c69c-4626-bfa4-fc1259b1ee49">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-a7ce33b1-0078-446c-b9f7-fcf0ac055f4f">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-cfec2e1b-1d7f-4d74-83da-31f6c7ac7780">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-eb280815-34f5-4410-8822-1dedd26b689f">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-3dc656a0-7d56-496a-b200-f4b61d67e907"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To rank items with IDs &quot;i1&quot;, &quot;i3&quot;, 
&quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, &quot;i31&quot;, 
&quot;i9&quot; for user &quot;u2&quot;. You send this JSON <code>{ 
&quot;user&quot;: &quot;u2&quot;, &quot;items&quot;: [&quot;i1&quot;, 
&quot;i3&quot;, &quot;i10&quot;, &quot;i2&quot;, &quot;i5&quot;, 
&quot;i31&quot;, &quot;i9&quot;] }</code> to the deployed engine and it will 
return a JSON of the ranked items. Simply send a query by making a HTTP request 
or through the <code>EngineCl
 ient</code> of an SDK.</p><p>With the deployed engine running, open another 
terminal and run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang="json"><a 
href="#tab-1fc5afd1-2c31-4bfe-900a-a69af70ccf8d">REST API</a></li> <li 
data-lang="python"><a href="#tab-017b6944-281a-4f1f-9c7b-405fd0d807aa">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-c3588a55-e54b-4f84-9cda-c905791891fd">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-3f8aca5a-4d8d-47e5-a6b2-b0a211f99872">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-3ba896a1-b5dd-451c-b817-b688cbc67d78">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-1fc5afd1-2c31-4bfe-900a-a69af70ccf8d"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span 
class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "u2", "items": ["i1", "i3", "i10", "i2", "i5", 
"i31", "i9"]}'</span> <span class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-bd5035ef-c69c-4626-bfa4-fc1259b1ee49"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-017b6944-281a-4f1f-9c7b-405fd0d807aa"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -362,7 +362,7 @@ http://localhost:8000/queries.json
   <span class="s">"user"</span><span class="p">:</span> <span 
class="s">"u2"</span><span class="p">,</span>
   <span class="s">"items"</span><span class="p">:</span> <span 
class="p">[</span><span class="s">"i1"</span><span class="p">,</span> <span 
class="s">"i3"</span><span class="p">,</span> <span class="s">"i10"</span><span 
class="p">,</span> <span class="s">"i2"</span><span class="p">,</span> <span 
class="s">"i5"</span><span class="p">,</span> <span class="s">"i31"</span><span 
class="p">,</span> <span class="s">"i9"</span><span class="p">]</span>
 <span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-a7ce33b1-0078-446c-b9f7-fcf0ac055f4f"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-c3588a55-e54b-4f84-9cda-c905791891fd"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -385,7 +385,7 @@ http://localhost:8000/queries.json
 <span class="nb">print_r</span><span class="p">(</span><span 
class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-cfec2e1b-1d7f-4d74-83da-31f6c7ac7780"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-3f8aca5a-4d8d-47e5-a6b2-b0a211f99872"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -402,7 +402,7 @@ http://localhost:8000/queries.json
   <span class="s1">'items'</span> <span class="o">=&gt;</span> <span 
class="p">[</span><span class="s1">'i1'</span><span class="p">,</span> <span 
class="s1">'i3'</span><span class="p">,</span> <span 
class="s1">'i10'</span><span class="p">,</span> <span 
class="s1">'i2'</span><span class="p">,</span> <span 
class="s1">'i5'</span><span class="p">,</span> <span 
class="s1">'i31'</span><span class="p">,</span> <span 
class="s1">'i9'</span><span class="p">])</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-eb280815-34f5-4410-8822-1dedd26b689f"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-3ba896a1-b5dd-451c-b817-b688cbc67d78"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c3b8e903/templates/recommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html 
b/templates/recommendation/quickstart/index.html
index 80c6f6a..610537c 100644
--- a/templates/recommendation/quickstart/index.html
+++ b/templates/recommendation/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp1 |    1 | 
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp2 |    2 | 
io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span 
class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data. By default, the Recommendation Engine 
Template supports 2 types of events: <strong>rate</strong> and 
<strong>buy</strong>. A user can give a rating score to an item or buy an item. 
This template requires user-view-item and user-buy-item events.</p><div 
class="alert-message info"><p>This template can easily be customized to 
consider more user events such as <em>like</em>, <em>dislike</em> 
etc.</p></div> <p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><
 p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in 
above steps. Note that <code>localhost:7070</code> is the default URL of the 
Event Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <h3 id='example-<strong>rate</strong>-event' 
class='header-anchors' >Example <strong>rate</strong> event</h3><p>A user (ID 
&quot;u0&quot;) gives an item (ID &quot;i0&quot;) a rating of 5 at 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified)</p><p>Run the following <code>curl</code> command 
to send the <code>rate</code> event:</p><div class="tabs"> <ul class="control"> 
<li data-lang="json"><a href="#tab-c42006f0-8aee-4276-90aa-4bb8f316c510">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-3dc642e9-1822-403d-bb27-e34050111000">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-7368ca68-b624-41af-bd4d-bf1829e1a5ad">PHP
  SDK</a></li> <li data-lang="ruby"><a 
href="#tab-2c5f7269-21ce-4bf7-a976-40cffa0e4332">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-f4648700-5a54-4e2f-8ed2-ada528a2efff">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-c42006f0-8aee-4276-90aa-4bb8f316c510"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data. By default, the Recommendation Engine 
Template supports 2 types of events: <strong>rate</strong> and 
<strong>buy</strong>. A user can give a rating score to an item or buy an item. 
This template requires user-view-item and user-buy-item events.</p><div 
class="alert-message info"><p>This template can easily be customized to 
consider more user events such as <em>like</em>, <em>dislike</em> 
etc.</p></div> <p>You can send these events to PredictionIO Event Server in 
real-time easily by making a HTTP request or through the provided SDK. Please 
see <a href="/appintegration/">App Integration Overview</a> for more details 
how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><
 p>Replace <code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in 
above steps. Note that <code>localhost:7070</code> is the default URL of the 
Event Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <h3 id='example-<strong>rate</strong>-event' 
class='header-anchors' >Example <strong>rate</strong> event</h3><p>A user (ID 
&quot;u0&quot;) gives an item (ID &quot;i0&quot;) a rating of 5 at 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified)</p><p>Run the following <code>curl</code> command 
to send the <code>rate</code> event:</p><div class="tabs"> <ul class="control"> 
<li data-lang="json"><a href="#tab-4b284bb8-006e-47dd-93b8-5edf963d5f5e">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-c02185f5-390d-4196-8ee3-4bea5d305017">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-85bc8bf6-1638-4b6a-9516-07e47c0938a2">PHP
  SDK</a></li> <li data-lang="ruby"><a 
href="#tab-d6d90468-f4a1-483e-9e5d-ec77879f19d3">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-cf1a0e6a-1622-4d19-9c4c-4b589a2ed1a6">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-4b284bb8-006e-47dd-93b8-5edf963d5f5e"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -57,7 +57,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-3dc642e9-1822-403d-bb27-e34050111000"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-c02185f5-390d-4196-8ee3-4bea5d305017"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -92,7 +92,7 @@ Your system is all ready to go.
     <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span><span 
class="p">,</span>
     <span class="n">properties</span><span class="o">=</span> <span 
class="p">{</span> <span class="s">"rating"</span> <span class="p">:</span> 
<span class="nb">float</span><span class="p">(</span><span 
class="o">&lt;</span><span class="n">RATING</span><span 
class="o">&gt;</span><span class="p">)</span> <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-7368ca68-b624-41af-bd4d-bf1829e1a5ad"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-85bc8bf6-1638-4b6a-9516-07e47c0938a2"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -123,7 +123,7 @@ Your system is all ready to go.
    <span class="s1">'properties'</span> <span class="o">=&gt;</span> <span 
class="k">array</span><span class="p">(</span><span 
class="s1">'rating'</span><span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">RATING</span><span 
class="o">&gt;</span><span class="p">)</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-2c5f7269-21ce-4bf7-a976-40cffa0e4332"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-d6d90468-f4a1-483e-9e5d-ec77879f19d3"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -150,7 +150,7 @@ Your system is all ready to go.
   <span class="p">}</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-f4648700-5a54-4e2f-8ed2-ada528a2efff"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-cf1a0e6a-1622-4d19-9c4c-4b589a2ed1a6"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -179,7 +179,7 @@ Your system is all ready to go.
     <span class="o">.</span><span class="na">property</span><span 
class="o">(</span><span class="s">"rating"</span><span class="o">,</span> <span 
class="k">new</span> <span class="n">Float</span><span 
class="o">(&lt;</span><span class="n">RATING</span><span 
class="o">&gt;));</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">rateEvent</span><span class="o">);</span>
 
-</pre></td> </tr></tbody></table> </div> </div> </div> <h3 
id='example-<strong>buy</strong>-event' class='header-anchors' >Example 
<strong>buy</strong> event</h3><p>A user (ID &quot;u1&quot;) buys an item (ID 
&quot;i2&quot;) at <code>2014-11-10T12:34:56.123-08:00</code> (current time 
will be used if eventTime is not specified)</p><p>Run the following 
<code>curl</code> command to send the <code>buy</code> event:</p><div 
class="tabs"> <ul class="control"> <li data-lang="json"><a 
href="#tab-34f45cc0-6aaa-4925-8c9c-1d0bec245e62">REST API</a></li> <li 
data-lang="python"><a href="#tab-b62cd339-8dff-44bb-b2b1-cc81cb14dc9f">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-a77e6dcd-ea30-47b8-9376-45499e5faf77">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-801d37d2-0609-4f69-8763-f2df4afebbf4">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-72fdff2a-2062-4e99-8bf6-e0e9aa16851c">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" id="tab-34f45cc0-6aaa-4925-8c9c-1d
 0bec245e62"> <div class="highlight shell"> <table style="border-spacing: 
0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <h3 
id='example-<strong>buy</strong>-event' class='header-anchors' >Example 
<strong>buy</strong> event</h3><p>A user (ID &quot;u1&quot;) buys an item (ID 
&quot;i2&quot;) at <code>2014-11-10T12:34:56.123-08:00</code> (current time 
will be used if eventTime is not specified)</p><p>Run the following 
<code>curl</code> command to send the <code>buy</code> event:</p><div 
class="tabs"> <ul class="control"> <li data-lang="json"><a 
href="#tab-3c26f793-bc7a-493d-bc2d-5372b85ecd3a">REST API</a></li> <li 
data-lang="python"><a href="#tab-88da59d9-cb2c-42f6-8a97-b6a6c9a8d072">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-ec4823d1-83be-4bb7-82c5-472d3635eb3c">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-c2a5a95a-f4d8-49d8-bcf2-7d5489670417">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-15226643-fac1-4072-9a5f-aa216d52046e">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" id="tab-3c26f793-bc7a-493d-bc2d-53
 72b85ecd3a"> <div class="highlight shell"> <table style="border-spacing: 
0"><tbody><tr> <td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2
 3
 4
@@ -198,7 +198,7 @@ Your system is all ready to go.
   "targetEntityId" : "i2",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-b62cd339-8dff-44bb-b2b1-cc81cb14dc9f"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-88da59d9-cb2c-42f6-8a97-b6a6c9a8d072"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -213,7 +213,7 @@ Your system is all ready to go.
     <span class="n">target_entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
     <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-a77e6dcd-ea30-47b8-9376-45499e5faf77"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-ec4823d1-83be-4bb7-82c5-472d3635eb3c"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -232,7 +232,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">ITEM</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-801d37d2-0609-4f69-8763-f2df4afebbf4"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-c2a5a95a-f4d8-49d8-bcf2-7d5489670417"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -249,7 +249,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> 
<span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-72fdff2a-2062-4e99-8bf6-e0e9aa16851c"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-15226643-fac1-4072-9a5f-aa216d52046e"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -297,17 +297,17 @@ Your system is all ready to go.
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed 
successfully and running, you should see a console message similar to the 
following:</p><div class="highlight shell"><table style="border-spacing: 
0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span 
class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind 
successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve 
predicted results. To recommend 4 movies to user whose id is 1, you send this 
JSON <code>{ &quot;user&quot;: &quot;1&quot;, &quot;num&quot;: 4 }</code> to 
the deployed engine and it will return a JSON of the recommended movies. Simply 
send a query by making a HTTP request or through the <code>EngineClient</code> 
of an SDK.</p><p>With the deployed engine running, open another terminal and 
run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang
 ="json"><a href="#tab-e0f99473-0390-4c54-8f92-9220de7845c4">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-3404628e-5335-4d5c-a9f4-e72cde611f99">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-f0027693-470d-4f16-88f5-f0b1ba0f89a7">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-5a747832-e99c-4a9a-be1e-83dc19d92b95">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-93a25ad7-0298-464b-b591-4182d2d9d338">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-e0f99473-0390-4c54-8f92-9220de7845c4"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can try to retrieve 
predicted results. To recommend 4 movies to user whose id is 1, you send this 
JSON <code>{ &quot;user&quot;: &quot;1&quot;, &quot;num&quot;: 4 }</code> to 
the deployed engine and it will return a JSON of the recommended movies. Simply 
send a query by making a HTTP request or through the <code>EngineClient</code> 
of an SDK.</p><p>With the deployed engine running, open another terminal and 
run the following <code>curl</code> command or use SDK to send the 
query:</p><div class="tabs"> <ul class="control"> <li data-lang
 ="json"><a href="#tab-4484427e-6ec3-49be-9eab-2b7e89f4b599">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-5e0664c5-67eb-4aca-8fff-6806a1cd6fc6">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-4532871d-5bcb-4a9c-a2c2-1d8f2e3c8b51">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-8f0acc5f-1862-43a3-a24b-a45f26f43c6c">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-8ac697a2-2a9e-4546-bd8e-a7106047857e">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-4484427e-6ec3-49be-9eab-2b7e89f4b599"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span 
class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "user": "1", "num": 4 }'</span> 
http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-3404628e-5335-4d5c-a9f4-e72cde611f99"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-5e0664c5-67eb-4aca-8fff-6806a1cd6fc6"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span 
class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span 
class="n">predictionio</span><span class="o">.</span><span 
class="n">EngineClient</span><span class="p">(</span><span 
class="n">url</span><span class="o">=</span><span 
class="s">"http://localhost:8000";</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span 
class="o">.</span><span class="n">send_query</span><span 
class="p">({</span><span class="s">"user"</span><span class="p">:</span> <span 
class="s">"1"</span><span class="p">,</span> <span class="s">"num"</span><span 
class="p">:</span> <span class="mi">4</span><span class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-f0027693-470d-4f16-88f5-f0b1ba0f89a7"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-4532871d-5bcb-4a9c-a2c2-1d8f2e3c8b51"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -326,7 +326,7 @@ Your system is all ready to go.
 <span class="nb">print_r</span><span class="p">(</span><span 
class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-5a747832-e99c-4a9a-be1e-83dc19d92b95"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-8f0acc5f-1862-43a3-a24b-a45f26f43c6c"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -339,7 +339,7 @@ Your system is all ready to go.
 <span class="n">response</span> <span class="o">=</span> <span 
class="n">client</span><span class="p">.</span><span 
class="nf">send_query</span><span class="p">(</span><span 
class="s1">'user'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="no">USER</span> <span 
class="no">ID</span><span class="o">&gt;</span><span class="p">,</span> <span 
class="s1">'num'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="no">NUMBER</span> <span 
class="p">(</span><span class="n">integer</span><span class="p">)</span><span 
class="o">&gt;</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-93a25ad7-0298-464b-b591-4182d2d9d338"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-8ac697a2-2a9e-4546-bd8e-a7106047857e"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4

http://git-wip-us.apache.org/repos/asf/predictionio-site/blob/c3b8e903/templates/similarproduct/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/quickstart/index.html 
b/templates/similarproduct/quickstart/index.html
index d5ae391..8b69d3b 100644
--- a/templates/similarproduct/quickstart/index.html
+++ b/templates/similarproduct/quickstart/index.html
@@ -32,7 +32,7 @@ Your system is all ready to go.
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp1 |    1 | 
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span>               MyApp2 |    2 | 
io5lz6Eg4m3Xe4JZTBFE13GMAf1dhFl6ZteuJfrO84XpdOz9wRCrDU44EUaYuXq5 | <span 
class="o">(</span>all<span class="o">)</span>
 <span class="o">[</span>INFO] <span class="o">[</span>App<span 
class="nv">$]</span> Finished listing 2 app<span class="o">(</span>s<span 
class="o">)</span>.
-</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Similar Product Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. An item has the <strong>categories</strong> property, 
which is a list of category names (String). A user can view an item. 
Respectively, this template requires &#39;$set&#39; user event, &#39;$set&#39; 
item event, and user-view-item events.</p><div class="alert-message 
info"><p>This template can easily be customized to consider more user events 
such as <em>buy</em>, <em>rate</em> and <em>like</em>.</p></div> <p>You can 
send these events to PredictionIO Event Server in real-time easily by making a 
HTTP request or through the provided SDK. Please see <a 
href="/appintegration/">App Integration Overview</a> for more detai
 ls how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
Note that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-6d9e5723-e134-4c4a-82cf-e0e6b3e0d51f">REST 
API</a></li> <li data-lang="python"><a href="#tab-c438b7f1-40
 ea-443f-9614-673ebfc87b53">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-0bb25e8f-fa2d-42ab-a820-5d93fa2aa562">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-32134d67-e009-404b-817a-38520349c7e4">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-d0c05149-e38c-450a-8a55-084c0b2a909e">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-6d9e5723-e134-4c4a-82cf-e0e6b3e0d51f"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p><a href="#"></a></p> <h2 
id='4.-collecting-data' class='header-anchors'>4. Collecting Data</h2><p>Next, 
let&#39;s collect some training data for the app of this Engine. By default, 
the Similar Product Engine Template supports 2 types of entities: 
<strong>user</strong> and <strong>item</strong>, and event 
<strong>view</strong>. An item has the <strong>categories</strong> property, 
which is a list of category names (String). A user can view an item. 
Respectively, this template requires &#39;$set&#39; user event, &#39;$set&#39; 
item event, and user-view-item events.</p><div class="alert-message 
info"><p>This template can easily be customized to consider more user events 
such as <em>buy</em>, <em>rate</em> and <em>like</em>.</p></div> <p>You can 
send these events to PredictionIO Event Server in real-time easily by making a 
HTTP request or through the provided SDK. Please see <a 
href="/appintegration/">App Integration Overview</a> for more detai
 ls how to integrate your app with SDK.</p><p>Let&#39;s try sending events to 
EventServer with the following <code>curl</code> commands (The corresponding 
SDK code is showed in other tabs).</p><p>Replace 
<code>&lt;ACCCESS_KEY&gt;</code> by the Access Key generated in above steps. 
Note that <code>localhost:7070</code> is the default URL of the Event 
Server.</p><p>For convenience, set your access key to the shell variable, 
run:</p><p><code>$ ACCESS_KEY=&lt;ACCESS_KEY&gt;</code></p> <p><a 
href="#"></a></p> <p>For example, when a new user with id &quot;u0&quot; is 
created in your app on time <code>2014-11-02T09:39:45.618-08:00</code> (current 
time will be used if eventTime is not specified), you can send a 
<code>$set</code> event for this user. To send this event, run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-9ca19e63-274c-4221-95b5-b9e0d7bc22dd">REST 
API</a></li> <li data-lang="python"><a href="#tab-d4f3b40d-6f
 54-492a-9972-c49a7bb4e0f6">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-5a35ddc6-cae6-4f98-959d-e9543280d180">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-57007834-2a83-4d43-80d4-0502313e9514">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-f9331ce0-1832-43e4-b60a-2541f70f367b">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-9ca19e63-274c-4221-95b5-b9e0d7bc22dd"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -47,7 +47,7 @@ Your system is all ready to go.
   "entityId" : "u0",
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-c438b7f1-40ea-443f-9614-673ebfc87b53"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-d4f3b40d-6f54-492a-9972-c49a7bb4e0f6"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -86,7 +86,7 @@ Your system is all ready to go.
   <span class="n">event_time</span><span class="o">=</span><span 
class="n">datetime</span><span class="p">(</span>
     <span class="mi">2014</span><span class="p">,</span> <span 
class="mi">11</span><span class="p">,</span> <span class="mo">02</span><span 
class="p">,</span> <span class="mi">09</span><span class="p">,</span> <span 
class="mi">39</span><span class="p">,</span> <span class="mi">45</span><span 
class="p">,</span> <span class="mi">618000</span><span class="p">,</span> <span 
class="n">pytz</span><span class="o">.</span><span 
class="n">timezone</span><span class="p">(</span><span 
class="s">'US/Pacific'</span><span class="p">)</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-0bb25e8f-fa2d-42ab-a820-5d93fa2aa562"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-5a35ddc6-cae6-4f98-959d-e9543280d180"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -111,7 +111,7 @@ Your system is all ready to go.
   <span class="s1">'entityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">USER</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-32134d67-e009-404b-817a-38520349c7e4"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-57007834-2a83-4d43-80d4-0502313e9514"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -128,7 +128,7 @@ Your system is all ready to go.
   <span class="s1">'user'</span><span class="p">,</span>
   <span class="o">&lt;</span><span class="no">USER</span> <span 
class="no">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-d0c05149-e38c-450a-8a55-084c0b2a909e"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-f9331ce0-1832-43e4-b60a-2541f70f367b"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -153,7 +153,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityType</span><span 
class="o">(</span><span class="s">"user"</span><span class="o">)</span>
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">USER_ID</span><span 
class="o">&gt;);</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">userEvent</span><span class="o">);</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Note that the item is set with categories properties: 
<code>&quot;c1&quot;</code> and <code>&quot;c2&quot;</code>. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-363e86da-7aab-4de4-9b5e-92383a5571c1">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-a30a6300-a03e-4dbe-a146-7ac75c21a115">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-238a897b-de63-48ac-9040-8c1390b3a9f0">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-47b7a977-e566-4827-b1e3-342367aff903">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-6c3705be-e51c-4eee-9511-cfd1e3db3b92">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-363e86
 da-7aab-4de4-9b5e-92383a5571c1"> <div class="highlight shell"> <table 
style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: 
right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a new item 
&quot;i0&quot; is created in your app on time 
<code>2014-11-02T09:39:45.618-08:00</code> (current time will be used if 
eventTime is not specified), you can send a <code>$set</code> event for the 
item. Note that the item is set with categories properties: 
<code>&quot;c1&quot;</code> and <code>&quot;c2&quot;</code>. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-4b29b813-aa0d-426a-9644-5fe998cf99fe">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-9aae9a97-9105-4b99-8162-71bfc2a259ed">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-6afec5cb-9835-4379-9e1f-265052c47125">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-889116d4-b267-4eab-9cd9-f9530d35024e">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-810320d3-cf10-4c46-bc5c-fc52dc3ca516">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-4b29b8
 13-aa0d-426a-9644-5fe998cf99fe"> <div class="highlight shell"> <table 
style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text-align: 
right"><pre class="lineno">1
 2
 3
 4
@@ -174,7 +174,7 @@ Your system is all ready to go.
   }
   "eventTime" : "2014-11-02T09:39:45.618-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-a30a6300-a03e-4dbe-a146-7ac75c21a115"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-9aae9a97-9105-4b99-8162-71bfc2a259ed"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -193,7 +193,7 @@ Your system is all ready to go.
     <span class="s">"categories"</span> <span class="p">:</span> <span 
class="p">[</span><span class="s">"&lt;CATEGORY_1&gt;"</span><span 
class="p">,</span> <span class="s">"&lt;CATEGORY_2&gt;"</span><span 
class="p">]</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-238a897b-de63-48ac-9040-8c1390b3a9f0"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-6afec5cb-9835-4379-9e1f-265052c47125"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -214,7 +214,7 @@ Your system is all ready to go.
 <span class="p">));</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-47b7a977-e566-4827-b1e3-342367aff903"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-889116d4-b267-4eab-9cd9-f9530d35024e"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -231,7 +231,7 @@ Your system is all ready to go.
   <span class="p">}</span>
 <span class="p">)</span>
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-6c3705be-e51c-4eee-9511-cfd1e3db3b92"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-810320d3-cf10-4c46-bc5c-fc52dc3ca516"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -244,7 +244,7 @@ Your system is all ready to go.
   <span class="o">.</span><span class="na">entityId</span><span 
class="o">(&lt;</span><span class="n">ITEM_ID</span><span class="o">&gt;)</span>
   <span class="o">.</span><span class="na">property</span><span 
class="o">(</span><span class="s">"categories"</span><span class="o">,</span> 
<span class="n">ImmutableList</span><span class="o">.</span><span 
class="na">of</span><span class="o">(</span><span 
class="s">"&lt;CATEGORY_1&gt;"</span><span class="o">,</span> <span 
class="s">"&lt;CATEGORY_2&gt;"</span><span class="o">));</span>
 <span class="n">client</span><span class="o">.</span><span 
class="na">createEvent</span><span class="o">(</span><span 
class="n">itemEvent</span><span class="o">)</span>
-</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-10493d62-1f53-40f7-acd5-6c0742eeb77f">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-7a0e5c86-7667-47ba-bcae-0f7b46f42ac7">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-633c7e6b-49d0-4a68-8da5-25c51943566e">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-2454491e-f8f9-4e0c-b7d4-4932aaa08f10">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-d8c88b2c-ee9f-4d75-8322-6f42a53d44f7">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-10493d62-1f53-40f7-acd5-6c0742eeb77f"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When the user 
&quot;u0&quot; view item &quot;i0&quot; on time 
<code>2014-11-10T12:34:56.123-08:00</code> (current time will be used if 
eventTime is not specified), you can send a view event. Run the following 
<code>curl</code> command:</p><div class="tabs"> <ul class="control"> <li 
data-lang="json"><a href="#tab-b324323d-0cdd-4021-9862-1d89755ea640">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-4dc36ca6-860d-44da-9186-213c11bf6b83">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-15411fb2-4357-42fb-836e-2f3564425db5">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-6819e0e1-f9c2-4c84-8344-767d60ffe816">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-5741dec7-ff01-4101-bf7a-a0ad9e671a16">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-b324323d-0cdd-4021-9862-1d89755ea640"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" style="text
 -align: right"><pre class="lineno">1
 2
 3
 4
@@ -263,7 +263,7 @@ Your system is all ready to go.
   "targetEntityId" : "i0",
   "eventTime" : "2014-11-10T12:34:56.123-08:00"
 }'</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-7a0e5c86-7667-47ba-bcae-0f7b46f42ac7"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-4dc36ca6-860d-44da-9186-213c11bf6b83"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -280,7 +280,7 @@ Your system is all ready to go.
   <span class="n">target_entity_type</span><span class="o">=</span><span 
class="s">"item"</span><span class="p">,</span>
   <span class="n">target_entity_id</span><span class="o">=&lt;</span><span 
class="n">ITEM</span> <span class="n">ID</span><span class="o">&gt;</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-633c7e6b-49d0-4a68-8da5-25c51943566e"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-15411fb2-4357-42fb-836e-2f3564425db5"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -299,7 +299,7 @@ Your system is all ready to go.
    <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> <span 
class="o">&lt;</span><span class="nx">ITEM</span> <span 
class="nx">ID</span><span class="o">&gt;</span>
 <span class="p">));</span>
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-2454491e-f8f9-4e0c-b7d4-4932aaa08f10"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-6819e0e1-f9c2-4c84-8344-767d60ffe816"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -316,7 +316,7 @@ Your system is all ready to go.
     <span class="s1">'targetEntityId'</span> <span class="o">=&gt;</span> 
<span class="o">&lt;</span><span class="no">ITEM</span> <span 
class="no">ID</span><span class="o">&gt;</span>
   <span class="p">}</span>
 <span class="p">)</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-d8c88b2c-ee9f-4d75-8322-6f42a53d44f7"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-5741dec7-ff01-4101-bf7a-a0ad9e671a16"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -376,19 +376,19 @@ User u10 views item i29
 </pre></td></tr></tbody></table> </div> <p>When the engine is deployed 
successfully and running, you should see a console message similar to the 
following:</p><div class="highlight shell"><table style="border-spacing: 
0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre 
class="lineno">1
 2</pre></td><td class="code"><pre><span class="o">[</span>INFO] <span 
class="o">[</span>HttpListener] Bound to /0.0.0.0:8000
 <span class="o">[</span>INFO] <span class="o">[</span>MasterActor] Bind 
successful. Ready to serve.
-</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To retrieve 4 items which are similar to item ID &quot;i1&quot;. You 
send this JSON <code>{ &quot;items&quot;: [&quot;i1&quot;], &quot;num&quot;: 4 
}</code> to the deployed engine and it will return a JSON of the recommended 
items. Simply send a query by making a HTTP request or through the 
<code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, 
open another terminal and run the following <code>curl</code> command or use 
SDK to send the query:</p><div class="tabs"> <ul class="control
 "> <li data-lang="json"><a 
href="#tab-81ff13ca-89a4-4501-870f-db8772866895">REST API</a></li> <li 
data-lang="python"><a href="#tab-11d0dad9-d322-423f-96a5-ad0743bdaddd">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-6fc4065e-2fcd-426a-b1eb-aec9b7c0e572">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-1ccb1b50-903b-411d-a3f0-f78115543ac6">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-84c01896-adee-4a3e-9df8-69e52a6c0781">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-81ff13ca-89a4-4501-870f-db8772866895"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
+</pre></td></tr></tbody></table> </div> <p>Do not kill the deployed engine 
process.</p><p>By default, the deployed engine binds to <a 
href="http://localhost:8000";><a 
href="http://localhost:8000";>http://localhost:8000</a></a>. You can visit that 
page in your web browser to check its status.</p><p><img alt="Engine Status" 
src="/images/engine-server-3246414b.png"/></p></p><h2 id='6.-use-the-engine' 
class='header-anchors'>6. Use the Engine</h2><p>Now, You can retrieve predicted 
results. To retrieve 4 items which are similar to item ID &quot;i1&quot;. You 
send this JSON <code>{ &quot;items&quot;: [&quot;i1&quot;], &quot;num&quot;: 4 
}</code> to the deployed engine and it will return a JSON of the recommended 
items. Simply send a query by making a HTTP request or through the 
<code>EngineClient</code> of an SDK.</p><p>With the deployed engine running, 
open another terminal and run the following <code>curl</code> command or use 
SDK to send the query:</p><div class="tabs"> <ul class="control
 "> <li data-lang="json"><a 
href="#tab-e71e0a15-7602-4c7a-acea-788804eac6fb">REST API</a></li> <li 
data-lang="python"><a href="#tab-0a191639-a706-4cb0-933e-da64e55c6440">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-c72f3dcc-1dec-44e1-b9ac-d33184ca23db">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-2a5b496f-9aff-4578-b2c3-4aa0159951e4">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-42076c82-1134-4b12-b24c-ad445e04618c">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-e71e0a15-7602-4c7a-acea-788804eac6fb"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbody><tr> <td class="gutter gl" 
style="text-align: right"><pre class="lineno">1
 2
 3
 4</pre></td> <td class="code"><pre><span class="gp">$ </span>curl -H <span 
class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
 -d <span class="s1">'{ "items": ["i1"], "num": 4 }'</span> <span 
class="se">\</span>
 http://localhost:8000/queries.json
 
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-11d0dad9-d322-423f-96a5-ad0743bdaddd"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Python SDK" 
data-lang="python" id="tab-0a191639-a706-4cb0-933e-da64e55c6440"> <div 
class="highlight python"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3</pre></td> <td class="code"><pre><span class="kn">import</span> <span 
class="nn">predictionio</span>
 <span class="n">engine_client</span> <span class="o">=</span> <span 
class="n">predictionio</span><span class="o">.</span><span 
class="n">EngineClient</span><span class="p">(</span><span 
class="n">url</span><span class="o">=</span><span 
class="s">"http://localhost:8000";</span><span class="p">)</span>
 <span class="k">print</span> <span class="n">engine_client</span><span 
class="o">.</span><span class="n">send_query</span><span 
class="p">({</span><span class="s">"items"</span><span class="p">:</span> <span 
class="p">[</span><span class="s">"i1"</span><span class="p">],</span> <span 
class="s">"num"</span><span class="p">:</span> <span class="mi">4</span><span 
class="p">})</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-6fc4065e-2fcd-426a-b1eb-aec9b7c0e572"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="PHP SDK" 
data-lang="php" id="tab-c72f3dcc-1dec-44e1-b9ac-d33184ca23db"> <div 
class="highlight php"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -407,7 +407,7 @@ http://localhost:8000/queries.json
 <span class="nb">print_r</span><span class="p">(</span><span 
class="nv">$response</span><span class="p">);</span>
 
 <span class="cp">?&gt;</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-1ccb1b50-903b-411d-a3f0-f78115543ac6"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Ruby SDK" 
data-lang="ruby" id="tab-2a5b496f-9aff-4578-b2c3-4aa0159951e4"> <div 
class="highlight ruby"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4
@@ -420,7 +420,7 @@ http://localhost:8000/queries.json
 <span class="n">response</span> <span class="o">=</span> <span 
class="n">client</span><span class="p">.</span><span 
class="nf">send_query</span><span class="p">(</span><span 
class="s1">'items'</span> <span class="o">=&gt;</span> <span 
class="p">[</span><span class="s1">'i1'</span><span class="p">],</span> <span 
class="s1">'num'</span> <span class="o">=&gt;</span> <span 
class="mi">4</span><span class="p">)</span>
 
 <span class="nb">puts</span> <span class="n">response</span>
-</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-84c01896-adee-4a3e-9df8-69e52a6c0781"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> <div data-tab="Java SDK" 
data-lang="java" id="tab-42076c82-1134-4b12-b24c-ad445e04618c"> <div 
class="highlight java"> <table style="border-spacing: 0"><tbody><tr> <td 
class="gutter gl" style="text-align: right"><pre class="lineno">1
 2
 3
 4

Reply via email to