This is a test post for embedding spotify playlist in my blog:
youtube videos:
And also youku:
This is a test post for embedding spotify playlist in my blog:
youtube videos:
And also youku:

這海報設計……真差
前幾天和老婆一起看了《王的盛宴》,分兩節看的,第一天晚上陪老婆熬夜寫報告,困的不行,看了前半截,全都是劉邦一個人胡言亂語說瘋話,一氣之下到豆瓣打了個兩星,第二天早上起來把後面半段看完了,想了想,偷偷改成了四星。陸川除了技術上粗糙了一點,其實整個故事,以及背後的歷史觀都是引人深思的。當然也有些缺點,但不失為一部好片。順便吐槽一下豆瓣的評分,5.1實在太低了,我不知道是不是有水軍操作,但是確實不是這個片子的真實水平。
前半部份的故事大家都熟悉,我既不敘述了。真正的故事要等到最後1/4.呂後(秦嵐 飾)說服張良協(奇道 飾)助自己謀殺韓信,以及逼蕭何(沙溢 飾)就範的情節十分精彩。與我們以往所熟知的蕭何助呂後殺韓信的故事不同,陸川講述了一個完全不同的謀殺忠臣的故事。張良韓信蕭何三人私交慎密,呂後採取了各個擊破的辦法,先從對劉邦最忠誠的張良下手,利用呂後自己在張良家安插的暗探得到的情報,指出韓信其實確有“天下人當大同”的反心,然後動之以情曉之以理,告訴張良如想保命,只有“不做項羽”,放虎歸山。張良獻計,先卸了韓信的兵權(殺掉韓信在軍中的十三個部下),然後又除掉了韓信的謀士蒯徹(此人在我眼裡甚是厲害,真實歷史裏劉邦本來要殺他,但是他憑藉三寸不爛之舌為自己擺脫了烹殺之禍)。最後逼與韓信私交甚好的蕭何就範,協助呂後擊殺韓信。
項羽死前
忘了是在哪裡看到的,有人說不同的電影試圖販賣的東西不一樣,《東邪西毒》賣的是情緒,《東成西就》賣的就是笑點。當然還有很多很多電影是賣故事的。《王的盛宴》當然不只是賣一個故事(這個故事也不值得買了,大家看得太多了),但是毫無疑問楚漢相爭這段歷史,或者說劉邦這個人本身,有太多戲劇化的元素可以說,他有兄弟(樊噲,蕭何,夏侯嬰,張良,韓信……),有女人(彪悍的呂後,知己戚夫人),有神一樣的敵人(項羽),有籍籍無名的身世(區區亭長,小字劉季),有最後的勝利,有背叛(先入關中),也有被背叛(陳豨韓信叛亂)。他的經歷無論從哪個角度來說都是很精彩的。當然,起於無名的帝王的身世往往都是精彩的(豐臣秀吉,朱元璋,還有毛)。所以這段歷史無論如何書寫,如何解釋,都是很有意思的,也是中國人百看不厭的。
但更深層次的考慮是,為什麼帝王的故事會有故事性?在我看來,君王是封建制度的中心,他是一張大的關係網的中心,這個網上面有君臣關係,有男女關係,有父子關係,有江山社稷與芸芸眾生的互相依存,當然還有君王與自己的關係﹣﹣﹣那種獨居高處的孤獨、淒涼與無奈。正是這些複雜的關係,暴露了人性中一些很重要的東西(人與人之間的不信任,對權力的渴望,忠孝禮義……),處在這些關係中的人的選擇,才被人們津津樂道,反覆咀嚼。
說回《王的盛宴》,本片的戲劇性主要來源是王和將之間的不信任。韓信太強,一個人橫掃天下(林彪頗像他),所以劉邦對他有恐懼,而且他太年輕,劉邦快死時他才三十多,很容易對劉邦剛剛弱冠的孩子造成威脅,這就為為什麼劉邦處心積慮要除掉他。劉邦自己是被項羽在鴻門宴上放走的,他深知婦人之仁會惹來殺身之禍,所以他寧肯不在乎天下人的看法,不在乎忘恩負義的罵名,也要殺死韓信。這其中自然也有恐懼作祟,但是不得不說也是一個帝王合理的選擇。
韓信死前想到的是自己快樂地跑向劉邦大軍時的場景,他沒想到這次投奔是奔向了自己人生的輝煌,同時也是奔向了自己的死亡
假令韓信學道謙讓,不伐己功,不矜其能,則庶幾哉,於漢家勳可以比周、召、太公之徒,後世血食矣。不務出此,而天下已集,乃謀畔逆,夷滅宗族,不亦宜乎!–史記,淮陰侯列傳第三十二
陸川的本意當然不會只是販賣這個故事,故事的后四分之一講的其實就是劉邦呂後如何篡改歷史。歷史是勝利者書寫的,所以可以隨意篡改,這當然是老生常談了,但是每次思考這個問題,都讓我覺得有說不出的悲涼之意。韓信的死有其必然,但是隨著他的死,有太多不該逝去的東西隨之湮滅,當年一起狂奔在草原上的兄弟,最後卻互相殘殺,這種故事每每向來都是痛徹心扉的。隨之而來的是一種“不能說”的皇帝維權與政治黑暗,戾氣凜凜,從鴻門宴的客人(單純的漢子)變成鴻門宴的主人(身居宮中,行屍走肉的皇帝),這起中的嬗變讓人不寒而慄。這方面的話,我的贅述是不必要的,這片影評已說盡了我的想法。
除了上面的啰嗦,再多說兩句關於演員的,劉燁一向用力過度,吳彥祖一向當花瓶,張震倒是有張有弛,比較亮眼。當然,都是很帥的~順便說,這個虞姬真好看:

