http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/productranking/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html 
b/templates/productranking/quickstart/index.html
index b7fee29..fb37913 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. N
 ote 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-f1bccd93-6271-4d79-a77d-31b6f83d687b">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-fe5f0ad1-1e55-47ab-bcb1-64d82f3760b3">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-6218a745-b379-41cd-a119-f489d5f2aa2f">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-955ba724-9ade-4b06-950b-621a89be9934">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-947267a2-be89-48ec-
 9e36-4436250290d2">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-f1bccd93-6271-4d79-a77d-31b6f83d687b"> <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. N
 ote 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-4b1430a5-093e-49d8-a775-94c5d7e7d331">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-5f07ddf9-a2c1-48ae-9fb2-7e07ad58e74c">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-a7d0bb33-1e3d-47f5-9fab-baa22c1d8a68">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-3863ffb8-71da-4aa8-bb28-cc6240987c79">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-311ebfd3-f632-4992-
 a76d-5a07c40cda6e">Java SDK</a></li> </ul> <div data-tab="REST API" 
data-lang="json" id="tab-4b1430a5-093e-49d8-a775-94c5d7e7d331"> <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-fe5f0ad1-1e55-47ab-bcb1-64d82f3760b3"> <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-5f07ddf9-a2c1-48ae-9fb2-7e07ad58e74c"> <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-6218a745-b379-41cd-a119-f489d5f2aa2f"> <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-a7d0bb33-1e3d-47f5-9fab-baa22c1d8a68"> <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-955ba724-9ade-4b06-950b-621a89be9934"> <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-3863ffb8-71da-4aa8-bb28-cc6240987c79"> <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-947267a2-be89-48ec-9e36-4436250290d2"> <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-311ebfd3-f632-4992-a76d-5a07c40cda6e"> <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-f0740b9e-4402-4065-9b8a-9aba2df6f4c7">REST API</a></li> <li 
data-lang="python"><a href="#tab-13ee8531-8ca6-48a7-b254-b533c5548929">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-25f258bc-ae73-4851-8aec-d3f10b3d7cf2">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-3218592a-9bd0-4cd5-b3c0-21a41d2b5f63">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-82623ceb-7877-40ae-9b72-250cae77e1f0">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-f0740b9e-4402-4065-9b8a-9aba2df6f4c7"> <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-d1a86991-aa7a-4af7-a80f-4d5ab31795d4">REST API</a></li> <li 
data-lang="python"><a href="#tab-e4b6bfbe-e019-4ab7-aa87-9350ddf99811">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-f79a6f05-be51-4e69-b640-531a03e150e6">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-494933ce-c0f8-4554-9a8a-6e6cab8af08c">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-e6baedcd-98d6-4abd-972e-17b620e197e0">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-d1a86991-aa7a-4af7-a80f-4d5ab31795d4"> <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-13ee8531-8ca6-48a7-b254-b533c5548929"> <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-e4b6bfbe-e019-4ab7-aa87-9350ddf99811"> <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-25f258bc-ae73-4851-8aec-d3f10b3d7cf2"> <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-f79a6f05-be51-4e69-b640-531a03e150e6"> <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-3218592a-9bd0-4cd5-b3c0-21a41d2b5f63"> <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-494933ce-c0f8-4554-9a8a-6e6cab8af08c"> <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-82623ceb-7877-40ae-9b72-250cae77e1f0"> <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-e6baedcd-98d6-4abd-972e-17b620e197e0"> <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-d37461ae-7977-4f5f-8857-ff8f12177bcf">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-3c3269f3-e5f7-43d4-b10a-e7a7e4369702">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-741f14c7-2762-4671-9ce3-a11ac1f03079">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-6b28c030-a6d1-4855-afbe-d3c2a0ad0e48">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-f432ddae-077c-4033-b25b-d58e5eacdad4">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-d37461ae-7977-4f5f-8857-ff8f12177bcf"> <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-6be05f81-9881-48c2-a9e1-7a70e4154386">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-088e4f8a-bb0b-4286-a545-7c44e0dcbb3f">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-76807fa9-0a00-4246-97c1-60c803110c4b">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-eee28af5-c822-4d7a-8aa6-fec154c367c7">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-10c5b660-ec7f-4692-b653-bbe9706d9d8c">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-6be05f81-9881-48c2-a9e1-7a70e4154386"> <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-3c3269f3-e5f7-43d4-b10a-e7a7e4369702"> <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-088e4f8a-bb0b-4286-a545-7c44e0dcbb3f"> <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-741f14c7-2762-4671-9ce3-a11ac1f03079"> <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-76807fa9-0a00-4246-97c1-60c803110c4b"> <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-6b28c030-a6d1-4855-afbe-d3c2a0ad0e48"> <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-eee28af5-c822-4d7a-8aa6-fec154c367c7"> <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-f432ddae-077c-4033-b25b-d58e5eacdad4"> <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-10c5b660-ec7f-4692-b653-bbe9706d9d8c"> <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 
temrinal 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-7f4e45e0-b701-48f1-858a-4e988cfe4832">REST API</a></li> <li 
data-lang="python"><a href="#tab-7f104e35-d8cc-4128-abc4-21d093ab5da5">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-92dbeb08-e451-4ca3-8c58-b3d467fe9700">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-25761161-3ef7-4454-89b5-fecf9048a8d5">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-6b287b6c-bf49-483f-ab99-223d2a9214c0">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-7f4e45e0-b701-48f1-858a-4e988cfe4832"> <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 
temrinal 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-af52c386-ef12-4088-907c-432d6de6d590">REST API</a></li> <li 
data-lang="python"><a href="#tab-e7f19037-d523-4696-bd11-ac87873a175d">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-6157572d-b679-4b00-93c9-9b93c8371aac">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-0750fe54-f8bc-4fb8-b70e-04a54d9f27a4">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-ba3f38cb-2edf-41c8-8bed-103761a609b9">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-af52c386-ef12-4088-907c-432d6de6d590"> <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-7f104e35-d8cc-4128-abc4-21d093ab5da5"> <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-e7f19037-d523-4696-bd11-ac87873a175d"> <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-92dbeb08-e451-4ca3-8c58-b3d467fe9700"> <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-6157572d-b679-4b00-93c9-9b93c8371aac"> <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-25761161-3ef7-4454-89b5-fecf9048a8d5"> <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-0750fe54-f8bc-4fb8-b70e-04a54d9f27a4"> <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-6b287b6c-bf49-483f-ab99-223d2a9214c0"> <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-ba3f38cb-2edf-41c8-8bed-103761a609b9"> <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/incubator-predictionio-site/blob/149df4c5/templates/productranking/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/productranking/quickstart/index.html.gz 
b/templates/productranking/quickstart/index.html.gz
index a3cf9b1..e1257c9 100644
Binary files a/templates/productranking/quickstart/index.html.gz and 
b/templates/productranking/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/batch-evaluator/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/batch-evaluator/index.html.gz 
b/templates/recommendation/batch-evaluator/index.html.gz
index a54ebdb..429abe1 100644
Binary files a/templates/recommendation/batch-evaluator/index.html.gz and 
b/templates/recommendation/batch-evaluator/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/blacklist-items/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/blacklist-items/index.html.gz 
b/templates/recommendation/blacklist-items/index.html.gz
index 0b97344..350449d 100644
Binary files a/templates/recommendation/blacklist-items/index.html.gz and 
b/templates/recommendation/blacklist-items/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/customize-data-prep/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/customize-data-prep/index.html.gz 
b/templates/recommendation/customize-data-prep/index.html.gz
index b8262b9..b1f1f6f 100644
Binary files a/templates/recommendation/customize-data-prep/index.html.gz and 
b/templates/recommendation/customize-data-prep/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/customize-serving/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/customize-serving/index.html.gz 
b/templates/recommendation/customize-serving/index.html.gz
index ca855bb..a296217 100644
Binary files a/templates/recommendation/customize-serving/index.html.gz and 
b/templates/recommendation/customize-serving/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/dase/index.html.gz 
b/templates/recommendation/dase/index.html.gz
index 2e0f041..15876e1 100644
Binary files a/templates/recommendation/dase/index.html.gz and 
b/templates/recommendation/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/evaluation/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/evaluation/index.html.gz 
b/templates/recommendation/evaluation/index.html.gz
index 23c3f07..dc95465 100644
Binary files a/templates/recommendation/evaluation/index.html.gz and 
b/templates/recommendation/evaluation/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/how-to/index.html.gz 
b/templates/recommendation/how-to/index.html.gz
index 4166654..c549938 100644
Binary files a/templates/recommendation/how-to/index.html.gz and 
b/templates/recommendation/how-to/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html 
b/templates/recommendation/quickstart/index.html
index 14d6cfd..c26d320 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 he can 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> <p>For example, when a user with ID &quot;u0&quot; rate an 
item with ID &quot;i0&quot; with rating of 5 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 the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-ca31dc10-7eff-4e71-8c50-e79ce8705711">REST API</a></li> <li 
data-lang="python"><a href="#tab-d4f3c84b-df1e-45cb-bbd1-fc0388d0915c">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-ec6f6c37-7329-458d-8a84-0ad339257be9">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-91d3b43c-9efb
 -4e7e-8800-dcc9f2bac0c0">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-9885836f-9465-488b-bc48-75726594021a">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-ca31dc10-7eff-4e71-8c50-e79ce8705711"> <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 he can 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> <p>For example, when a user with ID &quot;u0&quot; rate an 
