Tag Archives: Postaday2011

Drupal – Auto Assign Roles to Newly Registered User

The Auto Assign Role module serves 4 purposes:

  • Automatic role assignment for user registration
  • Automatic role assignment for admin created accounts
  • Assign role by path for user registration
  • Allow user to choose the roles in the user registration form

 

After the module installation, you could configure the Auto Assign Role setting @ Administer –> User management –> Auto assign role. Now, i would show you how to assign the role to user by the registration path. i am not going to demonstrate the others as they are quite straight forward. Continue reading Drupal – Auto Assign Roles to Newly Registered User

子華文集 – 棟篤屁 之 鬼問

棟篤屁之鬼問

家父是一個愛發問的人。
  
如果給賊人打劫,他說他會問賊人為什麼自甘墮落。
  
如果碰到鬼,他說他會問鬼為什麼嚇他。
  
面對人類應該如何反應,我投降,實在不懂,因為當中太多賊。
  
面對鬼應做什麼,我越來越覺得家父的態度是正確。
  
遇佛弑佛,遇到鬼反而不用那麼粗暴,閒話問一句,海闊天空。
  
問題是,世上真有鬼嗎?
  
我從來沒有見過鬼。

不單如此,在我十五歲以前,我從來沒有認識過一個見過鬼的人。 Continue reading 子華文集 – 棟篤屁 之 鬼問

jQuery – Cycle Plugin White Background Problem in Internet Explorer

The jQuery Cycle plugin is so helpful on showing animated slide show in your webpage. Check it out at the following website to find more details.
jQuery Cycle Plugin

But thanks Microsoft, it’s greatest product, Internet Explorer 7 and 8 has a bug when showing transparent png in the slide show. That is a white background would be added to the cycle element which block the background image. Add the following options when calling the cycle function. Continue reading jQuery – Cycle Plugin White Background Problem in Internet Explorer

沈旭暉 – 給唐英年的信﹕Lend Me Your Ears, What Went Wrong?

Dear Henry (唐老)﹕

再次感謝上周出席Roundtable周年活動。有說你選擇那場合作深度發言,是因為我們太溫和而籠絡、或太反叛而立威﹕這是non-issue。有說那是準特首政綱﹕這更是non-issue,不就是一個市長麼。但你代表的50後青年觀如何產生,卻是issue。

不少前輩都是令人尊敬的老好人,說起青年議題卻往往不歡而散。為什麼?關鍵除了以往提及的「50後超穩定社會結構」,我想還有重要一環﹕若憑昔日情懷研判今日,認識問題的方法論必有時代缺陷,可稱之為「50後超穩定認知結構」。你觸及的都是正面概念,問題一是主流50後和80後對同一概念有相反認知,問題二是雙方對這差異的本質欠認知,問題三是管治香港不能忽視這認知鴻溝。

這令人不安。

「唐五點」發表後,身旁很多青年不以為然,也有說你抽空而言其實頗有理。但就是後者,也希望你和周秀娜一樣,有衝動梳理一下自己的思想。基於這些迴響,我天真地相信作為當日主人家,有責任為你解構這認知鴻溝,說明何以同樣的五點必被相反解讀﹕ Continue reading 沈旭暉 – 給唐英年的信﹕Lend Me Your Ears, What Went Wrong?

陶傑 – 多士沾香檳

什麼叫「國民教育」,經過許多爭論,問題開始較為清晰,就是熱愛中國文化為先。

但是對中國文化的「熱愛」,熱愛哪一科目,到什麼程度,而且,最後由誰來考核一個小朋友對「中國」的認同?

還首先,凡優雅的品種,可以跨越國界,誰都有權「熱愛」的。譬如中國的崑劇,就有一個日本大師親自粉墨表演,許多中國人,反倒是門外漢,那麼「國民教育」在這個層次上,不知怎樣評分。

還有范仲淹的岳陽樓記:「若夫霪雨霏霏,連月不開,陰風怒號,濁浪排空,日星隱耀,山岳潛形,薄暮冥冥,虎嘯猿啼,登斯樓也,則有去國懷鄉,憂讒畏譏,滿目蕭然,感極而悲者矣」,這一段,不必喜歡任何一個政權:滿清、北洋、蔣介石政府或李登輝,都會有美的感覺而心有所觸。 Continue reading 陶傑 – 多士沾香檳

Javascript – Passing Parameters for the Function in setTimeout()

Previous post: Javacript – Schedule a Function call by setTimeout()

If the delayed function has input parameters, setTimeout() would fail when you simply add the parameters in the setTimeout() call.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    /* The call will fail and the alert box will display immediately */
    setTimeout(delayedAlert("Hi Eureka!"), 3000);
  });

  function delayedAlert(str) {
    alert(str);
  }
</script>

Continue reading Javascript – Passing Parameters for the Function in setTimeout()

jQuery & Javascript – Schedule a Function call by setTimeout()

In Javascript, you could schedule a function call using the setTimeout().

<html>
  <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        setTimeout(delayedAlert, 3000);
      });
		
      function delayedAlert() {
        alert("Hello Eureka!");
      }
    </script>
  </head>
  <body>
    <h1>Eureka!</h1>
  </body>
</html>

Continue reading jQuery & Javascript – Schedule a Function call by setTimeout()