Tuesday, 27 July 2010

daily snippet 2010.07.27

1. Fix the work station. It can't fire up monitor. Turn out that the vedio card is broken. The vendor just give me a new one.

2. Learned a cool PS technique: create realistic water surface in PS. Below is my homework.
3. Watched Toy Story 3. It's good but not as the comments.


Monday, 26 July 2010

snippet 2010.07.26

Investigate how to build a portfolio. Learned several PS tips.

1. SimpleView is a flash-based web portfolio. It can be embedded into HTML easily.

2. A guy invented a way to make ordinary photo look like infrared photography.

3. A unique way to make skin smooth while retain texture.

4. Subject extraction and fine-tuning with mask.

Tuesday, 22 June 2010

Programmatically log on to a website using GAE(Google Appengine)

In GAE, urllib2.urlopen() series methods eventually call GAE's urlfetch() to do the job. At the time this post is written, there's no way to let Urlfetch understand cookie.

After some time, I found a solution here. It worked fine by far. Maybe some day I'll improve his class to some extent. My next app will heavily use this function.

Monday, 14 June 2010

How I bind custom domain name for GAE(in China mainland)

This is the third day spent on binding my custom domain to my app. I'm exausted and want to record the path I've gone. According to Google's manual page, this task should be very easy, which is true, for users OUTSIDE of PRC of course.

1. I tried as Google's official method, namely adding a CNAME to ghs.google.com from my domain admin tool and other stuff. This doesn't work for people in China because their goverment has blocked virtually of IPs of ghs.google.com.

2. After some googling I found loads of pages wrote by Chinese guys tring to solve this problem. They simply add A record pointing directly to one of the IP of ghs.google.com which was not blocked by the GOV. This is bad since using ghs.google.com is for load-balancing. Actually, this method won't even work since all IPs were blocked.

3. I tried DNS forwarding. Failed because no DNS server in China provide URL forwarding service and yahoo.com's forwarding service is blocked by GOV.

4. I figured maybe I'll have to use a third-party host to redirct for me, via the famouse .htaccess config. So I started searching for web hosting service. There are bunchs claiming to provide free web hosting. None of them function after the long registeration process. In fact, they share similar signing up UI and even identical tone when persviding you to their paid service. I spent more than one whole day registering various 'free' web hosting sites and almost want to kill myself in the end. The case is better in China, first there's no free providers, and the charging ones need some lisence from GOV. We are so living in a free country here!

5. Finally I found a free DNS forwarding service that is not blocked by our dear old GFW. I can't reveal its name in case our human rights activists will use it too much and bring GFW to shut it down. Yes, it worked.

I must say googling all day is not much fun and made me throw up. All the tools I used building the app is free, but using them in China need us to pay extra labor. Thanks to this great goverment.

Wednesday, 21 October 2009

Found a bug in emacs ange-ftp(used by tramp)

Ever troubled by tramp asking you the question

"changed on disk; really edit the buffer? (y, n, r or C-h) "

every time you try saving the file in a remote server? Unfortunately, I had been haunted by it for two months.

Emacs 23 and Emacs 22's tramp, when used in ftp method to edit file in a remote machine, has the problem above. The solution is simple.

1. Open your ange-ftp.el.gz. Mine is at ~/local/share/share/emacs/23.1/lisp/net/ange-ftp.el.gz.

2. Find the line
(restore-buffer-modified-p mod-p)
And comment it out using ;;

3. Save ange-ftp.el.gz.

4. Add a line in your .emacs:
(load-file "~/local/share/share/emacs/23.1/lisp/net/ange-ftp.el.gz")

Restart emacs and it should be OK. This solution is kind of ad-hoc but it works perfect for me. The saving modified file trigger will still be there when it should. I'll take further investigation to it during my leisure time.

Sunday, 4 May 2008

不做戏子了

很jn去了圆明园,初夏的生机并不适合那里的气质,散落山间的欧式巨石废墟以及水草蔓延的湖都属于秋天的萧索或者严冬的坚硬。聊了很多关于寂寞和独处,简单记下我的心得。

回想小的时候其实是很内向的孩子,从不主动说话的。后来被环境灌输了一种认识:外向开朗是优秀的,内向不好。在此后漫长的岁月里逐渐变成了一个很喜欢表达的人。表达是一件使人感到舒服的事情,和某种满足感紧密相连。于是便成了现在的我。

然而我现在更愿意相信,那种抓住任何机会表达自己感受的品性,其实才是劣等和浅薄的。那样的感情往往是虚伪,至少是幼稚的体现。深刻丰盈的感情使用克制来表达而不是高昂的声调或者标新立异。

我需要获得这样一种品质:分清内心世界和外在的客观世界,哪怕内心已经崩溃到一片狼藉,依然有力量维护客观世界里的自己。让我想起“美丽人生”的故事,纳什需要辨别出自我想象出的人物和客观存在。在一些意义上,我们每个人都有和纳什同样的困扰,往往在生理上我们是健康安全的,没有来自温饱或者生存的压力,毁灭的力量来自我们的内心。那是我们无法逃避的艰难,每一天我们都要经受考验。

当内心承受痛苦时,努力完成客观世界对自己的期待,可以出于责任感,更应该处于对于自身生命的尊严和骄傲。这是一条修炼的旅途,或许彼岸既是救赎。学会独自承受内心的痛苦,不必依赖任何人,直面自己的苦难,学会通过调节战胜将内心拖入沉沦的力量。

Saturday, 3 May 2008

“对于生命更大,更坚定的信心”

我想我需要如实地记录下来自己的感受,可以让事情模糊不清,但对于感受必须力求准确,不刻意使用自认为优美的句子或某种动人的风格,寻找属于我的语言。我需要将这些过程作为发现自己的努力,尝试透过层层的记忆,去发现隐藏于背后的关于我自己和这个世界的真相。

这些天时常会感到压抑,不知道是因为Google的工作压力还是对zz的感情,如果确有感情而非我的幻想的话。我总是很容易对一个漂亮的女孩动感情,受到一些类似牵挂或者换得患失的情绪的控制,但来的快去的也快。这是令我厌恶的自己,也有一点点怜惜。也正是这个自己,使得我很难和有好感的人相处,好感越强烈就越困难。我会不由自主地做出讨好取悦对方的举动,然后紧张地等待对方的反应,对“人家不喜欢我”的任何证据保持敏感,并由此引发各种悲观的胡思乱想。往往是别人其实丝毫没有褒贬的意思,自己心里却几度波澜。

这不是好的或者说成熟的心态。“无欲则刚”,什么是欲呢?我想,“欲”里面有希求回报的意思,比如我若对她有二分好,就会期待对方换我一二分,我若牵挂她就一定希望她也挂念我,若是发现相反的证据便立刻生出不好的情绪,可能是伤感,可能开始怀旧,可能对周围失去热情,可能感到压抑。这种“欲”也许可以被一种更无畏的或者更宽容的态度所取代。看到一句话,“生命的意义在于奋斗,而不是索取”,如果把它稍作延伸,是不是可以说,我们的快乐应该建立在付出上而不是建立在回报上?我想对于工作和感情,这都是极好的态度。认真做事,从中发现乐趣和责任,看到简单事情的深度和广度,因自己的专注而感到充实;真心地待人,包括普通的朋友,自己喜欢的女孩子,以及吸引我的各种人。摒弃“我对她好而她不理我我就一定不能再理她否则是犯贱的逻辑”。用真诚取代目的,处于诚意的讨好才不是取悦,否则只会招来鄙视,或者来自别人,或者来自自己。