Handling variations of a page (or, the revenge of REST)

Suppose that you have a web application with users, and different users(or different sorts of users) need to see slightly different versionsof various pages and forms. It's both obvious and very tempting toimplement these page and form variations with conditional logic in asingle URL's view handler; you have to retrieve the user's informationanyways (and check access permissions), so you simply put in some checksand switches based on what sort of user they are or what permissionsthey have.

(


離合

如果你愛上一個人,你會認為他是不能分類的。他不會是「一個郵差」「一個聰明的肥仔」「一位長髮的結他手」,他就是他,這個世上唯獨你,和他,是獨特的,是離群的,是不可分類,亦不可再分割。

但你會不會害怕,有一

慢慢學會謙卑


在電影 《 127 小時》裏,男主角本來是天不怕地不怕,登山涉水獨闖高峰的冒險家,但一次攀山意外,令他墮落在山壁的 罅隙 之間,手臂被夾住,呼天不應,叫地不聞。整部電影就拍他被困深山,無法動彈,絕境求存的過程,

FM2配sigma 24mm 1.8出陣!!!

APX 400 的135版,這回是初次品味,出來的感覺和120大大不同,差別我看是在於120的菲林質素太差了,沒法體會愛克法APX 400的真髓。

為了慶祝APX 400 第一回戰,特別用上NIKON的FM2和適馬的神奇微距廣角鏡,2

Continue reading...

東京少女之無重漂浮

無意中看到台灣博客 凱撒之鷹 這篇 來自東京的漂浮少女 的網誌,介紹了這個名為 yowayowa camera woman diary 的圖片網誌,內裡記載了Natsumi這位日本少女,每天透過圖片來說的漂浮故事。

每天的圖片,其實都是Natsumi的生活片段,有趣的是,每張圖片,她

Continue reading...

器量與才識

當年我決定去 Berkeley 而不去 Oxford 讀博士,其中一個原因是 Donald Davidson 在 Berkeley 任教。我在港大的碩士論文寫的正是 Davidson 的語言哲學,對他十分佩服,也想進一步了解他的東西,能夠親炙這位重要的哲學家,自然是求之不得了。(另一個我非常佩服的

Why I want read-only form fields in Django

One of the things that Django has is aforms handling system, especially for forms populated from your schemamodels. One of the commonly requested features for it is the ability tohave read-only form fields, things that will be displayed in your formbut cannot be changed. So far, the official Django answer is that thisis a bad idea and you don't want to do that (see for example here ).

(One reason I've read for this view is that Django people considera


不分組不分開

戀人會問他的伴侶︰你喜歡我甚麼?這不容易回答的。沒有答案,固然是死路一條,回答了,也不見得會有好結局。

「我喜歡你的直率。」

「如果有人比我更直率,你就會移情別戀嗎?」

這是一個兩難的死胡同。

就愛情而言,其

Drupal 7 Front-End Performance - Shared Hosting Recommendations

Speedometer - Boosted
I've spent a lot of time working on making sure my smaller Drupal sites (mostly run on shared hosts or very small VPSes) run lean and mean. This helps the pages load faster, users are happier, and my hosting providers don't have to shut down any of my sites, even when they're under pretty heavy load.

Here are my three recommendations for making your Drupal 7 website run great on a shared (or low-end VPS) host:

  1. Enable Boost . It's

On Being Overpriced

In the recent hubbub over Motorola Xoom pricing, I started to think a bit more about the current landscape of tablets on the market today—the iPad, and the competition.

Obviously, the iPad has won round 1. And it looks like round 2 is starting with Apple throwing all the punches—even though there's been no word on a second revision from the horse's mouth (yet).

But I was thinking to myself, "Why (and how?!) is Apple the only company