<?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>David Xia</title>
	<atom:link href="http://www.davidxia.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.davidxia.com</link>
	<description>The cure for boredom is curiosity. There is no cure for curiosity.</description>
	<lastBuildDate>Thu, 17 May 2012 23:04:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Turn Mac OS X Lion Into a LAMP Web Server (Without MAMP)</title>
		<link>http://www.davidxia.com/2012/05/turn-mac-os-x-lion-into-a-lamp-web-server-without-mamp?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=turn-mac-os-x-lion-into-a-lamp-web-server-without-mamp</link>
		<comments>http://www.davidxia.com/2012/05/turn-mac-os-x-lion-into-a-lamp-web-server-without-mamp#comments</comments>
		<pubDate>Sat, 12 May 2012 08:30:39 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming & Software]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2789</guid>
		<description><![CDATA[Lots of developers use <a href="http://www.mamp.info" title="MAMP">MAMP</a> for local PHP development. There's nothing wrong with MAMP. It works. But I wanted to find out how to use the pre-installed Apache and PHP in Lion. 
 
 
<h2>Prerequisites</h2> 
 
Ensure these directories exist: 
 
<pre lang="shell"> 
$ sudo mkdir /usr/local/include 
$ sudo mkdir /usr/local/bin 
$ sudo mkdir /usr/local/lib 
$ sudo mkdir -p /usr/local/man/man1 
</pre> 
 
 
<h2>Setup Apache2</h2> 
 
<pre lang="php"> 
$ sudo chmod u+w /etc/apache2/httpd.conf 
$ sudo vim httpd.conf 
</pre> 
 
Uncomment #LoadModule php5_module libexec/apache2/libphp5.so. 
 
To enable virtual hosts, uncomment #Include /private/etc/apache2/extra/httpd-vhosts.conf. 
 
Enable .htaccess files by finding Directory <a href="http://www.davidxia.com/2012/05/turn-mac-os-x-lion-into-a-lamp-web-server-without-mamp">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/05/turn-mac-os-x-lion-into-a-lamp-web-server-without-mamp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proof of the Irrationality of √2</title>
		<link>http://www.davidxia.com/2012/04/proof-of-the-irrationality-of-%e2%88%9a2?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=proof-of-the-irrationality-of-%25e2%2588%259a2</link>
		<comments>http://www.davidxia.com/2012/04/proof-of-the-irrationality-of-%e2%88%9a2#comments</comments>
		<pubDate>Tue, 01 May 2012 00:36:22 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2772</guid>
		<description><![CDATA[The Pythagoreans, a wacky bunch of integer-worshipping Greeks, were so against the notion of irrational numbers that they supposedly murdered the poor soul who leaked their existence. In honor of <a href="http://en.wikipedia.org/wiki/Hippasus">Hippasus</a>, we'll prove that \(\sqrt{2}\) is irrational, ie \(\sqrt{2}\) can't be expressed \(\frac{p}{q}\) for some \(p, q \in \mathbb{Z}\). We'll do a proof by contradiction. 
 
Let's assume \(\sqrt{2}\) is rational. Then \(\exists a, b, \in \mathbb{Z}: \sqrt{2} = \frac{a}{b}\). \(a\) and \(b\) have a greatest common divisor and by dividing each by the gcd, we obtain an equivalent fraction \(\frac{p}{q}\) that's in lowest terms, i.e. \(p, q \in <a href="http://www.davidxia.com/2012/04/proof-of-the-irrationality-of-%e2%88%9a2">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/04/proof-of-the-irrationality-of-%e2%88%9a2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Euclid&#8217;s Algorithm</title>
		<link>http://www.davidxia.com/2012/04/euclids-algorithm?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=euclids-algorithm</link>
		<comments>http://www.davidxia.com/2012/04/euclids-algorithm#comments</comments>
		<pubDate>Thu, 26 Apr 2012 00:07:28 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[euclid's algorithm]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2711</guid>
		<description><![CDATA[What's the greatest common divisor (gcd) of X and Y? It turns out there's a nice algorithm for calculating this – the Euclidean Algorithm.

<h3>Common Divisor Divides Integer Combination</h3>

Let \((D, +, \cdot)\) be an integral domain.

Let \(c\) be a common divisor of two elements \(a\) and \(b\) of \(D\), i.e.:

$$a, b, c \in D: c&#124;a \wedge c&#124;b$$

Then:

$$\forall p, q \in D: c&#124;(pa + qb)$$

Proof:

\begin{aligned}
c&#124;a \implies &#038; \exists x \in D: a = xc \\
c&#124;b \implies &#038; \exists y \in D: b = yc \\
&#038; \forall p, q \in D: pq + qb = pxc + qyc = (px + qy)c \\
\implies &#038; \exists z \in D: pa + qb = zc \\
\implies &#038; c &#124; pa + qb
\end{aligned} <a href="http://www.davidxia.com/2012/04/euclids-algorithm">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/04/euclids-algorithm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dieter Rams – Less But Better</title>
		<link>http://www.davidxia.com/2012/04/dieter-rams-less-but-better?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dieter-rams-less-but-better</link>
		<comments>http://www.davidxia.com/2012/04/dieter-rams-less-but-better#comments</comments>
		<pubDate>Mon, 02 Apr 2012 00:08:43 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[dieter rams]]></category>
		<category><![CDATA[industrial design]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2692</guid>
		<description><![CDATA[I just finished reading the monograph <a href="http://www.amazon.com/gp/product/0714849189/ref=as_li_ss_tl?ie=UTF8&#038;tag=easiamus00-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0714849189"><em>Dieter Rams: As Little Design as Possible</em></a><img src="http://www.assoc-amazon.com/e/ir?t=easiamus00-20&#038;l=as2&#038;o=1&#038;a=0714849189" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />. The book covers the life and work of the influential German industrial designer whose hundreds of products are still manufactured and whose principles are still practiced. 
 
This was my first introduction to Rams, but I recognized his work in the 606 Universal Shelving System, Braun shavers, and the SK4 record player. These products were so successful they set the standard design for whole classes of products to follow. For example, I've never seen a record <a href="http://www.davidxia.com/2012/04/dieter-rams-less-but-better">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/04/dieter-rams-less-but-better/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install Vim 7.3 on Ubuntu 10.04 with Ruby and Python Support</title>
		<link>http://www.davidxia.com/2012/03/how-to-install-vim-7-3-on-ubuntu-10-04-with-ruby-and-python-support?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-install-vim-7-3-on-ubuntu-10-04-with-ruby-and-python-support</link>
		<comments>http://www.davidxia.com/2012/03/how-to-install-vim-7-3-on-ubuntu-10-04-with-ruby-and-python-support#comments</comments>
		<pubDate>Thu, 29 Mar 2012 21:10:51 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming & Software]]></category>
		<category><![CDATA[command-t vim]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2688</guid>
		<description><![CDATA[I wanted to use Vim's <a href="https://github.com/wincent/Command-T" title="Vim Command-T plugin">Command-T plugin</a> (via this <a href="https://github.com/casecommons/vim-config" title="Case Commons Vim Config">awesome Vim config</a>) for fast file navigation. But this plugin needs Vim to be compiled with Ruby support since it's is written in Ruby. You can check with 
 
<pre lang="shell"> 
vim --version 
</pre> 
 
Unfortunately, I saw "-ruby" which means it lacks Ruby support. I was previously using Vim 7.2 on Ubuntu 10.04 Lucid. First I uninstalled my old Vim and installed dependencies required to compile a new one: 
 
<pre lang="shell"> 
sudo apt-get remove vim-common vim-runtime vim-gtk vim-gui-common 
sudo apt-get</pre> <a href="http://www.davidxia.com/2012/03/how-to-install-vim-7-3-on-ubuntu-10-04-with-ruby-and-python-support">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/03/how-to-install-vim-7-3-on-ubuntu-10-04-with-ruby-and-python-support/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Call Me Smart</title>
		<link>http://www.davidxia.com/2012/03/dont-call-me-smart?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-call-me-smart</link>
		<comments>http://www.davidxia.com/2012/03/dont-call-me-smart#comments</comments>
		<pubDate>Fri, 16 Mar 2012 19:17:21 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[alfred binet]]></category>
		<category><![CDATA[IQ test]]></category>
		<category><![CDATA[left-right brain]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2668</guid>
		<description><![CDATA[People often tell me, I'm a "smart" guy. I have two beefs with this statement. It implies that there's one type of intelligence, usually the logical, analytical kind, and that my smarts are an innate quality rather than an achievement. 
 
The prevailing notion of intelligence is a narrow and limiting one that fails to embrace the multitude of human abilities. We define intelligence too often as the ability to analyze rationally and think deductively. Kids are increasingly, in the <a href="http://www.ted.com/talks/ken_robinson_says_schools_kill_creativity.html" title="Ken Robinson says schools kill creativity">words of Sir Ken Robinson</a>, educated "from the neck up." What about <a href="http://www.davidxia.com/2012/03/dont-call-me-smart">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/03/dont-call-me-smart/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>David Foster Wallace on American Consumer Culture</title>
		<link>http://www.davidxia.com/2012/03/david-foster-wallace-on-american-consumer-culture?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=david-foster-wallace-on-american-consumer-culture</link>
		<comments>http://www.davidxia.com/2012/03/david-foster-wallace-on-american-consumer-culture#comments</comments>
		<pubDate>Mon, 12 Mar 2012 16:46:44 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Economy]]></category>
		<category><![CDATA[american consumer culture]]></category>
		<category><![CDATA[David Foster Wallace]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2663</guid>
		<description><![CDATA[I recently watched some interviews of David Foster Wallace. It's fascinating to hear him speak. He's a deeply intelligent, neurotic, and sentimental man. 
 
My favorite parts are when DFW talks about American consumer culture. He describes the US as "<a href="http://youtu.be/AlUmT_biDwI?t=1m30s">one enormous engine and temple of self-gratification</a>," which works very well in growing the economy but doesn't nourish other parts of people. 
 
<a href="http://youtu.be/AlUmT_biDwI?t=7m36s" title="David Foster Wallace's quote on mixed messages for American youth">For young people in America</a>, there are very mixed messages from the culture. There's a streak of moralism in American life that extols the virtues <a href="http://www.davidxia.com/2012/03/david-foster-wallace-on-american-consumer-culture">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/03/david-foster-wallace-on-american-consumer-culture/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I Increased My WordPress Site&#8217;s Speed</title>
		<link>http://www.davidxia.com/2012/03/how-i-increased-my-wordpress-sites-speed?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-i-increased-my-wordpress-sites-speed</link>
		<comments>http://www.davidxia.com/2012/03/how-i-increased-my-wordpress-sites-speed#comments</comments>
		<pubDate>Fri, 02 Mar 2012 17:26:45 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[browser caching]]></category>
		<category><![CDATA[site performance]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2649</guid>
		<description><![CDATA[I spent yesterday optimizing the performance of this site. I love fast page loads and have little patience for sluggish performance. Here's what I did. 
 
<strong>1. Leverage browser caching</strong> 
 
Tell your web server to set expiration headers for static resources so browsers know to store them in local disk. This will keep requests off the network altogether. I use Apache: 
 
<pre lang="shell"> 
 ExpiresActive On 
 ExpiresDefault "access plus 300 seconds" 
 ExpiresByType text/css "access plus 1 month" 
 ExpiresByType text/javascript "access plus 1 month" 
 ExpiresByType application/javascript "access plus 1 month" 
 ExpiresByType application/x-javascript "access</pre> <a href="http://www.davidxia.com/2012/03/how-i-increased-my-wordpress-sites-speed">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/03/how-i-increased-my-wordpress-sites-speed/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Setup HTTPS and Secure WordPress Admin With a Self-Signed Certificate</title>
		<link>http://www.davidxia.com/2012/02/how-to-setup-https-and-secure-wordpress-admin-with-a-self-signed-certificate?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-setup-https-and-secure-wordpress-admin-with-a-self-signed-certificate</link>
		<comments>http://www.davidxia.com/2012/02/how-to-setup-https-and-secure-wordpress-admin-with-a-self-signed-certificate#comments</comments>
		<pubDate>Tue, 28 Feb 2012 20:41:29 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Information Security]]></category>
		<category><![CDATA[Programming & Software]]></category>
		<category><![CDATA[self-signed certificate]]></category>
		<category><![CDATA[SSL/TLS certificate]]></category>
		<category><![CDATA[wordpress security]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2583</guid>
		<description><![CDATA[I got bored so I learned how to setup HTTPS on the admin parts of my WordPress blog. At first I was generating self-signed certificates because I read that buying a third-party verified certificate could <a href="http://www.clintharris.net/2009/self-signed-certificates/" title="self-signed-certificates">cost upwards of $100 per year</a>. 
 
Then I saw this <a href="http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars" title="How to obtain and install an SSL/TLS certificate, for free">Ars article</a> on getting a legit one for free. 
 
After enabling mod_ssl on Apache and following the Ars guide above, I was ready to secure the admin parts of WordPress. The <a href="http://codex.wordpress.org/Administration_Over_SSL" title="WordPress Administration Over SSL">general idea is to</a> <a href="http://www.davidxia.com/2012/02/how-to-setup-https-and-secure-wordpress-admin-with-a-self-signed-certificate">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/02/how-to-setup-https-and-secure-wordpress-admin-with-a-self-signed-certificate/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Deploy Python Web App with Apache&#8217;s mod_wsgi</title>
		<link>http://www.davidxia.com/2012/02/how-to-deploy-python-web-app-with-apaches-mod_wsgi?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-deploy-python-web-app-with-apaches-mod_wsgi</link>
		<comments>http://www.davidxia.com/2012/02/how-to-deploy-python-web-app-with-apaches-mod_wsgi#comments</comments>
		<pubDate>Tue, 28 Feb 2012 20:07:57 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming & Software]]></category>
		<category><![CDATA[apache mod_wsgi]]></category>
		<category><![CDATA[python flask]]></category>

		<guid isPermaLink="false">http://www.davidxia.com/?p=2630</guid>
		<description><![CDATA[For quite a while I couldn't figure out how to deploy Python web apps. But with patience and tinkering, I slowly figured it out. 
 
Here were my steps: 
 
<strong>1. Setup Domain</strong> 
 
I created an A record for python.davidxia.com in my DNS records pointing to the IP of the server on which I developed. 
 
 
<strong>2. Setup Apache VirtualHost</strong> 
 
I put this in /etc/apache2/sites-available/davidxia (using Ubuntu 10.04): 
 
<pre lang="shell"> 
 
 ServerName python.davidxia.com 
 
 WSGIDaemonProcess myapp user=www-data group=www-data processes=1 threads=5 
 WSGIScriptAlias / /path/to/myapp/myapp.wsgi 
 WSGIScriptReloading On 
 
 
 WSGIProcessGroup myapp 
 WSGIApplicationGroup</pre> <a href="http://www.davidxia.com/2012/02/how-to-deploy-python-web-app-with-apaches-mod_wsgi">more</a>]]></description>
		<wfw:commentRss>http://www.davidxia.com/2012/02/how-to-deploy-python-web-app-with-apaches-mod_wsgi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

