【轉(zhuǎn)】Android 2.1 源碼結(jié)構(gòu)分析
摘要: 閱讀全文posted @ 2011-07-09 09:37 XXXXXX 閱讀(247) | 評論 (0) | 編輯 收藏
posted @ 2011-07-09 09:37 XXXXXX 閱讀(247) | 評論 (0) | 編輯 收藏
posted @ 2011-07-08 09:37 XXXXXX 閱讀(1578) | 評論 (0) | 編輯 收藏
posted @ 2011-06-18 15:25 XXXXXX 閱讀(694) | 評論 (1) | 編輯 收藏
看看 project euler 的第一道題:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
用 python 語言寫出來是:
posted @ 2011-06-17 20:26 XXXXXX 閱讀(4389) | 評論 (2) | 編輯 收藏
This is the first edition of what is expected to become a recurring series on InfoQ. The idea behind this minibook is that a number of InfoQ articles and interviews which deal with a particular topic (in this case, REpresentational State Transfer, or REST) are combined together to provide a detailed exploration suitable for both beginners and advanced practitioners.
Read More: http://www.infoq.com/minibooks/emag-03-2010-rest;jsessionid=1E2375E822D980824403DAD46588FAFE
posted @ 2011-06-15 12:39 XXXXXX 閱讀(251) | 評論 (0) | 編輯 收藏
#定義:如果在一個內(nèi)部函數(shù)里,對在外部作用域(但不是在全局作用域)的變量進行引用,那么內(nèi)部函數(shù)就被認為是閉包(closure)
分解來說,包含下面3個條件:
1) 需要函數(shù)嵌套, 就是一個函數(shù)里面再寫一個函數(shù).
2) 外部函數(shù)需要返回一個內(nèi)部函數(shù)的引
3) 外部函數(shù)中有一些局部變量, 并且, 這些局部變量在內(nèi)部函數(shù)中有使用
一些概念:
1)自由變量: 外部函數(shù)中定義的局部變量, 并且在內(nèi)部函數(shù)中被使用
2) 閉包: 那個使用了自由變量并被返回的內(nèi)部函數(shù)就稱為閉包
#支持閉包的語言有這樣的特性:
1)函數(shù)是一階值(First-class value),即函數(shù)可以作為另一個函數(shù)的返回值或參數(shù),還可以作為一個變量的值
2)函數(shù)可以嵌套定義,即在一個函數(shù)內(nèi)部可以定義另一個函數(shù)
#代碼示例
posted @ 2011-06-15 07:31 XXXXXX 閱讀(1312) | 評論 (0) | 編輯 收藏
posted @ 2011-06-14 16:57 XXXXXX 閱讀(1087) | 評論 (0) | 編輯 收藏
posted @ 2011-06-12 23:58 XXXXXX 閱讀(304) | 評論 (0) | 編輯 收藏
posted @ 2011-06-06 16:03 XXXXXX 閱讀(343) | 評論 (0) | 編輯 收藏