Category Archives: Uncategorized

Install Python 2.7 for CentOS 6

CentOS 6 uses Python 2.6 by default.

The following is how I install Python 2.7 and Django with official packages.

$ yum install python27 python27-devel python27-setuptools

$ yum install libffi-devel openssl-devel

$ pip2.7 install requests[security]

$ pip2.7 install uwsgi virtualenv virtualenvwrapper Django MySQL-python

Then uwsgi will use python2.7 automatically.


Notes on Android Multiple Threads

Service, IntentService, HandlerThread / Thread, AsyncTask.

Which one to use? What should be noticed?

Here is a comparison:
Notice parallel problem on various Android versions for AsyncTask:
Lifecycle of Threads should be considered carefully.
Threads are still running even if main thread has called finish().
Application components running in the process that’s killed are consequently destroyed. (