Huahai's blog

Data-Oriented Programming (DOP)

JSON is arguably the world's most popular human readable data format today.  It has largely replaced XML as the data exchange format on the Internet. One of the key reasons for the proliferation of JSON is its simplicity.  The data structure are very limited: only arrays, enclosed with []; and objects, enclosed with {}. That's it. It cannot be simpler.

Apparently, this dead simple data format is enough to represent the vast landscape of data that JSON becomes the de-facto data format for Web services. Most Web APIs we use today speaks JSON. However, JSON is not native for most programming languages. It becomes a pain to convert to and back from JSON in programming languages.

Switching to Spacemacs from Vim for Clojure/ClojureScript Development

Clojure has been my primary programming language for a couple of years now. During this period, I have relied on my trusty Vim text editor as the development environment. Coding Clojure in Vim had been an enjoyable experience with these excellent Vim plugins:

  1. vim-clojure-static
  2. fireplace.vim
  3. paredit.vim
  4. Rainbow Parentheses Improved
  5. vim-clojure-highlight
  6. vim-cljfmt



的变量啊”, variable for what? 后来明白了,原来就是一个地址可以存不同的东西啊


You don't need to *understand* mathematics, you just get used to it". 这种人



How to get a kitty manicure

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.


响应拜登副总统的“Buy a shotgun”的号召,我家买了一支泵动霰弹枪用于家防。这儿介绍一下这个枪的配置,配置的目标是让身材比较娇小的女性也可以比较容易地使用12GA的家防弹药。要不然,这个录像上的这些状况发生在Yunyao身上就不妙了。

Fixing Problems after Upgrading from Snow Leopard to Mountain Lion

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: Continue reading »

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

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. Continue reading »

Install Vim with Homebrew Python on OS X

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 Continue reading »

Start learning category theory

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!

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.

Syndicate content
Nice place