item with ID &quot;i0&quot; with rating of 5 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 the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-81ac0e8b-5a27-4877-ae03-3e0e7f264ef0">REST API</a></li> <li 
data-lang="python"><a href="#tab-633fd017-e257-4116-abe7-338c8db8570b">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-bd823a43-16cd-481d-96b6-8c14d4b13502">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f3de66c8-be19
 -42ff-8e73-0200460ea876">Ruby SDK</a></li> <li data-lang="java"><a 
href="#tab-6a20478f-24ca-4b25-ae4b-f147f2030baf">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-81ac0e8b-5a27-4877-ae03-3e0e7f264ef0"> <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-d4f3c84b-df1e-45cb-bbd1-fc0388d0915c"> <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-633fd017-e257-4116-abe7-338c8db8570b"> <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-ec6f6c37-7329-458d-8a84-0ad339257be9"> <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-bd823a43-16cd-481d-96b6-8c14d4b13502"> <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-91d3b43c-9efb-4e7e-8800-dcc9f2bac0c0"> <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-f3de66c8-be19-42ff-8e73-0200460ea876"> <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-9885836f-9465-488b-bc48-75726594021a"> <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-6a20478f-24ca-4b25-ae4b-f147f2030baf"> <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> <p>When a user with ID 
&quot;u1&quot; buy an item with ID &quot;i2&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 the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-fc3e4026-bd93-4ef6-9121-cbfc4f68204b">REST API</a></li> <li 
data-lang="python"><a href="#tab-843e4c85-c26a-4528-b303-903b8cb0a5dc">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-b7eb2be8-1f71-4013-b932-35e33166cff6">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-2ed065d6-f7c4-4cc2-aa61-317710b381b2">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-5b194b5f-bdfd-42a0-8112-fdaa65071a5b">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-fc3e4026-bd93-4ef6-9121-cbfc4f68204b"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbod
 y><tr> <td class="gutter gl" style="text-align: right"><pre class="lineno">1
