<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NoUseFor.net</title>
	<atom:link href="http://nousefor.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://nousefor.net</link>
	<description>Just a few useless thoughts and projects</description>
	<lastBuildDate>Sat, 10 Dec 2011 13:55:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HBase and Hive Thrift PHP Client</title>
		<link>http://nousefor.net/55/2011/12/php/hbase-and-hive-thrift-php-client/</link>
		<comments>http://nousefor.net/55/2011/12/php/hbase-and-hive-thrift-php-client/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 13:45:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[HBase]]></category>
		<category><![CDATA[Hive]]></category>
		<category><![CDATA[RPC]]></category>
		<category><![CDATA[Thrift]]></category>

		<guid isPermaLink="false">http://nousefor.net/?p=55</guid>
		<description><![CDATA[Due to my newest project I built a php client to access the HBase and Hive services within a hadoop cluster. Those services are accessible via thrift a high performance protocol for back end services. As building a client with thrift is not that easy I decided to put my HBase and Hive php thrift [...]]]></description>
			<content:encoded><![CDATA[<p>Due to my newest project I built a php client to access the HBase and Hive services within a hadoop cluster.</p>
<p>Those services are accessible via thrift a high performance protocol for back end services.</p>
<p>As building a client with thrift is not that easy I decided to put my HBase and Hive php thrift client packages online for others.</p>
<p>Links:<a href="http://hadoop.apache.org/"><br />
Hadoop</a><br />
<a href="http://hive.apache.org/">Hive</a><br />
<a href="http://hbase.apache.org/">HBase</a><br />
<a href="http://thrift.apache.org/">Thrift</a></p>
<p><strong>How it works</strong></p>
<p>Start the HBase and Hive Thrift server via shell:</p><pre><code>hive --service hiveserver
/usr/lib/hbase/bin/hbase-daemon.sh start thrift</code></pre>
<p>&nbsp;</p>
<p><a href="/download/hbase_hive_thrift_php.zip">Download HBase and Thrift php client package</a> and write your own client:</p><pre><code>//thrift php
$GLOBALS['THRIFT_ROOT'] = dirname(__FILE__).'/thrift/src';
require_once( $GLOBALS['THRIFT_ROOT'].'/Thrift.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/transport/TSocket.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php' );

//hbase thrift
require_once dirname(__FILE__).'/thrift/Hbase.php';

//hive thrift
require_once dirname(__FILE__).'/thrift/ThriftHive.php';

/*
HBase php thrift client
*/

//open connection
$socket = new TSocket( 'localhost', 9090 );
$transport = new TBufferedTransport( $socket );
$protocol = new TBinaryProtocol( $transport );
$client = new HbaseClient( $protocol );
$transport-&gt;open();

//show all tables
$tables = $client-&gt;getTableNames();
foreach ( $tables as $name ) {
echo( &quot;  found: {$name}\n&quot; );
}

//Create a table
try {
$columns = array(new ColumnDescriptor( array(
'name' =&gt;; 'colFamily:',
'maxVersions' =&gt; 10) ));

$client-&gt;createTable(&quot;tableName&quot;, $columns );
} catch ( AlreadyExists $ae ) {
echo( &quot;WARN: {$ae-&gt;;message}\n&quot; );
}

//insert data to table
$mutations = array(
new Mutation( array(
'column' =&gt; 'colFamily:Col',
'value' =&gt; 'value123'
) ),
);
$client-&gt;mutateRow( &quot;tableName&quot;, &quot;ID_1237846634624&quot;, $mutations );

//get table data
$row = $client-&gt;getRow(&quot;tableName&quot;, &quot;ID_1237846634624&quot;);

/*
Hive php thrift client
*/

//open connection
$transport = new TSocket(&quot;localhost&quot;, 10000);
$protocol = new TBinaryProtocol($transport);
$client = new ThriftHiveClient($protocol);
$transport-&gt;open();

//show tables
$client-&gt;execute('SHOW TABLES');
$tables = $client-&gt;fetchAll();
foreach ($tables as $name){
echo( &quot; found: {$name}\n&quot; );
}

//Create Hive table with Hbase table mapping
$mapping = 'CREATE EXTERNAL TABLE tableName(Col String, Col1 String)

STORED BY \'org.apache.hadoop.hive.hbase.HBaseStorageHandler\'
WITH SERDEPROPERTIES (&quot;hbase.columns.mapping&quot; = &quot;colFamily:Col, colFamily:Col&quot;)
TBLPROPERTIES(&quot;hbase.table.name&quot; = &quot;tableName&quot;)';

$client-&gt;execute($mapping);

//Query table
$client-&gt;execute('SELECT * FROM tableName Limit 10');
var_dump($client-&gt;fetchAll());</code></pre><p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://nousefor.net/55/2011/12/php/hbase-and-hive-thrift-php-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSearch &#8211; Meta Search Engine</title>
		<link>http://nousefor.net/44/2011/12/php/isearch-meta-search-engine/</link>
		<comments>http://nousefor.net/44/2011/12/php/isearch-meta-search-engine/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 12:12:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[iSearch]]></category>
		<category><![CDATA[meta search]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[search engine]]></category>

		<guid isPermaLink="false">http://nousefor.net/?p=44</guid>
		<description><![CDATA[Regular expression pattern based meta search with  an editor that is able to auto create patterns based on html code. Download source code]]></description>
			<content:encoded><![CDATA[<p><strong>Regular expression <a href="http://www.isearch.netii.net/showPatterns.php">pattern</a> based </strong><a href="http://www.isearch.netii.net/"><strong>meta search</strong></a> with  an <a href="http://www.isearch.netii.net/patternCreator.php">editor</a> that is able to auto create patterns based on html code.</p>
<p><a href="/download/iSearch.zip">Download source code</a></p>
<p><a href="http://www.isearch.netii.net/"><br />
</a>
<a href='http://nousefor.net/44/2011/12/php/isearch-meta-search-engine/attachment/index/' title='index'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/index-150x150.png" class="attachment-thumbnail" alt="index" title="index" /></a>
<a href='http://nousefor.net/44/2011/12/php/isearch-meta-search-engine/attachment/pattern-creator-2/' title='pattern creator'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/pattern-creator1-150x150.png" class="attachment-thumbnail" alt="pattern creator" title="pattern creator" /></a>
<a href='http://nousefor.net/44/2011/12/php/isearch-meta-search-engine/attachment/patterns-2/' title='patterns'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/patterns1-150x150.png" class="attachment-thumbnail" alt="patterns" title="patterns" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://nousefor.net/44/2011/12/php/isearch-meta-search-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>K9 Surveillance Robot</title>
		<link>http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/</link>
		<comments>http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 09:04:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[barcode]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[face detection]]></category>
		<category><![CDATA[lego]]></category>
		<category><![CDATA[lejos]]></category>
		<category><![CDATA[mindstorm]]></category>
		<category><![CDATA[NXT]]></category>
		<category><![CDATA[QR-Code]]></category>
		<category><![CDATA[text2speech]]></category>
		<category><![CDATA[web interface]]></category>

		<guid isPermaLink="false">http://nousefor.net/blog/?p=13</guid>
		<description><![CDATA[K9 surveillance robot is a lejos and android implementation running on Lego mindstorm hardware with the following features: Explores it’s environment while avoiding obstacles with an ultra sonar scanner and detects collisions with a bump sensor. Creates a map from cruising data and detected obstacles. Connects to bluetooth devices to exchange control data and commands. [...]]]></description>
			<content:encoded><![CDATA[<p>K9 surveillance robot is a lejos and android implementation running on Lego mindstorm hardware with the following features:</p>
<ul>
<li>Explores it’s environment while avoiding obstacles with an ultra sonar scanner and detects collisions with a bump sensor.</li>
<li>Creates a map from cruising data and detected obstacles.</li>
<li>Connects to bluetooth devices to exchange control data and commands.</li>
<li>Is monitoring the surrounding area by decoding video data processing it with face detection<br />
and draw detected faces into the map</li>
<li>Detects QR codes to receive commands and authentications.</li>
<li>Uses text to speech.</li>
<li>Serves a telnet interface for an interactive speech output.</li>
<li>Implements a web interface for live image streams, log output and a real time map</li>
</ul>
<p><a href="http://nousefor.net/download/k9.zip" target="_blank">Download</a></p>

<a href='http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/attachment/bruno/' title='bruno'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/2011/11/bruno-150x150.jpg" class="attachment-thumbnail" alt="bruno" title="bruno" /></a>
<a href='http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/attachment/map/' title='map'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/2011/11/map-150x150.png" class="attachment-thumbnail" alt="map" title="map" /></a>
<a href='http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/attachment/overview/' title='overview'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/2011/11/overview-150x150.png" class="attachment-thumbnail" alt="overview" title="overview" /></a>
<a href='http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/attachment/processing/' title='processing'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/2011/11/processing-150x150.png" class="attachment-thumbnail" alt="processing" title="processing" /></a>
<a href='http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/attachment/webinterface/' title='webinterface'><img width="150" height="150" src="http://nousefor.net/blog/wp-content/uploads/2011/11/webinterface-150x150.png" class="attachment-thumbnail" alt="webinterface" title="webinterface" /></a>

]]></content:encoded>
			<wfw:commentRss>http://nousefor.net/13/2011/11/java/android-java/k9-surveillance-robot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

