Author Archives: purplechun

平淡宁静的电影

一直觉得,看电影是一种寻觅感觉的过程。推荐一些电影给大家,平淡、节奏舒缓、不讲大道理,只从帧里行间,凭借风一样的触手,拨动着观影人。希望这些电影能在这炎炎夏日,紧张浮躁的社会环境下带给大家心灵一丝平淡的安静吧。

(P.S. 影片挑选全凭个人感觉,如果看官感觉归档不妥,还请见谅)

(P.S.S. 没有写一些影评,一方面是因为自己文笔一般,另一方面是作为推荐的电影,还是大家自己来细细品味吧,我的感觉不重要,哈哈)

一、东京日和

导演: 竹中直人

编剧: 荒木经惟 / 岩松了

主演: 竹中直人 / 中山美穗 / 松隆子 / 浅野忠信 / 森田芳光 / 冢本晋也 / 三浦友和

Continue reading

那些年我们一起走过的高考

高考过去快两周了,对于我而言,已经是七年。七年本是可以抹掉很多记忆的,但不适用于高考。而由于不争气的我参加过两次高考,这种记忆尤为深刻。

第一次高考感觉来的很突然,虽然也在复习,也在看着黑板上的倒计时,也在毕业留影,但当它临近时,依旧还是不知所措,以至于我对于第一次高考的过程印象不是很深刻。

Continue reading

Premature optimization is the root of all evil

Today during the code review, an important lesson was learned.

If you wrote Hadoop reducer before, you will know that one Reducer host will have many keys assigned to it based on the partition method. And in the run() method, it will iterate the keys and corresponding values and pass them to reducer() method, so each call of reducer() will handle only one key and its values.

Continue reading

读余光中《寻李白》有感而作

酒在哪?剑在哪?
长啸一声,便是那狂,便是那痴
列子御风,我辈又岂草履于世?
庄周梦蝶,晓梦之中,既是那蝶,也欲冲破浩瀚九天
错它个破碎
笑它个七窍流血,断肠
做半个神仙,小半个妖怪
饮了那霸王的胆魄
牵着她易安的温柔
便是,那万面玲珑
活它个电脑,活它个睡觉,活它个出人头地,活它个人

附余光中先生《寻李白》:
Continue reading

fix STATIC_URL is empty in Django

When using static files in my Django application, the STATIC_URL is empty even I set it in the setting.py, after a few research, here is how I fixed it.

My static image files are located at movie/static/img (my application is movie)

1. in views.py

from django.template import RequestContext

if you use render_to_response, make sure you add context_instance=RequestContext(request) in it,

render_to_response('movie/index.html', {'movie_list': movie_list}, context_instance=RequestContext(request));

Continue reading

setup Django 1.4 on Godaddy linux economy host

In case you want to use Django framework in Godaddy’s Linux Economy Host, here is the steps:

1. Godaddy has virtualenv installed, so first, create a virtual environment venv: (I use $HOME/lib/ for all the installed stuff below)

cd ~/
mkdir lib
cd lib
virtualenv --no-site-packages venv

The python package folder is $HOME/lib/venv/lib/python2.7/site-packages

2. Install the latest Django through pip
pip install Django

Continue reading

setup Git on Godaddy linux economy host

There is no version control on Godaddy linux host, which makes the code deployment very painful. So here is how to setup Git on the Godaddy host.

In this tutorial, we set repository on the Godaddy host.

1. download the pre-build git binaries, Godaddy uses CentOS, and the binary is built under CentOS. (Thanks to here)
In your $HOME folder on Godaddy host

% mkdir lib
% cd lib
% mkdir git
% cd git
% wget http://www.lichun.cc/resources/centos5.2-git.tar.gz
% tar -xvzf centos5.2-git.tar.gz

Continue reading