+</pre></td> </tr></tbody></table> </div> </div> </div> <p>When a user with ID 
&quot;u1&quot; buy an item with ID &quot;i2&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 the following &quot;rate&quot; event. 
Run the following <code>curl</code> command:</p><div class="tabs"> <ul 
class="control"> <li data-lang="json"><a 
href="#tab-6b33da06-366d-4152-a53c-8b0a1ac42bed">REST API</a></li> <li 
data-lang="python"><a href="#tab-70cf8f04-0762-496b-850f-97d80c8235dd">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-ea71b5a6-a59b-47a5-91fb-b82573914e36">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-05fc87a0-1e13-4cb8-b16f-5f5facbe81ad">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-78bcd193-59e7-4bb0-8424-956d8af06898">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-6b33da06-366d-4152-a53c-8b0a1ac42bed"> <div class="highlight shell"> 
<table style="border-spacing: 0"><tbod
 y><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-843e4c85-c26a-4528-b303-903b8cb0a5dc"> <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-70cf8f04-0762-496b-850f-97d80c8235dd"> <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-b7eb2be8-1f71-4013-b932-35e33166cff6"> <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-ea71b5a6-a59b-47a5-91fb-b82573914e36"> <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-2ed065d6-f7c4-4cc2-aa61-317710b381b2"> <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-05fc87a0-1e13-4cb8-b16f-5f5facbe81ad"> <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-5b194b5f-bdfd-42a0-8112-fdaa65071a5b"> <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-78bcd193-59e7-4bb0-8424-956d8af06898"> <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 temrinal 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-a7471942-ed28-4faa-9b5d-355bbe22919e">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-253f1503-9242-4ce4-b766-74538fc9e722">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-a3dcd15d-974b-4979-8c7d-86b547476673">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-93d53a84-a88d-4e68-af43-885558e50949">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-a5563e42-1f8e-4385-8428-ec0db51641a9">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-a7471942-ed28-4faa-9b5d-355bbe22919e"> <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 temrinal 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-76893901-5cc8-43ba-94ce-968181321913">REST API</a></li> 
