Using content hashing to avoid the double post problem

For those who have not encountered it, the double post problem (orthe double comment problem) happens when your web system is just slowenough to respond that the user clicks 'Post ' again intheir browser and re-submits the same post/comment/what have you. In astraightforwardly implemented system, this results in a second copy ofthe comment or post appearing.

(This is of course a specific instance of a general double submissionproblem for all web forms.)

I worried about


撲飛難過撲水

踏入秋天以後,蘭開夏道就開始有人吹saxophone。Frankly,我對這種樂器向來沒有好感,叭喇叭喇的吵死人。浪漫?You're kidding!我還打算報警。


我一邊為這噪音而生氣,一邊為買不到李傳韻獨奏會的門票,傷心了整整五秒鐘。李傳韻不

似是故人來

自從中大校長劉遵義與張國榮外甥女麥嘉軒共譜戀曲,促成他倆邂逅的「經濟機遇委員會」,應該改名為「經濟艷遇委員會」。這委員會只開會五次,you see!有緣的話,五次就夠。我一年開會五百幾次,怎麼又不見我有什麼艷遇

迪士尼的末日情懷

女人,既然愛起來可以很狂,絕起來自然也可以很絕。就看Joyce,跟那個已婚飛機師苦苦癡纏了一個世紀,有天突然click一聲想通了,竟然話散就散!她辭掉了航空公司的工作,把一頭長髮剪得極短,拜山的時候順便燒掉那狗公寫過

In security, you need to stop the root mistake

Here is something that I have become more and more convinced of: if youwant to actually solve a security problem, you need to stop the rootmistake.

Many security problems have various surface issues that you can target,and then they have one (or more) root mistakes. It is tempting and easyto target surface issues, but if you do so you are not really solvingthe problem; you are simply causing the attackers to find another wayto create the circumstances where the root mistake will be committedagain


角色自身

其實很難怪責認為周星馳沒有演技的人,因為我們看戲,著實是想看一個主角,在一個故事中,要展開一個怎樣的經歷,然後享受代入、理解和思考的趣味;但周星馳的戲實在不是這樣,因為我們想看的只是他本人,他的角色是

一日之計在於晨

一日之計在於晨

早上,六點四十分,小兒睡醒,仍然渴睡的媽媽,抖擻精神連忙幫他換片、餵奶,一廂情願地以快刀斬斬麻解決小兒的需要,希望之後他會盡快再回到夢鄉,希望大家都可以再睡一睡。

換片、餵奶……小兒非常合
Continue reading...

小小通告

由這星期開始,我在蘋果日報的專欄將改為逢星期一刊登。

多謝支持 :)

Fish

It's one week before the birth of my baby and I have many ultrasound photos capturing her adventure from the earliest embryo inside the womb. It is hard not to feel awestruck watching her growth from a humble-looking yolk sac to a lovely one with brain, heart, nose and legs.

Having a wife as an obstetrician means abundant opportunity for me to watch and adore my yet-to-be-born baby's face. Sure, the photos of her face invite lots of oohs and aahs from

'Conditional restart' in init.d scripts can be dangerous

Yesterday, the lighttpd instance that I run on my workstation waseffectively down for about twelve hours; while the daemon was running,it was using the wrong configuration file and so it wasn't reallyserving anything. In turn, this happened because I installed a lighttpdpackage update, and as part of the post-update actions the package did' /etc/init.d/lighttpd condrestart '.

In theory, conditional restart in an init.d script will only restartthings if the init script has started