I'm Zigang "Ivan" Xiao,
an engineer in bay area.
I have a cat called Moose.

about me

I write about technical stuff in the field of computer science, with a focus on Machine Learning, my hobbies, including guitar playing and ballroom dancing, and my life in US. Some of my posts are written in Chinese.

Replacing SATA Cable in Mid 2009 MBP

- - posted in diy, mac

Replacing MBP cable
Replacing MBP cable

Recently, my mid 2009 MBP (Model A1278) fails to recognize the hard drive. My first bet was another disk failure on me, but it was not the case. I took down the hard drive and put it to a mobile hard drive case and it can be read smoothly.

My Octopress Blogging Flow

- - posted in blogging, octopress

Writing in Sublime Text and previewing in Marked
Writing in Sublime Text and previewing in Marked

After blogging with Octopress for a while, I have already gained some insights on it, and my publishing flow has been smoother. I think it is right time to share my flow as a reference.

A Comparison of Least Square, L2-regularization and L1-regularization

- - posted in machine learning

Recovered Coefficients by Different Methods
Recovered Coefficients by Different Methods

Problem Setting

Ordinary Least Square (OLS), L2-regularization and L1-regularization are all techniques of finding solutions in a linear system. However, they serve for different purposes. Recently, L1-regularization gains much attention due to its ability in finding sparse solutions. This post demonstrates this by comparing OLS, L2 and L1 regularization.

OS X: Reveal File in Console

- - posted in osx, tips

One of the neat things you can do in OS X is to reveal a file in Finder.app from some other applications. Turns out lots of the time, we also want to do that in the terminal. The following script helps you with that:

Send Ctrl-a in Tmux After Rebinding to It

- - posted in tips, tmux

While tmux provides much better functionality than screen, most of us that work with tmux have been using screen for a long time, and it is more comfortable for us to use ctrl-a than the default ctrl-b, which is finger-strechy. Thus the first thing I will do after installing tmux is to rebind the prefix to ctrl-a. That gives us the most handy way of swapping last two windows by typing ctrl-a ctrl-a.

Source-highlight for Matlab/octave

- - posted in homebrew, matlab, tips

I recently worked with Matlab a lot. When in console, sometimes I want to use less to quickly examine the file content, and I have already set it up such that it uses source-highlight to output colorful escape sequence to the console. However, source-highlight does not come with a syntax support for Matlab by default. Luckily, this post and this (in Chinese) provides a solution.