posted @ 2008-03-13 11:37 Raylong 閱讀(1540) | 評論 (3) | 編輯 收藏
posted @ 2007-11-01 17:12 Raylong 閱讀(1160) | 評論 (14) | 編輯 收藏
posted @ 2007-10-30 18:49 Raylong 閱讀(6447) | 評論 (8) | 編輯 收藏
posted @ 2007-10-30 07:24 Raylong 閱讀(949) | 評論 (6) | 編輯 收藏
一提到線程好像是件很麻煩很復雜的事,事實上確實如此,涉及到線程的編程是很講究技巧的。這就需要我們變換思維方式,了解線程機制的比較通用的技巧,寫出高效的、不依賴于某個JVM實現的程序來。畢竟僅僅就Java而言,各個虛擬機的實現是不同的。學習線程時,最令我印象深刻的就是那種不確定性、沒有保障性,各個線程的運行完全是以不可預料的方式和速度推進,有的一個程序運行了N次,其結果差異性很大。 閱讀全文
posted @ 2007-10-25 23:53 Raylong 閱讀(32833) | 評論 (19) | 編輯 收藏
從Java1.1開始引入了內部類以來,它就引起了人們的激烈爭論。其實任何優秀的語言特性用得不好就是濫用,內部類用得不好就會導致代碼像迷宮一樣,導致出現毫無重用的綜合征。 閱讀全文
posted @ 2007-10-24 08:03 Raylong 閱讀(32226) | 評論 (24) | 編輯 收藏
posted @ 2007-10-22 08:52 Raylong 閱讀(638) | 評論 (0) | 編輯 收藏
Java提供了一種很好的機制,用強制規定的形式來消除錯誤處理過程中隨心所欲的因素:異常處理。它的優秀之處在于不用編寫特殊代碼檢測返回值就能很容易地檢測錯誤。而且它讓我們把異常處理代碼明確地與異常產生代碼分開,代碼變得更有條理。異常處理也是Java中唯一正式的錯誤報告機制。 閱讀全文
posted @ 2007-10-22 08:18 Raylong 閱讀(6481) | 評論 (12) | 編輯 收藏
posted @ 2007-10-21 13:14 Raylong 閱讀(17744) | 評論 (2) | 編輯 收藏
數組(array)是相同類型變量的集合,可以使用共同的名字引用它。數組可被定義為任何類型,可以是一維或多維。數組中的一個特別要素是通過下標來訪問它。數組提供了一種將有聯系的信息分組的便利方法。注意:如果你熟悉C/C++,請注意, Java數組的工作原理與它們不同。 閱讀全文
posted @ 2007-10-21 13:01 Raylong 閱讀(4685) | 評論 (3) | 編輯 收藏
posted @ 2007-10-21 12:47 Raylong 閱讀(5661) | 評論 (17) | 編輯 收藏
posted @ 2007-10-20 13:06 Raylong 閱讀(2625) | 評論 (22) | 編輯 收藏
posted @ 2007-10-20 11:17 Raylong 閱讀(1109) | 評論 (4) | 編輯 收藏
posted @ 2007-10-16 18:39 Raylong 閱讀(1252) | 評論 (25) | 編輯 收藏
(多態,或者說是向上轉型。他忽略了類型的具體細節,僅僅和基類交互。這很符合我們人類的思維習慣,比如你會開車,那么給你一輛奔馳你肯定能開,寶馬也可以。只需說我在開車,而不必說我在開奔馳開寶馬。當然你可以這么說,炫耀一下也不是錯^_^,Java允許你這么做。) 閱讀全文
posted @ 2007-10-15 16:22 Raylong 閱讀(1057) | 評論 (6) | 編輯 收藏
上周學的東西真就不多,速度實在太慢,不是我懶,而是看書太過細致,效率不高導致的。算法還沒接觸到正題呢,語法總結了一點點,編程思想剛看完第一章。如此的速度很愁人啊。 閱讀全文
posted @ 2007-10-15 07:38 Raylong 閱讀(523) | 評論 (15) | 編輯 收藏
-------------------Raylong 閱讀全文
posted @ 2007-10-14 16:12 Raylong 閱讀(13532) | 評論 (21) | 編輯 收藏
(下面開始列舉了其他語言的種種不足,幾乎每本技術書的開篇就是王婆賣瓜的形式出現的,給讀者點鼓勵嘛,不要被厚厚的磚頭般的書嚇到。搞計算機的女生的好處是,晚上在你回宿舍的路上,不幸遇見歹人攔路打劫,你只需隨便抄起一本書就能把他打個半死。好的技術書不僅能豐富知識,也是居家旅游、貼身自衛的最佳工具。C++本身就很復雜,用復雜的語言描述復雜的問題,對設計者和程序員的要求都很高。) 閱讀全文
posted @ 2007-10-13 21:27 Raylong 閱讀(1209) | 評論 (4) | 編輯 收藏
(早期的程序員都是很強的……) 閱讀全文
posted @ 2007-10-13 21:23 Raylong 閱讀(1273) | 評論 (4) | 編輯 收藏
9、Our problem is to devise a program that can remember sufficient information about the pairs it has seen to be able to decide whether or not a new pair of objects is connected. Informally, we refer to the task of designing such a method as the connectivity problem. This problem arises in a number of important applications.
我們要設計一個程序,它能夠知道足夠的配對信息,以便決定新的配對能否是聯通的。非正式地,我們把設計這樣的方法稱為聯通問題。這個問題出現在很多重要的應用中。
(看起來沒什么復雜的算法,是因為規模小,10個配對用人腦就能算出來。it possible for a human to 閱讀全文
posted @ 2007-10-13 08:40 Raylong 閱讀(1096) | 評論 (3) | 編輯 收藏
2007年10月11日 21:00:01
2007年10月12日 8:35:34 翻譯
Form:《Algorithms in Java: Parts 1-4, Third Edition》
1、 Most algorithms of interest involve methods of organizing the data involved in the computation. Objects created in this way are called data structures, and they also are central objects of study in computer 閱讀全文
posted @ 2007-10-13 08:22 Raylong 閱讀(1127) | 評論 (7) | 編輯 收藏
posted @ 2007-10-13 07:59 Raylong 閱讀(236) | 評論 (0) | 編輯 收藏