Wednesday, 7 August 2013

Singapore Travel List

1. Merlion Park->Marina Bay Sands (Casino)->Gardens By The Bay->Singapore River (Bar/Jumbo/Xiaohonglou seafood)
2. VivoCity(Movie/Shopping/Nosignboardseafood/ThaiExpress)->walk to Sentosa (Universal Studio/Casino/Song of the Sea/Jumbo)
3. Somerset313->Orcahrd(Ippudo/DFS)
4. East Coast: BBQ

Tuesday, 6 August 2013

Set X11 Forwarding for gitk

Tools: Xshell, Xming, git
1) Install Xming. Run it.
2) Xshell setting: Connection->SSH->Tunneling, click Forwarding X11 connection to X DISPALY:(localhost 0.0);
3) ssh to you server, test X11 by command 'xclock &'; if X11 is set properly, then a clock would appear in you local desk.
4) install git (gitk is installed by default).
5) goto a git repo, type in command 'gitk &'; the GUI would come out automatically as :


Thursday, 4 July 2013

iPone App Development

In this blog, I will share some techniques/experience in developing iPhone Apps.

UIWebView is to display html content and other documents, e.g., pdf,  inside iPhone App.  It has three methods to load content to the view:
- loadData:MIMEType:textEncodingName:baseURL:
– loadHTMLString:baseURL:
– loadRequest:
Both content from remote server and local file can be loaded. By setting the delegate of the UIWebView instance, we can intercept the click actions on the view. For example,
– webView:shouldStartLoadWithRequest:navigationType:
can will be called whenever a request is to be sent from the html, i.e., a hyperlink is clicked. In this case, we can customize the click action(the target should be a link anchor) to segue to another view controller. We can also change the content of the view by calling javascript code:
– stringByEvaluatingJavaScriptFromString:

Monday, 10 June 2013

Vim configuration


I have known vim for a long time. But until recently, I get to know how to use it efficiently. The power of vim originates from its various plugins. Since there is no center repository for these plugins like textmate, some plugins are hard to install; Conflicts also appear now and then.

The first thing to do is to configure the compile parameters. Some options are turned on to support more plugins, e.g., command-T requires ruby is enabled by vim.

./configure --with-features=BIG --enable-pythoninterp --enable-rubyinterp --enable-gui=no --with-x --enable-cscope --prefix=/home/wangwei/software

Once vim is installed. The first plugin to download is pathogen, which helps to manage your plugins. Next, you can configure your .vimrc file for window split, cursor moving, folding, etc. A good example is from nvie. The most frequently plugins I am using are: NERD-Tree, which is a file system explorer; Pyclewn, a plugin for gdb and pdb; vim-flake8, which is a superset of pep8 and pyflake for python syntax and style check. Python syntax folding, a plugin for python code folding based on syntax(the default folding/unfolding toggle is the space key).

Pyclewn puts the standard output into /dev/null by default. To display the standard output, open another terminal, type tty command(let the result by /dev/pts/11), set the tty in vim by : Cinferiortty /dev/pts/11.

Wednesday, 5 June 2013

IntelliJ+Maven

I didn't know IntelliJ IDEA until last week, when I set up the develop environment for a project. But after using it for one week, I have to say it is an excellent tool for coding and source view.

Similar to ecllipse, IntelliJ IDEA has many plugins, such as MavenScala . But it integrates these plugins much better than ecllipse. For example, maven project can be imported and built easily as the video shows:


To debug the maven project, you need to install it firstly, which downloads the dependent libraries, compiles your project and installs it into your local maven repository. Then, you can set breakpoints in your source code, and start debug through IntelliJ's debug tool.

IntelliJ also supports source view well. Source insight is well known for viewing c and c++ code. But for java and scala, IntelliJ would be a better choice. It provides definition jumps, function list, folding etc..

Last but no least, Git is integrated as default.

I will update this page later when I learn new features of IntelliJ.

Sunday, 23 September 2012

雅与俗