<li data-lang="python"><a 
href="#tab-8f53c678-0591-4c95-911c-4229eddf749f">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-6ba459c0-f389-4fec-b18c-acdff68743ce">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-719f126d-a044-4a32-a1dd-6f3285539911">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-3322f98f-762c-4125-b880-ad02e5042c1f">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-76893901-5cc8-43ba-94ce-968181321913"> <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-253f1503-9242-4ce4-b766-74538fc9e722"> <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-8f53c678-0591-4c95-911c-4229eddf749f"> <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-a3dcd15d-974b-4979-8c7d-86b547476673"> <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-6ba459c0-f389-4fec-b18c-acdff68743ce"> <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-93d53a84-a88d-4e68-af43-885558e50949"> <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-719f126d-a044-4a32-a1dd-6f3285539911"> <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-a5563e42-1f8e-4385-8428-ec0db51641a9"> <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-3322f98f-762c-4125-b880-ad02e5042c1f"> <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/incubator-predictionio-site/blob/149df4c5/templates/recommendation/quickstart/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/quickstart/index.html.gz 
b/templates/recommendation/quickstart/index.html.gz
index 775fe63..c44694b 100644
Binary files a/templates/recommendation/quickstart/index.html.gz and 
b/templates/recommendation/quickstart/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/reading-custom-events/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/recommendation/reading-custom-events/index.html.gz 
b/templates/recommendation/reading-custom-events/index.html.gz
index fb58928..7b664b5 100644
Binary files a/templates/recommendation/reading-custom-events/index.html.gz and 
b/templates/recommendation/reading-custom-events/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/recommendation/training-with-implicit-preference/index.html.gz
----------------------------------------------------------------------
diff --git 
a/templates/recommendation/training-with-implicit-preference/index.html.gz 
b/templates/recommendation/training-with-implicit-preference/index.html.gz
index 3a03726..e820238 100644
Binary files 
a/templates/recommendation/training-with-implicit-preference/index.html.gz and 
b/templates/recommendation/training-with-implicit-preference/index.html.gz 
differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/similarproduct/dase/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/dase/index.html.gz 
b/templates/similarproduct/dase/index.html.gz
index 6cb2e2c..a20a90f 100644
Binary files a/templates/similarproduct/dase/index.html.gz and 
b/templates/similarproduct/dase/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/similarproduct/how-to/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/how-to/index.html.gz 
b/templates/similarproduct/how-to/index.html.gz
index 656f009..a6f559e 100644
Binary files a/templates/similarproduct/how-to/index.html.gz and 
b/templates/similarproduct/how-to/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/similarproduct/multi-events-multi-algos/index.html.gz
----------------------------------------------------------------------
diff --git a/templates/similarproduct/multi-events-multi-algos/index.html.gz 
b/templates/similarproduct/multi-events-multi-algos/index.html.gz
index f4e790e..40a214f 100644
Binary files a/templates/similarproduct/multi-events-multi-algos/index.html.gz 
and b/templates/similarproduct/multi-events-multi-algos/index.html.gz differ

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-site/blob/149df4c5/templates/similarproduct/quickstart/index.html
----------------------------------------------------------------------
diff --git a/templates/similarproduct/quickstart/index.html 
b/templates/similarproduct/quickstart/index.html
index bf0f7b0..db8e9a2 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 detail
 s 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-80b9729e-881f-427a-aa8a-417a4f863f6b">REST 
