• 从变量说开来

    Posted on: Wed, 02/25/2015 - 22:07 By: Huahai

    数学的变量与计算机语言的变量不同。数学的变量更抽象,是真的变量。而计算机语言
    的变量是假的,其实还是属性,是某个内存地址或者寄存器的属性。

    一个非程序员A,第一次编程,看到变量,会很疑惑,比如我当年,“这是什么东西的
    的变量啊”, variable for what? 后来明白了,原来就是一个地址可以存不同的东西啊
    ,明白了。指针?这不是很明显么,就是地址啊,有什么难的?

    另一个非程序员B,第一次编程,看到变量,说,哦,我知道,数学上小学就学了的,
    变量就是数学上的变量啊,懂了。结果看到指针,panic了,数学上没有指针啊,
    到底什么是指针啊?

    人和人的思维方式不一样,从对数学的态度可以看出。有的人,比如冯诺伊曼,说“
    You don't need to *understand* mathematics, you just get used to it". 这种人
    就是上面的非程序员B。这些人成为数学家的话,一般会成为分析学家。中国培养出的
    职业数学家,大多是分析学家,比如张益唐之类,解决问题能力很强,一般不自己发明
    理论。

    另外一些人,比如Grothendieck,一定要把数学理解成某种结构才行,这种人成为数学
    家的话,会成为几何或者代数学家。这些人解决问题的能力不一定强,比如
    Grothendieck连57不是prime都不知道,但他发明了改变数学界的理论。这些人也是非
    程序员A。

    上述两种人可以用一个简单的测试来区分:给他一个玉米棒子,看他怎么啃。分析学家
    会啃得乱七八糟的,代数家会啃得一排排整整齐齐的。我有时在聚会时让大家做这个游
    戏,目前发现,中国人还是分析家居多。

  • How to get a kitty manicure

    Posted on: Wed, 09/04/2013 - 06:34 By: Huahai

    Speaker: Tom

    Dear fellow kitties, I am going to show you how to get a kitty manicure and pedicure.

    First of all, let me show you my beautiful finger nails. My mom polishes each and every one of them on a weekly basis. Such weekly pampering is essential for a purrfect kitty like me.

    Now, let me show you how to get a kitty manicure.

    First of all, relax and get each of your finger massaged. I like to sit on my mommy's lap to do the massage, but Mayori prefers to get her massage in her favorite bed.

  • 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". 

Subscribe to Huahai's Blog