Mittwoch, 31. Dezember 2008

Sonntag, 28. Dezember 2008

推薦: <<柏楊曰─讀通鑑‧論歷史>>

推薦: <<柏楊曰──讀通鑑‧論歷史>>

http://nrch.cca.gov.tw/ccahome/website/site4/BY_Collect/b9000e0/cca220003-li-wpkbbyb9000e0toc-0000-u.html

柏楊
  常常被問起一個問題:讀歷史,人能够從中取得教訓嗎?

  我在1998年7月台北遠流出版公司出版的《柏楊曰》第一集序中曾説:歷史的教訓,因為人類的健忘和野心家的篡改,而微乎其微……現在我補充:原因是經驗無法傳承,事非經過 不知難。這是上帝創造人類開的一項最大的玩笑。

盡管人性古今一致、中外不分,可是每一個人的生存基因中都同様有非常頑强的自我毁滅因子,既無法從歷史借鏡, 也很不容易自我克制。世界文明能向前邁進一步,才會有這麽艱巨的工程,這裏面牽涉到大自然的生態環境、牽涉到國民性與文化的累積,更决定于一個族群政策與 制度的抉擇。文明的更上層樓,是一個民族救危存亡的裏程碑。

   歷史的功能如果純粹從以上的角度來衡量,不但可讀性大减,連值不值得書寫都令人質疑。事實上,歷史的借鏡固然微弱,但,人類的歷史實在是世界進化的卷 標,讓你知道我們從怎麽様的原點出發,歷經的路程以及終將要奔赴的方向。如果没有歷史,人類的生存就茫茫無所歸依,所有生存中的顛簸、匍匐、挣扎、奮鬥都 是汹涌波濤中的一葉扁舟,没有舵手,也没有彼岸。

從這個角度認知,歷史的功能就不同于“使用手册”,它不可能告訴你如何開機、如何操作、如何修復、如何换 新零件……但,却是整個世界的文明生産制作不可或缺的原創力。

 中國是世界文明古國之一,有綿長豐富的歷史,在整個世界文明發展的進程中,她不只是汪洋大海中的一葉扁舟,簡直是一艘驚動四海的航空母艦。人類能不能振 衰起弊,和中國歷史能不能創造新猷息息相關。

可是,中國歷史上封建制度太長,暴君暴行接連不斷。人民唯一能期待的就是遇到“明君”“以德化民”,這實在是 天大的騙術。可憐,我們善良的人民幾千年來都眼巴巴地在被剮、被殺、被黥、被刖、被磔……之餘,叩首仰望“明君”由天而降。

   我用《柏楊曰》來讀歷史、提出我對傳統歷史不同角度的分析和批判,除了鍛練自己誠實面對自己國家的歷史之外,也要設法使讀歷史的人擺脱以往士大夫 附庸權貴,為執掌大權的皇帝老爺張目、護短,甚至為他們的酷虐暴行提供最没有良心的 合理化理論的習行。

我仍然要説我的史觀,未必能掌握歷史的全貌,而我擺脱傳統文化的包袱,不為君王唱贊美歌,而只為蒼生、為一個“人”的立場和尊嚴,説“人”話,從“以人為本”的角度來重新審視歷史。
  
2006年9月于台北



Samstag, 27. Dezember 2008

一 代 AV 天 后 飯 島 愛 陳 屍 香 閨

一 代 AV 天 后 陳 屍 香 閨
飯 島 愛 離 奇 死 (25 Dec 2008)

蘋果日報 :【 本 報 訊 】 飯 島 愛 , 一 個 「 三 十 世 代 」 開 外 男 性 都 不 會 忘 記 的 名 字 。 她 有 天 使 面 孔 、 魔 鬼 身 材 , 在 無 數 AV ( 成 人 電 影 ) 中 身 演 出 , 之 後 更 打 破 壁 壘 , 成 為 首 位 成 功 打 入 藝 能 界 殿 堂 的 AV 女 優 , 在 AV 界 寫 下 一 個 經 典 傳 奇 。 然 而 , 這 位 一 代 AV 天 后 昨 日 被 發 現 陳 屍 香 閨 , 懷 疑 自 殺 , 短 短 36 年 的 生 命 坎 坷 到 底 。

http://www1.appledaily.atnext.com//template/apple/art_main.cfm?iss_id=20081225&sec_id=4104&subsec_id=11866&art_id=12013871



Donnerstag, 25. Dezember 2008

EE4206/EE5806 Digital Image Processing

EE4206/EE5806 Digital Image Processing

Chapte 3 : Intensity Transformations and Spatial Filtering

main points

1.Basic Intensity Transformation Functions

- Image Negatives
- Log Transformation
- Power-Law (Gamma) Transformation
- Piecewise-Linear Transformation Functions

2. Histogram Processing

- Histogram Equalization
- Histogram Matching (Specification)
- Local Histogram Processing
- Using Histogram Statistics for Image Enhancement

3. Spatial filtering

- Spatial Correlation and Convolution
- Vector Representation of Linear Filtering
- Generating Spatial Filter Masks

4. Smoothing Spatial Filters

- Order-Statistic (Nonlinear)Filters

5. Sharpening Spatial Filters

- Using the Second Derivative for Image Sharpening -The Laplacian
- Unsharp Masking and Highboost Filtering
- Using first-Order Derivative for (Nonlinear) Image Sharpening -The Gradient



Montag, 22. Dezember 2008

推薦:黃堅--《思想門--先秦諸子解讀》

推薦:黃堅--《思想門--先秦諸子解讀》


本書是對孔子、孟子、莊子、墨子、韓非、蘇秦 的一次充滿力量與冒險的解讀。 文章不拘學院套路,另開闡釋法門,演練了一場先秦諸子與當今社會風氣相互激蕩、生發的實驗。

孔子是否“打劫”了儒者? 儒學在現實生活中是利還是弊?
蘇秦的一生是 ”無間道” ?!

徹底廢棄 “儒學”, “國學” 復興才有希望。

在作者筆下,孔子童心未泯、風趣搞怪,孟子是個很不好說話的人,而韓非子則是“三重棄兒”,蘇秦的一生是“一場玩笑”。

作者追溯了“儒”的起源,並提出: 只有徹底廢棄 “儒學”,“國學”復興才有希望——“將蒙在中華文明美味湯麵上的儒學油垢,一撇而盡。讓每一個獨立、真實的生命體,直接照射在二十一世紀的陽光下。”

http://www.cp1897.com.hk/product_info.php?BookId=9789620427480



Samstag, 20. Dezember 2008

陰符經注解序

陰符經注序

  陰符經三百餘字,其言深奧,其理精微,鑿開混沌,剖析鴻蒙,演造化之秘,闡性命之幽,為古今來修道第一部真經。唐陸龜蒙謂黃帝所著,宋陳淵謂黃帝受於廣成子,朱文公亦謂黃帝著,邵堯夫謂戰國時書,程伊川又謂非商末即週末時書。其說紛紛,各述所知,究無定見。以予論之,世皆傳為黃帝陰符經,丹經子書,俱謂陰符經系黃帝所作,考之文字,始於黃帝,興于唐虞夏商,或者黃帝撰作,口口相傳,不記文字,後世成真仙侶,筆之於書,流傳世間,亦未可定。

就其世傳之說,丹經之載,謂黃帝著之,亦無不可,但此書沿訛已久,苦無善本,字句差錯者極多,或借驪山老姥百言演道、百言演法、百言演術之說,紊亂聖道,以盲引盲;更有借伊呂張果子房孔明注語欺世惑人者,似此魚目混珠,指鹿為馬,大失真經妙旨。予於乾隆四十四年,歲次己亥,於南台深處,取諸家注本,校正字句,細心斟酌,略釋數語,述其大意,掃邪救正,以破狂言亂語之弊,高明者自能辨之。

  時大清嘉慶三年歲次戊午九月九日 棲雲山 素樸散人悟元子 劉一明 敘於 自在窩中



陰符經注解跋

  陰符經者,黃帝演道書也。而談兵之家,視為天時孤虛旺相之理,人事進退存亡之因,即緇黃之流,淺窺聖經,謬為注疏者亦不少,不幾誤璞為鼠,以青作黃乎?我悟元老師,造性命之精,證天人之奧,體古聖覺世之婆心,思發其覆,憫後學窮理而無門,詳為之解,掃諸說之悖謬,詮陰符之肯綮,其中盡性至命之學,有為無為之理,靡不詳明且備,將數千年埋沒之陰符,至今原旨畢露,而無餘蘊矣。經雲:觀天之道,執天之行,盡矣。僕則曰:聖經之精,聖道之微,盡矣。

  大清嘉慶三年歲次戊午九月九日 受業門人 王附青 雲峰甫 沐手敬題 軒轅黃帝著
  洮陽門人 張陽全 校閱
  悟元子 劉一明 注
  後學 陶鑄靈 重刊

  陰者,暗也,默也,人莫能見,莫能知,而己獨見獨知之謂;符者,契也,兩而相合,彼此如一之謂;經者,徑也,道也,常也,常行之道,經久不易之謂。陰符經即神明暗運,默契造化之道。默契造化,則人與天合,一動一靜,皆是天機,人亦一天矣。上中下三篇,無非申明陰符經三字,會得陰符經三字,則三篇大意可推而知矣。



1. 上篇

  1.1 觀天之道,執天之行,盡矣。

  性命之道,一天道也。天之道,陰陽之道耳。修道者能知天道之奧妙,而神明默運,竊陰陽之氣,奪造化之權,可以長生不死,可以無生無死,然其最要處,則在能觀能執耳。何謂觀?格物致知之為觀,極深研幾之為觀,心知神會之為觀,迴光返照之為觀,不隱不瞞之為觀;何謂執?專心致志之為執,身體力行之為執,愈久愈力之為執,無過不及之為執,始終如一之為執。

觀天道,無為之功,頓悟也,所以了性;執天行,有為之學,漸修也,所以了命。能觀能執,用陰陽之道以脫陰陽,依世間法而出世間,性命俱了,心法兩忘,超出天地,永劫長存,只此二句,即是成仙成佛之天梯,為聖為賢之大道,外此者,皆是旁門曲徑,邪說淫辭,故曰盡矣。
 
 1.2 天有五賊,見之者昌。

  五賊者,金木水火土也。天以陰陽五行化生萬物,氣以成形,而人即受此氣以生以長,但自陽極生陰,先天入於後天,五行不能和合,自相賊害,各一其性,木以金為賊,金以火為賊,火以水為賊,水以土為賊,土以木為賊,是謂天之五賊也。惟此五賊,百姓日用而不知,順行其氣,以故生而死,死而生,生死不已。若有見之者,逆施造化,顛倒五行,金本克木,木反因之而成器;木本克土,土反因之而生榮;土本克水,水反因之而不泛;水本克火,火反因之而不燥;火本克金,金反因之而生明;克中有生,五賊轉而為五寶,一氣混然,還元返本,豈不昌乎!
 
1.3 五賊在心,施行於天。宇宙在乎手,萬化生乎身。

  人秉五行之氣而生身,身中即具五行之氣。然心者身之主,身者心之室,五賊在身,實在心也。但心有人心道心之分;人心用事,則五賊發而為喜怒哀樂欲之五物;道心用事,則五賊變而為仁義禮智信之五德。若能觀天而明五行之消息,以道心為運用,一步一趨,盡出於天而不由人,宇宙雖大,如在手掌之中;萬化雖多,不出一身之內;攢五行而合四象,以了性命,可不難矣。
 
1.4 天性,人也。人心,機也。立天之道,以定人也。

  天性者,天賦之性,即真如之性,所謂真心,不識不知,順帝之則,而人得以為人者是也;人心者,氣質之性,即知識之性,所謂機心,見景生情,隨風揚波,而人因之有生有死者是也。天性者,天機,即是天道;人心者,人機,即是人道。守天機者存,順人機者亡。惟大聖人觀天道,執天行,中立不倚,寂然不動,感而遂通,修真性而化氣性,守天道而定人心,不使有一毫客氣雜於方寸之內也。

 1.5 天發殺機,移星易宿;地發殺機,龍蛇起陸;人發殺機,天地反覆;天人合發,萬化定基。

  殺機者,陰肅之氣,所以傷物也;然無陰不能生陽,非殺無以衛生,故天之殺機一發,則周而復始,而星宿移轉,斗柄回寅;地之殺機一發,則剝極而複,龍蛇起陸,靜極又動;惟人也亦俱一天地也,亦有此陰陽也,若能效天法地,運動殺機,則五行顛倒而地天交泰,何則?人心若與天心合,顛倒陰陽只片時。天時人事合而一之,則萬物變化之根基即於此而定矣。中庸所謂致中和,天地位焉,萬物育焉者,即此也。
  
