Euclid’s Algorithm


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.

Common Divisor Divides Integer Combination

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|a \wedge c|b $$


$$ \forall p, q \in D: c|(pa + qb) $$


$$ \begin{aligned} c|a \implies & \exists x \in D: a = xc\ c|b \implies & \exists y \in D: b = yc\ & \forall p, q \in D: pq + qb = pxc + qyc = (px + qy)c\ \implies & \exists z \in D: pa + qb = zc\ \implies & c | pa + qb \end{aligned} $$

Dieter Rams – Less but Better


I just finished reading the monograph Dieter Rams: As Little Design as Possible. 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 player without a clear case.

How to Install Vim 7.3 on Ubuntu 10.04 With Ruby and Python Support


I wanted to use Vim’s Command-T plugin (via this awesome Vim config) 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

vim --version

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:

sudo apt-get remove vim-common vim-runtime vim-gtk vim-gui-common
sudo apt-get build-dep vim

Then I compiled the latest version of Vim (7.3 as of this writing) from source:

hg clone vim
cd vim
./configure --enable-pythoninterp --enable-rubyinterp
sudo make install

If you don’t have Mercurial hg run:

sudo apt-get install mercurial

Don’t Call Me Smart


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.

David Foster Wallace on American Consumer Culture


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 “one enormous engine and temple of self-gratification,” which works very well in growing the economy but doesn’t nourish other parts of people.

For young people in America, there are very mixed messages from the culture. There’s a streak of moralism in American life that extols the virtues of being grown up and having a family and being a responsible citizen. But there’s also the sense of do what you want, gratify your appetite because when I’m a corporation, appealing to the parts of you that are selfish and self-centered and want to have fun all the time, is the best way to sell you things…[This is one more example of] the American economic and cultural systems that work very well in terms of selling people products and keeping the economy thriving do not work as well when it comes to educating children or helping us help each other know how to live and to be happy.

How I Increased My WordPress Site’s Speed


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.

1. Leverage browser caching

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:

<IfModule mod_expires.c>
    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 plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"

How to Deploy Python Web App With Apache’s Mod_wsgi


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:

1. Setup Domain

I created an A record for in my DNS records pointing to the IP of the server on which I developed.

Support This Kickstarter Project


I browse Kickstarter regularly looking to fund projects and to trigger my creative juices. There’s many projects dedicated to iPhone and iPad covers and accessories, so it’s refreshing to discover meaningful and unique endeavors like “Realizing Empathy: An Inquiry into the Meaning of Making”.

The creator, Seung Chan Lim, has written a book on what it means to make something. I knew I had to back his project when I saw it. I can tell he spent a lot of time thinking philosophically and practically about what he does. The book seems like a treasure trove of insight.

There’s only 17 days left, so please fund this project. I want the book. And watch the videos he’s put up. They are fantastic.

Making History


Final paper submission on December 12, 2009 for Columbia University’s Nonfiction Workshop class.

China has a long history of forgetting its past. When intellectuals criticized the first emperor in 213 BCE for burning classical books that could undermine his rule, he buried them alive. Two millennia later, Mao Zedong told throngs of teenage Red Guards to incinerate genealogical books, shatter antique pottery, and kill intellectuals during the Cultural Revolution. Political leaders saw China’s traditional culture as a backwater, and remembering was not important. Despite this cultural destruction, much has survived, and much more has been revived. In the summer of 2009, I tried to salvage my own piece of the past. I tried to write my family’s history. I am still trying.