API</a></li> <li data-lang="python"><a href="#tab-b0e631b8-fa3
 a-41f6-aef8-d1d84e2fa1ae">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-4b4e7b2e-991b-40e7-8eda-c38a9e31e6d2">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-f3f944be-13eb-4128-b77e-c1e33b5e3fa6">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-6d3a6cd3-803b-4359-96c3-c996dc7d88bb">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-80b9729e-881f-427a-aa8a-417a4f863f6b"> <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 detail
 s 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-57485d65-2794-40bd-ab66-95dcfea99f2b">REST 
API</a></li> <li data-lang="python"><a href="#tab-4efe0e49-c1f
 6-43fc-b548-a995ff443890">Python SDK</a></li> <li data-lang="php"><a 
href="#tab-d60bbbb1-621b-4730-8237-b8930b3e6add">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-45b69c87-db44-456d-8e3c-8db5b590a611">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-8ce32049-5e5e-433b-ad33-6a1c57fa426e">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-57485d65-2794-40bd-ab66-95dcfea99f2b"> <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-b0e631b8-fa3a-41f6-aef8-d1d84e2fa1ae"> <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-4efe0e49-c1f6-43fc-b548-a995ff443890"> <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-4b4e7b2e-991b-40e7-8eda-c38a9e31e6d2"> <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-d60bbbb1-621b-4730-8237-b8930b3e6add"> <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-f3f944be-13eb-4128-b77e-c1e33b5e3fa6"> <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-45b69c87-db44-456d-8e3c-8db5b590a611"> <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-6d3a6cd3-803b-4359-96c3-c996dc7d88bb"> <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-8ce32049-5e5e-433b-ad33-6a1c57fa426e"> <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-7b52dc37-4329-4b29-a9f2-fa78a7f5c22f">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-54906050-dc7c-4f23-9734-ecfef6c3845c">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-8535732b-e9bc-4eca-a56c-835ea58a053a">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-42d49250-ae4e-439a-941f-54c1c015d66d">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-eb078b16-7f60-4db5-ac3a-342888c65d46">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-7b52dc
 37-4329-4b29-a9f2-fa78a7f5c22f"> <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-a73befef-f0c6-458e-a298-70525c9b79a5">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-3bb78d26-1761-4fb3-a394-0a236d9736c5">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-a71bb348-2ede-4c1a-b58c-d12b79b93526">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-ad04ab87-b82a-4410-bfca-af2a3edd5b39">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-1173648b-f4f7-42a5-b38d-9d1c156a0770">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" id="tab-a73bef
 ef-f0c6-458e-a298-70525c9b79a5"> <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-54906050-dc7c-4f23-9734-ecfef6c3845c"> <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-3bb78d26-1761-4fb3-a394-0a236d9736c5"> <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-8535732b-e9bc-4eca-a56c-835ea58a053a"> <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-a71bb348-2ede-4c1a-b58c-d12b79b93526"> <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-42d49250-ae4e-439a-941f-54c1c015d66d"> <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-ad04ab87-b82a-4410-bfca-af2a3edd5b39"> <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-eb078b16-7f60-4db5-ac3a-342888c65d46"> <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-1173648b-f4f7-42a5-b38d-9d1c156a0770"> <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-bb51359b-bc7a-402e-8d0a-9fa98bb2beb4">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-b18e02a6-3ee9-4e53-baab-21efe7343dca">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-e95a741e-9845-4d5f-86a6-81eb8c557e21">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-cde4c30d-fa3b-482b-8429-ab316749142c">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-70241f89-fbb1-4619-b507-a46402509040">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-bb51359b-bc7a-402e-8d0a-9fa98bb2beb4"> <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-46d300ae-66ca-4da9-81ce-e20f6ebaece4">REST 