1.6 性有巧拙,可以伏藏。

  人秉陰陽之氣以成形,具良知良能以為性,性無不善,而氣有清濁。秉氣清者為巧,秉氣濁者為拙。性巧者多機謀,性拙者多貪癡。巧性拙性皆系氣質之性,人心主事,非本來之天性。修真之道,采先天,化後天,而一切巧拙之性,皆伏藏而不用矣。

 1.7 九竅之邪,在乎三要,可以動靜。

  九竅者,人身上七竅,下二竅也;三要者,耳目口也。人身九竅皆受邪之處,而九竅之中,惟耳目口三者為招邪之要口,耳聽聲則精搖,目視色則神馳,口多言則氣散,精氣神一傷,則全身衰敗,性命未有不喪者。人能收視,返聽,希言,閉其要口,委志虛無,內念不出,外念不入,精氣神三品大藥凝結不散,九竅可以動,可以靜,動之靜之,儘是天機,並無人機,更何有邪氣之不消滅哉!
 
1.8 火生於木,禍發必克;奸生於國,時動必潰。知之修煉,謂之聖人。

  火喻邪心,木喻性,奸譬陰惡,國譬身。木本生火,火發而禍及木,則木克;邪生於心,邪發而禍及心,則性亂;國中有奸,奸動而潰其國,則國亡;陰藏於身,陰盛而敗其身,則命傾;身心受累,性命隨之,於此而知潛修密煉,觀天道,執天行,降伏身心,保全性命,不為後天五行所拘者,非聖人其誰與歸?
  
1.9 天生天殺,道之理也。

  天道陰陽而已,陽主生,陰主殺,未有陽而不陰,生而不殺之理。故春生夏長秋斂冬藏,四時成序,周而復始,迴圈不已,亙古如是也。




2. 中篇

  2.1 天地,萬物之盜;萬物,人之盜;人,萬物之盜。三盜既宜,三才既安。故曰:食其時,百骸理;動其機,萬化安。

  天以始萬物,地以生萬物,然既生之,則又殺之,是天地即萬物之盜耳;世有萬物,人即見景生情,恣情縱欲,耗散神氣,幼而壯,壯而老,老而死,是萬物即人之盜耳;人為萬物之靈,萬物雖能盜人之氣,而人食萬物精華,借萬物之氣生之長之,是人即萬物之盜耳。大修行人,能奪萬物之氣為我用,又能因萬物盜我之氣而盜之,並因天地盜萬物之氣而盜之,三盜歸於一盜,殺中有生,三盜皆得其宜矣。三盜既宜,人與天地合德,並行而不相悖,三才亦安矣。三才既安,道氣長存,萬物不能屈,造化不能拘矣。

然此盜之秘密,有一時之功,須要不先不後,不將不迎,不可太過,不可不及,坎來則離受之,彼到而我待之,陽複以陰接之,大要不失其時,不錯其機,故曰,食其時,百骸理,動其機,萬化安。食其時者,趁時而吞服先天之氣也;動其機者,隨機而扭轉生殺之柄也。

食時則後天之氣化,百骸皆理,可以全形;動機則先天之氣複,萬化俱安,可以延年。時也機也,難言也。要知此時即天時,此機即天機,苟非深明造化,洞達陰陽者,烏能知之?噫!八月十五翫蟾輝,正是金精壯盛時,若到一陽才起處,便宜進火莫延遲。

  2.2 人知其神而神,不知不神之神而所以神。

  古今學人,皆認昭昭靈靈之識神,以為本來之元神,故著空執相,千奇百怪,到老無成,有死而已,殊不知此神為後天之神,而非先天之神,乃神而實不神者。先天之神,非色非空,至無而含至有,至虛而含至實,乃不神之神,而實至神者。奈何世人只知後天之神而神,甘入於輪回,不知先天不神之神,能保乎性命,無怪乎萬物盜我之氣而罔覺也。

  2.3 日月有數,小大有定,聖功生焉,神明出焉。其盜機也,天下莫能見,莫能知。君子得之固窮,小人得之輕命。

  人之所以能盜天地萬物之氣者,以其天地萬物有定數焉;天地萬物不能盜人之氣者,以其聖道無形無象焉。如日月雖高,而有度數可推,日則一年一周,天有春夏秋冬之可見;月則三十日一周,天有盈虛朔望之可窺,大為陽,小為陰,陽極則生陰,陰極則生陽,大往小來,小往大來,陰陽迴圈,乃一定不易之道。至人於此推陰陽造化之消息,用功於一時辰內,采鴻蒙未判之氣,以為丹母,奪天地虧盈之數,以為命基,先天而天弗違,後天而奉天時,聖功於此而生,神明於此而出,此功此明,其盜機也,雖天鬼神不可得而測度,而況於人乎!

天下烏得而見,烏得而知?如其能見能知,安能盜之?此其所以為聖,此其所以為神。是道也,非忠臣孝子大賢大德之人不能知,非烈士丈夫俯視一切萬有皆空者不能行。果是真正修道君子,得意忘言,大智若愚,大巧若拙,不到了性了命之後,不肯洩漏圭角,固窮而如無知者也。至於薄福小人,偶嘗滋味,自滿自足,又不自重性命,無而為有,虛而為盈,約而為泰,適以自造罪過,非徒無益,而又害之矣。



3. 下篇

  3.1 瞽者善聽,聾者善視。絕利一源,用師十倍。三返晝夜,用師萬倍。 

 瞽者善於聽,非善聽也,以目無所見,而神藏於耳,故其聽也聰;聾者善於視,非善視也,以耳無所聞,而氣運於目,故其視也明。即此二者以觀,閉目而耳聰,塞耳而目明,況伏先天之氣,舍假修真,存誠去妄者,何患不能長生乎?清靜經曰:眾生所以不得真道者,為有妄心;既有妄心,即驚其神;既驚其神,即著萬物;既著萬物,即生貪求,即是煩惱,煩惱妄想,憂苦身心,便遭濁辱,流浪生死,常沉苦海,永失真道。

妄想貪求,乃利之源也,人能絕此利之一源,則萬有皆空,諸慮俱息,勝於用師導引之功十倍,又能再三自返,存誠去妄,朝乾夕惕,晝夜殷勤,十二時中,無有間斷,漸歸於至善無惡之地,勝於用師導引之功萬倍。蓋師之功,能革其面,而不能革其心;能與人規矩,而不能使人巧;絕利自返,正心地下功,戒慎恐懼於不睹不聞之處,師力焉得而及之?至聖雲:一日克己復禮,天下歸仁焉。為仁由己,而由人乎哉?正此節妙諦。

 3.2 心生於物,死於物,機在目。

  心如主人,目如門戶。本來真心,空空洞洞,無我無人無物,與太虛同體,焉有生死,其有生死者,後天肉團之心耳。心不可見,因物而見,見物便見心,無物心不現。是主人或生或死,物生之,物死之,其所以使物生死心者,皆由目之開門揖盜耳。蓋目有所見,心即受之,是心生死之機,實在目也。人能返觀內照,外物無由而受,生死從何而來?古人雲:滅眥可以卻老,此至言也。

 3.3 天之無恩,而大恩生。迅雷烈風,莫不蠢然。至樂性餘,至靜性廉。

  天至高而萬物至卑,天與物相遠,似乎無恩於物矣。殊不知無恩之中而實有大恩生焉。天之氣鼓而成雷,噓而成風,迅雷震之而萬物發生,烈風吹之而萬物榮旺。發生榮旺,萬物皆蠢然無知,出於自然,此無恩而生大恩,天何心哉?故至樂者,萬物難屈,無拘無束,性常有餘;至靜者,萬物難移,無貪無愛,性常廉潔。樂者無心於余而自餘,靜者無心於廉而自廉,亦如天之無恩而有大恩。無心之用,神矣哉!

 3.4 天之至私,用之至公,禽之制在氣。

  天之道行於無象,運於無形,為物不貳,其至私與。然其四時行而萬物生,其用又至公焉。推其奧妙,其一氣流行,禽制萬物乎?禽者,擒也,統攝之謂;制者,造作之謂;言統攝萬物,製造萬物,在乎一氣也。一氣上升,萬物皆隨之生長,一氣下降,萬物皆隨之斂藏,生長斂藏,總是一氣擒制之,一本散而為萬殊,萬殊歸而為一本。私而公,公而私,非私非公,即私即公,一氣流行,迴圈無端,活活潑潑的也。

3.5  生者死之根,死者生之根。恩生於害,害生於恩。

  天道生物,即是一氣。上下運用一氣,上為陽,下為陰。陽者,生也,恩也;陰者,死也,害也。然有生必有死,有死必有生,是生以死為根,死以生為根也;有恩必有害,有害必有恩,是恩在害生,害在恩生也。若人死裏求生,則長生而不死,人能害裏尋恩,則有恩而無害,出此入彼,可不慎乎!

  3.6 愚人以天地文理聖,我以時物文理哲;

  愚人不知生死恩害,是天地造化迴圈之秘密,直以天地文理為聖矣。我則謂天文有象,地理有形,著之於外者,可見可知,未足為天地之聖。若夫時物之文理,無象無形,乃神運之道,藏之於內者,不可見,不可知,正天地之所以為哲也。蓋物有時而生,有時而死。當生之時,時生之,不得不生;當死之時,時死之,不得不死。生者,恩也,死者,害也,生而死,死而生,恩而害,害而恩,生死恩害,皆時運之,亦無非天地神道運之。天地神道不可見,因物以見之,觀於物之生死有時,而天地神道之明哲可知矣。

 3.7 人以愚虞聖,我以不愚虞聖;人以其奇期聖,我以不奇期聖。

  性命之道,始於有作人難見,及至無為眾始知。故古來修真上聖,當有作之時,黜聰毀智,韜明養晦,斡天關,回斗柄,采藥物於恍惚杳冥之鄉,行火候於無識無知之地,委志虛無,神明默運,雖天地鬼神,不可得而測度,而況於人乎?乃人不知其中奧妙,或以愚度聖人,彼豈知良賈深藏,若虛而實有,不愚之運用乎?當無為之時,和光同塵,積功修德,極往知來,一叩百應,神通廣大,智慧無邊,而人或以奇期聖人,彼豈知真常應物,而實非奇異之行藏也。聖人不愚,亦如時物文理之哲,聖人不奇,亦如天地文理不聖。聖人也,所參天地之化育,而德配天地者也。

  3.8沉水入火,自取滅亡。

  人之慳貪恩愛,如水淵也;酒色財氣,如火坑也。一切常人,不窮天地造化之道,不究聖功性命之學,自暴自棄,以假為真,以苦為樂,沉於水淵而不知,入於火坑而不曉,自取滅亡,將誰咎乎?

3.9  自然之道靜,故天地萬物生。天地之道浸,故陰陽勝。陰陽相推,而變化順矣。

  大道無形,生育天地;大道無名,長養萬物。無形無名,自然至靜之道。然靜者動之基,靜極而動,天地萬物即於此而生焉。一生天地,而天地即得自然之道以為道,故天地之道浸。浸者,浸潤漸入之謂,亦自然之義。惟其浸潤自然,動不離靜,靜不離動,一動一靜,互為其根,故陰陽勝。動為陽,靜為陰,動極而靜,靜極而動,陰極生陽,陽極生陰,陰陽相推,四時成序,萬物生成,或變或化,無不順之,造物者豈有心於其間哉?蓋以自然之道無形,無形而能變化,是以變化無窮也。

  3.10 是故聖人知自然之道不可違,因而制之。至靜之道,律曆所不能契。爰有奇器,是生萬象,八卦甲子,神機鬼藏。陰陽相勝之術,昭昭乎進於象矣。 

 聖人者,與天地合其德者也。惟與天地合德,故不違天地自然之道,因而裁制變通,與天地同功用。何則?自然之道,非色非空,至無而含至有,至虛而含至實,有無兼該,虛實並應者也。故以言其無,則虛空一氣,無聲無臭,其為道也至靜,靜至於至,雖律曆之氣數,有所不能契。夫律曆能契有形,不能契無形,至靜則無形矣,律曆焉得而契之?[囟/比]陵師所謂有物先天地,無名本寂寥者是也。以言其有,則造化不測,包羅一切,其為器也最奇,器至於奇,是謂神器。神也者,妙萬物而為言者也。

故萬象森羅,八卦相湯,甲子迴圈,神之伸機,鬼之屈藏,無不盡在包容之中。[囟/比]陵師所謂能為萬象主,不逐四時凋者是也。靜道者,無名天地之始;神器者,有名萬物之母。老子所謂無欲以觀其妙者,即觀其始也;有欲以觀其竅者,即觀其母也。非有不能成無,非觀竅難以觀妙。觀妙之道,萬有皆空,無作無為;觀竅之道,陰陽變化,有修有證。

聖人不違自然之道,因而制之,觀天道,執天行,從後天中返先天,在殺機中盜生機,顛倒五行,逆施造化,以陰養陽,以陽化陰,陽健陰順,陰陽混合,由觀竅而至觀妙,由神器而入至靜,由勉強而抵自然,有無一致,功力悉化,陰陽相勝之術,昭昭乎進於色象之外矣。要知此術非尋常之術,乃竊陰陽、奪造化之術,乃轉璿璣、脫生死之術。

昔黃帝修之,而乘龍上天;張葛許修之,而超凡入聖;以至拔宅者八百,飛升者三千,無非由此道而成之。籲!陰符經三百餘字,句句甘露,字字珠玉,示性命不死之方,開萬世修真之路,天機大露,後世丹經子書,雖譬喻千般,無非申明陰陽相勝之術,有志者若見此經,誠心敬閱,求師一訣,倘能直下承當,大悟大徹,勤而行之,以應八百之讖,有何不可?



