<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tommy Chheng : Programming Blog</title>
	<atom:link href="http://tommy.chheng.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tommy.chheng.com</link>
	<description>Ruby, Scala, Data, Search and other Programming topics.</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:55:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tommy.chheng.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tommy Chheng : Programming Blog</title>
		<link>http://tommy.chheng.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tommy.chheng.com/osd.xml" title="Tommy Chheng : Programming Blog" />
	<atom:link rel='hub' href='http://tommy.chheng.com/?pushpress=hub'/>
		<item>
		<title>Installing LAME on Amazon Elastic Map Reduce (EMR)</title>
		<link>http://tommy.chheng.com/2012/01/05/installing-lame-on-amazon-elastic-map-reduce-emr/</link>
		<comments>http://tommy.chheng.com/2012/01/05/installing-lame-on-amazon-elastic-map-reduce-emr/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 23:50:10 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=476</guid>
		<description><![CDATA[Amazon Elastic MapReduce instances does not have the debian-multimedia sources by default, you can add the below to a bootstrap script to have it installed: sudo sh -c "cat &#62;&#62; /etc/apt/sources.list &#60;&#60; EOF deb http://www.debian-multimedia.org squeeze main non-free deb http://www.debian-multimedia.org testing main non-free EOF&#34; gpg --keyserver hkp://pgpkeys.mit.edu --recv-keys 07DC563D1F41B907 gpg --armor --export 07DC563D1F41B907 &#124; sudo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=476&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Amazon Elastic MapReduce instances does not have the debian-multimedia sources by default, you can add the below to a bootstrap script to have it installed:</p>
<p><code><br />
sudo sh -c "cat &gt;&gt; /etc/apt/sources.list &lt;&lt; EOF<br />
deb http://www.debian-multimedia.org squeeze main non-free<br />
deb http://www.debian-multimedia.org testing main non-free<br />
EOF&quot;</p>
<p>gpg --keyserver hkp://pgpkeys.mit.edu --recv-keys  07DC563D1F41B907<br />
gpg --armor --export 07DC563D1F41B907 | sudo apt-key add -</p>
<p>sudo apt-get update<br />
sudo apt-get -y --force-yes install lame libmp3lame-dev faad</p>
<p></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=476&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2012/01/05/installing-lame-on-amazon-elastic-map-reduce-emr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging ActionView::MissingTemplate exception in Rails 3.1</title>
		<link>http://tommy.chheng.com/2012/01/03/debugging-actionviewmissingtemplate-exception-in-rails-3-1/</link>
		<comments>http://tommy.chheng.com/2012/01/03/debugging-actionviewmissingtemplate-exception-in-rails-3-1/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 06:56:06 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=472</guid>
		<description><![CDATA[We got an ActionView::MissingTemplate exception from a remote site using our embed code. The exception was: ActionView::MissingTemplate: Missing template /embed, application/embed with {:handlers=&#62;[:erb, :builder, :haml], :formats=&#62;["*/*;q=0.01"], :locale=&#62;[:en, :en]}. with these http headers: HTTP_ACCEPT "*/*;q=0.01" HTTP_ACCEPT_LANGUAGE "en" HTTP_USER_AGENT "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)" The strange thing is that PSP is sending us this accept header: HTTP_ACCEPT [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=472&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We got an ActionView::MissingTemplate exception from a remote site using our <a href="http://www.qwiki.com/api">embed code</a>.</p>
<p>The exception was:</p>
<p><code>ActionView::MissingTemplate: Missing template /embed, application/embed with {:handlers=&gt;[:erb, :builder, :haml], :formats=&gt;["*/*;q=0.01"], :locale=&gt;[:en, :en]}.<br />
</code></p>
<p>with these http headers:</p>
<p><code>HTTP_ACCEPT	"*/*;q=0.01"<br />
HTTP_ACCEPT_LANGUAGE	"en"<br />
HTTP_USER_AGENT	"Mozilla/4.0 (PSP (PlayStation Portable); 2.00)"<br />
</code></p>
<p>The strange thing is that PSP is sending us this accept header:<br />
<code>HTTP_ACCEPT	"*/*;q=0.01"; </code></p>
<p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">HTTP_ACCEPT</a> is a http request header used by the client asking for the types of formats it can support. Typically, browsers send an list of acceptable formats. Google Chrome sends <code>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</code> which means that the server should try to send back an html or xml format with a preference value of q=0.9 and if not available, send anything else(*/*) with a preference value of q=0.8.</p>
<p>Unfortunately, since our Rails controller code explicitly only accepted html or json with a respond_to block, Rails didn&#8217;t interpret &#8220;*/*&#8221; as html.</p>
<p><code>respond_to :html, :json<br />
render :layout =&gt; false</code></p>
<p>We can make the fix by explicitly render the default format as html:</p>
<p><code>render "embed.html", :layout =&gt; false</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/472/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/472/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/472/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=472&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2012/01/03/debugging-actionviewmissingtemplate-exception-in-rails-3-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>Solrsan: Lightweight Solr Gem for Ruby on Rails 3 Applications</title>
		<link>http://tommy.chheng.com/2011/04/29/solrsan-lightweight-solr-gem-for-ruby-on-rails-3-applications/</link>
		<comments>http://tommy.chheng.com/2011/04/29/solrsan-lightweight-solr-gem-for-ruby-on-rails-3-applications/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 18:24:01 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=434</guid>
		<description><![CDATA[I decided to create Solrsan to use the Apache Solr search server in my various Rails 3 applications. Currently, there are two main ruby gems for using Apache Solr in a ruby project: rsolr: RSolr is a low level layer to Apache Solr. Because it&#8217;s meant to be just an access layer, rsolr is missing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=434&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I decided to create <a href="https://github.com/tc/solrsan">Solrsan</a> to use the Apache Solr search server in my various Rails 3 applications. Currently, there are two main ruby gems for using <a href="http://lucene.apache.org/solr/">Apache Solr</a> in a ruby project: </p>
<ul>
<li><a href="https://github.com/mwmitchell/rsolr.git">rsolr</a>: RSolr is a low level layer to Apache Solr. Because it&#8217;s meant to be just an access layer, rsolr is missing the configuration setup such as the schema.xml, solrconfig.xml, etc which is custom per each Ruby/Rails app.</li>
<li><a title="sunspot" href="http://outoftime.github.com/sunspot/">sunspot</a>:  Sunspot is an all in one solution for using solr with a ruby project. It even uses rsolr under the hood.</li>
</ul>
<p>Generally, I like API access layers to be as similar to the raw api as possible. Sunspot&#8217;s api works using a search block:<br />
<code></p>
<pre>
Post.search do
  fulltext 'best pizza'
  with :blog_id, 1
  with(:published_at).less_than Time.now
  order_by :published_at, :desc
  paginate :page =&gt; 2, :per_page =&gt; 15
  facet :category_ids, :author_id
end
</pre>
<p></code></p>
<p>The actual query becomes an http get request. Solr itself is just a Java servlet which just reads http requests and responses with json/xml/other formats. I prefer using rsolr&#8217;s style of access because it&#8217;s most similar to http requests:</p>
<p><code></p>
<pre>
  response = solr.get 'select', :params =&gt; {
    :q=&gt;'washington',
    :start=&gt;0,
    :rows=&gt;10
  }
</pre>
<p></code></p>
<p><a href="https://github.com/tc/solrsan">Solrsan</a> also uses rsolr under the hood and adds a few extra functionality. For example, when you want to add solr functionality to your ruby/rails app, you need its own set of config files, a way to start/stop the solr server, a way to deploy using capistrano.  Solrsan comes with these basic setup files to help you get started.</p>
<h3>Indexing</h3>
<p>To index objects, edit <code>config/solr/conf/schema.xml</code> to state the types of fields you want to index. Or you can use dynamic fields to avoid specifying new fields each time. </p>
<p>Then, <code>include Solrsan::Search</code> into your model(Activerecord, mongoid, etc) and define a method called <code>as_solr_document</code> which returns a hash of the key-value pair entries to index. See the <a href="https://github.com/tc/solrsan">README</a> for more examples. </p>
<p>You can add an <code>after_save</code> method to call the index method as well. I did not automatically add the index method on every object save since some systems may need index via a different method such as via a queuing system.</p>
<h3>Searching</h3>
<p>Search is as easy as:<br />
<code>  response = Document.search(:q =&gt; "hello world") </code><br />
This will return a hashmap response composed of docs and metadata. <code>response[:docs]</code> will be a will_paginated object collection and response[:metadata] contains various supporting items such as error messages, facets, etc.</p>
<h3>Summary</h3>
<p>So I decided not to use sunspot because I want a transparent API access over a DSL implementation and I needed something more than the basic rsolr gem.</p>
<p>If you are interesting in using solrsan, the important links are the readme and unit tests. I&#8217;m already using solrsan on a few projects but it is still relatively new. Feel free to email/pull request any problems/bugs!</p>
<ul>
<li><a href="https://github.com/tc/solrsan">Solrsan readme</a>: Setup guide</li>
<li><a href="https://github.com/tc/solrsan_example">Solrsan Rails 3 example</a></li>
<li><a href="https://github.com/tc/solrsan/blob/master/test/unit/search_test.rb">Solrsan tests</a>: examples of how to perform the different types of search queries</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/434/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=434&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2011/04/29/solrsan-lightweight-solr-gem-for-ruby-on-rails-3-applications/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging ActiveMQ Authentication Configuration</title>
		<link>http://tommy.chheng.com/2011/03/24/debugging-activemq-authentication-configuration/</link>
		<comments>http://tommy.chheng.com/2011/03/24/debugging-activemq-authentication-configuration/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 17:08:38 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=391</guid>
		<description><![CDATA[I recently had to add basic authentication to an ActiveMQ broker and run into some unexpected issues. I followed the example in ActiveMQ in Action to use the simpleAuthenticationPlugin by adding the below snippet to activemq.xml: You can see the complete file at https://gist.github.com/881965 When I tried to start ActiveMQ with ACTIVEMQ_HOME/bin/activemq start xbean:file:conf/activemq.xml ActiveMQ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=391&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had to add basic authentication to an ActiveMQ broker and run into some unexpected issues. I followed the example in ActiveMQ in Action to use the simpleAuthenticationPlugin by adding the below snippet to activemq.xml:</p>
<p>You can see the complete file at <a href="https://gist.github.com/881965">https://gist.github.com/881965</a></p>
<p>When I tried to start ActiveMQ with<br />
<code>ACTIVEMQ_HOME/bin/activemq start xbean:file:conf/activemq.xml</code><br />
ActiveMQ wouldn&#8217;t start!</p>
<p>I checked the activemq.log and only see one line:<br />
<code>2011-03-22 13:21:02,799 | INFO  | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@23abcc03: startup date [Tue Mar 22 13:21:02 PDT 2011]; root of context hierarchy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main<br />
</code><br />
Not very helpful&#8230;<br />
If i comment out the simpleAuthenticationPlugin tags, activemq starts up correctly.</p>
<p>Hmm, what&#8217;s wrong?</p>
<p>Diving into the ActiveMQ In Action book further, I noticed I can start up activemq via<br />
<code>ACTIVEMQ_HOME/bin/activemq console xbean:file:conf/activemq.xml</code></p>
<p>This gives us a much more verbose log output.<br />
I now see the problem is due to:<br />
<code>Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'plugins'.<br />
 </code><br />
Googling up the error brings me to this page <a href="http://activemq.apache.org/xml-reference.html">http://activemq.apache.org/xml-reference.html</a></p>
<p>The problem?</p>
<p><strong>** In ActiveMQ 5.4 and later, the XML elements inside broker tag have to be ordered alphabetically!</strong></p>
<p>I moved the plugins tag before systemUsage tag and ActiveMQ was able to start up correctly with authentication.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=391&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2011/03/24/debugging-activemq-authentication-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>Database Migrations</title>
		<link>http://tommy.chheng.com/2010/12/27/database-migrations/</link>
		<comments>http://tommy.chheng.com/2010/12/27/database-migrations/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 04:03:37 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=381</guid>
		<description><![CDATA[I&#8217;m working on a project where I needed to create and manage database tables. I find that the active_record migration system from Ruby on Rails to be the best system for creating, versioning database changes. The project itself is in Scala so I took a look at scala migrations and c5-db-migration but I found active_record [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=381&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a project where I needed to create and manage database tables. I find that the active_record migration system from Ruby on Rails to be the best system for creating, versioning database changes. The project itself is in Scala so I took a look at <a href="http://code.google.com/p/scala-migrations/">scala migrations</a> and <a href="http://code.google.com/p/c5-db-migration/">c5-db-migration</a> but I found active_record migration to be better documented, supported and has a more concise syntax.</p>
<p>I recently created a template rails 3 project where I kept only the files necessary for generating migrations. Check it out at <a href="https://github.com/tc/database_migrations">https://github.com/tc/database_migrations</a></p>
<p>To get started:<br />
setup your database connection information in config/database.yml</p>
<p>Create a database:<br />
<code><br />
rake db:create<br />
</code><br />
Create a new migration:<br />
<code><br />
rails g migration create_users<br />
</code><br />
This will create a file in db/migrate.<br />
Add columns:<br />
<code><br />
class CreateUsers &lt; ActiveRecord::Migration<br />
  def self.up<br />
    create_table :users do |t|<br />
      t.string :name<br />
    end<br />
  end</p>
<p>  def self.down<br />
    drop_table :users<br />
  end<br />
end<br />
</code></p>
<p>Perform the migration:<br />
<code><br />
rake db:migrate<br />
</code></p>
<p>Now you have a working database which can be managed by this application.</p>
<p>You can rollback to a previous version:<br />
<code><br />
rake db:migrate VERISON=XXXX<br />
</code></p>
<p>The versioning of the database is managed in the database&#8217;s schema_migrations table.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/381/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=381&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2010/12/27/database-migrations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>How to develop with Factorie, a probabilistic modeling toolkit written in Scala</title>
		<link>http://tommy.chheng.com/2010/11/15/how-to-develop-with-factorie-a-probabilistic-modeling-toolkit-written-in-scala/</link>
		<comments>http://tommy.chheng.com/2010/11/15/how-to-develop-with-factorie-a-probabilistic-modeling-toolkit-written-in-scala/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 18:46:40 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=373</guid>
		<description><![CDATA[Factorie is a toolkit for developing probabilistic modeling. It is scalable and flexible and allows you to create factor graphs and perform inference. It is written by Andrew Mccallum and his research group at UMass. They previously written Mallet, the java package for text mining. I found that being written in Scala made the code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=373&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Factorie is a toolkit for developing probabilistic modeling. It is scalable and flexible and allows you to create factor graphs and perform inference. It is written by Andrew Mccallum and his research group at UMass. They previously written Mallet, the java package for text mining. I found that being written in Scala made the code very succinct and clear. You can learn more from its <a href="http://code.google.com/p/factorie/">google project page</a>. Prompted by setup questions on the mailing list, I decided to write a quick guide to using Factorie on a mac osx.</p>
<p>Start with cloning the source code:<br />
<code>hg clone https://factorie.googlecode.com/hg/ factorie<br />
</code><br />
Factorie uses <a href="http://maven.apache.org/">maven</a> to manage its build and dependenices. It is an open source package from apache so download it and learn a little how it works.<br />
Compile the code into a jar:<br />
<code>cd factorie<br />
mvn install<br />
</code><br />
This will create a factorie jar file in target/factorie*.jar and install it into your local maven repo. (most likely ~/.m2)</p>
<p>Now that you have factorie jar in your maven repo, clone a sample factorie project:<br />
<code>git clone git@github.com:tc/factorie-example.git<br />
</code><br />
In the factorie-example directory, you&#8217;ll notice a pom.xml. Inside the file, you&#8217;ll see:</p>
<div id="_mcePaste">&lt;dependency&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;cc.factorie&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;factorie&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;0.9.1-SNAPSHOT&lt;/version&gt;</div>
<div id="_mcePaste">&lt;/dependency&gt;</div>
<p>You may have to change the version to match the updated factorie jar version.</p>
<p>This sample project has two files:<br />
<code>src/main/scala/factorie/LDAExample.scala<br />
src/main/scala/factorie/LDAExampleTest.scala<br />
</code><br />
It&#8217;s good practice to have a unit test for your code. In this case, the unit test is trivial as it just runs the scala class, but ideally you have some type of assert you want to perform.</p>
<p>Compile and run it using:<br />
<code>mvn test<br />
</code><br />
You should see an output of listed topics:<br />
<code>.....Iteration 20<br />
alpha = 0.7897046248435047 1.083615490115922 1.3493645028398928 0.8200016581775706 1.1115652808961307 1.7646165019929618 2.0397615066201604 1.8106654639049065 1.75947360834168 1.2876416992683335<br />
Topic 0  china science achieved contacts powerful power urbana find faster projects<br />
Topic 1  computing performance list chinese gropp problems smith years today tennessee<br />
Topic 2  service stephen full messages members data twitter contacts services plenty<br />
Topic 3  world erica announcement computer floating components center states couldn fastest<br />
Topic 4  jaguar point ogg year high benchmark speed supercomputers community time<br />
Topic 5  itunes features print mac kessler suggests back challenge tomorrow tuesday<br />
Topic 6  mail facebook google shankland people address big reach ability aol<br />
Topic 7  system news university tianhe top topher national called supercomputing font<br />
Topic 8  apple share supercomputer systems operations machine company based released place<br />
Topic 9  gmail cnet software digg supercomputing social comments technology expected linpack</code></p>
<p>Be sure to look into src/main/scala/cc/factorie/example directory in the factorie source code for more examples.</p>
<p>If you use an IDE like Eclipse or Intelij IdeaX, type:<br />
<code>mvn eclipse:eclipse<br />
</code>or<br />
<code>mvn idea:idea<br />
</code>to generate the IDE project files.</p>
<p>Additionally, you can just edit using VIM or Emacs and compile using maven.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=373&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2010/11/15/how-to-develop-with-factorie-a-probabilistic-modeling-toolkit-written-in-scala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>RMongo: Accessing MongoDB in R</title>
		<link>http://tommy.chheng.com/2010/11/03/rmongo-accessing-mongodb-in-r/</link>
		<comments>http://tommy.chheng.com/2010/11/03/rmongo-accessing-mongodb-in-r/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 23:14:48 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=363</guid>
		<description><![CDATA[I recently created RMongo, a database access layer to MongoDB in R as an R package. To install RMongo: install.packages(&#8220;RMongo&#8221;) If that does not work, try downloading it from https://github.com/tc/RMongo/downloads and run: install.packages("~/Downloads/RMongo_0.0.21.tar.gz", repos=NULL, type="source") I tried to mimic the RMySQL commands in RMongo. Below are some example commands. library(RMongo) #ask for help ?RMongo #connect to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=363&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently created <a href="http://github.com/tc/RMongo">RMongo</a>, a database access layer to MongoDB in R as an R package.</p>
<p>To install RMongo:</p>
<p>install.packages(&#8220;RMongo&#8221;)</p>
<p>If that does not work, try downloading it from <a href="https://github.com/quid/RMongo/downloads">https://github.com/tc/RMongo/downloads</a> and run:</p>
<p><code>install.packages("~/Downloads/RMongo_0.0.21.tar.gz", repos=NULL, type="source")</code></p>
<p>I tried to mimic the RMySQL commands in RMongo. Below are some example commands.</p>
<p><code>library(RMongo)</code></p>
<p>#ask for help<br />
?RMongo</p>
<p>#connect to a database<br />
mongo results names(results)<br />
[1] &#8220;X_id&#8221; &#8220;name&#8221; &#8220;nutrient_definition_id&#8221; &#8220;description&#8221;<br />
&gt; results<br />
X_id name nutrient_definition_id<br />
1 4cd0f8e31e627d4e6600000e Adjusted Protein 257<br />
2 4cd0f9061e627d4e6600001a Sodium 307</p>
<p>&gt; results results<br />
X_id name nutrient_definition_id<br />
1 4cd0f9061e627d4e6600001a Sodium 307</p>
<p>&gt; dbDisconnect(mongo)</p>
<p>&nbsp;</p>
<p>RMongo is very alpha at this point. I built it as a quick way to prototype algorithms with data from mongoDB in R. Most of RMongo uses the mongo-java-driver to perform json-formatted queries. The R code in the package uses rJava to communicate with the mongo-java-driver.</p>
<p>Please report any bugs or necessary improvements. Or better yet, send in pull requests via the <a href="http://github.com/tc/RMongo">RMongo github project page</a>!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/363/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=363&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2010/11/03/rmongo-accessing-mongodb-in-r/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>How to run Background Processes using Resque/Redis in a Ruby on Rails App</title>
		<link>http://tommy.chheng.com/2010/10/26/how-to-run-background-processes-using-resqueredis-in-a-ruby-on-rails-app/</link>
		<comments>http://tommy.chheng.com/2010/10/26/how-to-run-background-processes-using-resqueredis-in-a-ruby-on-rails-app/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 18:37:43 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=357</guid>
		<description><![CDATA[When you have a long running block of code, you don&#8217;t want to run it inside a web application request cycle. A background processing queuing system is a good solution. There are a number of open source queuing systems available(delayed_job, beanstalk, etc) so you don&#8217;t need to write your own! This article will go over [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=357&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://tommychheng.files.wordpress.com/2010/10/resque.png"><img src="http://tommychheng.files.wordpress.com/2010/10/resque.png?w=630" alt="" title="resque"   class="alignnone size-full wp-image-361" /></a></p>
<p>When you have a long running block of code, you don&#8217;t want to run it inside a web application request cycle. A background processing queuing system is a good solution. There are a number of open source queuing systems available(delayed_job, beanstalk, etc) so you don&#8217;t need to write your own! This article will go over how to setup the resque queuing system in a Ruby on Rails application.</p>
<h3>Resque setup:</h3>
<p>Install redis<br />
<code>brew install redis<br />
</code>on mac.<br />
or</p>
<p>http://code.google.com/p/redis/</p>
<p>Add resque to your gemfile:<br />
<code>gem "resque"<br />
</code><br />
Install the new gem:<br />
<code>bundle install<br />
</code><br />
Create a redis config file called redis.yml in config:<br />
<code>defaults: &amp;defaults<br />
  host: localhost<br />
  port: 6379</p>
<p>development:<br />
  &lt;&lt;: *defaults</p>
<p>test:<br />
  &lt;&lt;: *defaults</p>
<p>staging:<br />
  &lt;&lt;: *defaults</p>
<p>production:<br />
  &lt;&lt;: *defaults</code></p>
<p>Add an initializer file called resque.rb in config/initializers:<br />
<code>Dir[File.join(Rails.root, 'app', 'jobs', '*.rb')].each { |file| require file }</p>
<p>config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))[Rails.env]<br />
Resque.redis = Redis.new(:host =&gt; config['host'], :port =&gt; config['port'])</code></p>
<p>Add resque.rake to lib/tasks<br />
<code>require 'resque/tasks'<br />
task "resque:setup" =&gt; :environment<br />
</code></p>
<h3>Running Resque:</h3>
<p>start redis:<br />
<code>redis-server<br />
</code><br />
start resque<br />
<code>COUNT=5 QUEUE=* rake resque:workers<br />
</code><br />
see web UI:<br />
<code>resque-web<br />
</code></p>
<h3>How to add resque jobs:</h3>
<p>Create a job class<br />
<code>class NewsCollectionJob<br />
  @queue = :news_collection_job</p>
<p>  def self.perform(start_date, end_date)<br />
    puts "from #{start_date} to #{end_date}"<br />
    #TODO your long running process here<br />
  end<br />
end<br />
</code><br />
Run it using:<br />
<code>Resque.enqueue(NewsCollectionJob, start_date, end_date)<br />
</code><br />
This command will not block so you can embed this code in a model. There you go! A few simple steps to getting a faster performing ruby application using background processing on resque/redis.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=357&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2010/10/26/how-to-run-background-processes-using-resqueredis-in-a-ruby-on-rails-app/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>

		<media:content url="http://tommychheng.files.wordpress.com/2010/10/resque.png" medium="image">
			<media:title type="html">resque</media:title>
		</media:content>
	</item>
		<item>
		<title>Performing MongoDB JSON Queries using the mongo-java-driver</title>
		<link>http://tommy.chheng.com/2010/10/05/performing-mongodb-json-queries-using-the-mongo-java-driver/</link>
		<comments>http://tommy.chheng.com/2010/10/05/performing-mongodb-json-queries-using-the-mongo-java-driver/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 00:10:27 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=353</guid>
		<description><![CDATA[I&#8217;m writing an query front-end for MongoDB which will be eventually used from within R. If you need to make json queries to mongodb in a JVM language, here&#8217;s some example code which you may find useful. It&#8217;s in scala but can be easily adaptable to any jvm language.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=353&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing an query front-end for MongoDB which will be eventually used from within R. If you need to make json queries to mongodb in a JVM language, here&#8217;s some example code which you may find useful. It&#8217;s in scala but can be easily adaptable to any jvm language.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=353&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2010/10/05/performing-mongodb-json-queries-using-the-mongo-java-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
		<item>
		<title>Cascading Example Project using Scala and Maven</title>
		<link>http://tommy.chheng.com/2010/09/26/cascading-example-project-using-scala-and-maven/</link>
		<comments>http://tommy.chheng.com/2010/09/26/cascading-example-project-using-scala-and-maven/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 05:20:20 +0000</pubDate>
		<dc:creator>tommychheng</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=347</guid>
		<description><![CDATA[I recently pushed an example project for using Cascading with Scala and Maven to http://github.com/tc/cascading-scala-maven-example. I created it because the main Cascading examples are built using Ant and in Java. I find I am more productive with an integrated dependency management system like Maven and a higher level language like Scala. With this example project, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=347&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently pushed an example project for using Cascading with Scala and Maven to <a href="http://github.com/tc/cascading-scala-maven-example">http://github.com/tc/cascading-scala-maven-example</a>.</p>
<p>I created it because the main Cascading examples are built using Ant and in Java. I find I am more productive with an integrated dependency management system like <a href="http://maven.apache.org">Maven</a> and a higher level language like <a href="http://scala-lang.org">Scala</a>.</p>
<p>With this example project, you can create a JAR file that you can use with any hadoop cluster by just using <code>mvn package</code>. You can also do <code>mvn assembly:assembly</code> to include all dependencies.</p>
<p>Check it out and hope it helps you get started in big data processing with <a href="http://hadoop.apache.org">Hadoop</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tommychheng.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tommychheng.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tommychheng.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tommychheng.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tommychheng.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tommychheng.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tommychheng.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tommychheng.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tommy.chheng.com&amp;blog=21824714&amp;post=347&amp;subd=tommychheng&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/2010/09/26/cascading-example-project-using-scala-and-maven/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8c8f227adb759f3eb632bcfe77131b8e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tommychheng</media:title>
		</media:content>
	</item>
	</channel>
</rss>
