Java – Connect Windows Active Directory Through LDAP @ 1

The Java Naming and Directory Interface (JNDI) is the standard Java API for multiple naming and directory services such as Lightweight Directory Access Protocol (LDAP).

Active Directory is a group of network services like account authentication and it supports LDAP. Therefore, you can write a Java program using JNDI in order to obtain the account credentials in the Active Directory of a Windows Server. Here comes the example. Continue reading Java – Connect Windows Active Directory Through LDAP @ 1

iPod Touch – Check if Camera is Available

Previously my first iPhone Application was rejected by Apple App Store. That application has a feature which allow users to take a photo or select an existing photo in the gallery.

As iPod Touch does not have a camera, the application crashes when user decide to take a photo. That’s why App Store rejected it.

So i have to check if the camera of the device is available. The following piece of code can do. Continue reading iPod Touch – Check if Camera is Available

黃萬里 – 永遠講真話的人

黃萬里(1911—2001),清華大學水利系教授,著名水利工程專家。父親黃炎培是中國著名的教育家、政治家和詩人,中共建政後官至全國人大副委員長。黃萬里1934年赴美留學,1937年歸國,自此傾畢生心力於大江大河治理。半個多世紀以來,他以學識淵博、觀點獨到而蜚聲中外,更以敢講真話、仗義執言而在學界獨樹一幟。

  黃萬里去世時,他的女兒說他是一個永遠講真話的人,為講真話,他可以不顧時局變化、切身利害。而他的一個學生也說,在中國水利學界,黃萬里代表了科學家的良心。

  黃萬里兩次反對中國的重大水利工程:三門峽而三峽,前者已經得到驗證——證明他說的是對的,而後者還有待觀察。儘管黃萬里反對的聲音是尖銳的、刺耳的,但他的存在,代表了另一種聲音的存在,而這種聲音正是最缺乏的聲音。
Continue reading 黃萬里 – 永遠講真話的人

陳雲 – 保衛大粵語

我是客家人,憂心客家話失傳,但我熱愛粵語。保衞粵語,固可從政治平權、從文化權利去講,但保衞粵語、保育粵語,更應從中文保育來講。

粵語保存中華雅言,珍如拱璧,即使粵語不是有一億人講(實際數字),只有幾百人講,也要保育,也要在學校傳習,特別是香港的情況,正體字、粵語教中文的優良傳統,出於政治意外,由英國殖民政府保存下來,更是文化奇迹,香港人固然要珍惜,大陸人也要理解。北方人立場不同,珍惜不珍惜,由得他們,但不要橫加干預,不准吾人在公共領域和文教機構用粵語Continue reading 陳雲 – 保衛大粵語

iPhone – Create an iAd Application

Starting from iPhone OS4, you can add an advertisement banner to your iPhone Application using the iAd framework. I found a great article talking about adding iAd to the iPhone app. Here is an example of a empty view based application with iAd.

1. Open Xcode and create a new View-based Application (iAdProject)
2. Add iAd.framework to the project
3. Modify the iAdProjectViewController.h Continue reading iPhone – Create an iAd Application