城大PCLL-Law 扣起1分肥你全個programme?

城大PCLL-Law 扣起1分肥你全個programme?

http://www.inmediahk.net/node/1001815




黃帝陰符經

黃帝陰符經

全書只有457字,共分三章。

1. 上篇——論道
2. 中篇——論法
3. 下篇——論術


上篇

  觀天之道,執天之行,盡矣。故天有五賊,見之者昌。五賊在乎心,施行乎天。宇宙在乎手,萬化生乎身。天性,人也。人心,機也。立天之道,以定人也。天發殺機,天地反覆。天人合發,萬化定基。性有巧拙,可以伏藏。九竅之邪,在乎三要,可以動靜。火生於木,禍發必克。奸生於國,時動必潰。知之修煉,謂之聖人。

中篇

  天生天殺,道之理也。天地,萬物之盜;萬物,人之盜;人,萬物之盜。三盜既宜,三才既安。故曰:食其時,百骸理;動其機,萬化安。人知其神而神,不知其不神之所以神也。日月有數,大小有定,聖功生焉,神明出焉。其盜機也,天下莫能見,莫能知。君子得之固躬,小人得之輕命。

下篇

  瞽者善聽,聾者善視;絕利一源,用師十倍;三反晝夜,用師萬倍。心生於物,死於物,機在於目。天之無恩而大恩生,迅雷烈風,莫不蠢然。至樂性餘,至靜性廉。天之至私,用之至公,禽之制在氣。生者死之根,死者生之根。恩生於害,害生於恩。愚人以天地文理聖,我以時物文理哲。人以虞愚聖,我以不虞愚聖。人以期其聖,我以不期其聖。故曰:沉水入火,自取滅亡。自然之道靜,故天地萬物生。天地之道浸,故陰陽勝。陰陽相推,而變化順矣。是故聖人知自然之道不可違,因而制之。至靜之道,律歷所不能契。爰有奇器,是生萬象。八卦甲子,神機鬼藏。陰陽相勝之術,昭昭乎進乎象矣。

http://baike.baidu.com/view/263384.htm



Donnerstag, 18. Dezember 2008

倪震宣布與周慧敏結婚

倪震宣布與周慧敏結婚

(明報)12月19日(2008) 星期五 00:05

成為城中話題的倪震 與周慧敏 戀情峰迴路轉,倪震下午2時許向傳媒表示,已跟周慧敏申請註冊結婚。

倪震的聲明全文如下:

「動搖過,才懂得堅定;失去過,才學會珍惜。一場風波,令我們更了解互相的愛;四方壓力,使我們更體會到彼此的不可分割。試煉,成就了信心。慧敏答應嫁給我了,我們已申請註冊結婚。祝福我們吧。」



Geertz--Local Knowledge

Clifford Geertz

地方知識: 詮釋人類學論文集
Local Knowledge: Further essays in interpretive anthropology. (1983)

http://hypergeertz.jku.at/HyperGeertz-1980-1989.htm

http://en.wikipedia.org/wiki/Clifford_Geertz



王 維 基 聲 明 全 文

王 維 基 聲 明 全 文


王 維 基 聲 明 全 文 。


各 位 朋 友 :

過 了 這 十 二 天 , 我 上 了 人 生 寶 貴 的 一 課 : 堅 持 直 率 , 用 辭 謹 慎 。

亞洲 電 視 是 一 個 具 有 使 命 和 社 會 責 任 的 機 構 , 無 論 從 香 港 人 的 立 場 還 是 其 他 因 素 來 考慮 , 亞 視 始 終 是 一 個 香 港 人 的 電 視 台 , 我 認 為 這 個 方 向 至 今 依 然 正 確 。 香 港 的 人 均本 地 生 產 總 值 是 內 地 十 多 倍 , 中 國 是 我 們 的 國 家 , 有 能 力 時 , 我 們 應 該 想 想 有 什 麼貢 獻 , 而 不 是 過 份 依 賴 。

亞 視 始 終 是 一 間 商 營 機 稱 , 他 的 希 望 在 於 自 己, 不 可 以 長 期 依 靠 賑 助 。 亞 視 從 新 定 位 , 讓 創 作 有 更 大 的 空 間 、 讓 觀 眾 有 更 多 選 擇, 令 亞 視 成 為 香 港 有 公 信 力 的 媒 體 , 這 是 我 們 三 人 的 共 同 夢 想 。 直 至 今 天 , 我 依 然擁 抱 這 個 熱 切 期 待 。

從 接 受 這 份 工 作 的 第 一 天 起 , 我 已 經 知 道 這 是 一 項艱 鉅 的 任 務 。 聽 張 永 霖 先 生 所 言 : 「 出 任 執 行 主 席 一 職 , 百 感 交 集 , 戰 戰 兢 兢 , 如履 薄 冰 。 」 , 我 就 想 起 康 有 為 先 生 廢 除 八 股 文 , 一 段 可 歌 可 泣 的 歷 史 。

沒有 膽 識 , 就 幹 不 了 大 事 。 要 改 革 , 我 沒 有 想 過 得 到 全 部 人 的 認 同 ; 改 革 的 過 程 中 ,我 們 要 面 對 固 有 利 益 者 的 強 大 阻 力 ; 要 改 革 成 功 , 就 一 定 要 迅 速 、 全 面 和 徹 底 , 更重 要 的
是 , 要 有 後 備 計 劃 。


以 上 種 種 , 我 已 經 有 充 足 準 備 。 過 往 四 年 , 我 在城 市 電 訊 亦 在 進 行 過 類 似 改 革 工 作 , 公 司 由 幾 年 前 虧 損 數 億 元 到 今 天 賺 一 億 二 千 多萬 。 我 認 為 這 種 全 面 改 革 , 對 亞 視 來 說 是 必 須 的 ; 改 革 的 目 的 , 是 要 令 員 工 對 自 己的 公 司 、 工 作 和 人 生 重 投 信 心 , 感 到 驕 傲 。

我 不 是 一 個 輕 言 放 棄 的 人 ,我 已 盡 我 的 最 大 努 力 。 我 依 然 深 信 我 所 做 的 大 部 份 事 , 對 亞 視 和 員 工 都 是 正 確 和 有利 的 , 只 是 , 大 家 的 步 伐 並 不 一 致 。 我 也 曾 經 說 過 , 我 已 經 愛 上 這 間 公 司 , 因 為 那裡 充 滿 希 望 和 優 秀 的 前 線 員 工 , 這 種 想 法 至 今 不 變 。 我 一 直 以 堅 持 直 率 , 真 心 待 人, 所 做 的 一 切 , 都 從 亞 視 和 員 工 的 利 益 為 出 發 點 。

最 後 , 我 想 提 提 張 永霖 先 生 , 因 為 我 在 他 身 上 學 到 很 多 。 正 如 Linus 說 過 , 我 們 是 背 對 背 的 , 無 其 他 人可 以 離 間 我 們 。 雖 然 在 短 暫 的 未 來 , 我 不 能 再 和 他 一 起 為 亞 視 服 務 , 但 我 會 繼 續 默默 的 支 持 他 。

可 能 我 倆 實 在 太 用 心 去 做 事 , 根 本 不 單 止 當 這 是 一 份 工 作, 更 將 亞 視 當 成 自 己 的 公 司 。 若 我 們 之 間 任 何 一 個 出 現 差 錯 , 都 只 因 為 太 過 用 心 、太 過 投 入 。 由 始 至 終 , 我 沒 有 考 慮 過 自 己 個 人 的 成 敗 和 利 益 , 我 們 只 有 一 個 焦 點 :怎 樣 才 可 以 令 亞 視 走 上 成 功 之 路 。 可 惜 , 事 情 發 展 就 像 很 多 愛 情 故 事 一 樣 , 你 最 愛的 , 不 一 定 是 和 你 結 婚 和 生 活 的 那 位 。

我 們 擁 有 一 個 共 同 目 標 , 只 可 惜, 在 日 常 運 作 上 出 現 不 同 看 法 。 就 好 像 爸 爸 媽 媽 照 顧 他 們 的 嬰 孩 一 樣 , 孩 子 過 了 晚上 的 飲 奶 時 間 , 仍 然 熟 睡 。 到 底 應 該 由 他 安 睡 , 還 是 叫 醒 他 喝 奶 呢 ? 雖 然 觀 點 不 同, 大 家 都 只 是 希 望 用 最 好 的 方 法 去 照 顧 孩 子 , 愛 心 卻 是 共 通 的 。

大 家 都 同 意 , 要 為 亞 視 建 立 新 文 化 和 新 路 向 。 我 選 擇 在 這 時 退 下 來 , 應 該 是 最 恰 當 的 做 法 。

無論 如 何 , 在 過 往 的 十 二 天 , 我 倆 一 直 緊 密 合 作 , 所 做 的 每 一 件 事 、 每 一 個 決 定 都 有我 們 的 共 同 意 見 和 討 論 。 藉 此 , 我 衷 心 感 謝 他 帶 領 我 走 過 這 一 段 路 。 工 作 完 結 了 ,兄 弟 情 仍 在 。

最 後 , 是 關 於 亞 洲 小 姐 面 試 的 。 我 用 錯 字 眼 , 但 我 絕 無 半點 不 尊 重 之 意 , 失 言 亦 是 無 心 之 失 。 無 論 如 何 , 我 必 須 承 認 這 是 一 個 錯 誤 。 對 此 我深 感 歉 疚 , 衷 心 希 望 得 到 佳 麗 和 大 眾 的 原 諒 。

王 維 基
二 零 零 八 年 十 二 月 十 七 日



EE4206/EE5806 Digital Image Processing

EE4206/EE5806 Digital Image Processing

Notes, tutorial, and assignments questions

http://www.spl.it.cityu.edu.hk/~ebook/notes/notes.html

login: student
password: image

This maths is quite difficult. If you don't understand the maths, you cannot write those image processing programs.



Mittwoch, 17. Dezember 2008

Cora Diamond : Riddles and Anselm's Riddle

Cora Diamond : Riddles and Anselm's Riddle

notes, p.273

On riddle phrases

1. Riddle phrase: a linguistic expression put together by continuing familiar patterns, so the question or request looks like those we know how to use;

2. to solve it, though, what we need is not somethingof which we have been given a description, but something which it willstrike us as right to call by the phrase.

3. And it is the familiarity of the pattern which makes it possible for us not to see the kind of quest we are engaged in.



Cora Diamond: Realism and The Realistic Spirit

Cora Diamond: Realism and The Realistic Spirit
notes p.59

Berkeley on misunderstandings about language:

1. when language is not being used to communicate information about particular matters in the world as we know it in experience, it is used to communicate information about something else...

2. when we can follow a bit of language, we take it that we must have in our mind an idea of what it is the words we understand stand for.



EE4216/EE5816 Internet Client-Server Comp

EE4216/EE5816 Internet Client-Server Computing

This course is about java network programming

Recommended text:

Reilly and Reilly (2002))
Java network Programming and Distributed Computing



Dienstag, 16. Dezember 2008

Cora Diamond- Riddles and Anselm's Riddle

Cora Diamond : Riddles and Anselm's Riddle

The Realistic Spirit

notes: p267

1. Where you can ask, you can look for an answer, and where you cannot look for an answer, you cannot ask either. Nor can you find an answer.

2. Do something which I shall be inclined to accept as a solution, though I don't know now what it will be like.

3.WE remain in the situation of linguistic description or interpretations. What we want is to change it.



Sonntag, 14. Dezember 2008

BitTorrent 估值大跌

BitTorrent估值大跌 廢除1700萬美元融資項目

騰訊科技訊 北京時間12月15日消息(2008),據國外媒體報導,美國科技博客網站Techcrunch創始人邁克爾•阿靈頓(Michael Arrington)周日撰文稱,美國知名檔共用服務商BitTorrent近日向公司股東發送的一封絕密電子郵件顯示,受美國金融危機等因素影響,該公司目前估值大幅下降,因此被迫廢除已於今年夏季完成的1700萬美元融資專案。

...
...

BitTorrent聯合創始人阿什文•納文(Ashwin Navin)上月初表示,自己將辭去公司總裁職務,然後將同Google旗下視頻共用網站YouTube聯合創始人陳士俊等人組建一家創業公司。

http://www.techcrunch.com/2008/12/14/bad-times-for-bittorrent-17-m-financing-undone-valuation-plummets/



Cora Diamond: Belief in Abstract General Ideas

Cora Diamond : Realism and the Realistic Spirit

notes,50

The disease of Belief in Abstract General Ideas.

"Its most characteristic symptom is his way of conceiving the connections between events. The only reason there can be for accepting a prediction is belief in a connection supposed to be real, in the sense if independent of our thoght, and for which the observed regularity is evidence."

But the term "real connection" is an abstract idea.

"You do indeed believe that you believe it!"



Freitag, 12. Dezember 2008

EE3206 Java Polymorphism

EE3206/EE5805 Java programming and Applictions

notes on Savitch(2006)'s Absolute Java , p 478-486

1. Polymorphism refers to the ability to associate many meanings to one method name by means of the late binding mechanism.

2. with late binding, the definition of a method is not bound to an invoction of the method until run time, in fact, not until th time at which the particular invocation takes place.


