作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/1)使用情境:一個對象可能要訪問共用資源來完成它所要提供的服務,在多線程情況下,多個這樣的對象在一起就會產生意想不到的後果,比如競爭。監視器就是在這樣的一個對象上設定一個鎖,以保證在給定時間內,只有一個線程可以執行這個對象上的任何一個方法。2)例子:我們建立一個日誌記錄的類public class FileLogger { public synchronized void
Advice to a Young Man (給年輕人的建議) Remember, my son, you have to work. Whether you handle a pick or a pen, a wheel-barrow(手推車;獨輪推車) or a set of books, digging ditches or editing a paper, ringing an auction bell or writing funny things, you must work.
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/Youth is not a time of life; it is a state of mind; it is not a matter of rosy(adj. 薔薇色的,玫瑰紅色的;美好的;樂觀的;漲紅臉的) cheeks, red lips and supple(supple ['s?pl]柔順的) knees; it is a matter of the will, a quality of
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/Every day I remind myself that my inner and outer life are based on the labors of other men, living and dead, and that I must exert myself in order to give in the same measure as I have received and
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/ ITIM 5.0 單伺服器配置和部署。 部署ITIM之前要對其組件進行部署: IBM DB2 Enterprise 9.1 with FP2 IBM WebSphere Application Server 6.1 with FP9 IBM Tivoli Directory Server 6.2 IBM Tivoli Directory Integrator 6.1 我們安裝系統的軟硬體環境是:
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/Universities and Their Function By Alfred North Whitehead The justification for a university is that it preserves the connection between knowledge and the zest(n. 風味;熱心;強烈的興趣) of life, by uniting
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/今天繼續看《編程之美》的第三個問題。問題的描述就不多說了,這是一個典型的離散數學問題(這個連結有非常詳細的問題描述),喜歡圖案的童鞋(比如我),可以參看CMU的一個講義。從1975年比爾蓋茨和他的導師發表的文章:Gates, W. and Papadimitriou, C. "Bounds for Sorting by Prefix Reversal." Discrete Mathematics. 27
作者:gnuhpc 出處:http://www.cnblogs.com/gnuhpc/1.概述這個模式也比較簡單,書中沒有提到。用於恢複上次操作結果等情境,比如資料庫復原等。這個模式有三個參與的實體:Originator:知道如何儲存自己的對象。Caretaker:知道Originator何時以及為何儲存並恢複自己的對象。Memento:由Originator進行讀寫,並且Caretaker完成維護的對象2.執行個體首先,我們建立一個Memento: 1: class Memento