• Run shadowsocks in a router with OpenWRT to unblock the Chinese network block

    Recently Shawdowsocks has become a lot more popular in China. We use it to break though the Chinese network block so that we can visit Google without blocking. If you’re living in China and have the demand of visiting websites like Google, Twitter, YouTube and BBC, Shadowsocks is a great choice to build your proxy server. However, if you’re no...

    Read on →

  • Never use mutable default parameters in Python

    When writing a Python function, you may need a list as default parameter. One may write a function like this: def test(q=[]): q.append(1) return q This function seems to be well written, whereas when calling it without a given parameter q, you may run into trouble. >>> test() [1] >>> test() [1, 1] >>> tes...

    Read on →

  • Understand how Git works in 5 diagrams

    Git has been a perfect choice for Version Control System. With git we can promptly switch between different revisions from our project, logging every line changed from the code, and check the difference between any two revisions. In this article I’m gonna explain you how Git objects, the most important part in Git, works. Git Obejcts If you h...

    Read on →

  • Install cx-Oracle on Mavericks correctly

    cx-Oracle is a Python Oracle DB connection package, ealier today I met some trouble installing on my macbook running Mavericks, after hacking I found the means to install it correctly: Download instantclient-basic-macos.x64-11.2.0.4.0.zip and instantclient-sdk-macos.x64-11.2.0.4.0.zip from http://www.oracle.com/technetwork/topics/intel...

    Read on →

  • Some questions you may be asked during a Python job interview.

    It’s fairly easy to learn the Python syntax, but Python as a full-featured language, is not that easy to be fully mastered. In my experience, these questions are the most likely be asked during a job interview about python, I wrote down the answers, hope that may help you! Q: What is lambda operator in Python, how do you use it? A: The lambda...

    Read on →