//Sales.java
//superclass
public class Sale
{
private String name;
private double price;

public Sale()
{
name = "No name yet";
price =0;
}

public Sale(String theName, double thePrice)
{
setName(theName);
setPrice(thePrice);
}

public Sale(Sale originalObject)
{
if(originalObject == null)
{
System.out.print("Error: null Saleobject.");
System.exit(0);

}
name = originalObject.name;
price = originalObject.price;

}
public static void announcement()
{
System.out.println("this is the Sale class");
}

public double getPrice()
{
return price;
}
public void setPrice(double newPrice)
{
if(newPrice >= 0)
price = newPrice;
else
{
System.out.println("Error: Negative price.");
System.exit(0);
}
}
public String getName()
{
return name;
}
public void setName(String newName)
{
if (newName != null && newName !="")
name = newName;
else
{
System.out.println("Error: Improper name value.");
System.exit(0);

}


}
public String toString()
{
return (name + " Price and TTotal Cost = $" + price);
}
public double bill()
{
return price;
}

/* returns true if the names are the same and the
bill for the calling object is equal to the bill for otherSale; */

public boolean equalDeals(Sale otherSale)
{
if(otherSale == null)
return false;
else
return (name.equals(otherSale.name)
&& bill() == otherSale.bill() );
}

/* returns true if the bill for the calling
object is less than the bill for otherSale */

public boolean lessThan(Sale otherSale)
{
if(otherSale == null)
{
System.out.println("Error: null Sale object");
System.exit(0);

}
return (bill() < otherSale.bill() );

}
public boolean equals(Object otherObject)
{
if (otherObject == null)
return false;
else if (getClass() != otherObject.getClass())
return false;
else
{
Sale otherSale = (Sale)otherObject;

return(name.equals(otherSale.name)
&& (price == otherSale.price));
}
}

}


//DiscountSale.java
//derived class, note the method name
public class DiscountSale extends Sale
{
private double discount;
//cannot be negative

public DiscountSale()
{
super();
discount = 0;

}
public DiscountSale(String theName,
double thePrice, double theDiscount)

{
super(theName, thePrice);
setDiscount(theDiscount);

}
public DiscountSale(DiscountSale originalObject)
{
super(originalObject);
discount = originalObject.discount;

}
public static void announcement()
{
System.out.println("This is theDiscountSale class.");
}
public double bill()
{
double fraction = discount/100;

return (1-fraction) *getPrice();
}
public double getDiscount()
{
return discount;
}

public void setDiscount(double newDiscount)
{
if (newDiscount >= 0)
discount = newDiscount;
else
{
System.out.println("Error: Negative discount.");
System.exit(0);

}
}
public String toString()
{
return (getName() + " Price = $" + getPrice()
+ " Discount = " + discount
+"%\n" + " Total cost = $"
+ bill());
}
public boolean equals(Object otherObject)
{
if (otherObject == null)
return false;
else if (getClass() != otherObject.getClass())
return false;
else
{
DiscountSale otherDiscountSale =
(DiscountSale)otherObject;

return(super.equals(otherDiscountSale)
&& discount == otherDiscountSale.discount);

}
}


}


//LateBindingDemo.java : main
public class LateBindingDemo
{
public static void main(String[] args)
{
Sale simple = new Sale("floor mat", 10.00);
DiscountSale discount = new DiscountSale("floor mat", 11.00, 10);

System.out.println(simple);
System.out.println(discount);

if (discount.lessThan(simple))
System.out.println("Discounted item is cheaper");
else
System.out.println("Discount item is not cheaper.");

Sale regularPrice = new Sale("cup holder", 9.99);
DiscountSale specialPrice =
new DiscountSale("cup holder", 11.00, 10);

System.out.println(regularPrice);
System.out.println(specialPrice);

if (specialPrice.equalDeals(regularPrice))
System.out.println("Deals are equal.");
else
System.out.println("Deals are not equal.");


}

}




Donnerstag, 11. Dezember 2008

EE3206 java this reference

EE3206/EE5805: Java programming and Applications

notes Liang(2009), p 334

The "this" reference is the name of a reference that refers to a calling object itself.

this.i=i; means "assign the value of parameter i to the data field i of the calling object."

We can also use "this" to invoke another constructor of the same class.

Eg:

public Circle()
{
// invoke another constructor
this(1.0);
}




EE3206 java: immutable class

EE3206/EE5805

Java Programming and Application
notes Liang (2009),
p.333

Three requirement for an immutable class

1. declare all fields private

2. provide no set() methods

3.Provide no accessor methods that returns a reference to a data field that is mutable. eg .return a Date object.



周慧敏倪震宣布分手

周慧敏倪震宣布分手

(明報)12月11日 星期四 20:00

藝人周慧敏 和倪震 發表聲明,周慧敏原諒倪震,但會回復朋友關係,倪震就基於「問責」,決定「引疚分手」。

周慧敏的聲明全文如下:

我與倪震識於微時,一起共渡過不能盡算的高低起落,早已磨合了一套我們之間的相處藝術。一個人的問題,兩個人去修正;一個人的挫敗,兩個人去承擔。我倆是一個團隊的,沒分高低,輸贏也是一体。某程度上,周慧敏早已是一位不同面貌的倪震。任誰一方受到傷害,另一方都願抵禦百倍的痛。一起走過將近二十個年頭,絕對不是在一般人的準則下相愛,但外人卻總愛把自己的一套價值觀去評價、批判屬於我倆之間的愛情。

今天我能夠成為自愛,懂得愛人,擁有著無比勇氣與承擔的女人,請不要小看這個精神伴侶在我背後為我付出過的一切努力,包容,寵愛,照顧與扶持。都生活了這麼久,沒有倪震,成就不了今天的周慧敏。所以我敢大膽向各位說一句:「我的伴侶絕對犯得起這個錯誤」,而這句說話,亦只我一人有資格去定論。看到伴侶事後為我做出的承擔,我馬上就原諒了他,又怎會有某些媒體創作出來的痛哭,拍檯,大罵,這般無稽的謊言呢?不到一天,我看到了很多無比荒誕,狠毒,涼薄的炒作與咀咒,妖魔鬼怪都湧進來,愈炒作愈黑暗,致人於死地。

公眾人物談戀愛要承受異於常人理解的壓力,從當年決定和不按常規行事的倪震談戀愛,就知道是一場革命了,亦沒有失望過。香港這片是非地,無風三尺浪,暗箭來自四方八面,行差踏錯一步就如掉進鬥獸場。當中我們需要的信心,包容,付出是一般情侶無法體會的。顯微鏡下看世界,任誰都難合格。我告訴大家,我們不害怕,也不逃避,只是有點累了。在回復到朋友關係以後,我們要好好享受不用被批判的日子,大家為未來再次裝備出發。我相信身份的改變,疏離不了我們之間微妙的關愛。

最後,我要向每位真正支持愛護我的朋友說:「我沒枉費與倪震轟轟烈列地愛過,永遠刻骨銘心,此生無憾。而我自己亦都會好好地勇敢活下去,一如過往。」多謝各位。

而倪震的聲明如下:

最近滿城風雨,矛頭都是我作為一個男朋友怎樣失敗。我多謝大家的意見和抨擊,事發後也承諾過深切反省和負責。想了一星期,我再為我的錯誤向慧敏道歉,也多謝她再一次肯包容我的過失。但感情由兩個人的事,變成了所有人的事,性質已起了改變。雨過天青不難,但可以保證暴風雨不再來嗎?我問了自己這個問題很久,意識到我這次的錯誤並非如一些損友說是技術上不小心,而是結構上出現了明顯的中年危機。我會正視問題,完善自我,不排除尋求專業輔助。在有信心改善之前,我明白到我在大家的心目中,不再是個稱職的男朋友,更不配做慧敏的男朋友。為了令公眾安心,為了顯示我的後悔和承擔,我決定引疚分手,和慧敏結束情侶關係,做回知心的朋友。這無疑是極大的損失,但我相信傳媒界,和慧敏的fans,都會歡迎我這個痛苦的決定。我不是個稱職的男朋友,但做個稱職的好朋友,我很有信心。

我和慧敏相識近二十年,一向互相支持和了解。今日因我的不撿點分手,也不會影響我們繼續來往,處理合作的日常事務,和照顧愛貓。我做錯事,認了錯,向慧敏交待了,也得到慧敏的原諒。基於問責分手,已是極刑。以前種種,我和慧敏不會再作回應。以後種種,請大家尊重我和慧敏只是朋友的關係,不要再訂出情侶的標準。假如我們

我已搬離跑馬地寓所,再一次多謝慧敏多年來的包容,和傳媒多年來的鞭撻。人頭落地了,退一步海闊天空,希望事情可以告一段落。



Mittwoch, 10. Dezember 2008

Frege: Begriffsschrift-preface

Frege's Begriffsschrift :preface

excerpted from "The Frege Reader" edited by M Beaney, p.51.


1. I hope that logicians, if they are not put off by first impression of unfamiliarity, will not repudiate the innovations to which I was driven by a necessity inherent in the subject matter itself.

2. These deviations from what is traditional find their justification in the fact that logic hitherto has always followed ordinary language and grammer too closely.

3. In particular, I believed that the replacement of the concepts subject and predicate by argument and function will prove itself in the long run. It is easy to see how taking a content as a function of an argument gives to concept formation.

4. What also deserves notice is the demostraion of the connection between the meanings of the words: if, and, not, there is, some, all, etc.



Dienstag, 9. Dezember 2008

Cora Diamond: Realism and the Realistic Spirit

Cora Diamond : Realism and the Realistic Spirit

notes: p.43

On philosophical glasses

1. "...the philosopher who takes himself to be wearing irremovable glasses does not take these to be distorting his view. The 'glasses' here are the underlying logical order of all thought... "

2. "Because he is convincedthat all thought must have his order, he is convinced that he is able to ee it in the reality of our actual thought and talk, even though the ways we think and speak do not (to what he takes to be a spuerficial view) appear to exhibit such an order."

3."The removal of the glasses is his being able to see properly what always was before him; what stood in the way of his removing them was a confused understanding of language."



Cora Diamond: Realism and the Realistic Spirit

Cora Diamond: Realism and the Realistic spirit

notes: p.41

1. "The conception of calculation as an experiment tends to strike us as th only realistic one.
Everything else, we think, is monshine. In an experiment we have someing tangible.

2. Ramsey's view on logic: that whenever we make an inference (of any sort) we do so according to some ruleor habit.



Montag, 8. Dezember 2008

Cora Diamond : Intro 2-1

Cora Diamond- The Realistic Spirit

notes p.35

1. The common thing: they do not invite us to give up the making of philosophical propositions because such propositions are nonsensical (because they are a priori, or departures from some language-game, or in whatver other way fail to meet some supposed requirement).

2. They both treat philosophical propositions as constructions we make on the basis of linguistic analogies, patterns, or images in our language.

3. We may come to see that we do not want to go on doing anything with these linguistic constructions; the satisfaction of our needs does not lie that way.

4. We abandon them; we leave them unused; we say "These we do not want." To call them nonsensical is to exclude them in that way from the commerce of our lives.


java Thread pools

EE3206/EE5805

notes on Liang(2009) p. 969

1. java 5 uses the Executor interface for executing tasks in a thread pool and the ExecutorService interface for managing and controlling tasks.




Reading Comprehension

I cannot write java multi-thread programming though I have read the whole chapter on multi-threading.

This is not a problem of reading comprehension.

An empirical question cannot be solved by logical understanding.



柏楊--醜陋的中國人

柏楊全集

醜陋的中國人

http://nrch.cca.gov.tw/ccahome/website/site4/BY_Collect/b9000f0/cca220003-li-wpkbbyb9000f0toc-0000-u.html




EE3206/EE5805 java Thread animations

EE3206/EE5805 Java programming and Application

notes on Liang(2009), p.964

use a thread to control animations


import javax.swing.*;


public class FlashingText extends JApplet implements Runnable
{
private JLabel jlblText = new JLabel("DMC Welcome", JLabel.CENTER);

public FlashingText()
{
add(jlblText);
new Thread(this).start();
}

public void run()
{
try
{
while(true)
{
if (jlblText.getText() == null)
jlblText.setText("DMC Welcome");
else
jlblText.setText(null);

Thread.sleep(300); // static
} // end while

}
catch(InterruptedException e)
{

}
}
}




java : 3 steps to threads

EE3206/EE5805 Java programming and Applications

notes on Liang(2009), p.958-961:

Three steps to start a thread

1. create a class that implements the Runnable interface and implements the run() method.

2. new() a thread object by passing the Runnable object to the Thread class

3. start threads by invoking the start() method

////////////////////////////////////

