Thursday, December 3, 2009

arXiv RSS author name problem in Google Reader

I like google reader a lot. But one thing about it makes me very frustrating - it does not display the author name in arXiv RSS feed correctly. Basically, arXiv provides feeds with linked author name, and google reader decides to use the HTML source code instead of parsing it into nicely formatted text.

Well, I just learned that by adding ?version=2.0 to the end of arXiv feed URL solves this problem, i.e.,
http://export.arxiv.org/rss/cond-mat?version=2.0

Thursday, June 18, 2009

Outer: Construct matrix from lists

In Mathematica, a quick way to construct a matrix from lists is through Outer. Let us consider two lists defined as
a={a1,a2,a3};
b={b1,b2};
Then the following command
Outer[f, a, b]
gives a matrix of the form
f[a1,b1] f[a1,b2]
f[a2,b1] f[a2,b2]
f[a3,b1] f[a3,b2]

A practical example is given below. Consider d-band electrons with spins. There are five d-orbitals and two spin states. Suppose orbital and spin stores the orbital and spin part of the state vector. The complete basis can be obtained by
Flatten[Outer[Join, orbital, spin, 1], 1]

Sunday, June 1, 2008

Unison: An Elegant File Sync App

Ever since I got an 24" iMac at work, how to sync between this iMac and my MacBook has being a problem for me. First of all, the place I work has a very tight security policy and everything has to go through either VPN or an SSH gateway. I eventually figure out how to do SSH tunnel, but that's the topic for another day.

Once I set up the SSH connection between the iMac and the MacBook, it is easy to use rsync to sync files. However, I am not really into this whole command-line thing, otherwise I'd just get a linux box. Fortunately, I found this nice little app called Unison, which provides a GUI for Mac OS X. The setup is straightforward. There is only one catch: both machines should have Unison installed. I actually found this out by scanning through the console log. One small complain: there is practically no documentation, everything has to be found through google.

Below is quoted from Unison website
Unison runs on both Windows and many flavors of Unix (Solaris, Linux, OS X, etc.) systems. Moreover, Unison works across platforms, allowing you to synchronize a Windows laptop with a Unix server, for example.


Since I cannot find a screenshot of Unison running on OS X on its website, I figured it'll be helpful to upload one here:

Tuesday, May 27, 2008

Sold on Firefox - Zoom In Just Gets Better

Two pictures worth a thousand words.

Web pages in Firefox after zoom in



Web pages in Safari after zoom in



That's right. Firefox not only increases the font size, it increases the size of everything proportionally.

Tuesday, May 13, 2008

Plain text in Mail.app by default

I generally prefer plain text when writing emails. However, in the place where I work, a lot of people use Microsoft Outlook or its web version. By default, it sends out emails in HTML. Even worse is the fact that the font size in those emails is too small. To reformat all incoming email and display them as plain text, quit Mail.app, type
# defaults write com.apple.mail PreferPlainText -bool TRUE
Relaunch Mail.app and enjoy.

To revert back, use
# defaults delete com.apple.mail PreferPlainText

Thursday, May 1, 2008

find

One thing about sharing files between Windows and Mac via a USB is that the USB has to be formated in fat32. Then all the files copied from Windows will have the file mode x enabled. Manually removing it for each file is very cumbersome because for directories you do want to keep the x mode. This can be done easily using find
# find . ! -type d -exec chmod -x {} \;
Another example is
# find . ! -type d -exec xattr -d com.apple.quarantine {} \;

Monday, April 21, 2008

Bluetooth unavailable? Reset SMC!

I don't know when did this happen: bluetooth in my MacBook suddenly becomes unavailable. System profile shows me no bluetooth device is detected. Just last week I transfered some photos from my cell phone to my MacBook, and now this?

After some googling, I found the solution: Reset the SMC unit. OK, unplug the AC adapter, remove the battery, hold on the power button, and 5 seconds later, my bluetooth is back.

My friend il actually had another problem with his MacBook: iSight no longer works. Guess what he did...... Reset SMC!

What else CANNOT be fixed by resetting SMC?