# I’m Zigang Xiao (Ivan), a PhD candidate in University of Illinois.

I write about technical stuff in the field of computer science, my hobbies, including guitar playing and ballroom dancing, and my study abroad experience in US. And yes, some of my posts are in Chinese ;)

# Sparse Signal Reconstruction via L1-minimization

- - posted in

This is a follow-up of the previous post on applications of L1 minimization.

- - posted in

# 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.

# Debugging AppleScript: Print to a File

- - posted in

Debugging AppleScript is easy when you work with the script editor, simply use log to print out anything in the console. However, after you compiled it to an app, this cannot work anymore.

I find there are several ways to do it in this thread. The two approaches that work best for me are:

# OS X: Reveal File in Console

- - posted in

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:

# OS X: Get Full Path of File Using Realpath

- - posted in

realpath is a command line utility that is included in most UNIX distributions but not Mac OS X. Thanks to Stuart Campbell, a minimal implementation is provided here, and my fork.

# Send Ctrl-a in Tmux After Rebinding to It

- - posted in

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

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.

# Batch Remove Photos in iPhone, Batch Convert Videos and Upload Back

- - posted in

One of the problems that drives iOS user crazy is the user-unfriendly manipulation/syncing of photos in iOS. There are just no easy way to remove photos in batch (though you can delete the entire camera roll in the settings).

# Fix (Ugly) Safari 7.0 Not Using Local Pac File

- - posted in

I found that Safari in Mavericks is not using local proxy.pac at all. Turns out because of sandboxing, it will not allow reading file from local. A traditional solution is to turn on Web Sharing, and thus use HTTP to read the pac file such as http://localhost/proxy.pac.

However, this cannot be done that simple, since Apple removed Web Sharing from normal version of Mavericks. To turn on the web service (Apache), do this:

Also, place the pac file under /Library/WebServer/Documents, which is the default Document Root of Apache.

Tom Fischer proposed another way to get around, however I don’t think it a good idea to mess around the system files.