public class TaskThreadDemo {
public static void main(String[] args)
{
// create tasks
Runnable printA = new PrintChar('a', 100);
Runnable printB = new PrintChar('b', 100);
Runnable print100 = new PrintNum(100);

// 2. create thread objects by passing
// the Runnable object to the Thread class
Thread thread1 = new Thread(printA);
Thread thread2 = new Thread(printB);
Thread thread3 = new Thread(print100);

// 3. start threads
thread1.start();
thread2.start();
thread3.start();

}

//////////////////////////////////////////////////

public class PrintChar implements Runnable
{
// 1. implements th Runnable interface and implements the run() method

private char charToPrint; //the characte to print
private int times; // the number of times to print

public PrintChar(char c, int t)
{
charToPrint = c;
times = t;

}
public void run()
{
for (int i=0; i< times; i++)
System.out.print(charToPrint);

}
}

///////////////////////////////////////

public class PrintNum implements Runnable
{
private int lastNum;

/** a task to print 1,2,3, ...i */
public PrintNum(int n)
{
lastNum =n;

}

public void run()
{
for(int i=1; i<= lastNum; i++)
System.out.print(" " + i);
}
}





Event dispatcher thread

EE3206/EE5805 java programming and Appications

Event dispatcher thread: notes on Liang(2009)

You need to write code in he event dispatch thread to avoid deadlock.


import javax.swing.*;

public class EventDispatcherThreadDemo
extends JApplet
{
// you need to write code in he event dispatch
// thread to avoid deadlock

public EventDispatcherThreadDemo()
{
add(new JLabel("Hi, it runs from an event dispatch thread"));
}

public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable() {
public void run()
{
JFrame frame =
new JFrame("EventDispatcherThreadDemo");
frame.add(new EventDispatcherThreadDemo());
frame.setSize(300,200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}

}); // anonymous inncer class
}
}




Freitag, 5. Dezember 2008

魑魅魍魎

魑魅魍魎

http://ja.wikipedia.org/wiki/魑魅魍魎

http://dict.idioms.moe.edu.tw/chengyu/mandarin/fulu/dict/cyd/2/cyd02966.htm




中國歷史通俗演義 - 明史

中國歷史通俗演義 - 明史

http://www.open-lit.com/bookindex.php?gbid=112




How to Draw in Java

EE3206/EE5805 Java Programming and Applications

notes from Liang(2009), p.478

How to draw in Java:

1. create a class that extends JPanel

2. override paintComponent()

The paintComponent() is automatically invoked to paint graphics when the component is first displayed or whenever the component needs to be redisplayed.



import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;


public class TestDrawPanel extends JFrame {

public TestDrawPanel()
{
JPanel dp = new DrawPanel();
dp.setBackground(Color.ORANGE);

add(dp);
// 3. add JPanel to the JFrame
}

public static void main(String[] args)
{
TestDrawPanel tdp = new TestDrawPanel();

tdp.setTitle("TestDrawPanel");
tdp.setSize(300,200);
tdp.setLocationRelativeTo(null);
tdp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tdp.setVisible(true);

}

class DrawPanel extends JPanel
{
// to draw, 1. create a class that extends JPanel
protected void paintComponent(Graphics g)
{
// 2. override the paintComponent()
//
super.paintComponent(g);

g.setColor(Color.RED);
g.drawLine(10,10, 70, 70);
g.drawRect(30,50 ,150, 100);
}
}


}




Donnerstag, 4. Dezember 2008

Cora Diamond: Later philosophy on Liberating

Cora Diamond : The Realistic Spirit

Introduction II

notes p.33

1. The notion in the later philosophy of philosophy as liberating is thus tied to an ability to look at the use without imposing on it what one thinks must already be there in it.

2. The notion of use itself and what is meant by giving or presenting it thus also changes: an expression is not presented timelessly--its use is not given --by the general form of the proposition it characterizes; use can be seen only as belonging to the spatial, temporal phenomenon of language.



Mittwoch, 3. Dezember 2008

Cora Diamod: No Philosophical Requirements

Cora Diamond : The Realistic Spirt

Notes: P28-29

1. "The aim of philosophy, as I see it, being in a kind of liberation from laying down this or that requirement..."

2. Philosophical Requirements may take the following form:

"Regardless of what things look like, if we are to have or do such-and-such, there must be so-and-so."



Cora Diamond: Intro II

Cora Diamond: The Realistic Spirit

notes: P27-28

1. "Our practice are exploratory, and it is indeed only through such exploration that we come to see fully what it was that we ourselves thought or wanted to say."

The present situation is not to explain and interpret but to explore and configure.


2. "Justification, in ethics as anywhere else goes on within lives we share with others, but what we make count in that life is not laid down in advance.

The force of what we are able to say depends on its relation to the life of the words we use, the place of those words in our lives; and we may make the words tell by argument, by image, by poetry, by Socratic redistribution, ... by proverbs, by all sorts of old and new things."





java : The Most Popular Language

TIOBE Programming Community Index

Java is the most popular programming language in 2008

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html



Montag, 1. Dezember 2008

EE3206/EE5805 Java Sys properties

EE3206/EE5805 Java Programming and Application

Here is the java code to check your system properties:


//
import java.util.*;

public class SysProperty
{

public SysProperty()
{

}

public static void main(String[] args)
{
Properties prop =
System.getProperties();

prop.list(System.out);
}

}




Sonntag, 30. November 2008

Blender Anination

Blender Animation


www.blender.org



EE3206/EE5805 Java-thread-5

EE3206/ EE5805 Java Programming and Applications


14.3.2 static synchronized mtehods,
notes from Gosling etc. "The Java progamming Language"

1. A static synchronized method acquires the lock of the Class object for its class. If static data is shared between threads then access to it must be protected by static synchronized methods.

2. Acquiring the Class object lock in a static synchronized method has no effect on any objects ofthat class.

3. You can still invoke synchronized methods on an object while another thread holds the Class object lock in a static synchronized method, only other static synchronized methods are blocked.



Samstag, 29. November 2008

The Java mind-set

The java mind-set

You must read Gosling etc 's "the Java programming Language".

It javalizes you on how to act in a java way.

The java mind-set, whether it is good or bad likes a pair of goggles put on your eyes.



EE3206/EE5805 Java thread-4

EE3206/EE5805 Java Programming and application

notes on 14.3.1 Synchronized methods
excerpted from the "The Java Programming Language, 4th ed."

1. Synchronization forces execution of the two threads to be mutually exclusive in time. On the contrary, unsynchronized access does not wait for any locks but proceeds regardless of locks that may be held on the object.

2. Locks are owned per thread, so invoking a synchronized method from within another method synchronized on the same object will proceed without blocking, releasing the lock only when the outermost synchronized method returns.

3. This per-thread behavior prevents a thread from blocking on lock it already has, and permits recursive method invocations and invocations of inherited methods which themselves may be synchronized.

4. The constructor does not need to be synchronized because it is executed only when creating an object, and that can happen in only one thread for any given new object.

5. Access to the field must be synchronized. With the synchronized declaration, two or more running thread are guaranteed not to interfere with each other.

6. There is no guarantee as to the order of operations. If the balance is queried about the same time that a deposit occurs, one of them will complete first but you cannot tell which.

7. You can ask whether the current thread holds the lock on a given object by passing that object to the Thread class's static holdsLock() method, which returnstrue if the current thread does hold the lock on that object.

Eg. assert Thread.holdsLock(this);

8. When an extended class overrides a synchronized method, the new method can be synchronized or not. The superclass's method will still be synchronized when it is invoked.

9. If the unsynchronized method uses super to invoke the superclss's synchronized method, the object 's lock will be acquired at that time and will be released when the superclass's method returns.




EE3206/EE5805 Java thread-3

EE3206/EE5805 Java Programming and Applications

notes on 14.3 Synchronization, from "The Java Programming Language":

1. We need to avoid interleaved operation that can corrupt the data. Such potentially interleaving actions are termed critical sections or critical regions, and you prevent interference by sychronizing access to those critical regions.

2. It is solved by acquiring a lock on an objet. Threads cooperate by agreeing to the protocol that before certain actions can occur on an object, the lock of the object must be acquired.

3. Acquiring the lock on an object prevents any other thread from acquiring that lock until the holder of the lock receives it.

4. Every object has a lock associated with it, and that lock can be acquired and released through the use of synchronized methods and statements. The terms syschronized code describes any code that is inside a synchronized method and statement.



EE3206/EE5805 Java thread-2

EE3206/EE5805 Java programming and Applications

notes on 14.2 using Runnable
from Gosling etc.. 's "The Java Programming Language , 4ed"

1.The work done by a thread is oackaged up in its run() method.

2. You can execute a Runnable object in its own thread by passing it to a thread constructor. If a thread object is constructed with a runnable object, the implementation of Thread.run will invoke the runnable object's run() method.

3. Real classes define complete state and behaviour, where having something execute in a separate thread is only a part of theit functionality.

4. Eg. new thread(this).start();
--While we didn't keep a reference to the thread, when the thread itself was created, it stored a reference to itself in its ThreadGroup.

5. We can place the run() method in part of an anonymous inner class (interface based) that implements Runnable. Eg.

...
public PrintServer2()
{
// constructor
Runnable service =
new Runnable() {
public void run() {
for(;;)
realPrint(request.remove() );
}
}; // queer
new Thread(sevice).start();
}
...


6. Using Runnable objects, you can create very flexible multithreaded designs. Each Runnable becomes a unit of work and each can be passed from one part of the system to another.

7. We can store Runnable objects in a queue and have a pool of worker threads servicing the work requests in the queue-- a very common design used in multithreaded server applications.



EE3206/EE5805 Java Threads-1

EE3206/ EE5805 Java Programming and Applications

notes on Threads from "The Java Programming Language, 3rd" p 229-231:

Creating Threads

1. To create a thread of control, you start by crating a Thread object:

Thread student = new Thread();

2. When the thread is ready to run, you invoke its start() method. The start() method spawns a new thread of control based on the data in the Thread object, then returns.

3. The JVM invokes the new thread's run() method, making the thread active. You can invoke start() only ONCE for each thread--invoking it again results in an
IllegalThreadStateException.

4. When a thread's run() method returns, the thread has exited. You can cease running a thread by invoking its interrupt() method.

5. To get a thread that does something, you must either extend Thread to provide a new method or create a Runnable object and pass it to the thread's constructor.

6. You can get the Thread object for the currently running thread by invoking the static method Thread.currentThread.



Mittwoch, 26. November 2008

java-src-3.1-Calculator.java

EE3206/EE5805 :

// java-src-3.1-Calculator.java


public class Calculator {
/** Main method */
public static void main(String[] args) {

// Check command-line arguments
if (args.length != 3) {
System.out.println(
"Usage: java Calculator operand1 operator operand2");
System.exit(0);
}

// The result of the operation
int result = 0;

// Determine the operator
switch (args[1].charAt(0)) {
case '+': result = Integer.parseInt(args[0]) +
Integer.parseInt(args[2]);
break;
case '-': result = Integer.parseInt(args[0]) -
Integer.parseInt(args[2]);
break;
case 'x': result = Integer.parseInt(args[0]) *
Integer.parseInt(args[2]);
break;
case '/': result = Integer.parseInt(args[0]) /
Integer.parseInt(args[2]);
}

// Display result
System.out.println(args[0] + ' ' + args[1] + ' ' + args[2]
+ " = " + result);
}
}





Java Coding Style

EE3206/ EE5805 Java Programming


Java Coding Style

http://geosoft.no/development/javastyle.html

http://java.sun.com/docs/codeconv/



Dienstag, 25. November 2008

Ogg Vorbis 格式

Ogg是一個完全開放性的多媒體系統計劃的名稱,也是Ogg Vorbis文件的擴展名。

Ogg Vorbis是一種類似于Mp3的有損音頻壓縮格式,但是它自由(免費、無專利限制)且開放源代碼。Vorbis是這種音頻壓縮格式的名稱。目前Ogg計劃只實現了Vorbis的部分。

Ogg Vorbis格式非常先進,雖然Vorbis也是有損壓縮,但是由于其使用了更加先進的聲學模型,同様位元率 (Bit Rate)下的Ogg文件比Mp3文件聽起來更好一些。事實上,一些評測結果顯示,在80k-256k的位元率下ogg格式呈現出該位元率範圍下的相對于其他音頻格式(mp3pro,wma,aac)更高的保真度。



http://en.wikipedia.org/wiki/Ogg

http://blog.roodo.com/rocksaying/archives/277025.html

http://www.fsf.org/resources/formats/playogg



Montag, 24. November 2008

Cora Diamond--Philosophy and the Mind-1

Cora Diamond--Philosophy and the Mind-1

Notes: (p.3)

1. ...Because logic 'fills' the world and because the possibilities of the world are the possibilities for thought, for the self considered non-psychologically, philosophical talk will be 'about the self' in its analysis of ordinary proposition about any and every ordinary subject matter.

2....remark about philosophy's being able to talk about the self in a non-psychological way is one of the remarks that has to be überwindet: we must win over it, throw away the ladder of which it is a rung.

3... The final step is the philosophical journey that takes us to the seeing of philosophical analysis as philosophy's non-philosophical presentation of the self leaves us without that description or any supposedly unspeakable understanding corresponding to it.



Samstag, 22. November 2008

The Logic of Experience

How is the logic of experience possible?

An empirical question cannot be logically deduced although it is logical.

So ./ cannot be .txt.

Donnerstag, 20. November 2008

EE3206 Java Mouse Color Panel

EE3206/EE5805 Java Programming (tut09)

There are 3 file in this exercise;

1.TestDrawableColorPanel.java (main)
2.RadioColorPanel.java
3.DrawColorPanel.java