第一次認真寫影評,就這樣吧。:)
Yesterday My friend XX asked me what he should use with python and latex, and of course as an extensive vim user I applied “Vim!”. This passage is not technically a guide but rather a collections of tools and guides for beginner vim user.
Vim is a wonderful text editor. Since programming is almost all about text editing. A productive editor can help you save a lot of time. There are a lot of competitor out there, but two of them are oldest and have most fans. Every serious programmer have heard their names, Emacs and Vim. They both have a long history back up to the very beginning of computer science and although there is tons of debate online about which one is better, there is no absolute conclusion. To me, they are all quite good but I choose Vim over Emacs because it just fits me better. As a beginner I encourage you to give both of them a try and see which one works for you better. However here I will stick to Vim since it’s my favorite.
Look at this page:Vim Installation, If you are not using any rare operating system, you will be fine with this. This gives you an GUI version of Vim. And if you are using *nix systems(Linux/Unix), and you would like a terminal version of Vim, you can compile it by your own(also on that page) or using a package control system to do that for you. For mac user I recommend Homebrew and for Ubuntu or other Debian Linux distributions the apt-get can do the job for you.
1 2 3 4 | |
If you have installed the software. The first step is to have a look at
vimtutor. It’s a short tutorial on how to use vim. In *inx system this can be
done by typing vimtutor in command line if you have installed the
command line version of vim. If you are using a GUI version of vim then have a
look at the vim folder. If you cannot find it, If you cannot find it, use
this page, open
your vim and do every step on your own. It won’t take you long and After this
you will get the basic knowledge of how vim work.
Vim can be highly customized and you should learn how to set up your own Vim.
In a *nix system. In your ~ folder you will have a hidden file named
.vimrc and a hidden folder .vim, the .vimrc file is a configuration file that
Vim will read every time when it starts. The .vimrc folder on the other hand,
contains all the plugins, themes and other useful files needed by your vim.
For Chinese reader there is a very good blog about .vimrc file. Read it
here.
And for plugins, I used to manage them by hand. But now there is a plugin that
can help you managing other plugins, its called vundle.
Read through the page and install it by yourself. If you have questions, feel
free to ask me.
Here is my .vimrc file: my .vimrc file You can see I am using a lot of plugins, here is a list of part them:
And there are a lot of more to explore. For Chinese reader this page is worth reading (although it is a little outdated) and this pageis suitable for English reader(I highly rely on this one).
最近做了個大膽的決定,就是以後要用繁體字進行中文的寫作了。對於網絡上的繁簡之爭,我一向是支持簡體字的。我不主張全面恢復繁體字,因為畢竟是歷史遺留產物了,而且簡體字的改革無論如何已經實際發生了,讓大多數人改變習慣是不可能的。何況漢字簡體化是不可逆轉之趨勢,不應阻止。
而我用繁體子的原因很簡單,因為現有古籍並沒有充分簡體化,這方面的工作(我不是這方面專家,不敢妄言,只敢臆測)進度緩慢。而我立志要在25歲前讀些古書,所以用繁體字有利於我個人對古籍的理解和認識。當然,我的期望是中華古籍在專業人士的嚴格把關下,被大量譯成簡體字。這樣,我也省了重學繁體字之累。
至於古籍,先從註釋版的史記讀起。偶爾讀一兩篇,與自身語文素養,是很大的提升。
相比更年轻一点的时候,我最近甚少谈论中国政治了,想了想,原因有以下几点:
首先,我太年轻,没有经历过很多事,我觉得我自己没有资历谈论政治。当然不是说每个年轻人都不能谈论政治或者不具备谈论政治的能力。只是作为我个人,我觉得我说出来的很有可能都是错的。而且这几年网上喷子太多,理性的交流很少,写出来的东西搞不好要挨骂,或者要起论战,很没意思。当然书生意气有时候还是很美的,但是在我们这个年纪能做的也真的只有看一看,想一想,谈一谈。真的能改变(这个国家,这个民族)多少呐?很难说。
当然上面这些也都是找借口,更深层次的理由是我没有什么精神上的信仰。最开始我相信国家实力,以为强国就是一个国家的宗旨,后来相信民主自由,可是有太多人假借民主自由来说谎,为自己谋利。再后来我相信精英治国,可是我现在对精英的定义也说不清了。思想上的经常变化导致我很难说我到底支持什么,反对什么。
不过我开这个博客的目的就是记录,无论我日后的思想怎么变化,在当下这个大环境中,我相信有些真理是不变的,我想在此把他们列举出来:
还有就是对自己的期望,希望我能多读几本书,多思考。只有这样才能做过一个合格的公民。
I am a confident C programmer because I am quite sure how C will work, I mean, I like pointers, I rarely got confused by them. However, it turns out that most people don’t like dealing with *something, so they wrapped it into something else in higher level programming languages like java and python. This time they got me confused how would they work. After some investigation, I found the following fact about them:
In java, all things are passed by reference(except for primitive variables like int or float), however the reference is passed by value to the callee, it means if you assign a new “address” to it, it would not effect the caller. A example is list below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
In python, the model is more complicated, in my understanding, all objects in python is passed by reference(like in java this reference is also passed by value). In this context it seems to be possible to change an object inside a function, however, it is not true. There are some certain objects that is not for you to manipulate them inside a function. They are called immutable objects. Strings, tuples and numbers are immutable but others are all mutable.
I am not sure that I am 100% right about this. If you spot any mistake, please let me know.
Raspberry Pi can be accessed via SSH if you have enabled it. But entering the password every time can be annoying. So there is a simple way to get Pi to trust your PC/Mac and here is how to do it on a Linux/Unix machine.
First on your machine:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Now you copy the content of the file ~/.ssh/idpsa.pub and go to your
Raspberry Pi, and do this:
1 2 3 4 5 6 7 8 9 | |
Now you’re done with it.
这是一篇测试日志,用来测试中文输出。
I had an interview with Amazon UK about half a month ago. The position I applied for is 2013 Summer Software Engineering Internship based in Slough which is a small town near London. Here is a summary of the interview and hopefully it will help not only me but also you with the other interviews waiting ahead.
The first question is about a project I listed in my CV. A java GUI game project that I did last year when I was taking the Objected Oriented and Functional Programming. The interviewer asked about the difficulty of the project and How I managed to get through them. The hint here is you should be familiar with your projects, the best way is to have a review of them before the interview.
The second one is about coming up an algorithm in a short time. The question is: we have 199 numbers which lies in between [0,99], every number may or may not have a duplicate but only one is along, try find it.
It is not difficult to come up with a naive way to solve this. Here is a python function that should do the work.
1 2 3 4 5 | |
I have not test it in the real world but the idea of it is clear. However, have an algorithm is not enough, the interviewer will not stop here, he will change his needs a little bit and you have to modify your code to accommodate them. So practice your programming skills is quite important because that’s what rally matters here.
After that the interviewer start asking about OO design and analysis, you should be able to explain to him the concept of class, object and when to use inheritance. He also asked something about composition but since I have no experience on that I was confused on that question.
Then comes up the data structure part, the interviewer asked about how to design a set (hash table or associateve array would seem right here), and then he continues with what is a binary tree and what is a balaced tree. How do you convert a binary tree into a balanced tree( rotating ). Finally he asked me how to reverse a linked list(I will provide some c code here later).
You are inveited to ask some questions at the end of the meeting, but I am not sure if it is a part of the assesemnts. Anyway it’s the first time ever I was interviewed by someone and show my technical skills. I think my English is a issue here because I may not be able to express myself clearly. But it is a good practice for my future carrer.
My CV can be found at http://www.cs.bris.ac.uk/~bf1891/bobfang.pdf. If you are interested, Please contact me.