• Fixing Problems after Upgrading from Snow Leopard to Mountain Lion

    Posted on: Mon, 09/24/2012 - 01:28 By: Huahai

    The IT department of my company has been urging us Mac users to upgrade OSX to Lion a long time ago. After getting a few papers submitted last week, I finally got around to upgrade the Snow Leopard for my Macbook Pro work machine. Since I couldn't find Lion on Apple Store any more, I decided to go straight to Mountain Lion. The download and installation went smoothly, and most things seemed to work after the upgrade. Here are a few things that broke and the fixes I found.

    SSH with public key

    Mountain Lion changed a few things that broke password-free SSH access to and from OSX using public/private key pairs.

    SSH from Mountain Lion to older SSH severs:

  • Count Number of Maps: First Exercises of Conceptual Mathematics in Clojure

    Posted on: Wed, 05/16/2012 - 21:33 By: Huahai

    As previously mentioned, I am learning category theory, beginning with Lawvere's Conceptual Mathematics book. This is a very elementry book that assumes almost nothing as a background. However, it is still a math book, which requires doing some exercises. Since the book provides no answer to exercises, I decide to make my own and post them here as I did them. Hopefully someone will find them useful.

  • Install Vim with Homebrew Python on OS X

    Posted on: Wed, 05/16/2012 - 05:50 By: Huahai

    For people that need full features of vim, the default installation of vim on Mac OS X is definitely not enough. For example, I need to use vim to post to this blog, which requires a version of vim with python support. I also prefer terminal version of vim to the GUI version, so MacVim is less desirable.

    One way to get what I want is to compile a version of vim with homebrew. Homebrew does not officially have a vim fomula, because that would be a duplicate of the system version. Fortunately, we can grab an unofficial formula at
    https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb

  • Start learning category theory

    Posted on: Mon, 04/30/2012 - 08:48 By: Huahai

    Perhaps due to my rather small brain (literally), I dislike remembering tedious details. When in elementary school, I hated reciting classic Chinese poems, but liked composing my own :-).  In high school, I hated chemistry but loved physics, because one could do everything based on a few principles in physics, whereas chemistry was all about memorization. Last year, I was chatting with a colleage of mine who had a Ph.D. degree in chemistry from Harvard. He said he's good at it because he could find patterns in all the tedious details and summerized them in his own head, so he didn't have to remember them all. So I said why not write those patterns down so others can benefit, and he didn't seem to like that idea. Anyway, let's go back to the main topic.

  • It's official: Tom is a Nebelung!

    Posted on: Sat, 03/24/2012 - 23:07 By: Huahai

    When Tom (唐唐)was adopted from the animal shelter, his papers listed him as an "American Domestic Long Hair". As new cat parents, we were eager to find out his true breed. We searched and searched online, and identified him as a Chartreux, based on his fur color and personality. We knew that Chartreux is a short hair cat but Tom has long hair, but we thought Tom must not have been a pure breed. We always joked about Tom's purpoted French origin and attributed his love of bread and butter to his French ancestry.

  • Why category thoery is fundamental yet hard to understand

    Posted on: Sat, 01/07/2012 - 07:02 By: Huahai

    Category theory is mathematical theory about mapping. Some call it the foundation of mathematics.

    According to my understanding of math as reproducible mental object, this is not supprising. As all the brain does is doing mapping. Or in Plovian's words: conduction. Signals going from one set of neuros to another.  Understanding mapping is fundamental obviously.

    Now category is billed the hardest to understand branch of mathematics, also known as "abstract nonsense". 

  • Are you Han? My paternal ancestry - Hypothesis

    Posted on: Wed, 12/28/2011 - 07:02 By: Huahai

    I was brought up as a Han Chinese and I myself have never doubted that identity.  However, I do know that I look slightly different from people around me when I grew up. Darker skin, slightly curly hairs, deeper set eyes and other distinctive facial features. Put it simply, my face does not look like an average Han male face. However, nobody really said anything about my appearance except that my old brother occasionally joked about it (he looks like a normal Han Chinese by the way). After all, I look just like my father.

  • Display LaTeX Math on Drupal with MathJax

    Posted on: Mon, 07/18/2011 - 21:19 By: Huahai

    MathJax seems to be the emerging standard for displaying math on the Web at this moment. It is supported by American Mathematical Society and American Physical Society, and has already been adopted by major math related discussion venues such as Physics Forums and Stack Exchange. MathJax displays math using CSS and Web fonts instead of images, so the quality is very high and is resize-friendly. Below are some examples:

    Inline math: the geometric product $\boldsymbol{uv}$ of vectors $\boldsymbol{u}$ and $\boldsymbol{v}$ is $\boldsymbol{u}\cdot\boldsymbol{v} + \boldsymbol{u}\wedge\boldsymbol{v}$, where $\boldsymbol{u}\cdot\boldsymbol{v}$ is the inner product and $\boldsymbol{u}\wedge\boldsymbol{v}$ is the outer product.

  • Upgrade Drupal with Almost Zero Down Time

    Posted on: Sat, 07/16/2011 - 09:17 By: Huahai

    This site was setup in 2007 with Drupal 5, and it has not been upgraded until today. I did not feel the need to upgrade since this is just a personal blog. A few days ago I wanted to install a module, but Drupal version 6 is required, so I thought it's finally the time to upgrade Drupal. This Drupal upgrade tutorial suggests to first take down the site to upgrade, but I do not like that. It turns out that more than a few days of work are required to bring back a fully functional upgraded site, so taking the site down to upgrade is not a good idea. Below is what I did to upgrade this site from version 5.3 to 6.22 with almost zero down time (well, maybe a few seconds, I didn't time it).

Subscribe to Huahai's Blog