/////////////////////////////////////////////////
//TestDrawableColorPanel.java (main)

public class TestDrawableColorPanel
{


public static void main(String[] args)
{
RadioColorPanel rcp = new RadioColorPanel();
rcp.setVisible(true);

}
}

//////////////////////////////////////////////////
//RadioColorPanel.java


import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;



public class RadioColorPanel extends JFrame
{
public static final int WIDTH = 600;
public static final int HEIGHT =300;

private JPanel radioButtonPanel;
private DrawColorPanel colorPanel;

private JRadioButton blackButton;
private JRadioButton blueButton;
private JRadioButton greenButton;
private JRadioButton redButton;
private JRadioButton whiteButton;

// to group radio button and add() them
private ButtonGroup btg;


RadioColorPanel()
{
super("Test Drawable Color Panel");
setSize(WIDTH, HEIGHT);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(new BorderLayout(5,5) );

radioButtonPanel = new JPanel();

radioButtonPanel.setLayout(new FlowLayout() );

btg= new ButtonGroup();


blackButton = new JRadioButton("Black");
blackButton.addItemListener(new radioColorButtonListener() );
radioButtonPanel.add(blackButton);
btg.add(blackButton);

blueButton = new JRadioButton("Blue");
blueButton.addItemListener(new radioColorButtonListener() );
radioButtonPanel.add(blueButton);
btg.add(blueButton);


greenButton = new JRadioButton("Green");
greenButton.addItemListener(new radioColorButtonListener() );
radioButtonPanel.add(greenButton);
btg.add(greenButton);


redButton = new JRadioButton("Red");
redButton.addItemListener(new radioColorButtonListener() );
radioButtonPanel.add(redButton);
btg.add(redButton);

whiteButton= new JRadioButton("White");
whiteButton.addItemListener(new radioColorButtonListener());
radioButtonPanel.add(whiteButton);
btg.add(whiteButton);


//ButtonGroup is not a subclass of Component. So a Buttongroup
// object cannot be added to a container



add(radioButtonPanel, BorderLayout.NORTH);

colorPanel = new DrawColorPanel();
colorPanel.setBorder(new TitledBorder("Color Area by ( Martin Leung )") );
add(colorPanel, BorderLayout.CENTER);

}

private class radioColorButtonListener implements ItemListener
{
public void itemStateChanged(ItemEvent e)
{
//make sure the source is a JRadioButton
if (e.getSource() instanceof JRadioButton)
{
if(blackButton.isSelected())
colorPanel.drawInBlack();
else if (blueButton.isSelected() )
colorPanel.drawInBlue();
else if (greenButton.isSelected() )
colorPanel.drawInGreen();
else if (redButton.isSelected() )
colorPanel.drawInRed();
else if (whiteButton.isSelected() )
colorPanel.drawInWhite();

}
colorPanel.setBackground(Color.LIGHT_GRAY);
}
}

}

///////////////////////////////////////////////
DrawColorPanel.java

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;

public class DrawColorPanel extends JPanel
implements MouseListener, MouseMotionListener
{

private Point lineStart = new Point(0,0);
private Point mousePoint = new Point();

private boolean blackColor =false;
private boolean blueColor = false;
private boolean greenColor = false;
private boolean redColor = false;
private boolean whiteColor = false;

public DrawColorPanel()
{
super();
addMouseMotionListener(this);
addMouseListener(this);

}

public void drawInBlack()
{
blackColor =true;
blueColor = false;
greenColor = false;
redColor = false;
whiteColor = false;
}

public void drawInBlue()
{

blackColor =false;
blueColor = true;
greenColor = false;
redColor = false;
whiteColor = false;
}

public void drawInGreen()
{

blackColor =false;
blueColor = false;
greenColor = true;
redColor = false;
whiteColor = false;

}

public void drawInRed()
{

blackColor =false;
blueColor = false;
greenColor = false;
redColor = true;
whiteColor = false;

}

public void drawInWhite()
{
blackColor =false;
blueColor = false;
greenColor = false;
redColor = false;
whiteColor = true;
}

// mouse handling interface

public void mouseClicked(MouseEvent e)
{
// get its (x,y) coord
// mousePoint = e.getPoint();
// repaint();
}

public void mouseEntered(MouseEvent e)
{
//
}

public void mouseExited(MouseEvent e)
{

}

public void mouseReleased(MouseEvent e)
{
//

}
public void mousePressed (MouseEvent e)
{
//
lineStart.move(e.getX(), e.getY());
// repaint();
}

public void mouseDragged(MouseEvent e)
{

Graphics g= getGraphics();


if (blackColor == true)
g.setColor(Color.BLACK);
else if (blueColor ==true)
g.setColor(Color.BLUE);
else if (greenColor == true)
g.setColor(Color.GREEN);
else if (redColor == true)
g.setColor(Color.RED);
else if (whiteColor == true)
g.setColor(Color.WHITE);

mousePoint = e.getPoint();

// the order of the 3 lines is very important...
g.drawLine(lineStart.x, lineStart.y, e.getX(), e.getY());
g.dispose();
lineStart.move(e.getX(), e.getY()) ;
// repaint();

}

public void mouseMoved(MouseEvent e)
{
//
}

public void paintComponent(Graphics g)
{
super.paintComponent(g);


//g.drawLine(lineStart.x, lineStart.y, mousePoint.x, mousePoint.y);
//g.dispose();

}


}




專家不過是訓練有素的狗

常言「專家只不過是一隻訓練有素的狗」語出何處及其英文原文?

From Student to Professional...

"讓學生 獲得對 各種價值的 理解和 感受是很重要的,
他必須能真切地 感受到 美麗 與道德的 良善,
否則他的專業知識只是使他更像一隻受過良好訓練的狗,
而不是 一個和諧發展的人."


http://reffaq.ncl.edu.tw/hypage.cgi?HYPAGE=faq_detail.htm&idx=1797

http://www.phy.ntnu.edu.tw/demolab/phpBB/viewtopic.php?topic=12179



EE3206 Java Drawing Mouse

EE3206 Java : How to Draw with a Mouse

tut09:

1. why only draw straight lines?

2.to use ArrayList to hold the points from the mouse event

http://www.leepoint.net/notes-java/examples/mouse/10mousetest.html




Mittwoch, 19. November 2008

Throwing Away the Ladder

Cora Diamond--Throwing Away the Ladder: How to Read the Tractatus

notes : (p.181-2)

1. to throw the ladder away is, among other things, to throw away in the end the attempt to take seriously the language of 'features of reality'.

2. To speak of features of reality in connection with what shows itself in language is to use a very add kind of figurative language. That goes also for "what shows itself."



Dienstag, 18. November 2008

EE3206 Java Event Handling

EE3206 Java Programming

Event Handling-- from Savitch 's Absolute Java (p.931)

1. Clicking a button with your mouse creates an object known as an event and sends the event object to another object known as the listeners. This is called firing the event.

2. The listener then performs some action. When we say that the event is "sent" to the listener object, what we really mean is that some method in the listeners object is invoked with event object as the argument.

3. For each button, it needs to specify what objects are listeners that will respond to events fired by that button; this is called registering the listener.

4. Different kinds of components require different kinds of listeners classes to handle the events they fire. A button fires events known as action events, which are handled by listeners known as action listeners.



聖鬥士--沙加的阿賴耶識

聖鬥士--沙加的阿賴耶識

http://hk.youtube.com/watch?v=ckyhzitRKQU&feature=related

http://hk.youtube.com/watch?v=3edWeKaDfLg&feature=related

http://hk.youtube.com/watch?v=uM_cf1T_QE0&feature=related



Montag, 17. November 2008

Cora Diamond--Realism and the Realistic Spirit

Cora Diamond--Realism and the Realistic Spirit

There is a quotation from Remarks on the Foundations of Mathematics (p.325)

"Not empiricism and yet realism in philosophy, that is the hardest thing."



Cora Diamond--How to Read the Tractatus

Cora Diamond-- Throwing Away the Ladder: How to read the Tractatus

Notes: (p.179)

"...the distinction between what can be said and what can only be shown."



Cora Diamond- Throwing Away the Ladder

Cora Diamond- "Throwing Away the Ladder: How to Read the Tractatus"

6.53 To say nothing except what can be said....

6.54. He must so to speak throw away the ladder, after he has climbed up on it.

7. Whereof one cannot speak, thereof one must be slient.

There is an useful link:

http://www.hum.utah.edu/philosophy/Faculty/millgram/witt/wittrdngs.html



Sonntag, 16. November 2008

Cora Diamond--linguistic surfaces

Cora Diamond--The Realistic Spirit (p.55)

'linguistic surfaces':

'sentences used independently of the ties to evidence and consequences which characterize the ordinary application of the expressions which they contain.'

-'The representation was not meant to be taken as an accurate portrayal of how things were...'

-'Conventions of representation of the sort we have been concerned with, in painting or in writing, do not settle truth...'

-(p.62) 'We make sentences called causal laws--when we have learned to reason inductively. To have learned to do so is indeed to have learned to behave in a certain way, and causal generalizations are what we come up with when we behave that way.'



Cora Diamond--conventions of description

Cora Diamond --The Realistic Spirit (p.54)

'conventions of description'

'the existence of rules or conventions concerning what my appropriately be said and indeed thought about a certain matter,... leaves open the question what is true about those matter.



HOW to convert yourself to LINUX

HOW to convert yourself to LINUX

1. You need a FRIEND who uses LINUX

2. Your LIFE needs LINUX


You need a complier to build from source.

Now think of Life as your compiler.
All of us have Life, but we need to recompile Life first using the -lessgeek and
-moreoutgoing flags in order to create Life suitable for you.

make LIFE -lessgeek -moreoutgoing


http://lxer.com/module/newswire/view/112116/index.html




Donnerstag, 13. November 2008

EE3206 Java-whichCard()

EE3206/EE5805 Java Hearts Programming Project

before executing westPlayer.playACard(CArd dealCard);, CPU needs to determine which card to deal, hence the algorithm :

public Card whichCardToDeal(int currentSuit);


