【轉】Android 2.1 源碼結構分析
摘要: 閱讀全文posted @ 2011-07-09 09:37 XXXXXX 閱讀(250) | 評論 (0) | 編輯 收藏
posted @ 2011-07-08 09:37 XXXXXX 閱讀(1583) | 評論 (0) | 編輯 收藏
posted @ 2011-06-18 15:25 XXXXXX 閱讀(698) | 評論 (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 閱讀(4392) | 評論 (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 閱讀(254) | 評論 (0) | 編輯 收藏
#定義:如果在一個內部函數里,對在外部作用域(但不是在全局作用域)的變量進行引用,那么內部函數就被認為是閉包(closure)
分解來說,包含下面3個條件:
1) 需要函數嵌套, 就是一個函數里面再寫一個函數.
2) 外部函數需要返回一個內部函數的引
3) 外部函數中有一些局部變量, 并且, 這些局部變量在內部函數中有使用
一些概念:
1)自由變量: 外部函數中定義的局部變量, 并且在內部函數中被使用
2) 閉包: 那個使用了自由變量并被返回的內部函數就稱為閉包
#支持閉包的語言有這樣的特性:
1)函數是一階值(First-class value),即函數可以作為另一個函數的返回值或參數,還可以作為一個變量的值
2)函數可以嵌套定義,即在一個函數內部可以定義另一個函數
#代碼示例
posted @ 2011-06-15 07:31 XXXXXX 閱讀(1315) | 評論 (0) | 編輯 收藏
posted @ 2011-06-14 16:57 XXXXXX 閱讀(1091) | 評論 (0) | 編輯 收藏
posted @ 2011-06-12 23:58 XXXXXX 閱讀(308) | 評論 (0) | 編輯 收藏
posted @ 2011-06-06 16:03 XXXXXX 閱讀(357) | 評論 (0) | 編輯 收藏