朱自清有一文《论雅俗共赏》,讲从古到今,文学作品在文字、体裁和内容上都经历了从雅到俗的渐变过程(如诗比词雅,词比曲雅)。我想这个过程也延续到了如今。相比民国时期,而今的作品更为通俗大众化,尤其网络文学,不乏情色、暴力、低俗之物。但再早的作品又过于高雅,似乎只能供学堂里细致地学习分析。唯有民国的文人、文学作品在雅与俗之间恰到好处,所以常常有感民国的文人格外风趣。“俗”我指的是话题大众化,“雅”则指起语言文字或者意旨优雅。刚看了朱自清的《女人》,体现的尤为贴切。

文章讲述了男人在街上看女人时的情形,描写的十分有趣,如“在路上走,远远的有女人来了,我的眼睛便像蜜蜂们嗅着花香一般,直攫过去。但是我很知足,普通的女人,大概看一两眼也就够了,至多再掉一回头。像我的一位同学那样,遇见了异性,就立正——向左或向右转,仔细用他那两只近视眼,从眼镜下面紧紧追出去半日半日,然后看不见,然后开步走”。和“乖子望一眼,呆子望到晚相应,重庆话里面有个词---“打望”,专指此事,可见这一现象的大众化。但是紧接着,文章就言及“艺术的女人”,也就是说对女人的欢喜热爱,追寻,是一种对艺术的热爱。。。其解释没有半点矫揉造作的成分,读来颇有意味。

“所谓艺术的女人,有三种意思:是女人中最为艺术的,是女人的艺术的一面,是我们以艺术的眼去看女人。而“艺术”一词,我用它的狭义,专指眼睛的艺术而言,与绘画,雕刻,跳舞同其范类。”“女人的圆满相,只是她的“人的诸相”之一;她可以有大才能,大智慧,大仁慈,大勇毅,大贞洁等等,但都无碍于这一相。诸相可以帮助这一相,使其更臻于充实;这一相也可帮助诸相,分其圆满于它们,有时更能遮盖它们的缺处”
简单说来,此处的“艺术”就是仅指女人的外表,或者说纯粹的外在美。只不过说的更为雅致。


不知女人们自己如何看待“艺术的女人”一语,是赞同抑或鄙夷男人们的色态。不过文章认为不独男人欢喜赞叹,女人也欢喜赞叹;而“妒”便是欢喜赞叹的另一面,正如“爱”是欢喜赞叹的一面一样。”


再《围城》里方鸿渐跟其父亲对信的一段,每每读来都拍案叫绝迩来触绪善感,欢寡悉殷,怀抱剧有秋气。每揽镜自照,神寒形削,清癯非寿者相。窃恐我躬不阅,周女士或将贻误终身。尚望大人垂体下情,善为解铃,毋小不忍而成终天之恨。” 其父的回信更有意思,“吾不惜重资,命汝千里负笈,汝埋头攻读之不暇,而有余闲照镜耶?汝非妇人女子,何须置镜?惟梨园子弟,身为丈夫而对镜顾影,为世所贱。吾不图汝甫离漆下,已渝染恶习,可叹可恨!且父母在,不言老,汝不善体高堂念远之情,以死相吓,丧心不孝,于斯而极!当是汝校男女同学,汝睹色起意,见异思迁;汝拖词悲秋,吾知汝实为怀春,难逃老夫洞鉴也。若执迷不悔,吾将停止寄款,命汝休学回家,明年与汝弟同 时结婚。细思吾言,慎之切切!

Sunday, 9 September 2012

Revolutionary Road

电影的基调给人一种舒适感,一个人静静的观看很有feel.

"people never forget the truth, but get better at lying.." 印象最深的一句台词,是April和Frank争吵时讲的。个人感觉,其实April也非一个因为理想而抛弃一切甚至生命的“革命”女性。所以她计划去巴黎当文秘,而不是表演。更大程度上来说,她的出发点就是摆脱枯燥无味的家务,急迫地想对现实生活做一些改变。所以她说不一定非去巴黎(只要离开就行)。同样,Frank刚开始接受April的建议也是因为他对当前无聊的工作极度厌烦,他甚至都还不清楚自己喜欢做什么。所以当老板给他提供了一份薪水更高的职位时,他对去巴黎的计划产生了犹豫并决定放弃。