public Card whichCardToDeal(int currentSuit)
{
if (player can follow suit)
{
retrun card same with the current suit
}
else if (player leads the suit && heartBreak == false)
{
if (player can deal card other than HEART)
{
retrun a card which is NOT a HEART
}
else
{
this player can only deal HEARTS
deal a HEART
heartBreak = ture
}
else if (player leads the trick && heartBreak == true)
{
can deal any card
}
else
{
this player only follow suit
return any card
}

}





Dienstag, 11. November 2008

Java Hearts remarks

EE3206/ EE5805 Java programming and Applications

Hearts game Project

public Card whcihCardToDeal(int leadSuit);

before CPU player playsACard(String cardname) , it needs to determine which card to deal.

The conditions are:

1. what is the value of leadSuit?
2. can it follow suit?
3. if not, which suit can be dealt?
4. if no other suits other than hearts-- deal a hearts,
then brokenHeart = ture
5 update playerCardList



Cora Diamond: The Realistic Spirit

Cora Diamond: The Realistic Spirit

Philosophy as liberating (p.32-33)

1."The way philosophy liberates is...connected with the significance of 'use' and of willingness or unwillingness to look to the use for what it enables us to see."

2."...philosophy as liberating is thus tied to an ability to look at the use without imposing on it what one thinks must already be there in it."

3."...an expression is not presented timelessly--its use is not given -- by the general form of the propositions it characterizes; use can be seen only as belonging to the spatial, temporal phenomenon of language."




Montag, 10. November 2008

EE3206 Hearts Games

EE3206/ EE5805 Java Programming and Applications

PlayACard()

1.It needs to be decomposed. Thre is a currentTrickList to record which player deals
whick and. display the displayCurrentTrickList().

2. When a CPU player deals a card , remove a card element in his playerCArdList. Add a card in currentTrickList in gamelogic.

randASuit();
whoTakeTrick() by using the currentTrickList
resetTrickList() for the next trick

Also, need to remember whoPlayNext. and the score



Frege's Ontological Argument

Notes on Joan Weiner's Frege Explained (p.159-161):

1. The ontological argument for the existence of God:

2." God is omniscient", "God exists"...

3. existence is not a property. The predicate 'exists' is actually a natural language expression for a quantifier.

4. To say that a cat exists is not to predicate existence of a particular cat but rather, to say that there exists an X such that X is a cat.

5. To say that God exists is not to predicate a property of God.

6. It is, rather to say something about the concept most perfect being that can be conceived; existence statements are about concepts.

7. There is no property of existence that can be predicated of an object. Thus the argument does not go through.

I first encountered this argument when I read Anscombe. But Weiner 's explanation is more clear and concise.



Sonntag, 2. November 2008

Frege Explained

Joan Weiner 's book "Frege Explained: From Arithmetic to Analytic Philosophy" is a very clear and good introduction to Frege.

I like Chaper 1: Frege's life and Character. I am rather sympathetic to Frege.

There is a sharp contrast between the fate of Frege and Russell in intellectual life.



Frege: Grundlagen

The Foundations of Arithmetic 算術基礎

From the Frege Reader (1997) edited by Michael Beaney, p.90 :

"In this investigation I have adhered to the following fundamental principles:

There must be a sharp separation of the psychological from the logical, the subjective from the objective;

The meaning of a word must be asked for in the context of a proposition, not in isolation;

The distinction between concept and object must be kept in mind.

Beaney comments on J.L. Austin's tranlation (page X) as making Frege "too muck like an Oxford linguistic philosopher." I hope there is another translation in the wiki.



Samstag, 1. November 2008

Frege: Begriffsschrift

Frege's Begriffsschrift

Summary: http://www.rbjones.com/rbjpub/philos/bibliog/frege01.htm

wiki: http://en.wikipedia.org/wiki/Begriffsschrift


In The Foundations of Arithmetic (算術基礎 ), Frege devised 3

"fundamental principles:

1. always to separate sharply the psychological from the logical, the subjective from the objective;

2. never to ask for the meaning of a word in isolation, but only in the context of a proposition;

3. never to loose sight of the distinction between concept and object."


(tranlated by J. L. Austin)(1980)



Freitag, 31. Oktober 2008

Savannah.nongnu.org

Savannah.nongnu.org

Savannah.nongnu.org is a central point for development, maintenance and distribution of Free Software that runs on free operating systems.




Donnerstag, 30. Oktober 2008

Java Hearts Remarks5

EE3206/EE5805 Java Programming and Applications

There is a PlayerInfo class which holds 4 players in an ArrayList.
Each Player in turn contains an ArrayList to hold 13 cards.

swap3card() to swap 3 cards to a neighbor player.
sortcard() to sort the card in the ArrayList.



Montag, 27. Oktober 2008

Frege-算術基礎

Frege——算術基礎

Die Grundlagen der Arithmetik

(The Foundations of Arithmetic)

"Are the laws of arithmetic synthetic a priori or analytic?"

http://www.china-pub.com/722567


java interface wiki

EE3206/EE5805 Java Programming and Applications

From Savitch's Absolute Java (2 ed. 2006), p.711-713, " An inteface is a type that can be satisfied by any class that implemetns the interface."

"An interface is a type. This allows you to write a method with a parameter of an interface type, ... and that parameter will accept as an argument any class you later define that implements the interface."



Samstag, 25. Oktober 2008

F S LCM-2008

predicted states and actions taken in logic..

on what condition will collective action taken?

To forecast the state..

action is taken on the same state...predefined in logic--LCM



Donnerstag, 23. Oktober 2008

java interface

EE3206 / EE5805 Java Programming and Applications

interface inheritance

In the java textbook, Liang(2009), p.397, "You can use an interface as a data type for a variable, as the result of casting and so on."

"You can now use the Edible interface to specify whether an object is edible.

The relationship between the class and the interface is known as interface inheritance.

Since interface inheritance and class inheritance are essentially the SAME, we will simply refer to both as inheritance. "

eg:
...
if (objects[i] instanceof Edible)
System.out.println(( (Edible) objects[i] ).howToEat() );




Freitag, 17. Oktober 2008

SF001:人們等知更鳥報春時,春天已經結束了

罕 有 開 金 口 股 神 自 掏 腰 包 買 股



  (星島日報報道)股神巴菲特投資取態對全球舉足輕重,這位價值投資翹楚,一向看重股票長遠投資價值,近日在全球金融海嘯下,他認為股票投資價值漸顯,一向少於公開場合談及對股市看法的他,在《紐約時報》撰文,表示會把自己私人的資金投進美股,若美股價值持續吸引,更會百分百持有美股。以下為他在《紐約時報》全文。

  目前金融世界,包括美國以及海外都亂成一鍋粥。而金融市場的問題更擴散至整體經濟,情況一發不可收拾。短期而言,失業將會上升,商業活動搖搖欲墜,新聞頭條繼續駭人。

  正因如此……我現在已出手吸納美股。我是用個人投資戶口買入美股的,而之前這個戶口除了美國國庫債券外甚麼都沒有。(上述種種與我在巴郡的投資沒有關係,我在這家公司的投資全部用於慈善)假如美股股價持續處於吸引的水平,我在巴郡以外的淨資產很快會百分百成為美股。

  為甚麼我會這樣做?

  本人有一條很簡單的買股原則:在眾人貪婪時你要恐懼,當眾人恐懼時你就要貪婪成性。可以很肯定的說,現在恐懼正在擴散,就算是投資老手亦復如此。是的,投資者應規避高槓桿投資和市場競爭力薄弱的公司,但對為數眾多質素良好公司的長期前景感到恐慌,實在沒頭沒腦。目前很多優質公司的盈利表現的確遇到阻滯,但它們以往也經常如此,大部分的公司在未來五年、十年以至二十年仍然陸續會有新的盈利。

  首先要弄清楚一件事:我不能預測股市的短期變化。我也不知道究竟股價在一個月後或一年後會升抑或跌。不過,在市場氣氛或者經濟全面恢復之前,股市有機會上升或者大升。就好像你守候的知更鳥出現時,但春天已差不多完結了。(註:知更鳥是春天的象徵)

  再看看一點歷史:在大蕭條的時候,杜指在一九三二年七月八日見底,跌至四十一點。不過,當時經濟環境仍然持續轉壞,直至羅斯福在一九三三年三月上任時為止,期間股市已經由低位反彈了三成。或者再看看第二次世界大戰早期的情況,當美國在歐洲以及太平洋情況不妙之時,股市已經在一九四二年四月見底,比起盟軍扭轉局勢為早。在一九八○年代初期,最佳入市時機就是通脹肆虐以及經濟在谷底之時。簡單來說,壞消息就是投資者的最好朋友,讓你可以用折讓價買入美國(公司)的未來。

  長期來說,美國股票市場的消息將會是正面的。在二十世紀,美國曾經忍受兩次世界大戰及其他傷痛又昂貴的軍事衝突;大蕭條、以及十多次的衰退及金融恐慌;石油危機、流感疫症,以及總統不體面地辭職。不過,杜指多年來仍能由六十六點升至一萬一千四百九十七點。

  你或許會認為,在如此一個有特高收益的世紀,投資者不可能損失金錢,但卻有一些投資者的確損手了。那些倒楣的人只會在感到安心時購入股份,但在報章標題令他們不安時着手沽售股份。

  今天,人們會因持有現金而感到安心,但他們不應如此,因他們正選擇一個長遠只得可怕回報的資產,那些現金資產實際上不但沒有回報,而且更在貶值。政府為紓緩現時危機而作出的政策,將會證明是引致通貨膨脹的,會加速現金實質價值下跌。

  幾乎可以肯定,下個十年股票的表現會在很大程度上好於現金。目前那些執於投資現金的人應該懂得即時收手。與其坐以待斃等待股市利好消息,不如主動出擊,勿忘冰球皇帝Wayne Gretzky說過的,迎擊冰球即將出沒的地方,而不是它已經所在之處。

  我不喜歡對股市表示意見,我亦一再強調,我不知道股市短期會如何,可是,我會依據一家開設在空置銀行大廈裏的餐廳的廣告所示:你的錢在那裏,你的胃口就在那裏。今天,我的錢及胃口都在股票上。
2008-10-18

「 壞 消 息 是 投 資 者 的 最 佳 朋 友 , 因 這 時 是 執 平 貨 的 良 機。 」


Mittwoch, 15. Oktober 2008

Samstag, 4. Oktober 2008

Java Hearts Remarks4

EE3206/EE5805 Java Programming and Application

Java Hearts Game Project Remarks4

The following notes are summarized from David Eck 's Introduction to Programming Using Java, Chap 5.4:

http://math.hws.edu/javanotes/index.html


1. For the Hearts Game, we need a standard deck of playing cards. Each player gets a hand of cards.

2. The Deck is shuffled and Cards are dealt one at a time from the Deck and added to the player's hand.

3. The Card classs has instance variable, suit and value.

4.The Deck class has shuffle() and dealCard().

5. The Hand class has addCard() and removeCard()

6. A Deck obect has 52 cards in standard order when created. Activate shuffle() to randomize the card.

Activate dealCard() to get the next card from the deck. The return type is card.


7.Hand Class. It has no cards when first created. Activate addCard() to add a card to the hand.

Specify the Card object for which card is added. Activate removeCard() to specify which card to remove.


8. Card Class. Use new Card(value, suit) to create a card object. There are four suits, eg, Card.SPADES.
Use enum type to specify.

In the Hearts game, Ace is the largest while 2 is the smallest card. Modify the code.

9. In text mode, 2 helper methods, getValueAsString() and getSuitAsString() for toString() .

Java Hearts Remarks3

EE3206/EE5805 Java Programming and Applications

Java Hearts Project Remarks3

In desgining the java Hearts game project, Eck's book is a very good reference. See Chap 5.4, 6 and 12.

We need 3 classes: Card, Hand and Deck

1. How to randomize,shuffle cards?

2. For the swap direction , "x mod 4 =0" to decide the direction of swapping the 3 cards


http://math.hws.edu/javanotes/index.html



Java Hearts Remarks2

EE3206/EE805 Java Programming and Applications

The Java Hearts game project: Remarks 2


There is a card demo program on how to drag card UNDER another while the order and layer of the card remain the SAME.

Card images can be obtained from the textbook : Liang's Introduction to Java programming 7/e website. see chap 13 exercise,


http://www.leepoint.net/notes-java/examples/graphics/cardDemo/cardDemo.html

Donnerstag, 2. Oktober 2008

Java Hearts Remarks1

EE3206/EE5805 Java Porgramming and Applications

How to draw cards on the JPanel?

1. Whenever a component is displayed, the jvm automatically creates a Graphics object for the component on the native platform.

eg Graphics graphics = jpanelcanvas.getGraphics();

2. In order to draw things on a component eg JPanel
consistently, you need to declare a class that
extends a Swing GUI component class an overrides
its paintComponent method to specify what to draw

3. ImageIcon imageicon = new ImageIcon("CardImg/36.png");
Image qimage = imageicon.getImage();
g.drawImage(qimage, 40, 40, 72, 96, this);

////////////////////////////////////////////////////

import javax.swing.*;
import java.awt.*;
import java.awt.Graphics;


public class DrawQueen extends JFrame
{
// paint a quueen card image
//In order to draw things on a component eg JPanel
// consistently, you need to declare a class that
// extends a Swing GUI component class an overrides
//its paintComponent method to specify what to draw


public DrawQueen()
{
add (new DrawPanel() );
}

public static void main (String[] args)
{
DrawQueen frame = new DrawQueen();

frame.setTitle("Draw a Queen on a JPanel component");
frame.setSize(500,400);
frame.setLocationRelativeTo(null); //centre the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}

}



class DrawPanel extends JPanel
{

ImageIcon imageicon = new ImageIcon("CardImg/36.png");
ImageIcon imageicon2 = new ImageIcon("CardImg/35.png");
ImageIcon imageicon3 = new ImageIcon("CardImg/12.png");
ImageIcon imageicon4 = new ImageIcon("CardImg/13.png");

Image qimage = imageicon.getImage();
Image rimage = imageicon2.getImage();
Image simage = imageicon3.getImage();
Image timage = imageicon4.getImage();

protected void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawLine(0,0,50,50);
g.drawString("Player 1", 0, 40);

if (qimage != null )
{
g.drawImage(qimage, 40, 40, 72, 96, this);
g.drawImage(rimage, 60, 40, 72, 96, this);
g.drawImage(simage, 80, 40, 72, 96, this);
g.drawImage(timage, 100, 40, 72, 96, this);
}

}
}

Freitag, 26. September 2008

EE5805 Java 傷心小棧-Wiki

EE3206/EE5805 Java Programming and Applications

The following wiki information on "傷心小棧" is excerpted from:

http://zh.wikipedia.org/wiki/傷心小棧

紅心大戰是一項四人的撲克牌遊戲。這個遊戲的目標是要在遊戲中拿到最少的分數。

如何玩

開始玩
要玩紅心,只是需要:

四名玩家
一副撲克牌
紙筆以記錄分數
在不同數量的玩家有不同的玩法,請參看「變化」部分。


[編輯] 牌面
玩紅心是需要一副52張的撲克牌,這與橋牌的版面相同,牌面大小由大至小的順序為A、K、Q、J、10、9、8、7、6、5、4、3和2。並且沒有皇牌。


[編輯] 目標
紅心的主要要點就是避免取得分數;當一位玩家的分數到了指定的點數(通常是100分),遊戲便會結束。而得到最少分數的玩家便會成為該次遊戲的優勝者。


[編輯] 遊玩概要
紅心是依照回合進行的,每一局都會發牌,與玩家交換卡牌,捨牌,以及計分四部分。遊戲會持續地進行,直到遊戲完結為止。

[編輯] 發牌
在捨牌時沒有特別的效果,多數發牌者會按次按左移動。

[編輯] 交換卡牌
在多數回合裡,每一名玩家會與其他三名玩家交換卡牌,並由其他玩家中取得三張牌。玩家在取得交換卡牌前必須先將卡牌交予另一位玩家。

每一局都會按照這個順序來交換卡牌:

第(4的倍數+1)局:傳左
第(4的倍數+2)局:傳右
第(4的倍數+3)局:對傳
第(4的倍數)局:保留所有牌;不交換任何牌

[編輯] 捨牌
所有的紅心牌和Q♠都是有分的卡牌。

首輪:首先由有2♣的玩家開始首輪捨牌,規定一定要出2♣,其他玩家依照順時鐘選牌丟出有相同花色的牌,若是沒有,則可以出其他花牌, 惟獨不能出有計分的牌(紅心牌和Q♠)。除了與首位出牌者不同花色的玩家之外,由點數大者贏得此次的捨牌。

第二輪之後:由上一輪贏者出牌,除了紅心牌其他花色皆可出,除非手中只剩下紅心牌而無其他花色,或是上幾輪中心碎(見下解釋),方可出紅心牌。 其他玩家依序丟出相同花色的牌,若是沒有,則可以出其他花牌,亦可以出有計分的牌。首次丟出紅心牌稱作心碎,下一輪之後出牌者皆可以出紅心牌。

[編輯] 計分
在每一回合完結時,有分數的牌會合計起來,每一張紅心牌有1分,而Q♠有13分,在一個回合中,總其有26分。但是如果其中一名玩家全取所有的紅心牌以及Q♠的話,那就會成為「豬羊變色」,這位玩家無需增加任何的分數,而另外三位便要加上26分;又或者某些玩家直接地減去該名玩家26分,但兩者的分數計法分別無關,只會將遊玩的時間加長。

最後,當任何一位玩家的分數起過了一個指定的分數,遊戲便算結束了。



EE5805 Java 傷心小棧遊戲過程

EE3206/EE5805 Java Programming and Applications

The following information on "傷心小棧遊戲過程" is excerpted from:

http://www.csps.kh.edu.tw/stu/stu89/right/course/brokeheart.html

傷心小棧遊戲過程:

一、傷心小棧的牌局一開始,首先每一位遊戲者需要選三張牌換給左邊下家的遊戲者(除了第四、八等四倍數的牌局例外)。

二、如何選牌,其操作方式如下所示:

 1在欲選的牌上按一下滑鼠左鍵,突出該張牌,即表示選擇此牌。

 2在突出的牌上按一下滑鼠左鍵,即可取消選擇此牌。

 3傷心小棧的玩法是比誰拿到的紅心牌少,即分數愈低愈好,所以在換牌時,儘量將一些高點數的牌換出丟,例如:穿衣服的Q、K和A。

三、在選擇好交換的三張牌後,按「向左轉」鈕換給下一家,同時您也會收到上一家換來的三張牌。

四、請按「確定」鈕接下換來的三張牌,等到全部遊戲者都換好牌後,手握梅花2的遊戲者必須先出牌,出牌的方法如下:

 1在欲出的牌上,用滑鼠左鍵按一下即可出牌。

 2在突出的牌上,用滑鼠左鍵按一下即可取消選擇此牌。

五、遊戲規則:

 1按順時鐘方向出牌,等到每家都出一張牌後,我們稱為「一墩」。

 2在同一墩的出牌時,每一位下家的遊戲者需出相同花色的牌,除非您手上沒有此花色的牌,才可以出別花色的牌。

 3等到出完一墩牌後,點數最高者必需收取此墩的牌,其中若有分數的牌,便是您的得分,同時得到下一墩的出牌權。

 4第一墩不能去出紅心和黑桃Q。

 5遊戲每一墩不能先出紅心,除非有遊戲者因無紅心牌,才可以出過紅心牌。

 6紅心和黑桃Q都是有分數的,因為是比誰的分數少,請儘量不要拿到這些牌。

六、等到所有遊戲者的牌都出完後,就算完成一局,可以看到這一局每位遊戲者所得的分數和名次。分數愈低,名次愈高,當莊家按下「確定」鈕後,就會進入下一局的牌局,這個牌局會持續進行直到某位遊戲者超100分。

七、計分方式:

 1紅心牌一張1分,黑桃Q一張13分。

 2如果一局有人拿到所有紅心牌和黑桃Q,稱為「博大」,拿到的遊戲者可得0分,其它遊戲者都得26分的處罰分數。

八、結束傷心小棧:如果想結束傷心小棧的遊戲,因為是網路上的牌局,將因參與遊戲的角色不同而有差異。

 1莊家結束遊戲,就會結束此牌局,其它遊戲者都會看到「傷心小棧即將結束」的警告訊息。

 2如果只是加入遊戲者結束遊戲,將不會影響牌局,其位置會被電腦取代。


Reference:

http://zh.wikipedia.org/wiki/傷心小棧
http://www.csps.kh.edu.tw/stu/stu89/right/course/brokeheart.html

Donnerstag, 25. September 2008

EE5805 Java Hearts Images

EE3206/EE5805 Java Programming and Applications

Hearts Game project

There are 52 card images from wiki:

SCROLL down. You can also find the unicode and html codes.

http://en.wikipedia.org/wiki/Hearts_(suit)

http://en.wikipedia.org/wiki/Diamonds_(suit)

http://en.wikipedia.org/wiki/Clubs_(suit)

http://en.wikipedia.org/wiki/Spades_(suit)

http://en.wikipedia.org/wiki/Suit_(cards)

The images are published under the GNU Free Documentation License.



Montag, 22. September 2008

EE5805 Java Programming (3)

EE3206 or EE5805 Java Programming and Applications

Tutorial 3 – Programming with Objects and Classes

Submission Required (Question 4--Due on 24 Sept 08)

1. Create a project “JTutor03”. Write a Java class SimpleBankAccount with a public
data field balance.

Write your own main method to create an object of
SimpleBankAccount. Test the object by reading from and writing to the balance.

2. The bank requires that a minimum balanace should be $100 upon creation of an
account. For this purpose, create another class DefaultBankAccount in the same
project.

It has a public data field balance and a no-arg constructor to initialize the
balance. Test the object by reading from and writing to the balance.

3. The DefaultBankAccount is not well protected as its balance is a public field.
Rewrite the class by changing its balance field to private and providing getters and
setters as suggested below.

Save the class as ProtectedBankAccount. You must
make sure the balance is enough for transaction. Test the object by using the
getters and setters to access the balance.

Method Headers:

-public double getBalance() // return balance
-public boolean withdraw(double amount) // return true on success
-public boolean deposit(double amount) // return true on success

Sample Test Output:

My initial account balance is 100.0
After depositing $200:
My account balance is 300.0

After withdrawing $200:
My account balance is 100.0

After withdrawing $200 again:
My account balance is 100.0

4. Create another class RealBankAccount by renaming the ProtectedBankAccount.
Write an instance method transfer based on the given header and static version
below. The instance method transfers money from its own account to another
account.

Method Header

-public boolean transfer(RealBankAccount to, double amount)
-Static Method - transfer

-public static boolean transfer(RealBankAccount from, RealBankAccount to, double amount) {
if(amount <= from.getBalance() && -amount <= to.getBalance())
{
from.withdraw(amount);
to.deposit(amount);
return true;
} // end if
else
return false;
}

Write a main method in RealBankAccount to test the class. The main method takes
three arguments from command line: balance of account A, balance of account B,
transferred amount. Demonstrate your result to the tutor during the tutorial class.

Example 1: java RealBankAccount 200 300 100
Account A balance is 200.0
Account B balance is 300.0

After transferring $100.0 from A to B:
Account A balance is 100.0
Account B balance is 400.0


Example 2: java RealBankAccount 300 400 500
Account A balance is 300.0
Account B balance is 400.0

After transferring $500.0 from A to B:
Account A balance is 300.0
Account B balance is 400.0


You have just progressively built up your bank account program. You may find that
each revision is just done by adding some extra features to the existing one, with most
of the class properties being same.

However, you have to redefine the same things in a new class every time. This is inconvenient and may cause errors when you copy and
paste the code. What even worse is that you are now maintaining multiple pieces of
code.

For example, you are asked to change the type and name of the balance in all
these four classes.

This could be a disaster when you have a fundamental change in
the base class of a big project that have hundreds of classes.
In the next lesson, you will see how we handle this problem.

- END -



Samstag, 20. September 2008

EE5805 Java-Use Cases Notes

EE5805 Java Programming and Applications

The following notes on Use Cases are excerpted from Fowler's "UML Distilled":

1. Use cases are a technique for capturing the functional requirements of a system.

2. Use cases work by describing the typical interactions between the users of a system the system itself. It provides a narrative of how a system is used.

3. A scenario is a sequence of steps describing an interaction between a user and a system.

4. Therefore, a use case is a set of scenarios tied together by a common user goal.

5. An actor isa role that a user plays in the system.

6. But almost all the value of use cases lies in the textual content, and the diagram is of rather limited value.


Content of Use Case



EE5805 Java -UML Tutorial

EE3206/EE5805 Java Programming and Applications

As we need to desgin the "Hearts" game using UML, there is a good tutorial on UML.

http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/index.htm


Also, a good brief introduction is Fowler's "UML Distilled"



Freitag, 19. September 2008

EE5805 Hearts Project (Python)

There is an open source game named "Hearts" written in python.

What is "Python"? It is the language which the first version of the BT software was written.

You need to install python nand pygame in order to play the game.

http://www.python.org


http://www.pygame.org/projects/23/362/?release_id=636

But, Pygame (a game development website in using python) is blockd by the the CityU firewall system.



EE5805 Java Project-Hearts-1

EE3206/EE5805 Java Programming and Applications

Project Part I – Problem Analysis

Background

CitySoft is a software company and the leading solution provider in the market. You
are working in the Java team to develop Java-based applications and systems. Your
team has just received a new project about a popular card game named Hearts that is
also a widespread computer game as packaged in Microsoft Windows XP.

Basically,the client wants to make a Java clone of MS Windows Hearts with a few additional features and modifications.

Figure 1. Microsoft Windows XP Hearts

1. Rename the players as East, North, West and South according to their position.
2. Enable both graphical and text mode display.
3. Enable following cheat codes:

Cheat code syntax (case insensitive) Example Remarks
a) set [east/south/west/north] [score] set east 30 Change players’ scores.
b) void [spade/heart/diamond/club] void diamond Remove a suit from human player by
exchanging with other players’ cards
on hand randomly.
c) shootmoon shootmoon Human player incurs all point cards of
preceding tricks.
d) visible [true/false] visible true Turn over all players’ cards.


