UserWarning: module dap was already imported from None

I installed python-matploglib and python-mpltoolkits.basemap using apt, but when I tried to import Basemap using from mpltoolkits.basemap import Basemap, the following warning shows up:

usr/lib/pymodules/python2.7/mpl_toolkits/ UserWarning: Module dap was already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path
more ...

Why I Switched to Octopress

I used to blog on After a year or so, I finally decided to abandoned it and switched to Octopress + Github Pages. Here are the reasons and how I migrated to Octopress. Maybe because I was using, and those who use a self-hosted wordpress have something different to say, the way I see it, wordpress, at least, sucks.

more ...

OS161 Synchronization Primitives: RWLock

The idea of Reader-Writer Lock is quite simple. In normal lock, we don't differentiate the threads. That said, each thread who wants to enter the critical section must first acquire the lock. But on a second thought, you may find that threads actually have different behavior inside the critical section: some threads just want to see the values of shared variable, while others really want to update those variables.

more ...

Use Ant Exec task for Linux Shell Commands

Suppose we use cscope and/or ctags for indexing source code of our Java project and we want to update the meta data files (e.g. cscope.out, tags) each time after we compile. We can use the --post-comile target to accomplish this. Create a custom_rules.xml in your project root directory with the following content. This file will be included to your main build.xml file.

more ...