<?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>A Noted Path by Theodore Nguyen-Cao</title>
	<atom:link href="http://www.theodorenguyen-cao.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theodorenguyen-cao.com</link>
	<description>Personal blog of Theodore Nguyen-Cao</description>
	<lastBuildDate>Sat, 12 Dec 2009 00:46:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Running IntelliJ 9 Public Preview Community Edition on Mac OSX</title>
		<link>http://www.theodorenguyen-cao.com/2009/10/15/running-intellij-9-public-preview-community-edition-on-mac-osx/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/10/15/running-intellij-9-public-preview-community-edition-on-mac-osx/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 20:56:30 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=334</guid>
		<description><![CDATA[JetBrains just announced they are open sourcing IntelliJ in a community edition with a subset of features from their commercial product.
Having used Eclipse almost exclusively in my Java work, I was interested in trying it out and went to download the .dmg file. I unpacked everything and tried to run the poorly named Maia-IC-90.94.app
Nothing came [...]]]></description>
			<content:encoded><![CDATA[<p>JetBrains just <a href="http://blogs.jetbrains.com/idea/2009/10/intellij-idea-open-sourced/">announced</a> they are open sourcing IntelliJ in a community edition with a subset of features from their commercial product.</p>
<p>Having used Eclipse almost exclusively in my Java work, I was interested in trying it out and went to <a href="http://www.jetbrains.com/idea/nextversion/free_java_ide.html">download the .dmg</a> file. I unpacked everything and tried to run the poorly named Maia-IC-90.94.app</p>
<p>Nothing came up. Lame.</p>
<p>I dug into the package and executed idea.sh which prompted me that I need to set the environment variable IDEA_SDK or JDK_HOME.</p>
<p>Ah ha!</p>
<p>In my .bash_profile, I set</p>
<pre class="console">export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
export IDEA_JDK=$JAVA_HOME</pre>
<p>And ran idea.sh again and IntelliJ came up.</p>
<p><a href="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/10/Picture-1.png"><img class="aligncenter size-full wp-image-336" title="Picture 1" src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/10/Picture-1.png" alt="Picture 1" width="450" height="270" /></a></p>
<p>Running Maia-IC.90.94.app still doesn&#8217;t run the app but at least now I can play around with IntelliJ.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/10/15/running-intellij-9-public-preview-community-edition-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linode API for Java</title>
		<link>http://www.theodorenguyen-cao.com/2009/10/11/linode-api-for-java/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/10/11/linode-api-for-java/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 06:06:36 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=331</guid>
		<description><![CDATA[I&#8217;ve been really happy with my recent move over to http://www.linode.com.  I was checking out their API and noticed there wasn&#8217;t any Java client.  I wanted a do a small pet project so I took a couple hours this weekend and wrote a Java client for the API.
The API leverages Apache HTTP Client and JSON.org [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been really happy with my recent move over to <a href="http://www.linode.com/?r=742e79d1ce5f2a9cf8f7f0fe34d858d7ec99ada5">http://www.linode.com</a>.  I was checking out their <a href="http://www.linode.com/api/">API</a> and noticed there wasn&#8217;t any Java client.  I wanted a do a small pet project so I took a couple hours this weekend and wrote a Java client for the API.</p>
<p>The API leverages <a href="http://hc.apache.org/httpclient-3.x/index.html">Apache HTTP Client</a> and <a href="http://json.org/java/">JSON.org Java</a> libraries and is built using <a href="http://maven.apache.org/">Maven</a>.</p>
<p>The project source code can be found <a href="http://github.com/theo/linode-api">here</a>.</p>
<p>If anyone runs into any problems with using it, please feel free to ping me! </p>
<p><strong>Update:</strong> Linode was nice enough to update their <a href="http://www.linode.com/api/">API page</a> with a reference to my project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/10/11/linode-api-for-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursive Remote Login</title>
		<link>http://www.theodorenguyen-cao.com/2009/10/04/recursive-remote-login/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/10/04/recursive-remote-login/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 17:38:00 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=325</guid>
		<description><![CDATA[
Trippy.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/10/recursive-remote-login.png"><img class="aligncenter size-full wp-image-326" title="recursive-remote-login" src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/10/recursive-remote-login.png" alt="recursive-remote-login" width="350" height="263" /></a></p>
<p>Trippy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/10/04/recursive-remote-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terracotta acquires Ehcache</title>
		<link>http://www.theodorenguyen-cao.com/2009/08/18/terracotta-acquires-ehcache/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/08/18/terracotta-acquires-ehcache/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 19:40:16 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=323</guid>
		<description><![CDATA[Pretty big news in the Java world today.
Open-source with a business model company, Terracotta, acquired Ehcache, the very popular caching library.
The creator and maintainer of Ehcache, Greg Luck, had these things to say about  the acquisition:
What this means for Ehcache Users

Ehcache remains under the Apache 2 license
New feature development is accelerated with the addition [...]]]></description>
			<content:encoded><![CDATA[<p>Pretty big news in the Java world today.</p>
<p>Open-source with a business model company, Terracotta, acquired Ehcache, the very popular caching library.</p>
<p>The creator and maintainer of Ehcache, Greg Luck, had these things to say about  the acquisition:</p>
<blockquote><p>What this means for Ehcache Users</p>
<ul>
<li><span style="background-color: #ffffff;">Ehcache remains under the Apache 2 license</span></li>
<li><span style="background-color: #ffffff;">New feature development is accelerated with the addition of a team of engineers working full-time on Ehcache</span></li>
<li><span style="background-color: #ffffff;">I am full-time on Ehcache. I have not had the time I would have liked to devote to Ehcache (I have been doing a miserly 10-15 hours per week for the past 6 years) but now I do. Look out!</span></li>
<li><span style="background-color: #ffffff;">Ehcache extends its standards support. There are multiple emerging standards in this area and I plan to work with the community to lead further standardisation efforts. A lack of time has been my biggest obstacle in doing more on this to date.</span></li>
<li><span style="background-color: #ffffff;">Ehcache gets new hosting at ehcache.org with state-of-the-art forums, source control and bug reporting. The changes will happen slowly and carefully.</span></li>
<li><span style="background-color: #ffffff;">File release at sourceforge.net is retained</span></li>
<li><span style="background-color: #ffffff;">Maven deployment to oss.sonatype.org and Maven Central is retained.</span></li>
<li><span style="background-color: #ffffff;">Distributed caching via Terracotta is seamless. Ehcache users can have full confidence that they can start single node and scale as high as they need to with Enterprise features.</span></li>
<li><span style="background-color: #ffffff;">Enterprise support, training and professional services for Ehcache. I have provided these for a few years now, but now we will have the full Terracotta organisation behind them with the usual SLAs.</span></li>
</ul>
<p>What this means for Terracotta Users</p>
<ul>
<li><span style="background-color: #ffffff;">Ehcache APIs will replace Terracotta distributed cache APIs as a single caching interface / standard for Terracotta distributed caching</span></li>
<li><span style="background-color: #ffffff;">a single-node version of Terracotta ala Ehcache will be available for the first time</span></li>
<li><span style="background-color: #ffffff;">Full freedom to run on the latest version of Ehcache at all times, knowing it will work with Terracotta</span></li>
<li><span style="background-color: #ffffff;">Single vendor support structure for caching interfaces / libraries as well as their scalability / reliability runtime.</span></li>
<li><span style="background-color: #ffffff;">the investment protection of standards</span></li>
</ul>
</blockquote>
<p>It&#8217;s pretty cool to see open source companies like SpringSource (recently acquired by VMWare) and Terracotta making big moves. I look forward to seeing what&#8217;s next for these guys.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/08/18/terracotta-acquires-ehcache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The JSON Saga</title>
		<link>http://www.theodorenguyen-cao.com/2009/08/14/the-json-saga/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/08/14/the-json-saga/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 20:40:43 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=319</guid>
		<description><![CDATA[Working with JSON all day and implementing my own URL shortening app, diminutiveurl.com using Base32 encoding, I really admire Douglas Crockford&#8217;s smart and simple approach to these topics.
I stumbled upon Crockford&#8217;s talk on the JSON Saga, where he tells the story of how JSON came about.  He is a really smart guy and a [...]]]></description>
			<content:encoded><![CDATA[<p>Working with <a href="http://www.json.org">JSON</a> all day and implementing my own URL shortening app, <a href="http://www.diminutiveurl.com">diminutiveurl.com</a> using <a href="http://www.crockford.com/wrmg/base32.html">Base32 encoding</a>, I really admire Douglas Crockford&#8217;s smart and simple approach to these topics.</p>
<p>I stumbled upon Crockford&#8217;s talk on the JSON Saga, where he tells the story of how JSON came about.  He is a really smart guy and a talented speaker. Check out the video:</p>
<div><object width="576" height="358" allowFullScreen="true"><param name="movie" value="http://cosmos.bcst.yahoo.com/up/ypp/default/player.swf"></param><param name="flashVars" value="vid=14846971&#038;siteHostUrl=http%3A//video.yahoo.com"></param><param name="wmode" value="transparent"></param><embed width="576" height="358" allowFullScreen="true" src="http://cosmos.bcst.yahoo.com/up/ypp/default/player.swf" type="application/x-shockwave-flash" flashvars="vid=14846971&#038;siteHostUrl=http%3A//video.yahoo.com"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/08/14/the-json-saga/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oh yeah! I got married!</title>
		<link>http://www.theodorenguyen-cao.com/2009/08/05/oh-yeah-i-got-married/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/08/05/oh-yeah-i-got-married/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 01:49:53 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=309</guid>
		<description><![CDATA[It&#8217;s been awhile since I updated this and big things have happened since.
Cutting to the chase: On June 20th, 2009 I married the lady of my dreams, Patcharee Phongsvirajati.  
The wedding ceremonies took place at our houses and the reception was held at Foxchase Manor.
Check out some photos taken by a few of the [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been awhile since I updated this and big things have happened since.</p>
<p>Cutting to the chase: On June 20th, 2009 I married the lady of my dreams, Patcharee Phongsvirajati.  </p>
<p>The wedding ceremonies took place at our houses and the reception was held at <a href="http://www.foxchasemanor.com/">Foxchase Manor</a>.</p>
<p>Check out some photos taken by a few of the many photographers:</p>
<p>Photography by <a href="http://www.phamphotography.com">Mac Pham</a>, my cousin:<br />
<object width="400" height="300"><param name="flashvars" value="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Fmacpham%2Fsets%2F72157620881995332%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Fmacpham%2Fsets%2F72157620881995332%2F&#038;set_id=72157620881995332&#038;jump_to="></param><param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Fmacpham%2Fsets%2F72157620881995332%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Fmacpham%2Fsets%2F72157620881995332%2F&#038;set_id=72157620881995332&#038;jump_to=" width="400" height="300"></embed></object></p>
<p>Photography by the Pros:<br />
<object width="400" height="300"><param name="flashvars" value="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620814936735%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620814936735%2F&#038;set_id=72157620814936735&#038;jump_to="></param><param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620814936735%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620814936735%2F&#038;set_id=72157620814936735&#038;jump_to=" width="400" height="300"></embed></object></p>
<p>Photography by Cau Duc, my uncle:<br />
<object width="400" height="300"><param name="flashvars" value="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620909272179%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620909272179%2F&#038;set_id=72157620909272179&#038;jump_to="></param><param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620909272179%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Ftheodorenguyen-cao%2Fsets%2F72157620909272179%2F&#038;set_id=72157620909272179&#038;jump_to=" width="400" height="300"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/08/05/oh-yeah-i-got-married/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google App Engine adds Java support (Review)</title>
		<link>http://www.theodorenguyen-cao.com/2009/04/08/google-app-engine-adds-java-support-review/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/04/08/google-app-engine-adds-java-support-review/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 20:30:32 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=293</guid>
		<description><![CDATA[Last night Google announced Java support on Google App Engine.
After a bit of toying around, here are my findings.
The Eclipse plugin is pretty slick. Deploying and build is simple.
The dev server that you spin up locally looks to be jetty under the hood.
Objects intended for storage are JDO annotated and after compiling, you run the [...]]]></description>
			<content:encoded><![CDATA[<p>Last night Google <a href="http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html">announced</a> Java support on Google App Engine.</p>
<p>After a bit of toying around, here are my findings.</p>
<p>The Eclipse plugin is pretty slick. Deploying and build is simple.</p>
<p>The dev server that you spin up locally looks to be jetty under the hood.</p>
<p>Objects intended for storage are JDO annotated and after compiling, you run the .class files through the DataNucleus Enhancer which adds additional metadata so Google can map it to BigTable.  The Eclipse plugin automatically performs this step for you after compiling. The examples provide a bunch of ant macros to help facilitate building/deploying.</p>
<p>One issue that I had was that the project was building with Java 1.6 and I would get an error after compiling:</p>
<pre class="console">Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file</pre>
<p></p>
<p>Even though they say they support Java 1.5 and 1.6, I guess this doesnâ€™t work on the Java 1.6 for the Mac.  Switching the build to 1.5 allows the DataNucleus Enhancer to run successfully. </p>
<p>Even though they are using JPA, some features have not yet been implemented or supported ( see <a href="http://code.google.com/appengine/docs/java/datastore/usingjpa.html#Unsupported_Features_of_JPA">http://code.google.com/appengine/docs/java/datastore/usingjpa.html#Unsupported_Features_of_JPA</a>)</p>
<p>Overall, I like what I see so far and think this would be great for quick prototypes of web apps/services.</p>
<p>Going through the tutorial, my awesome <a href="http://notedpath.appspot.com/guestbook.jsp">Guestbook</a> application has been created and deployed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/04/08/google-app-engine-adds-java-support-review/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Custom field names in Rails error messages</title>
		<link>http://www.theodorenguyen-cao.com/2009/04/06/custom-field-names-in-rails-error-messages/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/04/06/custom-field-names-in-rails-error-messages/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 03:36:28 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=286</guid>
		<description><![CDATA[The defaults in Rails with ActiveRecord is beautiful when you are just getting started and are created everything for the first time.  But once you get into it and your database schema becomes a little more solidified, the things that would have been easy to do by relying on the conventions of Rails require [...]]]></description>
			<content:encoded><![CDATA[<p>The defaults in Rails with ActiveRecord is beautiful when you are just getting started and are created everything for the first time.  But once you get into it and your database schema becomes a little more solidified, the things that would have been easy to do by relying on the conventions of Rails require a little bit more work.</p>
<p>In my case, I had a form where there was a database column named &#8220;num_guests&#8221;, representing the number of guests.  When the field fails to pass validation, the error messages is something like</p>
<blockquote><p>Num guests is not a number</p></blockquote>
<p>Not quite the text that we want.  It would be better if it said</p>
<blockquote><p>Number of guests is not a number</p></blockquote>
<p>After doing a little bit of digging, I found the <a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002244">human_attribute_name</a> method. You can override this method in your model class to provide alternative names for fields.  To change our error message, I did the following</p>
<pre name="code" class="ruby">
class Reservation < ActiveRecord::Base
  ...
  validates_presence_of :num_guests
  ...
  HUMAN_ATTRIBUTES = {
      :num_guests    => "Number of guests"
  }

  def self.human_attribute_name(attr)
      HUMAN_ATTRIBUTES[attr.to_sym] || super
  end
end
</pre>
<p>Since Rails 2.2, this method is used to support <a href="http://rails-i18n.org/wiki/pages/i18n-rails-guide">internationalization</a> (<a href="http://en.wikipedia.org/wiki/Internationalization_and_localization">i18n</a>).  Looking at it, it reminds me of Java&#8217;s <a href="http://java.sun.com/javase/6/docs/api/java/util/ResourceBundle.html">Resource Bundles</a> and <a href="http://static.springframework.org/spring/docs/2.5.5/reference/validation.html#validation-conversion">Spring MVC&#8217;s error messages</a>. Messages are defined based off a key and there&#8217;s a chain of look ups that get applied to resolve an error&#8217;s message.  </p>
<p>Although, I don&#8217;t see myself doing any i18n work in the near-term, it is cool that we have that option now in Rails.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/04/06/custom-field-names-in-rails-error-messages/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Recognizing talent (at the metro)</title>
		<link>http://www.theodorenguyen-cao.com/2009/03/30/recognizing-talent-at-the-metro/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/03/30/recognizing-talent-at-the-metro/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 03:42:45 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[talent]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=281</guid>
		<description><![CDATA[After reading about the violinist playing in the metro (which happened awhile ago), I think we are, at many times, too preoccupied with ourselves and the things that are happening in our lives when we should be taking a moment or a step back to recognize the great things that are happening right in front [...]]]></description>
			<content:encoded><![CDATA[<p>After reading about the <a href="http://urbanlegends.about.com/od/music/a/violinist_metro.htm">violinist playing in the metro</a> (which happened <a href="http://www.washingtonpost.com/wp-dyn/content/article/2007/04/04/AR2007040401721.html">awhile ago</a>), I think we are, at many times, too preoccupied with ourselves and the things that are happening in our lives when we should be taking a moment or a step back to recognize the great things that are happening right in front of us.</p>
<p>Do you think you would be able to recognize extraordinary talent when it is staring you in the face?</p>
<p>Video for viewing pleasure:<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/myq8upzJDJc&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/myq8upzJDJc&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/03/30/recognizing-talent-at-the-metro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checkboxes in Stripes and Spring MVC</title>
		<link>http://www.theodorenguyen-cao.com/2009/03/29/checkboxes-in-stripes-and-spring-mvc/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/03/29/checkboxes-in-stripes-and-spring-mvc/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 06:42:01 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[stripes]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=270</guid>
		<description><![CDATA[When building dynamic web sites with lots of javascript UI components being created on the client, understanding how the web framework you&#8217;re using will process the request and what must be done to update fields accordingly is even more important.
Specifically, checkboxes have always been a pain to deal with.  The gotcha with checkboxes are [...]]]></description>
			<content:encoded><![CDATA[<p>When building dynamic web sites with lots of javascript UI components being created on the client, understanding how the web framework you&#8217;re using will process the request and what must be done to update fields accordingly is even more important.</p>
<p>Specifically, checkboxes have always been a pain to deal with.  The gotcha with checkboxes are if a checkbox isn&#8217;t checked, the request doesn&#8217;t send the parameter so it requires some additional checks to detect that the user deselected something that was there to update the field accordingly.  I&#8217;ve been playing around with the <a href="http://www.stripesframework.org">Stripes framework</a> and ran into this issue.  </p>
<p>With Stripes, you can render a checkbox using their JSP tag:</p>
<pre name="code" class="html">
&lt;stripes:checkbox checked="true" name="property1" value="yes"/&gt;
&lt;stripes:checkbox checked="true" name="property2" value="no"/&gt;
</pre>
<p>When the &#8220;checked&#8221; value is equal to &#8220;value&#8221; value, Stripes will render the checkbox as checked.  So with the code shown, two checkboxes will be shown with the first checked and the second unchecked. </p>
<p>If a user reverses this by unchecking the first, checking the second, and submit the form, the HTTP request will only see that <code>property2=no</code>.  Before the form was submitted, &#8220;property1&#8243; had a value of &#8220;yes&#8221;. Now, &#8220;property1&#8243; won&#8217;t even appear in the request parameters, so we have to do special handling to check for the absent of the parameter to update &#8220;property1&#8243; to whatever value it should be when it is not checked.</p>
<p>In Spring MVC with form binding, checkboxes are dealt with a little differently. Using Spring MVC&#8217;s <a href="http://static.springframework.org/spring/docs/2.0.x/reference/spring-form.tld.html">form JSP tag</a>, you can do:</p>
<pre name="code" class="html">
  &lt;form:checkbox path="property1" value="yes"/&gt;
  &lt;form:checkbox path="property2" value="no"/&gt;
</pre>
<p>Assuming your command bean is named &#8220;person&#8221;, this will generate the following HTML:</p>
<pre name="code" class="html">
        &lt;input name="person.property1" type="checkbox" value="yes"/&gt;
        &lt;input type="hidden" value="1" name="_person.property1"/&gt;
        &lt;input name="person.property2" type="checkbox" value="no"/&gt;
        &lt;input type="hidden" value="1" name="_person.property2"/&gt;
</pre>
<p>As noted by the <a href="http://static.springframework.org/spring/docs/2.5.5/reference/mvc.html">docs</a>, </p>
<blockquote><p>What you might not expect to see is the additional hidden field after each checkbox. When a checkbox in an HTML page is not checked, its value will not be sent to the server as part of the HTTP request parameters once the form is submitted, so we need a workaround for this quirk in HTML in order for Spring form data binding to work. The checkbox tag follows the existing Spring convention of including a hidden parameter prefixed by an underscore (&#8220;_&#8221;) for each checkbox. By doing this, you are effectively telling Spring that â€œthe checkbox was visible in the form and I want my object to which the form data will be bound to reflect the state of the checkbox no matter whatâ€.</p></blockquote>
<p>Spring MVC  also provides a <a href="http://static.springframework.org/spring/docs/2.0.x/reference/spring-form.tld.html#spring-form.tld.checkboxes">&#8220;checkboxes&#8221; tag</a> which allows you to render a list of checkbox boxes without having to wrap the &#8220;checkbox&#8221; tag around a JSTL forEach.</p>
<p>Hopefully, that gives you some insight into how to work with checkboxes in Stripes and Spring MVC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/03/29/checkboxes-in-stripes-and-spring-mvc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IBM to buy Sun? Yay for developers!</title>
		<link>http://www.theodorenguyen-cao.com/2009/03/26/ibm-to-buy-sun-yay-for-developers/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/03/26/ibm-to-buy-sun-yay-for-developers/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 00:47:59 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[humor]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=261</guid>
		<description><![CDATA[There&#8217;s buzz going around that IBM is in talks to buy Sun.  Brian Aker, Director of Technology for MySQL at Sun, gives some insights into what he thinks will happen if this deal goes through.  Many have concerns that there&#8217;s a huge culture clash and IBM will just gobble up all the great [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s buzz going around that <a href="http://www.nytimes.com/2009/03/19/technology/companies/19sun.html?scp=3&amp;sq=sun%20ibm&amp;st=cse">IBM is in talks to buy Sun</a>.  Brian Aker, Director of Technology for MySQL at Sun, <a href="http://broadcast.oreilly.com/2009/03/brian-aker-what-would-an-ibm-b.html">gives some insights</a> into what he thinks will happen if this deal goes through.  Many have concerns that there&#8217;s a huge culture clash and IBM will just gobble up all the great things MySQL and Sun have produced.</p>
<p>All valid concerns.  However, if IBM can maintain the developer community relationship that Sun and MySQL have built  I think developers may have a lot to look forward to. Especially, government contractors.</p>
<p>First thing that popped into my mind when I read this was</p>
<blockquote><p>Sweet! No more heavy-weight Oracle development.  The government will allow devs to use MySQL now!</p></blockquote>
<p>After all, it&#8217;s backed by Big Blue.</p>
<p>And nobody ever got fired for choosing IBM.</p>
<p>Right?</p>
<p><small>Installing Oracle on a laptop still gives me nightmares. *shudders*</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/03/26/ibm-to-buy-sun-yay-for-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallels Desktop vs VMWare Fusion</title>
		<link>http://www.theodorenguyen-cao.com/2009/02/09/parallels-desktop-vs-vmware-fusion/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/02/09/parallels-desktop-vs-vmware-fusion/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 04:36:49 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=249</guid>
		<description><![CDATA[Ever since I got my Macbook, I&#8217;ve used Parallels with my Book Camp partition to run Windows side-by-side with OSX.  I had heard that there was this other option of using VMWare Fusion but never really bothered to look into it.  This was true until this weekend.  It had been a couple [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I got my Macbook, I&#8217;ve used Parallels with my Book Camp partition to run Windows side-by-side with OSX.  I had heard that there was this other option of using VMWare Fusion but never really bothered to look into it.  This was true until this weekend.  It had been a couple of days since I recently upgraded to 4gb of ram.  I actually had not started up Parallels in awhile but I wanted to test something in the dreaded Internet Explorer so I started up Parallels.</p>
<p>I was presented with the following message:</p>
<pre>Windows could not start because the following file is missing or corrupt:
<windows root>system32hal.dll.
Please re-install a copy of the above file.</windows></pre>
<p>Uh, what?</p>
<p>Must be a fluke! So, let&#8217;s try this again.</p>
<pre>
Windows could not start because the following file is missing or corrupt:
<windows root>system32ntoskrnl.dll.
Please re-install a copy of the above file.
</windows></pre>
<p>Uh-oh.  This doesn&#8217;t look good.</p>
<p>After <a href="http://www.google.com/search?hl=en&#038;q=ntoskrnl.dll+parallels&#038;btnG=Search">googling</a> a <a href="http://www.google.com/search?hl=en&#038;q=hal.dll+parallels&#038;btnG=Search">bit</a>, it turns out Parallels does some pretty bad things like <a href="http://communities.vmware.com/message/770207#770207">modify</a> essential Windows boot up files to get Boot Camp to work with Parallels. They even <a href="http://www.google.com/search?hl=en&#038;q=parallels+boot.ini&#038;btnG=Search">modify boot.ini</a>!  So, I think what happened to me was that Parallels crashed at some point and corrupted/deleted these essential Windows files rendering my Windows partition unbootable.</p>
<p>This is what you call a deal breaker.  If your software&#8217;s purpose is to allow other operating systems to run,  rendering said operating system unusable is a big no no.</p>
<p><img src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/02/fusion-1.png" alt="fusion-1" title="fusion-1" width="476" height="405" class="aligncenter size-full wp-image-257" /><br />
So, I&#8217;ve been using Fusion for a day or two now, feature for feature pretty much has everything Parallels had. Even the user interface is fairly similar, they just call things a little different. For example, what Parallels calls Coherence, Fusion calls Unity.  Performance is about the same but I don&#8217;t really play games or anything other than startup Internet Explorer when running Windows.  Best of all, Fusion doesn&#8217;t seem to do terrible things like modify Windows boot up files.  Fusion beats Parallels hands down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/02/09/parallels-desktop-vs-vmware-fusion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setup Apache on Mac OSX Leopard</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/28/setup-apache-on-mac-osx-leopard/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/28/setup-apache-on-mac-osx-leopard/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 05:46:01 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=227</guid>
		<description><![CDATA[I&#8217;ve had my Macbook for a little over a year now. However, I just recently found out Leopard comes with apache (apache2 to be specific) already installed.  To verify this is true, open up Terminal and type

>> apachectl -V
Server version: Apache/2.2.9 (Unix)
Server built:   Sep 19 2008 10:58:54
Server's Module Magic Number: 20051115:15
Server loaded: [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had my Macbook for a little over a year now. However, I just recently found out Leopard comes with apache (apache2 to be specific) already installed.  To verify this is true, open up Terminal and type</p>
<pre class="console">
>> apachectl -V
Server version: Apache/2.2.9 (Unix)
Server built:   Sep 19 2008 10:58:54
Server's Module Magic Number: 20051115:15
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
</pre>
<p>To start up apache, you can do it a couple of ways.</p>
<p>Type <code>sudo apachectl -k start</code></p>
<p>or</p>
<p><img src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/01/web-sharing.png" alt="web-sharing" title="web-sharing" width="500" height="419" class="aligncenter size-full wp-image-237" /></p>
<ol>
<li>Go to System Preferences</li>
<li>Click on Sharing</li>
<li>Check the box that says Web Sharing</li>
</ol>
<p>You can go to http://localhost or the URL provided in the Web Sharing screen to confirm apache is running and is able to serve up requests.</p>
<p>There is also a <code>~/Sites</code> directory in your home folder.  Apache is already setup to serve up files from this directory under <code>http://localhost/~<b>[username]</b></code> where <b>[username]</b> is your user account name. Any files here will be render for example ~/Sites/index.html is accessible from the browser via http://localhost/~<b>[username]</b>/index.html.</p>
<p>One note to get this to work.  Out of the box, all requests to /Sites result in a Forbidden 403 error. To resolve this issue, modify the conf file specified above as <code>SERVER_CONFIG_FILE</code> (<code>/private/etc/apache2/httpd.conf</code> in my case) from </p>
<pre class="console">
&lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
&lt;/Directory&gt;
</pre>
<p>to</p>
<pre class="console">
&lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
&lt;/Directory&gt;
</pre>
<p>Restart apache (sudo apachectl -k restart) and try going to <code>http://localhost/~<b>[username]</b></code> again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/28/setup-apache-on-mac-osx-leopard/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Happy Vietnamese New Year!</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/26/happy-vietnamese-new-year/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/26/happy-vietnamese-new-year/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 06:18:31 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=223</guid>
		<description><![CDATA[
May your pockets be filled with little red envelopes.  
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.theodorenguyen-cao.com/wp-content/uploads/2008/02/envelopes.jpg" alt="red_envelopes" title="red_envelopes" width="475" height="350" class="aligncenter size-full wp-image-72" /></p>
<p>May your pockets be filled with little red envelopes. <img src='http://www.theodorenguyen-cao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/26/happy-vietnamese-new-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cleaning up iPhoto</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/25/cleaning-up-iphoto/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/25/cleaning-up-iphoto/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 04:30:35 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[iphoto]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=208</guid>
		<description><![CDATA[The longer I use iPhoto, the more I hate it.  When I initially started using it, I would import photos but choose not to copy the originals to the iPhoto Library.  In the past year or so, I&#8217;ve started to just allow iPhoto to copy the originals to the iPhoto Library. So now, [...]]]></description>
			<content:encoded><![CDATA[<p>The longer I use <a href="http://www.apple.com/ilife/iphoto/">iPhoto</a>, the more I hate it.  When I initially started using it, I would import photos but choose not to copy the originals to the iPhoto Library.  In the past year or so, I&#8217;ve started to just allow iPhoto to copy the originals to the iPhoto Library. So now, I ended up with photos scattered all over the place.  This was a pain to maintain and figure out where my photos were.</p>
<p>I decided that I want all photos to be in one place and if I was going to use iPhoto, I&#8217;m going to import by copying the originals to the iPhoto Library. Before I could get all of this to happen, I had to backup all of existing photos that were not in the iPhoto Library to an external hard drive.  Planning on importing these photos over again from the external hard drive, I then deleted all of these photos through Finder.  Going back into iPhoto, I still saw the thumbnails for the photos I just deleted. If I attempt to open any of them though, it complained it couldn&#8217;t find the original.  What a mess.  There doesn&#8217;t seem to be a way to refresh your iPhoto Library and it would remove photos it doesn&#8217;t have references to any more.</p>
<p>I figure the easiest way to get my iPhoto Library setup the way I want it is to start from scratch.  So I went under my Pictures directory and renamed iPhoto Library to iPhoto Library.original. Opening up iPhoto again, you get prompted to search for your Library or create a new one.  I choose create a new iPhoto Library and now I can begin importing my photos. </p>
<p> <img src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/01/iphoto-prefs.png" alt="iphoto-prefs" title="iphoto-prefs" width="477" height="248" class="aligncenter size-full wp-image-211" /></p>
<p>After making sure I have the option to copy items to iPhoto Library when importing, I can now import photos from my external hard drive.</p>
<p>Great! Now I have all of my scattered photos in iPhoto Library.  But what about the photos I had imported to the original iPhoto Library ( the ones under iPhoto Library.original)?  Well, there didn&#8217;t seem to be an easy way to import non-broken originals form one iPhoto Library to another from the GUI so I went to the command line.</p>
<p>All of the original photos that are imported to an iPhoto Library are under a folder called Originals.  However, due to the way iPhoto manages the photos, this also includes the broken files that reference the photos I had deleted. Basically I wanted to get rid of all of these broken references before importing all of the photos from my original iPhoto Library to the new one I am creating.  Here&#8217;s how I did it.</p>
<ol>
<li>Open up Terminal</li>
<li>Change directory to the original iPhoto Library&#8217;s Originals directory (~/Pictures/iPhoto Library.original/Originals)</li>
<li>The broken references aren&#8217;t actually symbolic links. They seem to be using extended file attributes to denote where the original file actually is (see <code>xattr</code>).Â  Since we deleted the actual photos, to identify these files type:
<pre class="console">
find . -size 0
</pre>
<p>to get a list of all of the 0 byte files.
</li>
<li>To remove them:
<pre class="console">
find . -name "*.jpg" -size 0 -exec rm {}  \;
</pre>
<p>or if you want to just move them elsewhere:</p>
<pre class="console">
find . -name "*.jpg" -size 0 -exec mv {} $dest \;
</pre>
<p>where $dest is the path to where you want to move the files
</li>
<li>To delete all of the empty directories (that represent your events) for clean up purposes:
<pre class="console">find . -depth -type d -empty -exec rmdir {} \;</pre>
</li>
</ol>
<p>Now your original iPhoto Library should only contain photos that were imported by copying the originals to the iPhoto Library.</p>
<p>To finish importing everything, open iPhoto, choosing your new iPhoto Library and import the Originals directory from the original iPhoto Library (~/Pictures/iPhoto Library.originals/Originals). You might have to copy this folder someplace else since the Import menu doesn&#8217;t allow you to specify going into the iPhoto Library.originals package.</p>
<p>After about 5 hours of battling with iPhoto, I think I finally have all of my photos reimported to a fresh iPhoto Library with no duplicates and broken file references.  Having to do all of this really makes me think to just switch to something else. How do you guys feel about iPhoto? What are some good alternatives?  <a href="http://picasa.google.com/">Picasa</a> anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/25/cleaning-up-iphoto/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Moving wordpress to another host</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/21/moving-wordpress-to-another-host/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/21/moving-wordpress-to-another-host/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 04:57:35 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=196</guid>
		<description><![CDATA[If you&#8217;ve been following my blog for awhile, you might have noticed I moved this blog from blog.notedpath.com to theodorenguyen-cao.com as it was more fitting domain.  I originally just registered the domain, added the DNS record, and updated my apache config to have theodorenguyen-cao.com to be an server alias to blog.notedpath.com.
This allowed requests to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been following my blog for awhile, you might have noticed I moved this blog from <a href="http://blog.notedpath.com">blog.notedpath.com</a> to <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a> as it was more fitting domain.  I originally just registered the domain, added the DNS record, and updated my apache config to have <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a> to be an server alias to blog.notedpath.com.</p>
<p>This allowed requests to blog.notedpath.com/* and theodorenguyen-cao/* respond with the same content.  I thought I was done.  I discovered this wasn&#8217;t the case when I saw blog.notedpath.com as a direct traffic source in my google analytics for <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a>.  To fix the screwed up analytics, I needed to make it so that all requests that go to blog.notedpath.com are permanently redirected (301) to <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a>.</p>
<p>To do this I had to apply an Apache mod_alias <a href="http://httpd.apache.org/docs/1.3/mod/mod_alias.html#redirect" target="_blank">redirect directive</a> as such:</p>
<pre name="code" class="xml" >
&lt;VirtualHost *:80&gt;
        VirtualDocumentRoot /var/www/blog
        ServerName blog.notedpath.com
        Redirect permanent / http://www.theodorenguyen-cao.com/
        ErrorLog /var/log/apache2/wp-error.log
        TransferLog /var/log/apache2/wp-access.log
&lt;/VirtualHost&gt;
</pre>
<p>The virtual host for <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a> looks like:</p>
<pre name="code" class="xml" >
&lt;VirtualHost *:80&gt;
    VirtualDocumentRoot /var/www/blog
    ServerName www.theodorenguyen-cao.com
    ServerAlias theodorenguyen-cao.com
    CustomLog /var/log/apache2/theodorenguyen-cao.com_access.log Combined
    ErrorLog /var/log/apache2/theodorenguyen-cao_error.log
&lt;/VirtualHost&gt;
</pre>
<p>At first I thought this would only fix the simple case of blog.notedpath.com redirecting to <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a>, but blog.notepath.com/foobar not being translated to theodorenguyen-cao.com/foobar.  However, this does exactly what I want. All blog.notedpath.com URLs will be replaced with <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a> URLs.  Old bookmarks will simply redirect to a theodorenguyen-cao.com URL and not 404.</p>
<p>Success!</p>
<p>I&#8217;m still waiting to see if Google will update the search result links that point to blog.notedpath.com to be <a href="http://www.theodorenguyen-cao.com">theodorenguyen-cao.com</a> URLs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/21/moving-wordpress-to-another-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using validates_presence_of on a boolean field? Should use validates_inclusion_of!</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/12/using-validates_presence_of-on-a-boolean-field-should-use-validates_inclusion_of/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/12/using-validates_presence_of-on-a-boolean-field-should-use-validates_inclusion_of/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 05:38:43 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=191</guid>
		<description><![CDATA[rsvp.theoandpat.com had boolean flag to marked whether or not a visitor was going to be able to make it to our wedding. Unfortunately, if you selected you were not able to make it and submit the form, the application would return saying it could not process your submission because you have to say that you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rsvp.theoandpat.com">rsvp.theoandpat.com</a> had boolean flag to marked whether or not a visitor was going to be able to make it to our wedding. Unfortunately, if you selected you were not able to make it and submit the form, the application would return saying it could not process your submission because you have to say that you are going to make it. I argued, this is an RSVP form so you have to accept if you are RSVPing. That&#8217;s the point of the RSVP! Only people RSVP would bother submitting the form!Â  Pat wasn&#8217;t too happy about that and ask/told me to fix it.Â  </p>
<p>Digging into it, it turns out the wayÂ  for <code><a href="http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001893">validates_presence_of</a></code> relies on <code>Object#blank</code> which of course when sent</p>
<pre name="code" class="ruby">
false.blank? # returns true
</pre>
<p>Reading up on the documentation, it is suggested to use <code><a href="http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001898">validates_inclusion_of</a></code> when dealing with booleans.</p>
<p>The one line change solved the problem:</p>
<pre name="code" class="ruby">
validates_inclusion_of :accepted, :in => [true, false]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/12/using-validates_presence_of-on-a-boolean-field-should-use-validates_inclusion_of/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Picasa vs Flickr</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/12/picasa-vs-flickr/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/12/picasa-vs-flickr/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 05:06:37 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=182</guid>
		<description><![CDATA[Pat got me a new camera for my birthday this past October so I have been trying to take more pictures lately.  One of my new years resolutions is to take more pictures!  As a result, I&#8217;ve been trying out Yahoo&#8217;s Flickr and Google&#8217;s Picasa over the past couple of weeks.  With [...]]]></description>
			<content:encoded><![CDATA[<p>Pat got me a new camera for my birthday this past October so I have been trying to take more pictures lately.  One of my new years resolutions is to take more pictures!  As a result, I&#8217;ve been trying out Yahoo&#8217;s <a href="http://www.flickr.com">Flickr</a> and Google&#8217;s <a href="http://www.picasa.com">Picasa</a> over the past couple of weeks.  With Picasa recently added <a href="http://picasa.google.com/mac/">support on the Mac</a> and Apple announcing iPhoto out-of-the-box Flickr integration, the feature sets from the desktop are pretty much identical.  Both support (or will support) face recognition, tagging, and exporting.</p>
<p>For the web galleries, I really liked Picasa&#8217;s layout over Flickr&#8217;s.  The web site is a lot more simplistic and easy to navigate.  Maybe it&#8217;s becase I&#8217;m so familiar with other Google services.  Flickr&#8217;s slideshow is so awesome though.  Viewing your photostream through <a href="http://www.cooliris.com">Cooliris</a> is such beautiful eye candy.</p>
<p style="text-align: center;"><img class="size-medium wp-image-186 aligncenter" title="cooliris" src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/01/picture-16-300x187.png" alt="cooliris" width="300" height="187" /></p>
<p>I started with the free accounts.  Google gives you a gig of space for the free account and you can create as many albums as you want. Flickr&#8217;s free account gives you 100 mb of upload per month and limits you to three sets.</p>
<p>For me, it really came down to pricing. In order to get more disk space for Picasa, you have to <a href="https://www.google.com/accounts/PurchaseStorage?hl=en_US">purchase more storage</a>.  Starting purchase goes for $20/yr for 10gigs up to $500/yr for 400GB.  This storage is actually not specific to Picasa but is shared by all other Google services that need to use extra space. Flickr offers a <a href="http://www.flickr.com/upgrade/">Pro account</a>, which gives you unlimited storage space for your videos and photos and allows you to create any number of sets and collections, for $24.95.</p>
<p>Given the number of photos I want to upload and my budget, I went with Flickr. Today, storage is so cheap. For $25 bucks, I should be able to get unlimited storage for a service like photo sharing. I&#8217;ve started to upload some photos I&#8217;ve had for awhile and never really shared them with those who would most enjoy them.  It&#8217;s been really fun going through old pictures. My photostream can be found <a href="http://flickr.com/photos/theodorenguyen-cao/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/12/picasa-vs-flickr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tiny URLs? HA! diminutive URLs for the win!</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/11/tiny-urls-ha-diminutive-urls-for-the-win/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/11/tiny-urls-ha-diminutive-urls-for-the-win/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 04:19:10 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=171</guid>
		<description><![CDATA[Inspired by a discussion of URL shortening, I took a weekend and implemented one of my own.  When thinking about tiny URLs, a quote always came to mind.
Don&#8217;t use a big word where a diminutive one will suffice.
So after finding out the domain was available, diminutiveurl.com was born.  Yes, it&#8217;s poking a little [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by a <a href="http://www.codinghorror.com/blog/archives/000935.html">discussion</a> of URL shortening, I took a weekend and implemented one of my own.  When thinking about tiny URLs, a <a href="http://www.quotationspage.com/quote/264.html">quote</a> always came to mind.</p>
<blockquote><p>Don&#8217;t use a big word where a diminutive one will suffice.</p></blockquote>
<p>So after finding out the domain was available, <a href="http://www.diminutiveurl.com">diminutiveurl.com</a> was born.  Yes, it&#8217;s poking a little fun at the idea of a tiny url but it was fun to hack on.  It&#8217;s very minimilistic at this point but I hope to add some interesting features.<br />
<center><a href="http://www.diminutiveurl.com"><img class="size-full wp-image-172" title="diminutiveurl.com" src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/01/wt496ac2561d2a0-thumb_medium.jpg" alt="diminutiveurl.com" width="320" height="240" /></a></center></p>
<p>For no other reason than to build something, I hope you enjoy it! I am glad to present <a href="http://www.diminitiveurl.com">diminitiveurl.com</a>!  Please <a href="http://diminutiveurl.uservoice.com/">let me know what you think</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/11/tiny-urls-ha-diminutive-urls-for-the-win/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing theoandpat.com</title>
		<link>http://www.theodorenguyen-cao.com/2009/01/11/introducing-theoandpatcom/</link>
		<comments>http://www.theodorenguyen-cao.com/2009/01/11/introducing-theoandpatcom/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 04:03:04 +0000</pubDate>
		<dc:creator>Theo</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[pat]]></category>

		<guid isPermaLink="false">http://www.theodorenguyen-cao.com/?p=164</guid>
		<description><![CDATA[Over the course of the past months in her free time between work and planning a wedding, Pat&#8217;s been hard at work at creating a web site for our wedding. We felt we had enough to show it off to the rest o the world so I finally got around to deploying it.  I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Over the course of the past months in her free time between work and planning a wedding, Pat&#8217;s been hard at work at creating a web site for our wedding. We felt we had enough to show it off to the rest o the world so I finally got around to deploying it.  I&#8217;m really happy with the way it turned out. I think she did a pretty awesome job.  I contributed in a small way by setting up the web server, create the <a href="http://rsvp.theoandpat.com">RSVP</a> site, and installing the guestbook.  The whole concept and design is Pat&#8217;s creation.  She did all of the page layout and flash work.  I&#8217;m so proud of her. She&#8217;s turning into a web geek and she doesn&#8217;t even know it.</p>
<p style="text-align: center;"><img class="size-medium wp-image-167 aligncenter" title="theoandpat.com" src="http://www.theodorenguyen-cao.com/wp-content/uploads/2009/01/wt496abddf646a8-thumb_medium-300x225.jpg" alt="theoandpat.com" width="300" height="225" /></p>
<p>I&#8217;m sure there are some kinks to iron out but please check out <a href="http://www.theoandpat.com">theoandpat.com</a> and let us know what you think.  Oh, yeah also, <a href="http://rsvp.theoandpat.com">RSVP</a> for the wedding. If you&#8217;re reading my blog, chances are I know you and you&#8217;re invited. <img src='http://www.theodorenguyen-cao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>-Theo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.theodorenguyen-cao.com/2009/01/11/introducing-theoandpatcom/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