Requirement Analysis

Now, you are asked to analyze this card game system and document the system
requirements with the following things:

1. A brief summary of the game play

- For ease of reading, you should list out the steps or instructions in point form
with short sentences. You may also divide the game play into different sections
based on the game states if it is too long.

2. Use Cases and Use Case Diagrams

- Draw use case diagram(s) to demonstrate the functional requirements as well as
any entities involved.
- Use cases should be detailed with a sequence of actions and responses between
the actor and system. Alternative flows, if any, should also be shown. You may
tabulate the actions and responses in each use case for ease of reading.

Submission

Upload your document to Blackboard before 8pm in 1st October 2008. Your document
should be well-formatted based on the guidelines below:

1. Filename
- Since all students upload to the same pool, please rename your file as
Hearts_Group_NN.doc (e.g. Hearts_Group_05.doc).

2. Cover page
- Show your Name, Student ID, Group Number, Course Code and Last
Modification Dates.

3. UML tools
- Do not use the MS Word built-in drawing tools for the UML diagrams. You
should use some specialized drawing or modeling tools. Some of them are
available for free (see references). Others like Visio and Poseidon for UML are
also good but costly.

References

Wikipedia, Hearts (Window) - http://en.wikipedia.org/wiki/Hearts_(Windows)

Videocast, How to play Hearts - http://www.utipu.com/app/tip/id/398

JUDE Community Edition - https://jude.change-vision.com/jude-web/index.html

UMLet - http://www.umlet.com/




Samstag, 13. September 2008

The Rise of British Idealism

I have noticed that there are signs for the rise of British Idealism. There is a phenomenlogical turn in British philosophy. Many papers are "produced" on the Hussurlian context.


That means British philosophy is declining from the Empirical tradition.

May be the term "Postivist" or "Empiricist" sounds out-dated. Use "inter-subjectivity", "Meditiation: Descarte's way".


Is there any "new" Russell or Moore? Not to mention "new" Frege or "new "Wittgenstein.

羅時憲-唯識方隅

羅時憲-<<唯識方隅>>

http://www.dhalbi.org/publ/publ_law.htm

第一、 二卷:《八千頌般若經論對讀》上、下

第三卷:《般若波羅蜜多心經講錄》、 全文下載:(繁體) / (简体)

《能斷金剛般若波羅密多經纂釋》全文下載:(繁體) / (简体)

第四卷:《解深密經圓測疏節要》全文下載:(繁體9M) / (简体10M)

第五、六卷:《瑜伽師地論纂釋》一、二

六卷:《攝大乘論疏》、《大乘掌中論略疏》

第七-九卷:《成唯識論述記刪注》一 至 三 全文下載:(繁體50M)

第十卷:《唯識方隅》全文下載:(繁體3.3M及 索引) / (简体5.0M及 索引)

第十一卷:《學術論文集》

第十二卷:《詩文聯語遺照墨跡》



http://www.dhalbi.org/publ/publ_law.htm

Freitag, 12. September 2008

No pygame at cityu

You cannot access www.pygame.org at City University of Hong Kong.

The site http://www.pygame.org is blocked by the Computing Centre.

But you can access python. That means you can wrtite python but cannot write games in python at cityu.

python game rescources: At HERE