API</a></li> <li data-lang="python"><a 
href="#tab-11715310-e7d3-418f-8a4a-79e1285e8dba">Python SDK</a></li> <li 
data-lang="php"><a href="#tab-fc384c29-a668-4335-b002-9dc606fb4d48">PHP 
SDK</a></li> <li data-lang="ruby"><a 
href="#tab-c3ab7168-7235-4fd4-a385-bf861102704b">Ruby SDK</a></li> <li 
data-lang="java"><a href="#tab-918bf23c-0251-461a-8308-2d9152e3f799">Java 
SDK</a></li> </ul> <div data-tab="REST API" data-lang="json" 
id="tab-46d300ae-66ca-4da9-81ce-e20f6ebaece4"> <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-b18e02a6-3ee9-4e53-baab-21efe7343dca"> <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-11715310-e7d3-418f-8a4a-79e1285e8dba"> <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-e95a741e-9845-4d5f-86a6-81eb8c557e21"> <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-fc384c29-a668-4335-b002-9dc606fb4d48"> <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-cde4c30d-fa3b-482b-8429-ab316749142c"> <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-c3ab7168-7235-4fd4-a385-bf861102704b"> <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-70241f89-fbb1-4619-b507-a46402509040"> <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-918bf23c-0251-461a-8308-2d9152e3f799"> <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 temrinal 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-5d30bc46-b82e-4910-871d-430bef256290">REST API</a></li> <li 
data-lang="python"><a href="#tab-256aa36e-ca9f-4766-bbb1-bde4d5b63ff3">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-2de94d72-f430-46b0-b7ab-0805f07b2ad6">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-4a8f888e-7ade-413c-b12a-362ea91e45f3">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-f1ada964-0a27-4987-98e2-474c8599c3a4">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-5d30bc46-b82e-4910-871d-430bef256290"> <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 temrinal 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-cb2c4e5f-1535-4af9-b0e4-bec41b614a29">REST API</a></li> <li 
data-lang="python"><a href="#tab-6a0342e8-df54-4f2b-92ca-f9ca81e08a78">Python 
SDK</a></li> <li data-lang="php"><a 
href="#tab-ecc76bca-fc61-4525-a98f-f73865c57ff7">PHP SDK</a></li> <li 
data-lang="ruby"><a href="#tab-4257a80e-a458-4e25-8528-914c041a2a42">Ruby 
SDK</a></li> <li data-lang="java"><a 
href="#tab-be8170be-120d-41eb-ace0-7f21acbe5e77">Java SDK</a></li> </ul> <div 
data-tab="REST API" data-lang="json" 
id="tab-cb2c4e5f-1535-4af9-b0e4-bec41b614a29"> <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-256aa36e-ca9f-4766-bbb1-bde4d5b63ff3"> <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-6a0342e8-df54-4f2b-92ca-f9ca81e08a78"> <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-2de94d72-f430-46b0-b7ab-0805f07b2ad6"> <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-ecc76bca-fc61-4525-a98f-f73865c57ff7"> <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-4a8f888e-7ade-413c-b12a-362ea91e45f3"> <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-4257a80e-a458-4e25-8528-914c041a2a42"> <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-f1ada964-0a27-4987-98e2-474c8599c3a4"> <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-be8170be-120d-41eb-ace0-7f21acbe5e77"> <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