diff --git a/404.html b/404.html index 19baa490..59f84f35 100755 --- a/404.html +++ b/404.html @@ -47,6 +47,12 @@ + + + + + + diff --git a/books/AIPP/index.html b/books/AIPP/index.html index 45199296..83be0532 100755 --- a/books/AIPP/index.html +++ b/books/AIPP/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/ATBSP/index.html b/books/ATBSP/index.html index e14eb566..728c4638 100755 --- a/books/ATBSP/index.html +++ b/books/ATBSP/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/Algorithm/index.html b/books/Algorithm/index.html index f987d64a..2b1f46ce 100755 --- a/books/Algorithm/index.html +++ b/books/Algorithm/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/Archive/SOP4/index.html b/books/Archive/SOP4/index.html index 87174e70..e89e55d3 100755 --- a/books/Archive/SOP4/index.html +++ b/books/Archive/SOP4/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/CNATDA2/index.html b/books/CNATDA2/index.html index e4df8af0..db0df212 100755 --- a/books/CNATDA2/index.html +++ b/books/CNATDA2/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/CSAPP/Chapter1/index.html b/books/CSAPP/Chapter1/index.html index 9f9fcad1..ed8d1003 100755 --- a/books/CSAPP/Chapter1/index.html +++ b/books/CSAPP/Chapter1/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/CSAPP/Chapter2/index.html b/books/CSAPP/Chapter2/index.html index cc61a1ef..83010a14 100755 --- a/books/CSAPP/Chapter2/index.html +++ b/books/CSAPP/Chapter2/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/CSAPP/Chapter3/index.html b/books/CSAPP/Chapter3/index.html index f06cdb38..3b12dc57 100755 --- a/books/CSAPP/Chapter3/index.html +++ b/books/CSAPP/Chapter3/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/CSAPP/index.html b/books/CSAPP/index.html index 44f971f1..ec109c82 100755 --- a/books/CSAPP/index.html +++ b/books/CSAPP/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/CTP/index.html b/books/CTP/index.html index bc4e690d..7be98191 100755 --- a/books/CTP/index.html +++ b/books/CTP/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/DSAAC/index.html b/books/DSAAC/index.html index 6594715c..e28b03bd 100755 --- a/books/DSAAC/index.html +++ b/books/DSAAC/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/ECP/index.html b/books/ECP/index.html index fe22c767..a317ff02 100755 --- a/books/ECP/index.html +++ b/books/ECP/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/FOCS/AppE/index.html b/books/FOCS/AppE/index.html index 61893dd5..234d39bd 100755 --- a/books/FOCS/AppE/index.html +++ b/books/FOCS/AppE/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/FOCS/Chapter1-4/index.html b/books/FOCS/Chapter1-4/index.html index 856aa6c7..4d2fc699 100755 --- a/books/FOCS/Chapter1-4/index.html +++ b/books/FOCS/Chapter1-4/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/FOCS/Chapter9/index.html b/books/FOCS/Chapter9/index.html index f28aed2a..3f40e551 100755 --- a/books/FOCS/Chapter9/index.html +++ b/books/FOCS/Chapter9/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/FOCS/index.html b/books/FOCS/index.html index e44e951b..f87a2023 100755 --- a/books/FOCS/index.html +++ b/books/FOCS/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/LinuxServer/index.html b/books/LinuxServer/index.html index 7d519633..3d8d7589 100755 --- a/books/LinuxServer/index.html +++ b/books/LinuxServer/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/PCC/index.html b/books/PCC/index.html index d3bbf5b4..be759928 100755 --- a/books/PCC/index.html +++ b/books/PCC/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/ProGit/index.html b/books/ProGit/index.html index 0579ea46..0cc3e9fb 100755 --- a/books/ProGit/index.html +++ b/books/ProGit/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/SFJSRMJD/index.html b/books/SFJSRMJD/index.html index 77e25359..f66c8477 100755 --- a/books/SFJSRMJD/index.html +++ b/books/SFJSRMJD/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/books/index.html b/books/index.html index f508ed41..0c215c80 100755 --- a/books/index.html +++ b/books/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/CMU-15-213/Lab/BC1/index.html b/courses-outside/CMU-15-213/Lab/BC1/index.html index 808e4da8..659500e7 100755 --- a/courses-outside/CMU-15-213/Lab/BC1/index.html +++ b/courses-outside/CMU-15-213/Lab/BC1/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/CMU-15-213/Lab/L0/index.html b/courses-outside/CMU-15-213/Lab/L0/index.html index bf2269a6..06471c35 100755 --- a/courses-outside/CMU-15-213/Lab/L0/index.html +++ b/courses-outside/CMU-15-213/Lab/L0/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/CMU-15-213/Lecture/Lecture1/index.html b/courses-outside/CMU-15-213/Lecture/Lecture1/index.html index 3ec785b8..01cb91eb 100755 --- a/courses-outside/CMU-15-213/Lecture/Lecture1/index.html +++ b/courses-outside/CMU-15-213/Lecture/Lecture1/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/CMU-15-213/Lecture/Lecture2/index.html b/courses-outside/CMU-15-213/Lecture/Lecture2/index.html index 4d7cdd30..ede6fed9 100755 --- a/courses-outside/CMU-15-213/Lecture/Lecture2/index.html +++ b/courses-outside/CMU-15-213/Lecture/Lecture2/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/CMU-15-213/index.html b/courses-outside/CMU-15-213/index.html index fc80f8db..872aced6 100755 --- a/courses-outside/CMU-15-213/index.html +++ b/courses-outside/CMU-15-213/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/index.html b/courses-outside/index.html index cf40a938..433ece64 100755 --- a/courses-outside/index.html +++ b/courses-outside/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/web.lab/HTMLBasic/index.html b/courses-outside/web.lab/HTMLBasic/index.html index 242f3d7e..8f2b4614 100755 --- a/courses-outside/web.lab/HTMLBasic/index.html +++ b/courses-outside/web.lab/HTMLBasic/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-outside/web.lab/index.html b/courses-outside/web.lab/index.html index b6b311d4..23d1251b 100755 --- a/courses-outside/web.lab/index.html +++ b/courses-outside/web.lab/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zju/control-theory/index.html b/courses-zju/control-theory/index.html index be196206..9f7b5388 100755 --- a/courses-zju/control-theory/index.html +++ b/courses-zju/control-theory/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zju/discrete-math/index.html b/courses-zju/discrete-math/index.html index a62cb7ca..d7840e0f 100755 --- a/courses-zju/discrete-math/index.html +++ b/courses-zju/discrete-math/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zju/general-physics-1/index.html b/courses-zju/general-physics-1/index.html index 53cd111c..e40c2148 100755 --- a/courses-zju/general-physics-1/index.html +++ b/courses-zju/general-physics-1/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zju/index.html b/courses-zju/index.html index cf50ce61..29034cf1 100755 --- a/courses-zju/index.html +++ b/courses-zju/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zju/probability-and-statistics/index.html b/courses-zju/probability-and-statistics/index.html index 33e5a389..b223b7e2 100755 --- a/courses-zju/probability-and-statistics/index.html +++ b/courses-zju/probability-and-statistics/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/c-standard-library-and-graphic-library/index.html b/courses-zjucs/c-programming/c-standard-library-and-graphic-library/index.html index f7ee7cc3..fc8125de 100755 --- a/courses-zjucs/c-programming/c-standard-library-and-graphic-library/index.html +++ b/courses-zjucs/c-programming/c-standard-library-and-graphic-library/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/data-structure-and-algorithm/index.html b/courses-zjucs/c-programming/data-structure-and-algorithm/index.html index 27eb1abd..2afefad8 100755 --- a/courses-zjucs/c-programming/data-structure-and-algorithm/index.html +++ b/courses-zjucs/c-programming/data-structure-and-algorithm/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/data-type-and-memory-management/index.html b/courses-zjucs/c-programming/data-type-and-memory-management/index.html index f6f1dff9..7b16db69 100755 --- a/courses-zjucs/c-programming/data-type-and-memory-management/index.html +++ b/courses-zjucs/c-programming/data-type-and-memory-management/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/exam/index.html b/courses-zjucs/c-programming/exam/index.html index 9609d9f7..47db81cf 100755 --- a/courses-zjucs/c-programming/exam/index.html +++ b/courses-zjucs/c-programming/exam/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/index.html b/courses-zjucs/c-programming/index.html index 487bd86a..9d7e5663 100755 --- a/courses-zjucs/c-programming/index.html +++ b/courses-zjucs/c-programming/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/io-and-file/index.html b/courses-zjucs/c-programming/io-and-file/index.html index 2eb2c613..0fe411a1 100755 --- a/courses-zjucs/c-programming/io-and-file/index.html +++ b/courses-zjucs/c-programming/io-and-file/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/linguish/index.html b/courses-zjucs/c-programming/linguish/index.html index 5686f4a8..2cd939ee 100755 --- a/courses-zjucs/c-programming/linguish/index.html +++ b/courses-zjucs/c-programming/linguish/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/misc/index.html b/courses-zjucs/c-programming/misc/index.html index 3474d6eb..3bb9e2b5 100755 --- a/courses-zjucs/c-programming/misc/index.html +++ b/courses-zjucs/c-programming/misc/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/c-programming/program-structure-and-compilation/index.html b/courses-zjucs/c-programming/program-structure-and-compilation/index.html index 99697e0b..68644b0d 100755 --- a/courses-zjucs/c-programming/program-structure-and-compilation/index.html +++ b/courses-zjucs/c-programming/program-structure-and-compilation/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/data-structures/index.html b/courses-zjucs/data-structures/index.html index fe646de0..ce84602f 100755 --- a/courses-zjucs/data-structures/index.html +++ b/courses-zjucs/data-structures/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/digital-logic/index.html b/courses-zjucs/digital-logic/index.html index c1dc78c0..e81e0d01 100755 --- a/courses-zjucs/digital-logic/index.html +++ b/courses-zjucs/digital-logic/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/hpc101/index.html b/courses-zjucs/hpc101/index.html index 6550062f..f9b9260b 100755 --- a/courses-zjucs/hpc101/index.html +++ b/courses-zjucs/hpc101/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/hpc101/lab1/index.html b/courses-zjucs/hpc101/lab1/index.html index 56fd6ef5..300fe97e 100755 --- a/courses-zjucs/hpc101/lab1/index.html +++ b/courses-zjucs/hpc101/lab1/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/hpc101/lab2/index.html b/courses-zjucs/hpc101/lab2/index.html index 13cb00f1..fbfbc677 100755 --- a/courses-zjucs/hpc101/lab2/index.html +++ b/courses-zjucs/hpc101/lab2/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/hpc101/lec1/index.html b/courses-zjucs/hpc101/lec1/index.html index a8ea4a78..af8b3161 100755 --- a/courses-zjucs/hpc101/lec1/index.html +++ b/courses-zjucs/hpc101/lec1/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/courses-zjucs/index.html b/courses-zjucs/index.html index d9122bb8..8fab2c47 100755 --- a/courses-zjucs/index.html +++ b/courses-zjucs/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/index.html b/index.html index 7b2efa3c..91ca5556 100755 --- a/index.html +++ b/index.html @@ -49,6 +49,12 @@ + + + + + + @@ -1503,6 +1509,7 @@

内容
  • 图书馆:读过的书的笔记。
  • 杂项:不知道放在哪里的笔记。
  • +
  • 远程桌面指南
  • diff --git a/links/index.html b/links/index.html index 89ae57c1..0640066d 100755 --- a/links/index.html +++ b/links/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/misc/QA/index.html b/misc/QA/index.html index ecca982b..99d3c509 100755 --- a/misc/QA/index.html +++ b/misc/QA/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/misc/blog/index.html b/misc/blog/index.html index bf681705..ac0a07ad 100755 --- a/misc/blog/index.html +++ b/misc/blog/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/misc/index.html b/misc/index.html index 63c9ac5b..696de4cb 100755 --- a/misc/index.html +++ b/misc/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/misc/openwrt/index.html b/misc/openwrt/index.html index 43acd31e..e0edf2e2 100755 --- a/misc/openwrt/index.html +++ b/misc/openwrt/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/misc/remote/index.html b/misc/remote/index.html index 63a8c3e1..42c48c7c 100755 --- a/misc/remote/index.html +++ b/misc/remote/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/misc/workflow/index.html b/misc/workflow/index.html index 152affda..78848e67 100755 --- a/misc/workflow/index.html +++ b/misc/workflow/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/projects/index.html b/projects/index.html index 77ca8a18..36adfa06 100755 --- a/projects/index.html +++ b/projects/index.html @@ -49,6 +49,12 @@ + + + + + + diff --git a/search/search_index.json b/search/search_index.json index 5c902b30..d979bcc2 100755 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"\ud83c\udfb3Bowling's TechStack \u00b6 \u79c1\u3001\u30a2\u30a4\u30c9\u30eb\u5ba3\u8a00 \u5199\u4ee3\u7801\u662f\u70ed\u7231\uff0c\u5199\u5230\u4e16\u754c\u5145\u6ee1\u7231\uff01 \u7b80\u4ecb \u00b6 \u8fd9\u662f Bowling \u7684\u7b14\u8bb0\u672c \ud83d\udcd3\u3002\u6211\u60f3\u7b80\u8981\u8bb0\u5f55\u81ea\u5df1\u5b66\u8fc7\u7684\u77e5\u8bc6\u3001\u638c\u63e1\u7684\u6280\u80fd\uff0c\u642d\u5efa\u8d77\u81ea\u5df1\u7684\u6280\u672f\u6808\u3002 \u91cd\u6784\u4e2d \u76ee\u524d\u7b14\u8bb0\u672c\u6b63\u5728\u91cd\u6784\u4e2d\uff0c\u5927\u90e8\u5206\u7b14\u8bb0\u5904\u4e8e\u5f52\u6863\u6574\u7406\u7684\u72b6\u6001\uff0c\u6682\u4e0d\u53ef\u89c1\u3002\u8bb8\u591a\u539f\u6709\u7684\u94fe\u63a5\u4e5f\u4e0d\u518d\u53ef\u7528\u3002\u9884\u8ba1\u672c\u5b66\u671f\u5185\u5b8c\u6210\u91cd\u6784\u3002 \u5173\u4e8e\u76ee\u524d\u6b63\u5728\u5b66\u4e60\u7684\u5185\u5bb9\uff0c\u8bf7\u53c2\u9605 Project \u9875\u9762 \u3002 \u5173\u4e8e\u6574\u4e2a\u7b14\u8bb0\u672c\u7684\u7d22\u5f15\uff0c\u8bf7\u53c2\u9605 Stack \u6280\u672f\u6808 \u3002 \u521d\u8877 \u8ba1\u7b97\u673a\u5b66\u79d1\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u7eb7\u7e41\u590d\u6742\uff0c\u800c\u4e14\u8fed\u4ee3\u5f88\u5feb\u3002\u6211\u5e38\u5e38\u9762\u4e34\u5b66\u4e60\u5b8c\u4e00\u9879\u6280\u672f\u540e\uff0c\u4e00\u6bb5\u65f6\u95f4\u5185\u6ca1\u590d\u4e60\u5c31\u5fd8\u6389\u7684\u7a98\u5883\u3002\u800c\u4e14\u4e4b\u524d\u4e5f\u6ca1\u6709\u5efa\u7acb\u8d77\u5f88\u7cfb\u7edf\u7684\u7b14\u8bb0\u4f53\u7cfb\uff0c\u5927\u90e8\u5206\u7b14\u8bb0\u8981\u4e48\u7834\u788e\u3001\u6df7\u4e71\u800c\u96be\u4ee5\u9605\u8bfb\uff0c\u8981\u4e48\u9057\u5931\u4e86\u3002\u4e8e\u662f\u6211\u5c06\u81ea\u5df1\u7684\u7b14\u8bb0\u6309\u7167\u8ba1\u7b97\u673a\u5b66\u79d1\u7684\u5206\u7c7b\uff0c\u6574\u7406\u5f52\u7c7b\uff0c\u5e0c\u671b\u4f7f\u81ea\u5df1\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u4f53\u7cfb\u5316\u3002 \u5185\u5bb9 \u00b6 \u76ee\u524d\u4f9d\u7136\u89c9\u5f97\u7b14\u8bb0\u672c\u5f88\u4e71\uff0c\u6682\u4e14\u5212\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u5206\u533a\uff1a \u4e3b\u9875 \u53cb\u94fe \uff1a\u5176\u4ed6\u4eba\u7684\u7b14\u8bb0\u672c\uff0c\u90fd\u597d\u5389\u5bb3\uff01 \u9879\u76ee \uff1a\u6b63\u5728\u8fdb\u884c\u7684\u9879\u76ee \u6280\u672f\u6808 \uff1a\u4ee5\u6280\u672f\u6811\u7684\u5f62\u5f0f\u7d22\u5f15\u7b14\u8bb0\u672c\u4e2d\u7684\u5185\u5bb9 \u6807\u7b7e \uff1a\u4e3b\u8981\u7528\u6765\u7d22\u5f15\u6b63\u5728\u7f16\u5199\u7684\u9875\u9762 \u6821\u5185 CS \u8bfe\u7a0b \uff1a\u6d59\u6c5f\u5927\u5b66\u8ba1\u7b97\u673a\u8bfe\u7a0b\u7684\u7b14\u8bb0\uff0c\u5305\u62ec\u8bfe\u7a0b\u4f5c\u4e1a\u548c\u5b9e\u9a8c\u3002 C \u8bed\u8a00\u7a0b\u5e8f\u8bbe\u8ba1 \u6570\u636e\u7ed3\u6784\u57fa\u7840 \u6570\u5b57\u903b\u8f91\u8bbe\u8ba1 HPC101 \u6821\u5916\u8bfe\u7a0b \uff1a\u4e3b\u8981\u4e3a\u56fd\u5916\u8457\u540d\u5927\u5b66\u7684 CS \u8bfe\u7a0b CMU 15-213 \u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf \u5176\u4ed6\u8bfe\u7a0b \uff1a\u6d59\u6c5f\u5927\u5b66\u5176\u4ed6\u8bfe\u7a0b\u7684\u7b14\u8bb0\u3002 \u63a7\u5236\u8bba\u57fa\u7840 \u79bb\u6563\u6570\u5b66 \u6982\u7387\u8bba\u4e0e\u6570\u7406\u7edf\u8ba1 \u56fe\u4e66\u9986 \uff1a\u8bfb\u8fc7\u7684\u4e66\u7684\u7b14\u8bb0\u3002 \u6742\u9879 \uff1a\u4e0d\u77e5\u9053\u653e\u5728\u54ea\u91cc\u7684\u7b14\u8bb0\u3002","title":"\ud83c\udfe1\u9996\u9875"},{"location":"#bowlings-techstack","text":"\u79c1\u3001\u30a2\u30a4\u30c9\u30eb\u5ba3\u8a00 \u5199\u4ee3\u7801\u662f\u70ed\u7231\uff0c\u5199\u5230\u4e16\u754c\u5145\u6ee1\u7231\uff01","title":"\ud83c\udfb3Bowling's TechStack"},{"location":"#_1","text":"\u8fd9\u662f Bowling \u7684\u7b14\u8bb0\u672c \ud83d\udcd3\u3002\u6211\u60f3\u7b80\u8981\u8bb0\u5f55\u81ea\u5df1\u5b66\u8fc7\u7684\u77e5\u8bc6\u3001\u638c\u63e1\u7684\u6280\u80fd\uff0c\u642d\u5efa\u8d77\u81ea\u5df1\u7684\u6280\u672f\u6808\u3002 \u91cd\u6784\u4e2d \u76ee\u524d\u7b14\u8bb0\u672c\u6b63\u5728\u91cd\u6784\u4e2d\uff0c\u5927\u90e8\u5206\u7b14\u8bb0\u5904\u4e8e\u5f52\u6863\u6574\u7406\u7684\u72b6\u6001\uff0c\u6682\u4e0d\u53ef\u89c1\u3002\u8bb8\u591a\u539f\u6709\u7684\u94fe\u63a5\u4e5f\u4e0d\u518d\u53ef\u7528\u3002\u9884\u8ba1\u672c\u5b66\u671f\u5185\u5b8c\u6210\u91cd\u6784\u3002 \u5173\u4e8e\u76ee\u524d\u6b63\u5728\u5b66\u4e60\u7684\u5185\u5bb9\uff0c\u8bf7\u53c2\u9605 Project \u9875\u9762 \u3002 \u5173\u4e8e\u6574\u4e2a\u7b14\u8bb0\u672c\u7684\u7d22\u5f15\uff0c\u8bf7\u53c2\u9605 Stack \u6280\u672f\u6808 \u3002 \u521d\u8877 \u8ba1\u7b97\u673a\u5b66\u79d1\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u7eb7\u7e41\u590d\u6742\uff0c\u800c\u4e14\u8fed\u4ee3\u5f88\u5feb\u3002\u6211\u5e38\u5e38\u9762\u4e34\u5b66\u4e60\u5b8c\u4e00\u9879\u6280\u672f\u540e\uff0c\u4e00\u6bb5\u65f6\u95f4\u5185\u6ca1\u590d\u4e60\u5c31\u5fd8\u6389\u7684\u7a98\u5883\u3002\u800c\u4e14\u4e4b\u524d\u4e5f\u6ca1\u6709\u5efa\u7acb\u8d77\u5f88\u7cfb\u7edf\u7684\u7b14\u8bb0\u4f53\u7cfb\uff0c\u5927\u90e8\u5206\u7b14\u8bb0\u8981\u4e48\u7834\u788e\u3001\u6df7\u4e71\u800c\u96be\u4ee5\u9605\u8bfb\uff0c\u8981\u4e48\u9057\u5931\u4e86\u3002\u4e8e\u662f\u6211\u5c06\u81ea\u5df1\u7684\u7b14\u8bb0\u6309\u7167\u8ba1\u7b97\u673a\u5b66\u79d1\u7684\u5206\u7c7b\uff0c\u6574\u7406\u5f52\u7c7b\uff0c\u5e0c\u671b\u4f7f\u81ea\u5df1\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u4f53\u7cfb\u5316\u3002","title":"\u7b80\u4ecb"},{"location":"#_2","text":"\u76ee\u524d\u4f9d\u7136\u89c9\u5f97\u7b14\u8bb0\u672c\u5f88\u4e71\uff0c\u6682\u4e14\u5212\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u5206\u533a\uff1a \u4e3b\u9875 \u53cb\u94fe \uff1a\u5176\u4ed6\u4eba\u7684\u7b14\u8bb0\u672c\uff0c\u90fd\u597d\u5389\u5bb3\uff01 \u9879\u76ee \uff1a\u6b63\u5728\u8fdb\u884c\u7684\u9879\u76ee \u6280\u672f\u6808 \uff1a\u4ee5\u6280\u672f\u6811\u7684\u5f62\u5f0f\u7d22\u5f15\u7b14\u8bb0\u672c\u4e2d\u7684\u5185\u5bb9 \u6807\u7b7e \uff1a\u4e3b\u8981\u7528\u6765\u7d22\u5f15\u6b63\u5728\u7f16\u5199\u7684\u9875\u9762 \u6821\u5185 CS \u8bfe\u7a0b \uff1a\u6d59\u6c5f\u5927\u5b66\u8ba1\u7b97\u673a\u8bfe\u7a0b\u7684\u7b14\u8bb0\uff0c\u5305\u62ec\u8bfe\u7a0b\u4f5c\u4e1a\u548c\u5b9e\u9a8c\u3002 C \u8bed\u8a00\u7a0b\u5e8f\u8bbe\u8ba1 \u6570\u636e\u7ed3\u6784\u57fa\u7840 \u6570\u5b57\u903b\u8f91\u8bbe\u8ba1 HPC101 \u6821\u5916\u8bfe\u7a0b \uff1a\u4e3b\u8981\u4e3a\u56fd\u5916\u8457\u540d\u5927\u5b66\u7684 CS \u8bfe\u7a0b CMU 15-213 \u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf \u5176\u4ed6\u8bfe\u7a0b \uff1a\u6d59\u6c5f\u5927\u5b66\u5176\u4ed6\u8bfe\u7a0b\u7684\u7b14\u8bb0\u3002 \u63a7\u5236\u8bba\u57fa\u7840 \u79bb\u6563\u6570\u5b66 \u6982\u7387\u8bba\u4e0e\u6570\u7406\u7edf\u8ba1 \u56fe\u4e66\u9986 \uff1a\u8bfb\u8fc7\u7684\u4e66\u7684\u7b14\u8bb0\u3002 \u6742\u9879 \uff1a\u4e0d\u77e5\u9053\u653e\u5728\u54ea\u91cc\u7684\u7b14\u8bb0\u3002","title":"\u5185\u5bb9"},{"location":"links/","text":"\u94fe\u63a5 \u00b6 \ud83d\udd17 \u94fe\u63a5\u662f\u4e00\u4e2a\u5f88\u795e\u5947\u7684\u4e1c\u897f\uff0c\u5c06\u4e92\u8054\u7f51\u4e2d\u5404\u79cd\u5404\u6837\u7684\u4e1c\u897f\u94fe\u63a5\u5728\u4e00\u8d77\uff0c\u521b\u9020\u51fa\u65e0\u7a77\u7684\u53ef\u80fd\u6027\u3002\u8fd9\u91cc\u653e\u7f6e\u7684\u51fa\u7ad9\u94fe\u63a5\u4f7f\u8fd9\u4e2a\u7f51\u7ad9\u6210\u4e3a\u4e92\u8054\u7f51\u7684\u4e00\u90e8\u5206\uff0c\u4e5f\u5c06\u5e26\u6765\u4e00\u4e9b\u53ef\u80fd\u6027\u3002 \u8fd9\u4e9b\u94fe\u63a5\u76ee\u524d\u5927\u90e8\u5206\u662f\u5176\u4ed6\u4eba\u7684\u7b14\u8bb0\u672c\u3002 \u6d59\u91cc\u7684\u524d\u8f88\u548c\u670b\u8f88\u4eec \u00b6 45gfg9 gg \u6d47\u7a9d \ud83d\ude0d \u6e90\u8679\u7ffc \u7ffc\u54e5\u888b\u888b\u7a9d \ud83e\udd7a sana sana\u9171 \ud83e\udd24 TH\u8ba0NK %%% \ud83d\ude1a TonyCrane / \u9e64\u7fd4\u4e07\u91cc xg \u6d47\u6b7b\u6211 \ud83e\udd24 Isshiki\u4fee \u4fee\u4f6c tql \ud83d\ude0d \u54b8\u9c7c\u6684 \u597d\u602a\u7684\u5b66\u957f \ud83e\udee8 \u91d1\u9c7c\u9a6c hls yyds\uff01\ud83e\udd70 yhwu-is wyyyyyyyyyds!\ud83d\ude18 HobbitQia \u634f\u634f\u5c0f Q \ud83d\ude0b \u9644\u4e2d\u7684\u540c\u5b66\u4eec \u00b6 Doubeecat zlgg \u592a\u5f3a\u60f9 \u5176\u4ed6 \u00b6 \u975e\u5e38\u5389\u5bb3\u7684\u535a\u5ba2\uff1a NTU \u4e00\u4f4d\u7814\u7a76\u5458\u7684\u7f16\u7a0b\u7b14\u8bb0 \u8fd9\u4e2a\u771f\u7684\u5f88\u5f3a\uff0c\u8986\u76d6\u4e86\u6211\u6240\u6709\u60f3\u638c\u63e1\u7684\u6280\u672f\u6808\u3002","title":"\ud83d\udd17\u53cb\u94fe"},{"location":"links/#_1","text":"\ud83d\udd17 \u94fe\u63a5\u662f\u4e00\u4e2a\u5f88\u795e\u5947\u7684\u4e1c\u897f\uff0c\u5c06\u4e92\u8054\u7f51\u4e2d\u5404\u79cd\u5404\u6837\u7684\u4e1c\u897f\u94fe\u63a5\u5728\u4e00\u8d77\uff0c\u521b\u9020\u51fa\u65e0\u7a77\u7684\u53ef\u80fd\u6027\u3002\u8fd9\u91cc\u653e\u7f6e\u7684\u51fa\u7ad9\u94fe\u63a5\u4f7f\u8fd9\u4e2a\u7f51\u7ad9\u6210\u4e3a\u4e92\u8054\u7f51\u7684\u4e00\u90e8\u5206\uff0c\u4e5f\u5c06\u5e26\u6765\u4e00\u4e9b\u53ef\u80fd\u6027\u3002 \u8fd9\u4e9b\u94fe\u63a5\u76ee\u524d\u5927\u90e8\u5206\u662f\u5176\u4ed6\u4eba\u7684\u7b14\u8bb0\u672c\u3002","title":" \u94fe\u63a5"},{"location":"links/#_2","text":"45gfg9 gg \u6d47\u7a9d \ud83d\ude0d \u6e90\u8679\u7ffc \u7ffc\u54e5\u888b\u888b\u7a9d \ud83e\udd7a sana sana\u9171 \ud83e\udd24 TH\u8ba0NK %%% \ud83d\ude1a TonyCrane / \u9e64\u7fd4\u4e07\u91cc xg \u6d47\u6b7b\u6211 \ud83e\udd24 Isshiki\u4fee \u4fee\u4f6c tql \ud83d\ude0d \u54b8\u9c7c\u6684 \u597d\u602a\u7684\u5b66\u957f \ud83e\udee8 \u91d1\u9c7c\u9a6c hls yyds\uff01\ud83e\udd70 yhwu-is wyyyyyyyyyds!\ud83d\ude18 HobbitQia \u634f\u634f\u5c0f Q \ud83d\ude0b","title":"\u6d59\u91cc\u7684\u524d\u8f88\u548c\u670b\u8f88\u4eec"},{"location":"links/#_3","text":"Doubeecat zlgg \u592a\u5f3a\u60f9","title":"\u9644\u4e2d\u7684\u540c\u5b66\u4eec"},{"location":"links/#_4","text":"\u975e\u5e38\u5389\u5bb3\u7684\u535a\u5ba2\uff1a NTU \u4e00\u4f4d\u7814\u7a76\u5458\u7684\u7f16\u7a0b\u7b14\u8bb0 \u8fd9\u4e2a\u771f\u7684\u5f88\u5f3a\uff0c\u8986\u76d6\u4e86\u6211\u6240\u6709\u60f3\u638c\u63e1\u7684\u6280\u672f\u6808\u3002","title":"\u5176\u4ed6"},{"location":"projects/","text":"\u9879\u76ee\u5217\u8868 \u00b6 \u65e5\u62f1\u4e00\u5352 \u60f3\u8981\u771f\u6b63\u5730\u638c\u63e1\u77e5\u8bc6\uff0c\u5176\u5b66\u4e60\u65b9\u5f0f\u5fc5\u987b\u662f\u6301\u4e45\u7684\u3002\u575a\u6301\u4ee5\u201c\u65e5\u62f1\u4e00\u5352\u201d\u7684\u65b9\u5f0f\u524d\u8fdb\u3002 MIT Web Development Crash Course \u00b6 MIT \u5f00\u8bbe\u7684 Web \u5f00\u53d1\u901f\u6210\u8bfe\uff0c\u603b\u8ba1\u65f6\u957f\u4e24\u4e2a\u6708\u3002 Linux \u670d\u52a1\u5668\u67b6\u8bbe \u00b6 \u7b14\u8bb0\u94fe\u63a5\uff1a LinuxServer \u5b8c\u5584 LaTeX \u7b14\u8bb0 \u00b6 \u6839\u636e Overleaf \u6559\u7a0b\u5b8c\u6574\u8fdb\u884c LaTeX \u5b66\u4e60\u3002 Date Done 5.9 \u6587\u6863\u7ed3\u6784-\u5206\u533a\u3001\u4ea4\u53c9\u5f15\u7528 \u91cd\u65b0\u6574\u7406\u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u7b14\u8bb0 \u00b6 \u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u5bf9\u8ba1\u7b97\u673a\u5b66\u79d1\u603b\u4f53\u505a\u4e86\u4e00\u4e2a\u6982\u8ff0\uff0c\u5e76\u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u7684\u57fa\u7840\u77e5\u8bc6\u3002\u5728\u6211\u770b\u6765\uff0c\u8ba1\u7b97\u673a\u7cfb\u5b66\u751f\u5e94\u8be5\u5148\u5b66\u4e60\u8fd9\u6837\u4e00\u95e8\u5bfc\u8bba\u8bfe\uff0c\u5efa\u7acb\u8d77\u5bf9\u8ba1\u7b97\u673a\u5b66\u79d1\u7684\u57fa\u672c\u8ba4\u8bc6\u3001\u7406\u89e3\u76f8\u5173\u6982\u5ff5\uff0c\u624d\u80fd\u8fdb\u4e00\u6b65\u8fdb\u884c\u5b66\u4e60\uff0c\u6bd4\u5982\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7b49\u3002 \u9879\u76ee\u8fdb\u5ea6\uff1a Date Done 4.20 Ch 1-3 C \u9677\u9631\u4e0e\u7f3a\u9677 \u00b6 \u7b14\u8bb0\u94fe\u63a5\uff1a CTP.md Date Done 4.30 0-3.6","title":"\ud83d\udcdd\u9879\u76ee"},{"location":"projects/#_1","text":"\u65e5\u62f1\u4e00\u5352 \u60f3\u8981\u771f\u6b63\u5730\u638c\u63e1\u77e5\u8bc6\uff0c\u5176\u5b66\u4e60\u65b9\u5f0f\u5fc5\u987b\u662f\u6301\u4e45\u7684\u3002\u575a\u6301\u4ee5\u201c\u65e5\u62f1\u4e00\u5352\u201d\u7684\u65b9\u5f0f\u524d\u8fdb\u3002","title":" \u9879\u76ee\u5217\u8868"},{"location":"projects/#mit-web-development-crash-course","text":"MIT \u5f00\u8bbe\u7684 Web \u5f00\u53d1\u901f\u6210\u8bfe\uff0c\u603b\u8ba1\u65f6\u957f\u4e24\u4e2a\u6708\u3002","title":"MIT Web Development Crash Course"},{"location":"projects/#linux","text":"\u7b14\u8bb0\u94fe\u63a5\uff1a LinuxServer","title":"Linux \u670d\u52a1\u5668\u67b6\u8bbe"},{"location":"projects/#latex","text":"\u6839\u636e Overleaf \u6559\u7a0b\u5b8c\u6574\u8fdb\u884c LaTeX \u5b66\u4e60\u3002 Date Done 5.9 \u6587\u6863\u7ed3\u6784-\u5206\u533a\u3001\u4ea4\u53c9\u5f15\u7528","title":"\u5b8c\u5584 LaTeX \u7b14\u8bb0"},{"location":"projects/#_2","text":"\u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u5bf9\u8ba1\u7b97\u673a\u5b66\u79d1\u603b\u4f53\u505a\u4e86\u4e00\u4e2a\u6982\u8ff0\uff0c\u5e76\u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u7684\u57fa\u7840\u77e5\u8bc6\u3002\u5728\u6211\u770b\u6765\uff0c\u8ba1\u7b97\u673a\u7cfb\u5b66\u751f\u5e94\u8be5\u5148\u5b66\u4e60\u8fd9\u6837\u4e00\u95e8\u5bfc\u8bba\u8bfe\uff0c\u5efa\u7acb\u8d77\u5bf9\u8ba1\u7b97\u673a\u5b66\u79d1\u7684\u57fa\u672c\u8ba4\u8bc6\u3001\u7406\u89e3\u76f8\u5173\u6982\u5ff5\uff0c\u624d\u80fd\u8fdb\u4e00\u6b65\u8fdb\u884c\u5b66\u4e60\uff0c\u6bd4\u5982\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7b49\u3002 \u9879\u76ee\u8fdb\u5ea6\uff1a Date Done 4.20 Ch 1-3","title":"\u91cd\u65b0\u6574\u7406\u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u7b14\u8bb0"},{"location":"projects/#c","text":"\u7b14\u8bb0\u94fe\u63a5\uff1a CTP.md Date Done 4.30 0-3.6","title":"C \u9677\u9631\u4e0e\u7f3a\u9677"},{"location":"stack/","text":"\u6280\u672f\u6808 \u00b6 Info Developer Roadmaps Wikipedia: Computer Science \u8ba1\u7b97\u673a\u5b66\u79d1\u535a\u5927\u7cbe\u6df1\uff0c\u5b8c\u6574\u7684\u6280\u672f\u6808\u53ef\u4ee5\u4ece\u6c99\u5b50\u9020\u8d77\uff0c\u4f46\u6ca1\u6709\u4eba\u80fd\u6210\u4e3a\u8fd9\u6837\u7684\u201c\u5168\u6808\u5de5\u7a0b\u5e08\u201d\u3002\u80fd\u638c\u63e1\u5176\u95f4\u7684\u4e00\u4e2a\u90e8\u5206\u5c31\u5df2\u7ecf\u975e\u5e38\u5389\u5bb3\u3002\u4ee5\u4e0b\u53ea\u662f\u4e00\u4e2a\u6280\u672f\u6808\u6846\u67b6\uff0c\u5c06\u81ea\u5df1\u6d45\u8584\u7684\u77e5\u8bc6\u5206\u7c7b\u5806\u653e\u800c\u5df2\uff0c\u5e76\u4e0d\u662f\u76ee\u6807\u3002 Tip \u543e\u751f\u4e5f\u6709\u6daf\uff0c\u800c\u77e5\u4e5f\u65e0\u6daf\u3002\u4ee5\u6709\u6daf\u968f\u65e0\u6daf\uff0c\u6b86\u5df2\uff01\u5df2\u800c\u4e3a\u77e5\u8005\uff0c\u6b86\u800c\u5df2\u77e3\uff01 \u57fa\u7840 \u00b6 \u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08Fundations Of Computer Science\uff09 \u8fd9\u662f\u6211\u8ba4\u4e3a\u8ba1\u7b97\u673a\u7cfb\u5b66\u751f\u5e94\u8be5\u4e0a\u7684\u7b2c\u4e00\u95e8\u8bfe\uff0c\u5bf9\u81ea\u5df1\u5c06\u8981\u5b66\u4e60\u7684\u5185\u5bb9\u6709\u4e00\u4e2a\u6574\u4f53\u7684\u8ba4\u77e5\u3002 \u6559\u7a0b \u6559\u7a0b\u5e76\u4e0d\u5f52\u5728\u6280\u672f\u6808\uff0c\u4f46\u6211\u61d2\u5f97\u5efa\u535a\u5ba2\uff0c\u800c\u4e14\u89c9\u5f97\u6559\u7a0b\u4e5f\u4f1a\u9891\u7e41\u66f4\u65b0\uff0c\u5c31\u653e\u5728\u7b14\u8bb0\u672c\u60f9\u3002 Windows \u8fdc\u7a0b\u684c\u9762\u6559\u7a0b \u4e91\u670d\u52a1\u5668\u7efc\u5408\u6559\u7a0b Linux \u4ece\u5c0f\u767d\u5230\u83dc\u9e21 \u6b63\u5728\u72ec\u7acb\u7684 GitHub \u4ed3\u5e93\u7f16\u5199\u4e2d Linux \u4ece\u83dc\u9e21\u5230\u4e13\u5bb6 \u6574\u7406\u4e2d Linux \u6df1\u5165\u6e90\u7801 \u7b49\u5f85\u5b66\u4e60\u4e2d Web \u5f00\u53d1 \u00b6 \u7f51\u7edc\u6280\u672f\u4e0e\u670d\u52a1\u5668\u8fd0\u7ef4 HTTP TCP/IP Nginx \u524d\u7aef HTML CSS JavaScript React \u540e\u7aef \u7406\u8bba\u8ba1\u7b97\u673a\u79d1\u5b66 \u00b6 \u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5 \u8ba1\u7b97\u7406\u8bba \u4fe1\u606f\u8bba\u4e0e\u7f16\u7801\u7406\u8bba \u7f16\u7a0b\u8bed\u8a00\u548c\u7f16\u8bd1\u5668 \u7f16\u7a0b\u8bed\u8a00\u7406\u8bba\u548c\u5f62\u5f0f\u5316\u65b9\u6cd5 \u8ba1\u7b97\u673a\u7cfb\u7edf \u00b6 \u8ba1\u7b97\u673a\u4f53\u7cfb\u7ed3\u6784\u4e0e\u8ba1\u7b97\u673a\u5de5\u7a0b \u64cd\u4f5c\u7cfb\u7edf \u5e76\u53d1\u3001\u5e76\u884c\u4e0e\u5206\u5e03\u5f0f\u7cfb\u7edf \u8ba1\u7b97\u673a\u7f51\u7edc \u8ba1\u7b97\u673a\u5b89\u5168\u548c\u5bc6\u7801\u5b66 \u6570\u636e\u5e93\u548c\u6570\u636e\u6316\u6398 \u4eba\u5de5\u667a\u80fd \u00b6 \u4eba\u5de5\u667a\u80fd\u57fa\u7840\uff08\u57fa\u7840\uff1a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u3001\u6570\u5b66\u5206\u6790\uff09 \u8ba1\u7b97\u673a\u5e94\u7528\u6280\u672f \u00b6 \u8ba1\u7b97\u673a\u56fe\u5f62\u5b66\u548c\u89c6\u89c9 \u8f6f\u4ef6\u5de5\u7a0b","title":"\ud83c\udf70\u6280\u672f\u6808"},{"location":"stack/#_1","text":"Info Developer Roadmaps Wikipedia: Computer Science \u8ba1\u7b97\u673a\u5b66\u79d1\u535a\u5927\u7cbe\u6df1\uff0c\u5b8c\u6574\u7684\u6280\u672f\u6808\u53ef\u4ee5\u4ece\u6c99\u5b50\u9020\u8d77\uff0c\u4f46\u6ca1\u6709\u4eba\u80fd\u6210\u4e3a\u8fd9\u6837\u7684\u201c\u5168\u6808\u5de5\u7a0b\u5e08\u201d\u3002\u80fd\u638c\u63e1\u5176\u95f4\u7684\u4e00\u4e2a\u90e8\u5206\u5c31\u5df2\u7ecf\u975e\u5e38\u5389\u5bb3\u3002\u4ee5\u4e0b\u53ea\u662f\u4e00\u4e2a\u6280\u672f\u6808\u6846\u67b6\uff0c\u5c06\u81ea\u5df1\u6d45\u8584\u7684\u77e5\u8bc6\u5206\u7c7b\u5806\u653e\u800c\u5df2\uff0c\u5e76\u4e0d\u662f\u76ee\u6807\u3002 Tip \u543e\u751f\u4e5f\u6709\u6daf\uff0c\u800c\u77e5\u4e5f\u65e0\u6daf\u3002\u4ee5\u6709\u6daf\u968f\u65e0\u6daf\uff0c\u6b86\u5df2\uff01\u5df2\u800c\u4e3a\u77e5\u8005\uff0c\u6b86\u800c\u5df2\u77e3\uff01","title":" \u6280\u672f\u6808"},{"location":"stack/#_2","text":"\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08Fundations Of Computer Science\uff09 \u8fd9\u662f\u6211\u8ba4\u4e3a\u8ba1\u7b97\u673a\u7cfb\u5b66\u751f\u5e94\u8be5\u4e0a\u7684\u7b2c\u4e00\u95e8\u8bfe\uff0c\u5bf9\u81ea\u5df1\u5c06\u8981\u5b66\u4e60\u7684\u5185\u5bb9\u6709\u4e00\u4e2a\u6574\u4f53\u7684\u8ba4\u77e5\u3002 \u6559\u7a0b \u6559\u7a0b\u5e76\u4e0d\u5f52\u5728\u6280\u672f\u6808\uff0c\u4f46\u6211\u61d2\u5f97\u5efa\u535a\u5ba2\uff0c\u800c\u4e14\u89c9\u5f97\u6559\u7a0b\u4e5f\u4f1a\u9891\u7e41\u66f4\u65b0\uff0c\u5c31\u653e\u5728\u7b14\u8bb0\u672c\u60f9\u3002 Windows \u8fdc\u7a0b\u684c\u9762\u6559\u7a0b \u4e91\u670d\u52a1\u5668\u7efc\u5408\u6559\u7a0b Linux \u4ece\u5c0f\u767d\u5230\u83dc\u9e21 \u6b63\u5728\u72ec\u7acb\u7684 GitHub \u4ed3\u5e93\u7f16\u5199\u4e2d Linux \u4ece\u83dc\u9e21\u5230\u4e13\u5bb6 \u6574\u7406\u4e2d Linux \u6df1\u5165\u6e90\u7801 \u7b49\u5f85\u5b66\u4e60\u4e2d","title":"\u57fa\u7840"},{"location":"stack/#web","text":"\u7f51\u7edc\u6280\u672f\u4e0e\u670d\u52a1\u5668\u8fd0\u7ef4 HTTP TCP/IP Nginx \u524d\u7aef HTML CSS JavaScript React \u540e\u7aef","title":"Web \u5f00\u53d1"},{"location":"stack/#_3","text":"\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5 \u8ba1\u7b97\u7406\u8bba \u4fe1\u606f\u8bba\u4e0e\u7f16\u7801\u7406\u8bba \u7f16\u7a0b\u8bed\u8a00\u548c\u7f16\u8bd1\u5668 \u7f16\u7a0b\u8bed\u8a00\u7406\u8bba\u548c\u5f62\u5f0f\u5316\u65b9\u6cd5","title":"\u7406\u8bba\u8ba1\u7b97\u673a\u79d1\u5b66"},{"location":"stack/#_4","text":"\u8ba1\u7b97\u673a\u4f53\u7cfb\u7ed3\u6784\u4e0e\u8ba1\u7b97\u673a\u5de5\u7a0b \u64cd\u4f5c\u7cfb\u7edf \u5e76\u53d1\u3001\u5e76\u884c\u4e0e\u5206\u5e03\u5f0f\u7cfb\u7edf \u8ba1\u7b97\u673a\u7f51\u7edc \u8ba1\u7b97\u673a\u5b89\u5168\u548c\u5bc6\u7801\u5b66 \u6570\u636e\u5e93\u548c\u6570\u636e\u6316\u6398","title":"\u8ba1\u7b97\u673a\u7cfb\u7edf"},{"location":"stack/#_5","text":"\u4eba\u5de5\u667a\u80fd\u57fa\u7840\uff08\u57fa\u7840\uff1a\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u3001\u6570\u5b66\u5206\u6790\uff09","title":"\u4eba\u5de5\u667a\u80fd"},{"location":"stack/#_6","text":"\u8ba1\u7b97\u673a\u56fe\u5f62\u5b66\u548c\u89c6\u89c9 \u8f6f\u4ef6\u5de5\u7a0b","title":"\u8ba1\u7b97\u673a\u5e94\u7528\u6280\u672f"},{"location":"tags/","text":"\u6807\u7b7e \u00b6 \u672c\u9875\u9762\u4e3a\u6240\u6709\u6dfb\u52a0\u4e86\u6807\u7b7e\u7684\u9875\u9762\u63d0\u4f9b\u7d22\u5f15\uff0c\u4f5c\u4e3a\u4efb\u52a1\u770b\u677f\u3002 Ongoing \u00b6 \u8ba1\u7b97\u673a\u7f51\u7edc\uff1a\u81ea\u9876\u5411\u4e0b\u65b9\u6cd5 Linux \u5e94\u7528\u5927\u5168\uff1a\u670d\u52a1\u5668\u67b6\u8bbe \u7cbe\u901a Git Ch2. \u4fe1\u606f\u7684\u8868\u793a\u548c\u5904\u7406 Ch3. \u7a0b\u5e8f\u7684\u673a\u5668\u7ea7\u8868\u793a \u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08\u7b2c\u56db\u7248\uff09 Appendix E: Boolen Algebra and Logic Circuits Ch. 1-4 Intro, Number, Data and Operation Ch9. Programming Language Lecture 02: Bits, Bytes, and Ints; Floating Point HTML \u57fa\u7840 Todo \u00b6 Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5 \u8f93\u5165\u8f93\u51fa\u4e0e\u6587\u4ef6 doing \u00b6 \u7c7b\u578b\u7cfb\u7edf\u4e0e\u5185\u5b58\u7ba1\u7406 todo \u00b6 \u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5 \u7a0b\u5e8f\u7ed3\u6784\u4e0e\u7f16\u8bd1\u8fc7\u7a0b","title":"\ud83d\udd16\u6807\u7b7e"},{"location":"tags/#_1","text":"\u672c\u9875\u9762\u4e3a\u6240\u6709\u6dfb\u52a0\u4e86\u6807\u7b7e\u7684\u9875\u9762\u63d0\u4f9b\u7d22\u5f15\uff0c\u4f5c\u4e3a\u4efb\u52a1\u770b\u677f\u3002","title":" \u6807\u7b7e"},{"location":"tags/#ongoing","text":"\u8ba1\u7b97\u673a\u7f51\u7edc\uff1a\u81ea\u9876\u5411\u4e0b\u65b9\u6cd5 Linux \u5e94\u7528\u5927\u5168\uff1a\u670d\u52a1\u5668\u67b6\u8bbe \u7cbe\u901a Git Ch2. \u4fe1\u606f\u7684\u8868\u793a\u548c\u5904\u7406 Ch3. \u7a0b\u5e8f\u7684\u673a\u5668\u7ea7\u8868\u793a \u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08\u7b2c\u56db\u7248\uff09 Appendix E: Boolen Algebra and Logic Circuits Ch. 1-4 Intro, Number, Data and Operation Ch9. Programming Language Lecture 02: Bits, Bytes, and Ints; Floating Point HTML \u57fa\u7840","title":"Ongoing"},{"location":"tags/#todo","text":"Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5 \u8f93\u5165\u8f93\u51fa\u4e0e\u6587\u4ef6","title":"Todo"},{"location":"tags/#doing","text":"\u7c7b\u578b\u7cfb\u7edf\u4e0e\u5185\u5b58\u7ba1\u7406","title":"doing"},{"location":"tags/#todo_1","text":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5 \u7a0b\u5e8f\u7ed3\u6784\u4e0e\u7f16\u8bd1\u8fc7\u7a0b","title":"todo"},{"location":"books/","text":"\u56fe\u4e66\u9986 \u00b6 \u7535\u5b50\u56fe\u4e66\u9986 \u6b22\u8fce\u53c2\u89c2\u6211\u7684\u7535\u5b50\u56fe\u4e66\u9986\uff1a lib.bowling233.top \u3002\u5176\u4e2d\u4e3b\u8981\u5b58\u653e\u8ba1\u7b97\u673a\u5b66\u79d1\u4e66\u7c4d\u3002 \u672c\u5206\u533a\u5b58\u653e\u4e86\u4e00\u4e9b\u8bfb\u4e66\u7b14\u8bb0\u3002 \u5df2\u5b8c\u6210 \u00b6 Python \u7a0b\u5e8f\u8bbe\u8ba1\u57fa\u7840 \u8fdb\u884c\u4e2d \u00b6 \u5e76\u884c\u7a0b\u5e8f\u8bbe\u8ba1\u5bfc\u8bba C \u9677\u9631\u4e0e\u7f3a\u9677 \u7b97\u6cd5\u7ade\u8d5b\u5165\u95e8\u7ecf\u5178 \u6682\u505c\u4e2d \u00b6 \u7cbe\u901a Git \u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba \u8ba1\u5212\u9605\u8bfb \u00b6","title":"\u56fe\u4e66\u9986"},{"location":"books/#_1","text":"\u7535\u5b50\u56fe\u4e66\u9986 \u6b22\u8fce\u53c2\u89c2\u6211\u7684\u7535\u5b50\u56fe\u4e66\u9986\uff1a lib.bowling233.top \u3002\u5176\u4e2d\u4e3b\u8981\u5b58\u653e\u8ba1\u7b97\u673a\u5b66\u79d1\u4e66\u7c4d\u3002 \u672c\u5206\u533a\u5b58\u653e\u4e86\u4e00\u4e9b\u8bfb\u4e66\u7b14\u8bb0\u3002","title":"\u56fe\u4e66\u9986"},{"location":"books/#_2","text":"Python \u7a0b\u5e8f\u8bbe\u8ba1\u57fa\u7840","title":"\u5df2\u5b8c\u6210"},{"location":"books/#_3","text":"\u5e76\u884c\u7a0b\u5e8f\u8bbe\u8ba1\u5bfc\u8bba C \u9677\u9631\u4e0e\u7f3a\u9677 \u7b97\u6cd5\u7ade\u8d5b\u5165\u95e8\u7ecf\u5178","title":"\u8fdb\u884c\u4e2d"},{"location":"books/#_4","text":"\u7cbe\u901a Git \u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba","title":"\u6682\u505c\u4e2d"},{"location":"books/#_5","text":"","title":"\u8ba1\u5212\u9605\u8bfb"},{"location":"books/AIPP/","text":"\u5e76\u884c\u7a0b\u5e8f\u8bbe\u8ba1\u5bfc\u8bba \u00b6 An Introduction to Parallel Programming Ch1. Why Parallel Programming? \u00b6 This chapter mainly describes the reasons for parallel programming, the development of parallel programming, and the basic concepts of parallel programming. Rather than building ever-faster, more complex, monolithic processors, the industry has decided to put multiple, relatively simple, complete processors on a single chip . Such integrated circuits are called multicore processors , and core has become synonymous with central processing unit, or CPU. Compute n values and add them together Method 1: I have \\(p\\) cores, so I will divide the work into \\(p\\) pieces. Each core can form a partial sum of approximately \\(n/p\\) values. They send their partial sums to a single core, which adds them together. Method 2: Instead of making the master core do all the work of computing the final sum, we can pair the cores so that while core 0 adds in the result of core 1, core 2 can add in the result of core 3, core 4 can add in the result of core 5 and so on. Compare: When \\(n\\) is large, method 2 is better. The first method require 999 receives and adds, while the second method requires only 10. Two approaches to parallel programming: Task-parallelism Data-parallelism Explanaition: The first part of global sum example is task-parallelism, each core carries out roughtly the same oprations on its assigned elements. And the second part is data-parallelism, receiving and adding the cores' partial sums. Writing actual code for parallel programs is relatively complex. Communication : cores communicate with each other. Load balancing : the work is divided evenly among the cores. Synchronization : cores must wait for each other at certain points in the program. Things we will learn: Three different extensions to C: OpenMP MPI Pthreads Two main types of parallel systems: Shared-memory systems cores can share access to the computer\u2019s memory Distributed-memory systems each core has its own, private memory, and the cores must communicate explicitly by doing something like sending messages across a network Pthreads and OpenMP were designed for programming shared-memory systems. They provide mechanisms for accessing shared-memory locations. MPI, on the other hand, was designed for programming distributed-memory systems. It provides mechanisms for sending messages. And we distinguish between three terms: Concurrent : a program is one in which multiple tasks can be in progress at any instant. Parallel : a program is one in which multiple tasks cooperate closely to solve a problem. Distributed : a program may need to cooperate with other programs to solve a problem. A Word of Warning It may be tempting to write parallel programs \u201cby the seat of your pants,\u201d without taking the trouble to carefully design and incrementally develop your program. This will almost certainly be a mistake. Every parallel program contains at least one serial program. Since we almost always need to coordinate the actions of multiple cores, writing parallel programs is almost always more complex than writing a serial program that solves the same problem. In fact, it is often far more complex. All the rules about careful design and development are usually far more important for the writing of parallel programs than they are for serial programs. Exercise Answers \u00b6 1.3 Global sum variables: core_nums : number of cores core_index : index of core divisor : determine whether to send or receive data core_difference : determine which core to cooperate with round send core receive core divisor core_difference 1 1 = 0 + 1 0 = 0 * 2 2 1 2 2 = 0 + 2 0 = 0 * 4 4 2 3 4 = 0 + 4 0 = 0 * 8 8 4 pseduocode while divisor != core_num { if(!core_index % divisor) receive data from core_index + core_difference sum together else send data to core_index - core_difference divisor *= 2 core_difference *= 2 } 1.4 Bitmask implementation pseduocode while bitmask != core_num { if(!core_index % bitmask) receive data from core_index ^ bitmask sum together else send data to core_index ^ bitmask bitmask << 1 } 1.5 Odd cores Only need to modify condition of while loop and check number before receive data. divisor version bitmask version pseduocode while true { if(!core_index % divisor) receive data from core_index + core_difference sum together else send data to core_index - core_difference if(divisor >= core_num) break; divisor *= 2 core_difference *= 2 } pseduocode while true { if(!core_index % bitmask) receive data from core_index ^ bitmask sum together else send data to core_index ^ bitmask if(bitmask >= core_num) bitmask << 1 } Ch2. Parallel Hardware and Parallel Software \u00b6 First time read I skipped these contents when I read this chapter for the first time: Modifications to the von Neumann Model SIMD Systems Interconnection Networks Notes for these contents can be seen in CSAPP. 2.1 Background \u00b6 von Neumann architecture What's the von Neumann bottleneck ? Concepts of processes, multitasking, and threads From the perspective of the operating system, a process contains of what? Executable code, block of memory (what's in it?), descriptor, security information, state. Some terminology: block, fork, join 2.2 Modifications to the von Neumann Model \u00b6 Caching (CPU Cache) Terminology: spatial locality, temporal locality cache miss write-through, write-back In which way will data be cached? When CPU needs access to some data, how will it work? What causes the inconsistency between cache and main memory? 2.3 Parallel Hardware \u00b6 MIMD system They are asynchronous . Shared-memory system: communicate by accessing shared data structure interconnect connect all the processors to main memory or a block of memory Uniform Memory Access, Nonuniform Memory Access Distributed-memory system: communicate by sending messages or special functions that provide access to the memory of another processor Interconnection (Skipped, but remember to read back again.) Cache coherence Why cache inconsistency happens both in write-through and write-back policy? Ch3. Distributed-Memory Programming with MPI \u00b6 What is MPI? What do we use it for? 3.1 Getting Started \u00b6 Configuring Environment Refer to HPC-101 Lab 1. Notes are here . Some concepts: communicator : a group of processes that can communicate with each other. All MPI function that involve communication have a communicator argument. collective communication : a communication that involves all processes in a communicator butterfly : a communication pattern, reverse the branches to distribute data broadcast : data belonging to a single process is sent to all of the processes in the communicator Basic Structure of MPI program: Basic Structure of MPI program #include int main ( int argc , char * argv []) { int my_rank , p ; MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & my_rank ); MPI_Comm_size ( MPI_COMM_WORLD , & p ); /* do some work */ MPI_Finalize (); return 0 ; } Basic Commands for MPI Programs: mpicc : compile MPI programs a wrapper for gcc mpiexec and mpirun : run MPI programs (they are synonyms to each other) -n : specify the number of processes --hostfile : specify the hostfile More on Open MPI documentation Tools for clusters scp : tools for transferring files -r : recursive (copy directory with multiple files) -P : port Example: scp [ other options ] [ source username@IP ] :/ [ directory and file name ] [ destination username@IP ] :/ [ destination directory ] scp /users/Hostinger/desktop/scp.zip root@191.162.0.2:/writing/article scp -r /users/Hostinger/desktop root@191.162.0.2:/writing/article I also wrote a Python script to send files to clusters: send_file.sh #!/usr/bin/env python3 import sys import os for i in range ( 3 , len ( sys . argv )): os . system ( \"scp \" + sys . argv [ 1 ] + \" \" + sys . argv [ i ] + \":\" + sys . argv [ 2 ]) Usage: ./send_file.sh file /path/to/dest vm1 vm2 ... Ref to functions: must include int MPI_Init ( int * argc_p /* in/out */ , char *** argv /* in/out */ ); int MPI_Finalize ( void ); MPI_Init defines a communicator called MPI_COMM_WORLD that contains all the processes started by the user. about communicator int MPI_Comm_size ( MPI_Comm comm /* in */ , int * comm_sz_p /* out */ ); int MPI_Comm_rank ( MPI_Comm comm /* in */ , int * my_rank_p /* out */ ); The two function is getting information about MPI_COMM_WORLD . send and receive int MPI_Send ( void * buf /* in\uff0cpoints to the data to be sent */ , int count /* in, number of objects */ , MPI_Datatype datatype /* in, type of objects, correspond to C basic data type */ , int dest /* in, the rank of the process that receive the message */ , int tag /* in, distinguish messages that are otherwise identical */ , MPI_Comm comm /* in */ ); int MPI_Recv ( void * buf /* out */ , int count /* in */ , MPI_Datatype datatype /* in */ , int source /* in, MPI_ANY_SOURCE can be used */ , int tag /* in, MPI_ANY_TAG can be used */ , MPI_Comm comm /* in */ , MPI_Status * status /* out, usually won't use, just pass MPI_STATUS_IGNORE */ ); int MPI_Get_count ( MPI_Status * status_p /* in */ , MPI_Datatype type /* in */ , int * count_p /* out */ ); About wildcard arguments ONLY ONE RECIVER can use a wildcard argument. status_p argument MPI_Status is a struct with at least three members: MPI_SOURCE , MPI_TAG , MPI_ERROR . We can determine the sender by MPI_SOURCE and MPI_TAG . MPI_Get_count() is used to get the amount of data that's been received. HANG If a process tries to receive a message and there's no matching send, then the process will block forever. If send don't match, it will block too. What happens when you send message? Sending process assemble the message with information about the destination process, tag, size and etc. Two ways to send messages: buffer and block . Buffer: place the message into its own internal storage, and the call will return . Block: wait until it can begin transmitting the message. So, when function returns, we don't know whether the message has been transmitted, only know that the storage for the message (buffer) is available for reuse . Typical implementations have default \"cutoff\" message size. If less, it will buffer, or it will block. Messages from one process are nonovertaking . 3.4 Collective Communication \u00b6 collective communication int MPI_Reduce ( // reduce data from all processes to one process void * input_data_p /* in */ , void * output_data_p /* out */ , int count /* in */ , MPI_Datatype datatype /* in */ , MPI_Op operator /* in */ , int dest_process /* in */ , MPI_Comm comm /* in */ ); int MPI_Allreduce ( // reduce data from all processes to all processes void * input_data_p /* in */ , void * output_data_p /* out */ , int count /* in */ , MPI_Datatype datatype /* in */ , MPI_Op operator /* in */ , MPI_Comm comm /* in */ ); int MPI_Bcast ( // broadcast data from one process to all processes void * data_p /* in/out */ , int count /* in */ , MPI_Datatype datatype /* in */ , int source_proc /* in */ , MPI_Comm comm /* in */ ); int MPI_Scatter ( // scatter data from one process to all processes void * send_buf_p /* in */ , int send_count /* in, NOTICE HERE counts for the amount of data going to each process */ , MPI_Datatype send_type /* in */ , void * recv_buf_p /* out */ , int recv_count /* in */ , MPI_Datatype recv_type /* in */ , int src_proc /* in */ , MPI_Comm comm /* in */ ); int MPI_Gather ( // gather data from all processes to one process void * send_buf_p /* in */ , int send_count /* in */ , MPI_Datatype send_type /* in */ , void * recv_buf_p /* out */ , int recv_count /* in, NOTICE HERE counts for the number of data items received from each process */ , MPI_Datatype recv_type /* in */ , int dest_proc /* in */ , MPI_Comm comm /* in */ ); int MPI_Allgather ( // gather data from all processes to all processes void * send_buf_p /* in */ , int send_count /* in */ , MPI_Datatype send_type /* in */ , void * recv_buf_p /* out */ , int recv_count /* in */ , MPI_Datatype recv_type /* in */ , MPI_Comm comm /* in */ ); Key is the fifth argument operator . Find: MPI_MAX , MPI_MIN , MPI_MAXLOC , MPI_MINLOC Compute: MPI_SUM , MPI_PROD Bitwise: MPI_BAND , MPI_BOR , MPI_BXOR Logical: MPI_LAND , MPI_LOR , MPI_LXOR You can define yourself. Difference between MPI_Reduce and MPI_Allreduce : MPI_Reduce have dest_process argument, and MPI_Allreduce doesn't. Read the example Please read the example vector.c and make sure you understand each line of code. 3.5 MPI Derived Datatypes \u00b6 To improve the performance of our program, we can reduce the total number of messages sent. A derived datatype consists of a sequence of basic MPI datatypes together with a displacement for each of the datatypes. {(MPI_DOUBLE, 0), (MPI_DOUBLE, 16), (MPI_INT, 24)} To create a derived datatype, we need to use MPI_Type_create_struct() . create derived datatype int MPI_Type_create_struct ( int count /* in, number of elements */ , int array_of_blocklengths [] /* in, individual data items might be arrays or subarrays */ , MPI_Aint array_of_displacements [] /* in, displacement of each elements */ , MPI_Datatype array_of_types [] /* in, type of each block */ , MPI_Datatype * new_type_p /* out */ ); int MPI_Type_commit ( MPI_Datatype * new_mpi_t_p /* in/out */ ); int MPI_Type_free ( MPI_Datatype * old_mpi_t_p /* in/out */ ); MPI_Aint is big enough to store any address on the system. In our example, the call is: MPI_Type_create_struct ( 3 , { 1 , 1 , 1 }, { 0 , 16 , 24 }, { MPI_DOUBLE , MPI_DOUBLE , MPI_INT }, & new_type ); To find displacement of a variable, we can use MPI_Get_address() . get address of a variable int MPI_Get_address ( void * location_p /* in */ , MPI_Aint * address_p /* out */ ); MPI_Aint , a_addr , b_addr , n_addr ; MPI_Get_address ( & a , & a_addr ); array_of_displacements [ 0 ] = 0 ; MPI_Get_address ( & b , & b_addr ); array_of_displacements [ 1 ] = b_addr - a_addr ; MPI_Get_address ( & n , & n_addr ); array_of_displacements [ 2 ] = n_addr - a_addr ;","title":"\u5e76\u884c\u7a0b\u5e8f\u8bbe\u8ba1\u5bfc\u8bba"},{"location":"books/AIPP/#_1","text":"An Introduction to Parallel Programming","title":"\u5e76\u884c\u7a0b\u5e8f\u8bbe\u8ba1\u5bfc\u8bba"},{"location":"books/AIPP/#ch1-why-parallel-programming","text":"This chapter mainly describes the reasons for parallel programming, the development of parallel programming, and the basic concepts of parallel programming. Rather than building ever-faster, more complex, monolithic processors, the industry has decided to put multiple, relatively simple, complete processors on a single chip . Such integrated circuits are called multicore processors , and core has become synonymous with central processing unit, or CPU. Compute n values and add them together Method 1: I have \\(p\\) cores, so I will divide the work into \\(p\\) pieces. Each core can form a partial sum of approximately \\(n/p\\) values. They send their partial sums to a single core, which adds them together. Method 2: Instead of making the master core do all the work of computing the final sum, we can pair the cores so that while core 0 adds in the result of core 1, core 2 can add in the result of core 3, core 4 can add in the result of core 5 and so on. Compare: When \\(n\\) is large, method 2 is better. The first method require 999 receives and adds, while the second method requires only 10. Two approaches to parallel programming: Task-parallelism Data-parallelism Explanaition: The first part of global sum example is task-parallelism, each core carries out roughtly the same oprations on its assigned elements. And the second part is data-parallelism, receiving and adding the cores' partial sums. Writing actual code for parallel programs is relatively complex. Communication : cores communicate with each other. Load balancing : the work is divided evenly among the cores. Synchronization : cores must wait for each other at certain points in the program. Things we will learn: Three different extensions to C: OpenMP MPI Pthreads Two main types of parallel systems: Shared-memory systems cores can share access to the computer\u2019s memory Distributed-memory systems each core has its own, private memory, and the cores must communicate explicitly by doing something like sending messages across a network Pthreads and OpenMP were designed for programming shared-memory systems. They provide mechanisms for accessing shared-memory locations. MPI, on the other hand, was designed for programming distributed-memory systems. It provides mechanisms for sending messages. And we distinguish between three terms: Concurrent : a program is one in which multiple tasks can be in progress at any instant. Parallel : a program is one in which multiple tasks cooperate closely to solve a problem. Distributed : a program may need to cooperate with other programs to solve a problem. A Word of Warning It may be tempting to write parallel programs \u201cby the seat of your pants,\u201d without taking the trouble to carefully design and incrementally develop your program. This will almost certainly be a mistake. Every parallel program contains at least one serial program. Since we almost always need to coordinate the actions of multiple cores, writing parallel programs is almost always more complex than writing a serial program that solves the same problem. In fact, it is often far more complex. All the rules about careful design and development are usually far more important for the writing of parallel programs than they are for serial programs.","title":"Ch1. Why Parallel Programming?"},{"location":"books/AIPP/#ch2-parallel-hardware-and-parallel-software","text":"First time read I skipped these contents when I read this chapter for the first time: Modifications to the von Neumann Model SIMD Systems Interconnection Networks Notes for these contents can be seen in CSAPP.","title":"Ch2. Parallel Hardware and Parallel Software"},{"location":"books/AIPP/#ch3-distributed-memory-programming-with-mpi","text":"What is MPI? What do we use it for?","title":"Ch3. Distributed-Memory Programming with MPI"},{"location":"books/ATBSP/","text":"Python \u7f16\u7a0b\u5feb\u901f\u4e0a\u624b\uff1a\u8ba9\u7e41\u7410\u5de5\u4f5c\u81ea\u52a8\u5316 \u00b6 \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u9605\u8bfb\u65f6\u95f4 \uff5c \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e Al Sweigart 2015 2023.07 \u672c\u4e66\u6458\u8981 \u672c\u4e66\u7684\u76ee\u7684\u6027\u5f88\u5f3a\uff1a\u8ba9\u4f60\u5feb\u901f\u4e0a\u624b Python \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u6700\u5e38\u89c1\u7684\u7528\u6cd5\uff0c\u53ea\u9700\u8981\u5199\u7528\u5b8c\u5c31\u6254\u6389\u7684\u4ee3\u7801\u3002\u56e0\u6b64\u5b83\u5e76\u4e0d\u4f1a\u5411\u4f60\u4ecb\u7ecd\u5f88\u591a\u7f16\u7a0b\u65b9\u9762\u7684\u7ec6\u8282\uff0c\u751a\u81f3\u6839\u672c\u4e0d\u63d0\u9762\u5411\u5bf9\u8c61\u7b49\u77e5\u8bc6\u3002 \u5728\u6211\u770b\u6765\uff0c\u8fd9\u672c\u4e66\u9002\u5408\u5e0c\u671b\u5feb\u901f\u5c06 Python \u5e94\u7528\u5230\u5b66\u4e60\u5de5\u4f5c\u4e2d\u7684\u8bfb\u8005\u3002\u5982\u679c\u4f60\u9009\u62e9 SOP \u548c PCC \u7b49\u4e66\uff0c\u90a3\u4e48\u5927\u90e8\u5206\u7684\u65f6\u95f4\u90fd\u5c06\u82b1\u5728\u7f16\u7a0b\u548c\u8bed\u8a00\u7684\u5b66\u4e60\u4e0a\uff0c\u5e76\u4e0d\u80fd\u7acb\u523b\u5c06\u5b83\u5e94\u7528\u5230\u5de5\u4f5c\u4e0a\u3002 \u672c\u7bc7\u7b14\u8bb0\u4ec5\u9009\u8bfb\u4ee5\u4e0b\u7ae0\u8282\uff1a Ch6. \u5b57\u7b26\u4e32\u64cd\u4f5c Ch7. \u6b63\u5219\u8868\u8fbe\u5f0f Ch8-9. \u6587\u4ef6 Ch11. Web Ch17. \u56fe\u50cf \u96f6\u6563 tips \u00b6 None \u503c\uff1a\u8fd9\u662f NoneType \u6570\u636e\u7c7b\u578b\u7684\u552f\u4e00\u503c\u3002\u5982\u679c\u4f60\u5e0c\u671b\u53d8\u91cf\u4e2d\u7684\u503c\u4e0d\u4f1a\u548c\u5176\u4ed6\u4e1c\u897f\u6df7\u6dc6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5b83\u3002 \u4f7f\u7528\u6ca1\u6709\u8fd4\u56de\u503c\u7684\u51fd\u6570\u8fdb\u884c\u8d4b\u503c\u4e5f\u4f1a\u5f97\u5230 None \uff0c\u4f60\u53ef\u4ee5\u8ba4\u4e3a Python \u5728\u8fd9\u4e9b\u51fd\u6570\u672b\u5c3e\u90fd\u52a0\u4e0a\u4e86 return None \u3002 \u5f15\u7528\u5230\u5e95\u662f\u600e\u4e48\u56de\u4e8b\uff1f \u4f60\u53ef\u4ee5\u5c06\u53d8\u91cf\u770b\u4f5c\u4e00\u4e2a\u5305\u542b\u503c\u7684\u76d2\u5b50 \u5bf9\u4e8e \u4e0d\u53ef\u53d8\u6570\u636e\u7c7b\u578b \u7684\u503c\uff0c\u6bd4\u5982 \u5b57\u7b26\u4e32\u3001\u6574\u578b\u6216\u5143\u7ec4 \uff0c\u76d2\u5b50\u91cc\u88c5\u7684\u5c31\u662f\u503c\u672c\u8eab\u3002 \u5bf9\u4e8e \u53ef\u53d8\u6570\u636e\u7c7b\u578b \u7684\u503c\uff0c\u6bd4\u5982 \u5217\u8868\u3001\u5b57\u5178 \uff0c\u76d2\u5b50\u91cc\u88c5\u7684\u662f\u503c\u7684\u5f15\u7528\u3002 \u6280\u5de7\uff1a copy \u6a21\u5757\uff1a copy.copy() \uff1a\u590d\u5236\u5217\u8868\u6216\u5b57\u5178\u8fd9\u6837\u7684\u53ef\u53d8\u503c\u3002\u4f46\u662f\uff0c\u5982\u679c\u5217\u8868\u7684\u91cc\u9762\u6709\u5217\u8868\u5462\uff1f copy.deepcopy() \uff1a\u540c\u65f6\u590d\u5236\u5217\u8868\u3001\u5b57\u5178\u6216\u5217\u8868\u4e2d\u7684\u5217\u8868\u8fd9\u6837\u7684\u53ef\u53d8\u503c\u3002 \u6280\u5de7\uff1a pprint \u6a21\u5757 \u6f02\u4eae\u6253\u5370\uff1a pprint.pprint() \uff1a\u5c06\u5217\u8868\u3001\u5b57\u5178\u7b49\u6570\u636e\u7c7b\u578b\u6253\u5370\u6210\u6f02\u4eae\u7684\u683c\u5f0f\u3002 \u5982\u679c\u5e0c\u671b\u5f97\u5230\u5b57\u7b26\u4e32\uff0c\u4f7f\u7528 pprint.pformat() \u3002 Ch6. \u5b57\u7b26\u4e32\u64cd\u4f5c \u00b6 r \u524d\u7f00\uff1a\u539f\u59cb\u5b57\u7b26\u4e32\uff0c\u4e0d\u8f6c\u4e49\u3002\u5e38\u7528\u4e8e\u8def\u5f84\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3002 \u4e09\u91cd\u5f15\u53f7 \uff1a\u5176\u95f4\u7684\u6240\u6709\u5f15\u53f7\u3001\u5236\u8868\u7b26\u6216\u6362\u884c\u90fd\u88ab\u8ba4\u4e3a\u662f\u5b57\u7b26\u4e32\u7684\u4e00\u90e8\u5206\u3002 Python \u7684\u4ee3\u7801\u7f29\u8fdb\u89c4\u5219\u4e0d\u9002\u7528\u4e8e\u4e09\u91cd\u5f15\u53f7 \uff0c\u4f60\u7684\u7f29\u8fdb\u4e5f\u4f1a\u88ab\u6253\u5370\u51fa\u6765\u3002\u4e09\u91cd\u5f15\u53f7\u63a8\u8350\u8fd9\u6837\u5199\uff0c\u4fdd\u8bc1\u8f93\u51fa\u4e0e\u4ee3\u7801\u770b\u8d77\u6765\u4e00\u81f4\u3002\u5176\u4e2d\u7b2c\u4e00\u884c\u7684 \\ \u9632\u6b62\u6587\u6bb5\u5f00\u5934\u591a\u4e00\u4e2a\u6362\u884c\u7b26\u3002 print ( ''' \\ Dear Alice, Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sincerely, Bob''' ) \u591a\u884c\u5b57\u7b26\u4e32\u8fd8\u7ecf\u5e38\u7528\u4f5c\u591a\u884c\u6ce8\u91ca\u3002 \u5b57\u7b26\u4e32\u65b9\u6cd5\u96c6\u9526 \u00b6 isX() \u7cfb\u5217\uff1a isalpha() \u3001 isalnum() \u3001 isdecimal() \u3001 isspace() \u3001 istitle() \u3002 \u8f6c\u6362\uff1a upper() \u3001 lower() \u3001 title() \u3001 capitalize() \u3001 swapcase() \u3002 \u67e5\u627e\uff1a startswith() \u3001 endswith() \u3002 \u591a\u5b57\u7b26\u4e32\uff1a join() \u3001 split() \u88c1\u526a\uff1a strip() \u3001 lstrip() \u3001 rstrip() \u3002 \u5bf9\u9f50\uff1a ljust() \u3001 rjust() \u3001 center() \u3002 \u526a\u8d34\u677f \u00b6 \u4f7f\u7528 pyperclip \u5305\uff08\u9700\u8981\u5b89\u88c5\uff09\u53ef\u4ee5\u4e0e\u7cfb\u7edf\u526a\u8d34\u677f\u4ea4\u4e92\u3002 pyperclip.copy() \uff1a\u5c06\u5b57\u7b26\u4e32\u590d\u5236\u5230\u526a\u8d34\u677f\u3002 pyperclip.paste() \uff1a\u5c06\u526a\u8d34\u677f\u4e2d\u7684\u5185\u5bb9\u7c98\u8d34\u5230\u5b57\u7b26\u4e32\u3002 \u7ec3\u4e60 \u4ece\u526a\u8d34\u677f\u4e0a\u83b7\u53d6\u591a\u884c\u5b57\u7b26\u4e32\uff0c\u5c06\u5b83\u4eec\u8f6c\u6362\u6210 Markdown \u683c\u5f0f\u7684\u5217\u8868\u3002 import pyperclip text = pyperclip . paste () lines = text . split ( ' \\n ' ) for i in range ( len ( lines )): lines [ i ] = '* ' + lines [ i ] text = ' \\n ' . join ( lines ) pyperclip . copy ( text ) \u5173\u6ce8\u4ee3\u7801\u4e2d\u5982\u4f55\u5904\u7406\u6362\u884c\u7b26\u3002 Ch7. \u6a21\u5f0f\u5339\u914d\u4e0e\u6b63\u5219\u8868\u8fbe\u5f0f \u00b6 \u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5757 \u00b6 re \u6a21\u5757\u5904\u7406\u6b63\u5219\u8868\u8fbe\u5f0f\u3002 re.compile() \uff1a\u521b\u5efa\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u5bf9\u8c61\uff08Regex \u6a21\u5f0f\u5bf9\u8c61\uff09\u3002 \u7528\u4f8b\uff1a phoneNumRegex = re.compile(r'\\d\\d\\d-\\d\\d\\d-\\d\\d\\d\\d') \u8bb0\u5f97\u7528\u539f\u59cb\u5b57\u7b26\u4e32\u3002 Regex \u5bf9\u8c61\u6709\u5982\u4e0b\u65b9\u6cd5\uff1a search() \uff1a\u627e\u7b2c\u4e00\u6b21\u5339\u914d \u8f93\u5165\uff1a\u4e00\u4e2a\u5b57\u7b26\u4e32\u3002 \u8fd4\u56de\uff1a\u4e00\u4e2a Match \u5bf9\u8c61 \uff0c\u5305\u542b\u5339\u914d\u6587\u672c\u7684 \u7b2c\u4e00\u4e2a \u51fa\u73b0\u7684\u4f4d\u7f6e\u3002 Match \u5bf9\u8c61\u6709\u5982\u4e0b\u65b9\u6cd5\uff1a group() \uff1a\u8fd4\u56de\u5339\u914d\u7684\u5b57\u7b26\u4e32\u3002 \u8f93\u5165\uff1a\u4e00\u4e2a\u6574\u6570\uff08\u8868\u793a\u5206\u7ec4\uff09\uff0c0 \u6216\u7559\u7a7a\u8868\u793a\u6574\u4e2a\u5339\u914d\u3002 \u8fd4\u56de\uff1a\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u3002 findall() \uff1a\u627e\u6240\u6709\u5339\u914d \u8f93\u5165\uff1a\u4e00\u4e2a\u5b57\u7b26\u4e32\u3002 \u8fd4\u56de\uff1a\u4e00\u4e2a \u5b57\u7b26\u4e32\u5217\u8868 \uff0c\u5305\u542b\u5339\u914d\u7684\u6240\u6709\u5b57\u7b26\u4e32\u3002 \u5982\u679c\u6709\u5206\u7ec4\uff0c\u8fd4\u56de\u7684\u662f\u5143\u7ec4\u7684\u5217\u8868\u3002\u6bcf\u4e2a\u5143\u7ec4\u662f\u4e00\u4e2a \u5339\u914d \uff0c\u6bcf\u4e2a\u5143\u7ec4\u4e2d\u7684\u9879\u662f\u6539\u5339\u914d\u4e2d\u7684\u5404\u4e2a\u5206\u7ec4\u3002 sub() \uff1a\u66ff\u6362\u64cd\u4f5c \u8f93\u5165\uff1a\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u662f\u7528\u4e8e\u53d6\u4ee3\u5339\u914d\u7684\u5b57\u7b26\u4e32\uff0c\u7b2c\u4e8c\u4e2a\u662f\u8981\u88ab\u66ff\u6362\u7684\u5b57\u7b26\u4e32\u3002 \u5728\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528 \\1 \u3001 \\2 \u7b49\u6765\u5f15\u7528\u5339\u914d\u7684\u5206\u7ec4\u3002 \u8fd4\u56de\uff1a\u66ff\u6362\u540e\u7684\u5b57\u7b26\u4e32\u3002 \u6b63\u5219\u8868\u8fbe\u5f0f\u8bed\u6cd5 \u00b6 () \u5206\u7ec4\uff1a \u5206\u7ec4\u5c31\u662f\u5c06\u591a\u4e2a\u5b57\u7b26\u5f53\u4f5c\u4e00\u4e2a\u5355\u5143\u3002 | \u7ba1\u9053\uff1a\u5339\u914d\u591a\u4e2a\u8868\u8fbe\u5f0f\u4e2d\u7684\u4e00\u4e2a\u3002 ? \u53ef\u9009\u5339\u914d\uff1a\u524d\u9762\u7684\u5206\u7ec4\u51fa\u73b0 0 \u6b21\u6216 1 \u6b21\u3002 * \u96f6\u6b21\u6216\u591a\u6b21\u5339\u914d\uff1a\u524d\u9762\u7684\u5206\u7ec4\u51fa\u73b0 0 \u6b21\u6216\u591a\u6b21\u3002 + \u4e00\u6b21\u6216\u591a\u6b21\u5339\u914d\uff1a\u524d\u9762\u7684\u5206\u7ec4\u51fa\u73b0 1 \u6b21\u6216\u591a\u6b21\u3002 {n} \u5339\u914d n \u6b21\uff1a\u524d\u9762\u7684\u5206\u7ec4\u51fa\u73b0 n \u6b21\u3002 \u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u8303\u56f4\uff0c\u6bd4\u5982 {1,3} \u3002\u7b2c\u4e00\u6216\u7b2c\u4e8c\u4e2a\u6570\u5b57\u53ef\u4ee5\u4e0d\u5199\u3002 ? \u975e\u8d2a\u5fc3\u5339\u914d\uff1a\u9650\u5236\u524d\u9762\u7684\u5206\u7ec4\u5339\u914d\u5c3d\u53ef\u80fd\u5c11\u7684\u6587\u672c\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u8d2a\u5fc3\u7684\uff0c\u5373\u5339\u914d\u5c3d\u53ef\u80fd\u957f\u7684\u5b57\u7b26\u4e32\u3002 \u5b57\u7b26\u5206\u7c7b\uff1a \\d \u4efb\u4f55\u6570\u5b57 \\D \u9664\u6570\u5b57\u5916\u7684\u4efb\u4f55\u5b57\u7b26 \\w \u4efb\u4f55\u5b57\u6bcd\u3001\u6570\u5b57\u6216\u4e0b\u5212\u7ebf\u5b57\u7b26\uff08\u53ef\u4ee5\u8ba4\u4e3a\u662f\u5339\u914d\u201c\u5355\u8bcd\u201d\u5b57\u7b26\uff09 \\W \u9664\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf\u4ee5\u5916\u7684\u4efb\u4f55\u5b57\u7b26 \\s \u7a7a\u683c\u3001\u5236\u8868\u7b26\u6216\u6362\u884c\u7b26\uff08\u53ef\u4ee5\u8ba4\u4e3a\u662f\u5339\u914d\u201c\u7a7a\u767d\u201d\u5b57\u7b26\uff09 \\S \u4f7f\u7528\u4e2d\u62ec\u53f7\u521b\u5efa\u81ea\u5df1\u7684\u5b57\u7b26\u5206\u7c7b\u3002 ^ \uff1a\u5339\u914d\u5fc5\u987b\u53d1\u751f\u5728\u5b57\u7b26\u4e32\u5f00\u59cb\u5904\u3002 $ \uff1a\u5339\u914d\u5fc5\u987b\u53d1\u751f\u5728\u5b57\u7b26\u4e32\u7ed3\u5c3e\u5904\u3002 . \uff1a\u901a\u914d\u7b26\uff0c\u5339\u914d\u9664\u6362\u884c\u7b26\u5916\u4efb\u4f55\u5b57\u7b26\u3002 \u5982\u679c\u8981\u5339\u914d\u6362\u884c\u7b26\uff0c\u4f7f\u7528 re.DOTALL \u4f5c\u4e3a re.compile() \u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u3002 \u5927\u5c0f\u5199\u65e0\u5173\u5339\u914d\uff1a\u4f7f\u7528 re.IGNORECASE \u6216 re.I \u4f5c\u4e3a re.compile() \u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u3002 \u7ba1\u7406\u590d\u6742\u7684\u6b63\u5219\u8868\u8fbe\u5f0f \u00b6 \u4f7f\u7528 re.VERBOSE \u6216 re.X \u4f5c\u4e3a re.compile() \u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\u53ef\u4ee5\u5728\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u6dfb\u52a0\u6ce8\u91ca\u3002 \u7528\u4f8b\uff1a phoneRegex = re . compile ( r '''( (\\d {3} |\\(\\d {3} \\))? # area code (\\s|-|\\.)? # separator \\d {3} # first 3 digits (\\s|-|\\.) # separator \\d {4} # last 4 digits (\\s*(ext|x|ext.)\\s*\\d{2,5})? # extension )''' , re . VERBOSE ) \u52a0\u4e86\u6ce8\u91ca\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u5c31\u6e05\u6670\u591a\u5566\uff01 \u4f7f\u7528\u7ba1\u9053\u7b26\u53f7\u53ef\u4ee5\u5c06\u591a\u4e2a re.compile() \u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u7ed3\u5408\u8d77\u6765\u4f7f\u7528\uff0c\u6bd4\u5982 re.compile(r'pattern', re.IGNORECASE | re.DOTALL) \u3002","title":"Python \u7f16\u7a0b\u5feb\u901f\u4e0a\u624b\uff1a\u8ba9\u7e41\u7410\u5de5\u4f5c\u81ea\u52a8\u5316"},{"location":"books/ATBSP/#python","text":"\u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u9605\u8bfb\u65f6\u95f4 \uff5c \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e Al Sweigart 2015 2023.07 \u672c\u4e66\u6458\u8981 \u672c\u4e66\u7684\u76ee\u7684\u6027\u5f88\u5f3a\uff1a\u8ba9\u4f60\u5feb\u901f\u4e0a\u624b Python \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u6700\u5e38\u89c1\u7684\u7528\u6cd5\uff0c\u53ea\u9700\u8981\u5199\u7528\u5b8c\u5c31\u6254\u6389\u7684\u4ee3\u7801\u3002\u56e0\u6b64\u5b83\u5e76\u4e0d\u4f1a\u5411\u4f60\u4ecb\u7ecd\u5f88\u591a\u7f16\u7a0b\u65b9\u9762\u7684\u7ec6\u8282\uff0c\u751a\u81f3\u6839\u672c\u4e0d\u63d0\u9762\u5411\u5bf9\u8c61\u7b49\u77e5\u8bc6\u3002 \u5728\u6211\u770b\u6765\uff0c\u8fd9\u672c\u4e66\u9002\u5408\u5e0c\u671b\u5feb\u901f\u5c06 Python \u5e94\u7528\u5230\u5b66\u4e60\u5de5\u4f5c\u4e2d\u7684\u8bfb\u8005\u3002\u5982\u679c\u4f60\u9009\u62e9 SOP \u548c PCC \u7b49\u4e66\uff0c\u90a3\u4e48\u5927\u90e8\u5206\u7684\u65f6\u95f4\u90fd\u5c06\u82b1\u5728\u7f16\u7a0b\u548c\u8bed\u8a00\u7684\u5b66\u4e60\u4e0a\uff0c\u5e76\u4e0d\u80fd\u7acb\u523b\u5c06\u5b83\u5e94\u7528\u5230\u5de5\u4f5c\u4e0a\u3002 \u672c\u7bc7\u7b14\u8bb0\u4ec5\u9009\u8bfb\u4ee5\u4e0b\u7ae0\u8282\uff1a Ch6. \u5b57\u7b26\u4e32\u64cd\u4f5c Ch7. \u6b63\u5219\u8868\u8fbe\u5f0f Ch8-9. \u6587\u4ef6 Ch11. Web Ch17. \u56fe\u50cf","title":"Python \u7f16\u7a0b\u5feb\u901f\u4e0a\u624b\uff1a\u8ba9\u7e41\u7410\u5de5\u4f5c\u81ea\u52a8\u5316"},{"location":"books/ATBSP/#tips","text":"None \u503c\uff1a\u8fd9\u662f NoneType \u6570\u636e\u7c7b\u578b\u7684\u552f\u4e00\u503c\u3002\u5982\u679c\u4f60\u5e0c\u671b\u53d8\u91cf\u4e2d\u7684\u503c\u4e0d\u4f1a\u548c\u5176\u4ed6\u4e1c\u897f\u6df7\u6dc6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5b83\u3002 \u4f7f\u7528\u6ca1\u6709\u8fd4\u56de\u503c\u7684\u51fd\u6570\u8fdb\u884c\u8d4b\u503c\u4e5f\u4f1a\u5f97\u5230 None \uff0c\u4f60\u53ef\u4ee5\u8ba4\u4e3a Python \u5728\u8fd9\u4e9b\u51fd\u6570\u672b\u5c3e\u90fd\u52a0\u4e0a\u4e86 return None \u3002 \u5f15\u7528\u5230\u5e95\u662f\u600e\u4e48\u56de\u4e8b\uff1f \u4f60\u53ef\u4ee5\u5c06\u53d8\u91cf\u770b\u4f5c\u4e00\u4e2a\u5305\u542b\u503c\u7684\u76d2\u5b50 \u5bf9\u4e8e \u4e0d\u53ef\u53d8\u6570\u636e\u7c7b\u578b \u7684\u503c\uff0c\u6bd4\u5982 \u5b57\u7b26\u4e32\u3001\u6574\u578b\u6216\u5143\u7ec4 \uff0c\u76d2\u5b50\u91cc\u88c5\u7684\u5c31\u662f\u503c\u672c\u8eab\u3002 \u5bf9\u4e8e \u53ef\u53d8\u6570\u636e\u7c7b\u578b \u7684\u503c\uff0c\u6bd4\u5982 \u5217\u8868\u3001\u5b57\u5178 \uff0c\u76d2\u5b50\u91cc\u88c5\u7684\u662f\u503c\u7684\u5f15\u7528\u3002 \u6280\u5de7\uff1a copy \u6a21\u5757\uff1a copy.copy() \uff1a\u590d\u5236\u5217\u8868\u6216\u5b57\u5178\u8fd9\u6837\u7684\u53ef\u53d8\u503c\u3002\u4f46\u662f\uff0c\u5982\u679c\u5217\u8868\u7684\u91cc\u9762\u6709\u5217\u8868\u5462\uff1f copy.deepcopy() \uff1a\u540c\u65f6\u590d\u5236\u5217\u8868\u3001\u5b57\u5178\u6216\u5217\u8868\u4e2d\u7684\u5217\u8868\u8fd9\u6837\u7684\u53ef\u53d8\u503c\u3002 \u6280\u5de7\uff1a pprint \u6a21\u5757 \u6f02\u4eae\u6253\u5370\uff1a pprint.pprint() \uff1a\u5c06\u5217\u8868\u3001\u5b57\u5178\u7b49\u6570\u636e\u7c7b\u578b\u6253\u5370\u6210\u6f02\u4eae\u7684\u683c\u5f0f\u3002 \u5982\u679c\u5e0c\u671b\u5f97\u5230\u5b57\u7b26\u4e32\uff0c\u4f7f\u7528 pprint.pformat() \u3002","title":"\u96f6\u6563 tips"},{"location":"books/ATBSP/#ch6","text":"r \u524d\u7f00\uff1a\u539f\u59cb\u5b57\u7b26\u4e32\uff0c\u4e0d\u8f6c\u4e49\u3002\u5e38\u7528\u4e8e\u8def\u5f84\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3002 \u4e09\u91cd\u5f15\u53f7 \uff1a\u5176\u95f4\u7684\u6240\u6709\u5f15\u53f7\u3001\u5236\u8868\u7b26\u6216\u6362\u884c\u90fd\u88ab\u8ba4\u4e3a\u662f\u5b57\u7b26\u4e32\u7684\u4e00\u90e8\u5206\u3002 Python \u7684\u4ee3\u7801\u7f29\u8fdb\u89c4\u5219\u4e0d\u9002\u7528\u4e8e\u4e09\u91cd\u5f15\u53f7 \uff0c\u4f60\u7684\u7f29\u8fdb\u4e5f\u4f1a\u88ab\u6253\u5370\u51fa\u6765\u3002\u4e09\u91cd\u5f15\u53f7\u63a8\u8350\u8fd9\u6837\u5199\uff0c\u4fdd\u8bc1\u8f93\u51fa\u4e0e\u4ee3\u7801\u770b\u8d77\u6765\u4e00\u81f4\u3002\u5176\u4e2d\u7b2c\u4e00\u884c\u7684 \\ \u9632\u6b62\u6587\u6bb5\u5f00\u5934\u591a\u4e00\u4e2a\u6362\u884c\u7b26\u3002 print ( ''' \\ Dear Alice, Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Sincerely, Bob''' ) \u591a\u884c\u5b57\u7b26\u4e32\u8fd8\u7ecf\u5e38\u7528\u4f5c\u591a\u884c\u6ce8\u91ca\u3002","title":"Ch6. \u5b57\u7b26\u4e32\u64cd\u4f5c"},{"location":"books/ATBSP/#ch7","text":"","title":"Ch7. \u6a21\u5f0f\u5339\u914d\u4e0e\u6b63\u5219\u8868\u8fbe\u5f0f"},{"location":"books/Algorithm/","text":"\u7b97\u6cd5 \u00b6 \u6458\u8981 \u8be5\u7bc7\u7b14\u8bb0\u662f\u591a\u672c\u7b97\u6cd5\u5206\u6790\u6559\u6750\u7684\u7b14\u8bb0\u5408\u96c6\uff0c\u5305\u62ec\uff1a \u300a\u7b97\u6cd5\u300b\u7b2c\u56db\u7248 \u300a\u7b97\u6cd5\u5bfc\u8bba\u300b\u7b2c\u4e09\u7248 \u7b97\u6cd5\u5206\u6790\u57fa\u7840 \u00b6 \u5728\u7b97\u6cd5\u5206\u6790\u57fa\u7840\u8fd9\u5757\uff0c\u300a\u7b97\u6cd5\u300b\u66f4\u6ce8\u91cd\u4e8e\u5e94\u7528\uff0c\u8bb2\u89e3\u4e86\u5f88\u591a\u6570\u636e\u62bd\u8c61\u3001API \u8bbe\u8ba1\u7684\u5185\u5bb9\uff0c\u5173\u4e8e\u6570\u5b66\u7684\u90e8\u5206\u5219\u4f7f\u7528\u56fe\u50cf\u548c\u5b9e\u9a8c\u7ed3\u679c\u7ed9\u8bfb\u8005\u76f4\u89c2\u7684\u4e86\u89e3\u3002\u300a\u7b97\u6cd5\u5bfc\u8bba\u300b\u5219\u5bf9\u7b97\u6cd5\u5206\u6790\u7684\u6570\u5b66\u63cf\u8ff0\u8fdb\u884c\u4e86\u4e25\u8c28\u7684\u5b9a\u4e49\u548c\u63a8\u5bfc\u3002 \u6570\u636e\u62bd\u8c61 \u00b6 \u300a\u7b97\u6cd5\u300b\u8981\u6c42\u5bf9\u4e09\u79cd\u57fa\u672c\u7684\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u6709\u4e00\u5b9a\u4e86\u89e3\uff1a \u80cc\u5305 \u76ee\u7684\uff1a\u6536\u96c6\u5143\u7d20\u5e76\u8fed\u4ee3\u6240\u6709\u6536\u96c6\u7684\u5143\u7d20 \u4e0d\u652f\u6301\u5220\u9664 \u961f\u5217 \u5148\u8fdb\u5148\u51fa\u7b56\u7565 \u6808 \u540e\u8fdb\u5148\u51fa\u7b56\u7565 \u7b97\u6cd5\uff1a\u53cc\u6808\u8868\u8fbe\u5f0f\u6c42\u503c \u7531 Dijkstra \u53d1\u660e\u7684\u7b80\u5355\u7b97\u6cd5\uff1a\u4e00\u4e2a\u6808\u4fdd\u5b58\u8fd0\u7b97\u7b26\uff0c\u4e00\u4e2a\u6808\u4fdd\u5b58\u64cd\u4f5c\u6570\u3002 \u5c06\u64cd\u4f5c\u6570\u538b\u5165\u6808 \u5c06\u8fd0\u7b97\u7b26\u538b\u5165\u6808 \u5ffd\u7565\u5de6\u62ec\u53f7 \u9047\u5230\u53f3\u62ec\u53f7\uff0c\u5f39\u51fa\u8fd0\u7b97\u7b26\u548c\u6240\u9700\u6570\u91cf\u7684\u64cd\u4f5c\u6570\uff0c\u5c06\u7ed3\u679c\u538b\u5165\u64cd\u4f5c\u6570\u6808 \u663e\u7136\u8be5\u7b97\u6cd5\u8981\u6c42\u8868\u8fbe\u5f0f\u5df2\u7ecf\u9012\u5f52\u5730\u5c06\u6240\u6709\u5b50\u8868\u8fbe\u5f0f\u4f7f\u7528\u62ec\u53f7\u62ec\u8d77","title":"\u7b97\u6cd5"},{"location":"books/Algorithm/#_1","text":"\u6458\u8981 \u8be5\u7bc7\u7b14\u8bb0\u662f\u591a\u672c\u7b97\u6cd5\u5206\u6790\u6559\u6750\u7684\u7b14\u8bb0\u5408\u96c6\uff0c\u5305\u62ec\uff1a \u300a\u7b97\u6cd5\u300b\u7b2c\u56db\u7248 \u300a\u7b97\u6cd5\u5bfc\u8bba\u300b\u7b2c\u4e09\u7248","title":"\u7b97\u6cd5"},{"location":"books/Algorithm/#_2","text":"\u5728\u7b97\u6cd5\u5206\u6790\u57fa\u7840\u8fd9\u5757\uff0c\u300a\u7b97\u6cd5\u300b\u66f4\u6ce8\u91cd\u4e8e\u5e94\u7528\uff0c\u8bb2\u89e3\u4e86\u5f88\u591a\u6570\u636e\u62bd\u8c61\u3001API \u8bbe\u8ba1\u7684\u5185\u5bb9\uff0c\u5173\u4e8e\u6570\u5b66\u7684\u90e8\u5206\u5219\u4f7f\u7528\u56fe\u50cf\u548c\u5b9e\u9a8c\u7ed3\u679c\u7ed9\u8bfb\u8005\u76f4\u89c2\u7684\u4e86\u89e3\u3002\u300a\u7b97\u6cd5\u5bfc\u8bba\u300b\u5219\u5bf9\u7b97\u6cd5\u5206\u6790\u7684\u6570\u5b66\u63cf\u8ff0\u8fdb\u884c\u4e86\u4e25\u8c28\u7684\u5b9a\u4e49\u548c\u63a8\u5bfc\u3002","title":"\u7b97\u6cd5\u5206\u6790\u57fa\u7840"},{"location":"books/CNATDA2/","tags":["Ongoing"],"text":"\u8ba1\u7b97\u673a\u7f51\u7edc\uff1a\u81ea\u9876\u5411\u4e0b\u65b9\u6cd5 \u00b6 Computer Networking: A Top-Down Approach Seventh Edition \u51fa\u7248\u793e \u4f5c\u8005 \u51fa\u7248\u65f6\u95f4 \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e James F. Kurose, Keith W. Ross 2017 Ch2. \u5e94\u7528\u5c42 \u00b6 Abstract \u5b9a\u4e49\u57fa\u672c\u6982\u5ff5\uff1a\u7f51\u7edc\u670d\u52a1\u3001\u5ba2\u6237\u548c\u670d\u52a1\u5668\u3001\u8fdb\u7a0b\u548c\u8fd0\u8f93\u5c42\u63a5\u53e3 \u51e0\u79cd\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\uff1aWeb\u3001\u7535\u5b50\u90ae\u4ef6\u3001DNS\u3001\u5bf9\u7b49\u6587\u4ef6\u5206\u53d1\u548c\u89c6\u9891\u6d41 \u5f00\u53d1\u7b80\u5355\u7684\u8fd0\u884c\u5728 TCP \u548c UDP \u4e0a\u7684\u5e94\u7528\u7a0b\u5e8f 2.1 \u5e94\u7528\u5c42\u534f\u8bae\u539f\u7406 \u00b6 \u5728\u5e94\u7528\u5c42\u4e2d\uff0c\u6709\u4e24\u79cd\u7a0b\u5e8f\u8fdb\u884c\u901a\u4fe1\uff1a \u8fd0\u884c\u5728 Web \u670d\u52a1\u5668\u4e3b\u673a\u4e0a\u7684 Web \u670d\u52a1\u5668\u7a0b\u5e8f \u8fd0\u884c\u5728\u7528\u6237\u4e3b\u673a\u4e0a\u7684 \u6d4f\u89c8\u5668\u7a0b\u5e8f \u8bbe\u8ba1\u7f51\u7edc\u5e94\u7528\u65f6\uff0c\u6709\u4e24\u79cd\u5e94\u7528\u7a0b\u5e8f\u4f53\u7cfb\u7ed3\u6784\uff1a \u5ba2\u6237-\u670d\u52a1\u5668\u4f53\u7cfb\u7ed3\u6784 \u4e00\u4e2a\u603b\u662f\u6253\u5f00\u7684\u79f0\u4e3a\u670d\u52a1\u5668\u7684\u4e3b\u673a\uff0c\u670d\u52a1\u6765\u81ea\u5176\u4ed6\u79f0\u4e3a\u5ba2\u6237\u7684\u4e3b\u673a\u7684\u8bf7\u6c42\u3002 \u7279\u5f81\uff1a\u670d\u52a1\u5668\u5177\u6709\u56fa\u5b9a\u7684\u3001\u5468\u77e5\u7684\u5730\u5740\u3002\u5ba2\u6237\u7aef\u603b\u662f\u80fd\u5411\u8be5 IP \u53d1\u9001\u5206\u7ec4\u4e0e\u5176\u8054\u7cfb\u3002 \u5b9e\u4f8b\uff1aWeb\u3001FTP\u3001Telnet\u3001\u7535\u5b50\u90ae\u4ef6\u3002 \u5bf9\u7b49\uff08P2P\uff09\u4f53\u7cfb\u7ed3\u6784 \u5e94\u7528\u7a0b\u5e8f\u5728\u95f4\u65ad\u8fde\u63a5\u7684\u4e3b\u673a \u5bf9 \u4e4b\u95f4\u76f4\u63a5\u901a\u4fe1\u3002 \u6d41\u91cf\u5bc6\u96c6\u578b\u5e94\u7528\u5927\u591a\u662f P2P \u7684\u3002 \u5b9e\u4f8b\uff1a\u6587\u4ef6\u5171\u4eab\uff08BT\uff09\u3001\u5bf9\u7b49\u534f\u52a9\u4e0b\u8f7d\u5668\uff08\u8fc5\u96f7\uff09\u3001\u7f51\u7edc\u7535\u8bdd\u548c\u89c6\u9891\u4f1a\u8bae\uff08Skype\uff09\u3002 \u7279\u6027\uff1a \u81ea\u6269\u5c55\u6027 \u6df7\u5408\u4f53\u7cfb\u7ed3\u6784 \u5b9e\u4f8b\uff1a\u5373\u65f6\u8baf\u606f\u5e94\u7528 \u5728\u4e24\u4e2a\u4e0d\u540c\u7aef\u7cfb\u7edf\u4e0a\u7684\u8fdb\u7a0b\uff0c\u901a\u8fc7\u8ba1\u7b97\u673a\u7f51\u7edc\u4ea4\u6362 \u62a5\u6587 \u8fdb\u884c\u901a\u8baf\u3002\u5728\u4efb\u4f55\u7ed9\u5b9a\u7684\u4e00\u5bf9\u8fdb\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1\u4f1a\u8bdd\u573a\u666f\uff0c\u6211\u4eec\u603b\u662f\u80fd\u5c06\u5176\u4e2d\u4e00\u4e2a\u8fdb\u7a0b\u6807\u8bb0\u4e3a\u5ba2\u6237\uff0c\u53e6\u4e00\u4e2a\u6807\u8bb0\u4e3a\u670d\u52a1\u5668\u3002 \u53d1\u8d77\u901a\u4fe1\u8054\u7cfb \u7684\u662f\u5ba2\u6237\u7aef\uff0c\u4f1a\u8bdd\u5f00\u59cb\u65f6 \u7b49\u5f85\u8054\u7cfb \u7684\u662f\u670d\u52a1\u5668\u3002 \u8fdb\u7a0b\u901a\u8fc7 \u5957\u63a5\u5b57\uff08socket\uff09 \u63a5\u53e3\u5411\u7f51\u7edc\u53d1\u9001\u62a5\u6587\u3001\u4ece\u7f51\u7edc\u63a5\u6536\u62a5\u6587\u3002\u5957\u63a5\u5b57\u63a5\u53e3\u7531\u64cd\u4f5c\u7cfb\u7edf\u7ba1\u7406\u3002\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u8005\u5bf9\u4e8e\u5957\u63a5\u5b57\u4e0b\u5c42\u7684\u57fa\u7840\u8bbe\u65bd\u51e0\u4e4e\u6ca1\u6709\u63a7\u5236\u6743\uff08\u53ef\u4ee5\u9009\u62e9\u8fd0\u8f93\u5c42\u534f\u8bae\u7b49\uff09\u3002 \u6211\u4eec\u9700\u8981\u77e5\u9053\u4e24\u79cd\u4fe1\u606f\u624d\u80fd\u5c06\u5206\u7ec4\u9001\u8fbe\u76ee\u6807\u8fdb\u7a0b\uff1a \u4e3b\u673a\u7684\u5730\u5740\uff1aIP \u5730\u5740 \u8fdb\u7a0b\u7684\u8868\u793a\uff1a\u7aef\u53e3\u53f7 \u7aef\u53e3\u53f7\u7528\u4e8e\u6807\u8bc6\u5e94\u7528\u7a0b\u5e8f\u3002 \u5e94\u7528\u7a0b\u5e8f\u53ef\u80fd\u9700\u8981\u8fd0\u8f93\u5c42\u63d0\u4f9b\u8fd9\u4e9b\u670d\u52a1\u8981\u6c42\uff1a \u53ef\u9760\u6570\u636e\u4f20\u8f93 \u591a\u5a92\u4f53\u5e94\u7528\u5927\u591a\u662f\u80fd\u5fcd\u53d7\u6570\u636e\u4e22\u5931\u7684\u5e94\u7528\u3002 \u541e\u5410\u91cf \u591a\u5a92\u4f53\u5e94\u7528\u5927\u591a\u662f \u5e26\u5bbd\u654f\u611f \u7684\u3002\u5f53\u534f\u8bae\u65e0\u6cd5\u63d0\u4f9b\u9700\u6c42\u7684\u541e\u5410\u91cf\u65f6\uff0c\u5e94\u7528\u7a0b\u5e8f\u53ea\u80fd\u9009\u62e9\u8f83\u4f4e\u7684\u7f16\u7801\uff0c\u6216\u653e\u5f03\u53d1\u9001\u3002 \u7535\u5b50\u90ae\u4ef6\u3001\u6587\u4ef6\u4f20\u8f93\u90fd\u5c5e\u4e8e \u5f39\u6027\u5e94\u7528 \u3002 \u5b9a\u65f6 \u8fd9\u91cc\u7684\u5b9a\u65f6\u6307\u7684\u662f\u65f6\u5ef6\u3002 \u5b89\u5168\u6027 \u5728\u4e00\u822c\u7684 TCP/IP \u7f51\u7edc\u4e2d\uff0c\u4e3a\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e24\u4e2a\u8fd0\u8f93\u5c42\u534f\u8bae\uff1aUDP \u548c TCP\u3002 Ch4. \u7f51\u7edc\u5c42\uff1a\u6570\u636e\u5e73\u9762 \u00b6 4.1 \u7f51\u7edc\u5c42\u6982\u8ff0 \u00b6 \u6bcf\u53f0\u4e3b\u673a\u548c\u8def\u7531\u5668\u4e2d\u90fd\u6709\u4e00\u4e2a\u7f51\u7edc\u5c42\u90e8\u5206\u3002\u7f51\u7edc\u5c42\u5177\u6709\u4e24\u5927\u91cd\u8981\u529f\u80fd\uff1a \u8f6c\u53d1\uff08forwarding\uff09\uff1a\u7531\u6570\u636e\u5e73\u9762\u5b9e\u73b0\uff0c\u8def\u7531\u5668\u5c06\u5206\u7ec4\u4ece\u4e00\u4e2a\u8f93\u5165\u94fe\u8def\u79fb\u52a8\u5230\u9002\u5f53\u7684\u8f93\u51fa\u94fe\u8def\u3002 \u8def\u7531\u9009\u62e9\uff08routing\uff09\uff1a\u7531\u63a7\u5236\u5e73\u9762\u5b9e\u73b0\uff0c\u8def\u7531\u5668\u4f7f\u7528 \u8def\u7531\u9009\u62e9\u7b97\u6cd5 \u51b3\u5b9a\u5206\u7ec4\u5728\u7aef\u7cfb\u7edf\u4e4b\u95f4\u6d41\u52a8\u7684\u8def\u5f84\u3002 \u6bcf\u53f0\u8def\u7531\u5668\u5177\u6709\u4e00\u4e2a\u8f6c\u53d1\u8868\u3002\u5728\u76ee\u524d\u6700\u5e7f\u6cdb\u4f7f\u7528\u7684\u7f51\u7edc\u7ed3\u6784\u4e2d\uff0c\u8f6c\u53d1\u8868\u7531\u4e00\u4e2a\u8fdc\u7a0b\u63a7\u5236\u5668\u8fdb\u884c\u8ba1\u7b97\u548c\u5206\u53d1\uff0c\u8fd9\u79f0\u4e3a\u8f6f\u4ef6\u5b9a\u4e49\u7f51\u7edc\uff08Software Defined Network\uff0cSDN\uff09\u3002 4.2 \u8def\u7531\u5668\u5de5\u4f5c\u539f\u7406 \u00b6 \u4e00\u53f0\u8def\u7531\u5668\u6709\u56db\u4e2a\u7ec4\u4ef6\uff1a \u8f93\u5165\u7aef\u53e3\uff1a\u63a5\u6536\u5206\u7ec4\u3001\u67e5\u8be2\u8f6c\u53d1\u8868\u3002 \u4ea4\u6362\u7ed3\u6784\uff1a\u8fde\u63a5\u8f93\u5165\u7aef\u53e3\u548c\u8f93\u51fa\u7aef\u53e3\u3002 \u8f93\u51fa\u7aef\u53e3\uff1a\u5b58\u50a8\u548c\u4f20\u8f93\u5206\u7ec4\u3002 \u8def\u7531\u9009\u62e9\u5904\u7406\u5668\uff1a\u4e0e\u8fdc\u7a0b\u63a7\u5236\u5668\u901a\u4fe1\u3001\u63a5\u6536\u8f6c\u53d1\u8868\u3001\u5728\u8f93\u5165\u7aef\u53e3\u5b89\u88c5\u8f6c\u53d1\u8868\u9879\u3001\u6267\u884c\u7f51\u7edc\u7ba1\u7406\u529f\u80fd\u7b49\u3002 \u524d\u9762\u7684\u4e09\u4e2a\u7ec4\u4ef6\u7531\u786c\u4ef6\u5b9e\u73b0\uff0c\u800c\u8def\u7531\u9009\u62e9\u5904\u7406\u5668\u7531\u8f6f\u4ef6\u5b9e\u73b0\u3002 \u4e24\u79cd\u8f6c\u53d1\u6a21\u5f0f\uff1a \u57fa\u4e8e\u76ee\u7684\u5730\u8f6c\u53d1\uff1a\u6700\u4e3a\u6cdb\u7528\u7684\u8f6c\u53d1\u6a21\u5f0f\uff0c\u53ea\u6839\u636e\u76ee\u7684\u5730\u51b3\u5b9a\u8f6c\u53d1\u3002 \u901a\u7528\u8f6c\u53d1\uff1a\u7528\u66f4\u591a\u56e0\u7d20\u63a7\u5236\u8f6c\u53d1\u51b3\u7b56\uff0c\u6bd4\u5982\uff1a\u5e94\u7528\u5c42\u534f\u8bae\u3001\u67d0\u4e9b\u9996\u90e8\u5b57\u6bb5\u7b49\u3002\uff08\u4e0d\u9700\u8981\u4e86\u89e3\uff0c\u77e5\u9053\u6709\u8fd9\u4e48\u4e2a\u4e1c\u897f\u5c31\u884c\uff09\u3002 \u8f93\u5165\u7aef\u53e3\u5904\u7406\uff1a \u8f6c\u53d1\u8868\u4ece\u8def\u7531\u9009\u62e9\u5904\u7406\u5668\u901a\u8fc7\u72ec\u7acb\u603b\u7ebf\u590d\u5236\u5230\u8f93\u5165\u7aef\u53e3\u7684\u7ebf\u8def\u5361\u3002 \u8f93\u5165\u7aef\u53e3\u5904\u7406\u6d41\u7a0b\uff1a\u7ebf\u8def\u7aef\u63a5-\u6570\u636e\u94fe\u8def\u5904\u7406\uff08\u534f\u8bae\uff0c\u62c6\u5c01\uff09-\u67e5\u627e\u3001\u8f6c\u53d1\u3001\u6392\u961f-\u8fdb\u5165\u4ea4\u6362\u7ed3\u6784 \u9664\u4e86\u67e5\u627e\u4ee5\u5916\uff0c\u8f93\u5165\u7aef\u53e3\u8fd8\u9700\u8981\u6267\u884c\u5176\u4ed6\u529f\u80fd\uff0c\u5982\u68c0\u67e5\u3001\u91cd\u5199\u5206\u7ec4\u4e2d\u7684\u67d0\u4e9b\u5185\u5bb9\uff0c\u66f4\u65b0\u7f51\u7edc\u8ba1\u6570\u5668\u7b49\u3002 \u8f6c\u53d1\u8868\u592a\u5927\u4e86\u600e\u4e48\u529e\uff1f \u5bf9\u4e8e 32 \u4f4d IP \u5730\u5740\uff0c\u5982\u679c\u8def\u7531\u8868\u4e2d\u4e3a\u6bcf\u4e2a IP \u5730\u5740\u8bbe\u7f6e\u4e00\u4e2a\u8868\u9879\uff0c\u5219\u8def\u7531\u8868\u6709 40 \u591a\u4ebf\u4e2a\u9879\u3002\u4e8b\u5b9e\u4e0a\u8def\u7531\u5668\u4f7f\u7528 \u6700\u957f\u524d\u7f00\u5339\u914d \u89c4\u5219\uff0c\u8f6c\u53d1\u8868\u4e2d\u4fdd\u5b58 \u524d\u7f00\u5339\u914d \u3002 \u6700\u957f\u524d\u7f00\u5339\u914d\u6307\u7684\u662f\uff1a\u5982\u679c\u8def\u7531\u8868\u4e2d\u6709\u591a\u4e2a\u5339\u914d\u9879\uff0c\u90a3\u4e48\u9009\u62e9\u6700\u957f\u7684\u524d\u7f00\u5339\u914d\u9879\u3002 \u8fd9\u8981\u6c42\u786c\u4ef6\u5b9e\u73b0\uff1a\u5bf9\u5927\u578b\u8f6c\u53d1\u8868\u7684\u8d85\u8fc7\u7b80\u5355\u7ebf\u6027\u641c\u7d22\u7684\u67e5\u627e\u7b97\u6cd5\u3001\u5bf9\u5185\u5b58\u7684\u9ad8\u901f\u8bbf\u95ee\u3002\u6709\u5174\u8da3\u53ef\u4ee5\u67e5\u627e\u76f8\u5173\u8d44\u6599\u3002 \u4ea4\u6362\u7ed3\u6784\u6709\u591a\u79cd\u5b9e\u73b0\uff0c\u7b80\u5355\u4e86\u89e3\u4e00\u4e0b\uff1a \u7ecf\u5185\u5b58\u4ea4\u6362\uff1a\u53d7\u5185\u5b58\u8bbf\u95ee\u901f\u5ea6\u7684\u9650\u5236\u3002\u5728\u73b0\u4ee3\u8def\u7531\u5668\u4e2d\uff0c\u5c06\u5206\u7ec4\u5b58\u8fdb\u5185\u5b58\u4f4d\u7f6e\u4e5f\u5e38\u5e38\u7531\u8f93\u5165\u7aef\u53e3\u7684\u7ebf\u8def\u5361\u5b8c\u6210\uff0c\u8fd9\u66f4\u50cf\u662f\u4e00\u4e2a\u5171\u4eab\u5185\u5b58\u7684\u591a\u5904\u7406\u5668\u3002 \u7ecf\u603b\u7ebf\u4ea4\u6362\uff1a\u63a5\u6536\u5206\u7ec4-\u6253\u6807\u7b7e-\u4e0a\u603b\u7ebf-\u5339\u914d\u7684\u8f93\u51fa\u7aef\u53e3\u63a5\u6536-\u53bb\u9664\u6807\u7b7e\u3002\u6240\u6709\u7aef\u53e3\u90fd\u4f1a\u6536\u5230\u5206\u7ec4\uff0c\u4f46\u53ea\u6709\u5339\u914d\u7684\u7aef\u53e3\u4f1a\u63a5\u6536\u5230\u5206\u7ec4\u3002\u603b\u7ebf\u4e0a\u4e00\u6b21\u53ea\u80fd\u6709\u4e00\u4e2a\u5206\u7ec4\uff0c\u901f\u5ea6\u53d7\u603b\u7ebf\u5e26\u5bbd\u9650\u5236\u3002 \u7ecf\u4e92\u8054\u7f51\u7edc\u4ea4\u6362\uff1a\u4f7f\u7528\u66f4\u52a0\u590d\u6742\u7684\u5185\u90e8\u4ea4\u6362\u7ed3\u6784\uff0c\u5982\u7eb5\u6a2a\u5f0f\u4ea4\u6362\u7f51\u7edc\u3001\u591a\u7ea7\u4ea4\u6362\u7ed3\u6784\u7b49\u3002\u5b83\u4eec\u901a\u5e38\u662f \u975e\u963b\u585e \u7684\uff0c\u5373\u53ea\u8981\u6ca1\u6709\u5176\u4ed6\u5206\u7ec4\u5360\u7528\u8be5\u8f93\u51fa\u7aef\u53e3\uff0c\u5c31\u53ef\u4ee5\u7acb\u5373\u5c06\u5206\u7ec4\u4ece\u8f93\u5165\u7aef\u53e3\u8f6c\u53d1\u5230\u8f93\u51fa\u7aef\u53e3\u3002 \u8f93\u51fa\u7aef\u53e3\u5904\u7406\uff1a \u8f93\u51fa\u7aef\u53e3\u5904\u7406\u6d41\u7a0b\uff1a\u6392\u961f-\u6570\u636e\u94fe\u8def\u5904\u7406\uff08\u534f\u8bae\uff0c\u5c01\u88c5\uff09-\u7ebf\u8def\u7aef\u63a5 \u8f93\u5165\u6392\u961f\uff1a\u7ebf\u8def\u524d\u90e8\u963b\u585e\uff08Head-Of-Line\uff0cHOL\uff09\u963b\u585e\u3002\u5982\u679c\u4e00\u4e2a\u5206\u7ec4\u5728\u4e00\u4e2a\u8f93\u51fa\u7aef\u53e3\u6392\u961f\uff0c\u90a3\u4e48\u8be5\u8f93\u51fa\u7aef\u53e3\u7684\u6240\u6709\u5206\u7ec4\u90fd\u4f1a\u88ab\u963b\u585e\uff0c\u5373\u4f7f\u5176\u4e2d\u4e00\u4e9b\u5206\u7ec4\u53ef\u4ee5\u88ab\u8f6c\u53d1\u5230\u5176\u4ed6\u8f93\u51fa\u7aef\u53e3\u3002 \u8f93\u51fa\u6392\u961f\uff1a\u8981\u4e48\u4e22\u5f03\u5c3e\u90e8\u5230\u8fbe\u5206\u7ec4\uff08drop-tail\uff09\uff0c\u8981\u4e48\u5220\u9664\u4e00\u4e9b\u5df2\u6392\u961f\u7684\u5206\u7ec4\uff08Active Queue Management\uff0cAQM\uff09\u3002 \u5206\u7ec4\u8c03\u5ea6\uff1a\u51b3\u5b9a\u6392\u961f\u7684\u5206\u7ec4\u5982\u4f55\u7ecf\u8f93\u51fa\u94fe\u8def\u4f20\u8f93\u3002 \u5148\u6765\u5148\u670d\u52a1\uff08FCFS\uff0c\u53c8\u79f0\u4e3a FIFO\uff09 \u4f18\u5148\u6743\u6392\u961f\uff08priority queuing\uff09\uff1a\u5206\u7ec4\u88ab\u5206\u6210\u51e0\u79cd\u4f18\u5148\u6743\u7c7b\uff0c\u9009\u62e9\u5206\u7ec4\u4f20\u8f93\u65f6\u4f18\u5148\u4ece\u9ad8\u4f18\u5148\u6743\u7c7b\u4e2d\u9009\u62e9\u3002\u6bd4\u5982\uff0c\u5b9e\u65f6\u901a\u8bdd\u7684\u4f18\u5148\u6743\u53ef\u80fd\u9ad8\u4e8e\u90ae\u4ef6\u670d\u52a1\u3002 \u5faa\u73af\u6392\u961f\uff1a\u5b57\u9762\u610f\u601d\uff0c\u5faa\u73af\u8c03\u5ea6\u5668\u8f6e\u6d41\u670d\u52a1\u591a\u4e2a\u7c7b\u3002 \u52a0\u6743\u516c\u5e73\u6392\u961f\uff08Weighted Fair Queuing, WFQ\uff09\uff1a\u4fdd\u8bc1\u5373\u4f7f\u5728\u6240\u6709\u7c7b\u7684\u90fd\u6709\u6392\u961f\u65f6\uff0c\u6bcf\u4e2a\u7c7b\u4ecd\u7136\u4fdd\u8bc1\u5206\u914d\u5230\u5bf9\u5e94\u52a0\u6743\u7684\u5e26\u5bbd\u90e8\u5206\u3002 4.3 \u7f51\u9645\u534f\u8bae\uff1aIPv4\u3001\u5bfb\u5740\u3001IPv6 \u53ca\u5176\u4ed6 \u00b6 IPv4 \u6570\u636e\u62a5\u683c\u5f0f\u89c1\u4e66\u672c\u3002 \u6570\u636e\u62a5\u5206\u7247\uff1a \u4e00\u4e2a\u94fe\u8def\u5c42\u5e27\u80fd\u627f\u8f7d\u7684\u6700\u5927\u6570\u636e\u91cf\u53eb\u505a \u6700\u5927\u4f20\u9001\u5355\u5143\uff08Maximum Transmission Unit\uff0cMTU\uff09 \uff0c\u5b83\u4e25\u683c\u9650\u5236 IP \u6570\u636e\u62a5\u7684\u957f\u5ea6\u3002\u5982\u679c\u4e00\u4e2a\u6570\u636e\u62a5\u7684\u957f\u5ea6\u5927\u4e8e MTU\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u5206\u7247\u3002 IPv4 \u7684\u8bbe\u8ba1\u8005\u8ba4\u4e3a\uff0c\u5728\u8def\u7531\u5668\u4e2d\u7ec4\u88c5\u6570\u636e\u62a5\u4f1a\u7ed9\u534f\u8bae\u5e26\u6765\u5f88\u5927\u7684\u590d\u6742\u6027\u4e14\u5f71\u54cd\u8def\u7531\u5668\u6027\u80fd\uff0c\u56e0\u6b64 \u5206\u7247\u7ec4\u88c5\u5728\u7aef\u7cfb\u7edf\u4e2d\u8fdb\u884c \u3002IPv4 \u62a5\u6587\u4e2d\u7684\u6807\u8bc6\u3001\u6807\u5fd7\u548c\u7247\u504f\u79fb\u5b57\u6bb5\u7528\u4e8e\u5206\u7247\u548c\u7ec4\u88c5\u3002 \u540c\u4e00\u4e2a\u6570\u636e\u62a5\u7684\u6240\u6709\u5206\u7247\u90fd\u6709\u76f8\u540c\u7684\u6807\u8bc6\u5b57\u6bb5\u503c\u3002 \u6700\u540e\u4e00\u4e2a\u7247\u7684\u6807\u5fd7\u6bd4\u7279\u4e3a 0\uff0c\u5176\u4ed6\u5206\u7247\u7684\u6807\u5fd7\u6bd4\u7279\u4e3a 1\u3002 \u7247\u504f\u79fb\u5b57\u6bb5\u53ef\u4ee5\u8ba9\u76ee\u7684\u4e3b\u673a\u786e\u5b9a\u662f\u5426\u4e22\u5931\u4e86\u67d0\u4e00\u7247\u3002 IPv4 \u7f16\u5740\uff1a IP \u5730\u5740\u4e0e \u63a5\u53e3 \u76f8\u5173\u8054\uff0c\u800c\u4e0d\u662f\u4e0e\u4e3b\u673a\u6216\u8def\u7531\u5668\u76f8\u5173\u8054\u3002 IP \u5730\u5740\u957f\u5ea6\u4e3a 32 \u6bd4\u7279\uff084 \u5b57\u8282\uff09\uff0c\u5171\u6709\u7ea6 40 \u4ebf\u4e2a\u53ef\u80fd\u7684 IP \u5730\u5740\u3002 193.32.216.9 \u8fd9\u6837\u7684\u8bb0\u6cd5\u79f0\u4e3a \u70b9\u5206\u5341\u8fdb\u5236\u8bb0\u6cd5 \uff08dotted-decimal notation\uff09\uff0c\u6bcf\u4e2a\u5b57\u8282\u7528\u5341\u8fdb\u5236\u4e66\u5199\uff0c\u5404\u5b57\u8282\u95f4\u7528\u70b9\u9694\u5f00\u3002 \u91cd\u70b9\uff1a\u5b50\u7f51\u7684\u6982\u5ff5 \u4e92\u8054\u51e0\u4e2a\u4e3b\u673a\u63a5\u53e3\u4e0e\u4e00\u4e2a\u8def\u7531\u5668\u63a5\u53e3\u7684\u7f51\u7edc\u5f62\u6210\u5b50\u7f51\uff08subnet\uff09\u3002\u8fd9\u4e9b\u4e3b\u673a\u63a5\u53e3\u548c\u8def\u7531\u5668\u63a5\u53e3\u4e4b\u95f4\u7531 \u5e76\u4e0d\u5305\u542b\u8def\u7531\u5668\u7684\u7f51\u7edc \u8fde\u63a5\u8d77\u6765\uff0c\u6bd4\u5982\u4e00\u4e2a\u4ee5\u592a\u7f51\u4ea4\u6362\u673a\u3002\u5b50\u7f51\u7684\u5b9a\u4e49\u5e76\u4e0d\u5c40\u9650\u4e8e\u591a\u53f0\u4e3b\u673a\u5230\u4e00\u4e2a\u8def\u7531\u5668\u63a5\u53e3\uff0c\u8def\u7531\u5668\u63a5\u53e3\u4e4b\u95f4\u4e5f\u6784\u6210\u5b50\u7f51\u3002 IP \u7f16\u5740\u4e3a\u8be5 \u5b50\u7f51 \u5206\u914d\u4e00\u4e2a\u5f62\u5982 223.1.1.0/24 \u7684\u5730\u5740\uff0c\u5176\u4e2d /24 \u662f \u5b50\u7f51\u63a9\u7801 \uff0c\u8868\u660e\u6700\u5de6\u4fa7 24 \u6bd4\u7279\u5b9a\u4e49\u4e86\u5b50\u7f51\u5730\u5740\u3002\u4efb\u4f55\u5176\u4ed6\u8fde\u63a5\u5230 223.1.1.0/24 \u7f51\u7edc\u7684\u4e3b\u673a\u5730\u5740\u90fd\u5e94\u5f53\u6709 223.1.1.xxx \u7684\u5f62\u5f0f\u3002 \u56e0\u7279\u7f51\u7684\u5730\u5740\u5206\u914d\u7b56\u7565\uff1a\u65e0\u7c7b\u522b\u57df\u95f4\u8def\u7531\u9009\u62e9\uff08Classless Interdomain Routing\uff0cCIDR\uff09\u3002 IP \u5730\u5740\u5212\u5206\u4e3a\u4e24\u90e8\u5206\uff0c\u4e5f\u4f7f\u7528\u70b9\u5206\u5341\u8fdb\u5236\u683c\u5f0f\uff0c a.b.c.d/x \u3002 \u5730\u5740\u7684\u5269\u4f59 \\(32-x\\) \u6bd4\u7279\u7528\u4e8e\u533a\u5206\u8be5\u7ec4\u7ec7\u5185\u90e8\u7684\u8bbe\u5907\uff0c\u5176\u4e2d\u6240\u6709\u8bbe\u5907\u5177\u6709\u76f8\u540c\u7684\u7f51\u7edc\u524d\u7f00\u3002\u53ea\u6709\u5f53\u7ec4\u7ec7\u5185\u90e8\u7684\u8def\u7531\u5668\u8f6c\u53d1\u5206\u7ec4\u65f6\u624d\u8003\u8651\u8fd9\u4e9b\u6bd4\u7279\u3002\u8fd9\u4e9b\u8f83\u4f4e\u6bd4\u7279\u53ef\u80fd\u7528\u4e8e\u53e6\u5916\u7684\u5b50\u7f51\u7ed3\u6784\u3002 CIDR \u5bfb\u5740\u7684\u4f8b\u5b50 \u4e00\u4e2a ISP \u62e5\u6709\u5730\u5740\u5757 200.23.16.0/20 \uff0c\u5b83\u5411\u5916\u754c\u901a\u544a\uff1a\u5411\u6211\u53d1\u9001\u4ee5 200.23.16.0/20 \u5f00\u59cb\u7684\u4efb\u4f55\u4e1c\u897f\u3002\u8fd9\u4e2a ISP \u5c06 200.23.16.0/23 \u3001 200.23.18.0/23 \u7b49\u51e0\u4e2a\u7ec4\u7ec7\u8fde\u63a5\u5230\u4e92\u8054\u7f51\u3002 \u8fd9\u6837\u4f7f\u7528\u5355\u4e2a\u7f51\u7edc\u524d\u7f00\u901a\u544a\u591a\u4e2a\u7f51\u7edc\u7684\u80fd\u529b\u79f0\u4e3a \u5730\u5740\u805a\u5408 \uff08address aggregation\uff09\u6216 \u8def\u7531\u805a\u5408 \uff08routing aggregation\uff09\u6216 \u8def\u7531\u6458\u8981 \uff08route summarization\uff09\u3002 \u8fd9\u4e2a ISP \u53c8\u62ff\u5230\u4e86\u4e00\u4e2a\u8f85\u52a9 ISP\uff0c\u5b83\u5177\u6709 199.31.0.0/16 \u7684\u5730\u5740\u5757\u3002\u73b0\u5728\u5c06\u7ec4\u7ec7 200.23.16.0/23 \u901a\u8fc7\u8be5\u8f85\u52a9 ISP \u8fde\u63a5\u5230\u4e92\u8054\u7f51\u3002\u8fd9\u4e2a ISP \u5e94\u5f53\u5411\u5916\u754c\u901a\u544a\uff1a\u5411\u6211\u53d1\u9001\u4ee5 199.31.0.0/16 \u6216 200.23.16.0/23 \u5f00\u59cb\u7684\u4efb\u4f55\u4e1c\u897f\u3002 \u4e0a\u9762\u8fd9\u4e2a\u4f8b\u5b50\u8bf4\u660e\uff1a\u8def\u7531\u9009\u62e9\u65f6\u5c06\u4f7f\u7528 \u6700\u957f\u524d\u7f00\u5339\u914d \u3002 \u5728 CIDR \u4e4b\u524d\uff0cIP \u5730\u5740\u7684\u7f51\u7edc\u90e8\u5206\u88ab\u9650\u5236\u4e3a 8\u300116 \u6216 24 \u6bd4\u7279\uff0c\u79f0\u4e3a \u5206\u7c7b\u7f16\u5236 \uff08classful addressing\uff09\u65b9\u6848\u3002\u8fd9\u4e9b\u5b50\u7f51\u5206\u522b\u79f0\u4e3a A\u3001B \u548c C \u7c7b\u7f51\u7edc\u3002\u5206\u7c7b\u7f16\u5740\u65b9\u6848\u7684\u95ee\u9898\u5728\u4e8e\uff0c\u5b83\u4eec\u5c06\u5730\u5740\u7a7a\u95f4\u5212\u5206\u4e3a\u56fa\u5b9a\u5927\u5c0f\u7684\u5757\uff0c\u8fd9\u4e9b\u5757\u53ef\u80fd\u8fc7\u5927\u6216\u8fc7\u5c0f\u3002 \u4e00\u4e2a\u7279\u522b\u7684\u5730\u5740\uff1a 255.255.255.255 \u5e7f\u64ad\u5730\u5740\u3002\u5f53\u4e00\u53f0\u4e3b\u673a\u53d1\u51fa\u76ee\u7684\u5730\u4e3a\u5e7f\u64ad\u5730\u5740\u7684\u6570\u636e\u62a5\u65f6\uff0c\u62a5\u6587\u4ea4\u4ed8\u7ed9\u540c\u7f51\u7edc\u4e2d\u6240\u6709\u4e3b\u673a\u3002 IP \u5730\u5740\u7684\u5206\u914d\uff1a \u5730\u5740\u5757\u7684\u5206\u914d\uff1a\u7f51\u7edc\u7ba1\u7406\u5458\u5411 ISP \u8054\u7cfb\uff0c\u83b7\u53d6 ISP \u63d0\u4f9b\u7684\u5730\u5740\u5757\u3002ISP \u5219\u4ece\u4e00\u4e2a\u5168\u7403\u6027\u7684\u6743\u5a01\u673a\u6784\u56e0\u7279\u7f51\u540d\u5b57\u548c\u5730\u5740\u5206\u914d\u673a\u6784\uff08Internet Corporation for Assigned Names and Numbers\uff0cICANN\uff09\u83b7\u53d6\u5730\u5740\u5757\u3002 \u4e3b\u673a\u5730\u5740\uff1a\u52a8\u6001\u4e3b\u673a\u914d\u7f6e\u534f\u8bae\uff08Dynamic Host Configuration Protocol\uff0cDHCP\uff09\u3002 \u91cd\u70b9\uff1aDHCP \u534f\u8bae DHCP \u534f\u8bae\u662f\u4e00\u79cd\u5373\u63d2\u5373\u7528\u534f\u8bae\uff08plug-and-play protocol\uff09\u6216\u96f6\u534f\u8bae\uff08zeroconf\uff09\uff0c\u5b83\u5141\u8bb8\u4e3b\u673a\u81ea\u52a8\u83b7\u53d6 IP \u5730\u5740\u548c\u5176\u4ed6\u914d\u7f6e\u53c2\u6570\u3002 DHCP \u534f\u8bae\u662f\u4e00\u79cd\u5ba2\u6237-\u670d\u52a1\u5668\u534f\u8bae\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5ba2\u6237\u662f\u65b0\u5230\u8fbe\u7684\u4e3b\u673a\uff0c\u6bcf\u4e2a\u5b50\u7f51\u5177\u6709\u4e00\u53f0 DHCP \u670d\u52a1\u5668\u3002\u5982\u679c\u6ca1\u6709\uff0c\u5c31\u9700\u8981 DHCP \u4e2d\u7ee7\u4ee3\u7406\uff08DHCP relay agent\uff09\uff0c\u901a\u5e38\u662f\u4e00\u4e2a \u8def\u7531\u5668 \uff0c\u5b83\u77e5\u9053\u8be5\u7f51\u7edc\u7684 DHCP \u670d\u52a1\u5668\u5730\u5740\uff0c\u63d0\u4f9b\u4e2d\u7ee7\u4ee3\u7406\u670d\u52a1\u3002 DHCP \u534f\u8bae\u7684\u5de5\u4f5c\u539f\u7406\u5982\u4e0b\uff1a DHCP \u670d\u52a1\u5668\u53d1\u73b0\uff1a\u65b0\u5230\u8fbe\u7684\u4e3b\u673a\u5728 UDP \u5206\u7ec4\u4e2d\u5411\u7aef\u53e3 67 \u5e7f\u64ad\u4e00\u4e2a DHCP \u53d1\u73b0\u62a5\u6587\uff08DHCP discover message\uff09\uff0c\u76ee\u7684\u5730\u5740\u4e3a\u5e7f\u64ad\u5730\u5740 255.255.255.255 \uff0c\u6e90\u5730\u5740\u4e3a 0.0.0.0 \uff08\u4ee3\u8868\u672c\u4e3b\u673a\uff09\u3002 DHCP \u670d\u52a1\u5668\u63d0\u4f9b\uff1aDHCP \u670d\u52a1\u5668\u6536\u5230 DHCP \u53d1\u73b0\u62a5\u6587\u540e\uff0c\u7528\u5e7f\u64ad\u7684 DHCP \u63d0\u4f9b\u62a5\u6587\uff08DHCP offer message\uff09\u4f5c\u4e3a\u54cd\u5e94\u3002 \u63d0\u4f9b\u62a5\u6587\u5305\u542b\uff1a\u53d1\u73b0\u62a5\u6587\u7684 ID\u3001\u5411\u5ba2\u6237\u63a8\u8350\u7684 IP \u5730\u5740\u3001\u7f51\u7edc\u63a9\u7801\u3001IP \u5730\u5740\u79df\u671f\uff08address lease time\uff09\u3002 \u5982\u679c\u5b50\u7f51\u4e2d\u5b58\u5728\u51e0\u4e2a DHCP \u670d\u52a1\u5668\uff0c\u8be5\u5ba2\u6237\u4f1a\u9009\u62e9\u5176\u4e2d\u4e00\u4e2a\u3002 DHCP \u8bf7\u6c42\uff1a\u5ba2\u6237\u5411\u9009\u4e2d\u7684\u670d\u52a1\u5668\u53d1\u9001 DHCP \u8bf7\u6c42\u62a5\u6587\uff08DHCP request message\uff09\uff0c\u56de\u663e\u914d\u7f6e\u53c2\u6570\u3002 DHCP ACK\uff1a\u670d\u52a1\u5668\u54cd\u5e94\uff0c\u8bc1\u5b9e\u8981\u6c42\u7684\u53c2\u6570\u3002 \u91cd\u70b9\uff1a\u7f51\u7edc\u5730\u5740\u8f6c\u6362 NAT \u4e00\u4e2a NAT \u4f7f\u80fd\u8def\u7531\u5668 \uff08\u5c31\u662f\u5177\u6709NAT\u529f\u80fd\u7684\u8def\u7531\u5668\uff0c\u8fd9\u4e2a\u7ffb\u8bd1\u597d\u602a\uff09\u5bf9\u5916\u7684\u884c\u4e3a\u50cf\u662f\u4e00\u4e2a\u5177\u6709\u5355\u4e2a IP \u5730\u5740\u7684\u5355\u4e00\u8bbe\u5907\u3002\u5b83\u5bf9\u5916\u9690\u85cf\u4e86\u5185\u90e8\u7f51\u7edc\u7684\u7ec6\u8282\u3002\u8def\u7531\u5668\u4e0a\u6709\u4e00\u5f20 NAT \u8f6c\u6362\u8868\uff0c\u5305\u542b\u7aef\u53e3\u53f7\u548c IP \u5730\u5740\u3002 NAT \u7f51\u7edc\u5185\u7684\u7f16\u5740\u901a\u5e38\u4f7f\u7528\u5730\u5740\u7a7a\u95f4 10.0.0.0/8 \uff0c\u8fd9\u662f RFC 1918 \u4e2d\u4fdd\u7559\u7684\u4e09\u90e8\u5206 IP \u5730\u5740\u7a7a\u95f4\u4e4b\u4e00\u3002\u8fd9\u4e9b\u5730\u5740\u7528\u4e8e\u4e13\u7528\u7f51\u7edc\uff08private network\uff09\u3002 NAT \u4f7f\u80fd\u8def\u7531\u5668\u7684\u5de5\u4f5c\u539f\u7406\u5982\u4e0b\uff1a NAT \u7f51\u7edc\u5185\u7684\u4e3b\u673a 10.0.0.1 \u8bf7\u6c42\u67d0 Web \u670d\u52a1\u5668\uff0c\u5e76\u4e3a\u5176\u5206\u914d 3345 \u7aef\u53e3\u3002\u6570\u636e\u62a5\u53d1\u9001\u5230 LAN \u4e2d\u3002 NAT \u8def\u7531\u5668\u63a5\u6536\u5230\u6570\u636e\u62a5\uff0c\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u7aef\u53e3\u53f7 5001 \uff0c\u5e76\u5c06\u6e90 IP \u548c\u6e90\u7aef\u53e3\u53f7\u66ff\u6362\u6210\u5176\u5e7f\u57df\u7f51\u4e00\u4fa7\u63a5\u53e3\u7684 IP \u5730\u5740 139.76.29.7:5001 \u3002NAT \u8def\u7531\u5668\u5728 NAT \u8f6c\u6362\u8868\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u8868\u9879\uff0c\u8be5\u62a5\u6587\u88ab\u9001\u5f80\u5e7f\u57df\u7f51\u3002 Web \u670d\u52a1\u5668\u63a5\u6536\u5230\u62a5\u6587\uff0c\u4f46\u4ed6\u4e0d\u77e5\u9053\u62a5\u6587\u88ab\u4fee\u6539\u3002\u54cd\u5e94\u62a5\u6587\u6309 139.76.29.7:5001 \u5230\u8fbe NAT \u8def\u7531\u5668\u3002 NAT \u8def\u7531\u5668\u6309\u8f6c\u6362\u8868\u91cd\u5199\u54cd\u5e94\u62a5\u6587\u7684\u76ee\u7684 IP \u5730\u5740\u548c\u7aef\u53e3\u53f7\uff0c\u5e76\u8f6c\u53d1\u5230\u4e13\u7528\u7f51\u7edc\u3002 \u5bf9 NAT \u7684\u6279\u8bc4\u5982\u4e0b\uff1a \u7aef\u53e3\u53f7\u662f\u7528\u4e8e\u8fdb\u7a0b\u5bfb\u5740\u7684\uff0c\u800c\u4e0d\u662f\u7528\u4e8e\u4e3b\u673a\u5bfb\u5740\u7684\u3002\u5bf9\u8be5\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6848\u5305\u62ec NAT \u7a7f\u8d8a\u548c\u901a\u7528\u5373\u63d2\u5373\u7528\uff08Universal Plug and Play\uff0cUPnP\uff09\u3002 NAT \u4f7f\u7f51\u7edc\u5c42\u66f4\u6539\u4e86\u4f20\u8f93\u5c42\u7684\u534f\u8bae\uff0c\u8fd9\u8fdd\u53cd\u4e86\u534f\u8bae\u5206\u5c42\u539f\u5219\u3002 \u5c3d\u7ba1\u5b58\u5728\u6279\u8bc4\uff0c\u4f46 NAT \u5df2\u7ecf\u6210\u4e3a\u4e86\u56e0\u7279\u7f51\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002 IPv6 \u534f\u8bae\uff1a\u6269\u5927\u4e86\u5730\u5740\u7a7a\u95f4\uff0c\u5e76\u5f3a\u5316\u4e86\u5176\u4ed6\u65b9\u9762\u3002 \u62a5\u6587\u9996\u90e8\u4e3a\u5b9a\u957f\u7684 40 \u5b57\u8282\uff1a\u4f7f\u8def\u7531\u5668\u66f4\u5feb\u5904\u7406\u62a5\u6587\u3002 IPv6 \u4e0d\u5141\u8bb8\u4e2d\u95f4\u8def\u7531\u5668\u8fdb\u884c\u5206\u7247\u4e0e\u91cd\u65b0\u7ec4\u88c5\uff0c\u53ea\u80fd\u5728\u6e90\u548c\u76ee\u7684\u5730\u95f4\u8fdb\u884c\u3002\u5982\u679c\u6570\u636e\u62a5\u592a\u5927\uff0c\u8def\u7531\u5668\u4e22\u5f03\u6570\u636e\u62a5\u5e76\u8fd4\u56de\u201c\u5206\u7ec4\u592a\u5927\u201d\u7684 ICMP \u9519\u8bef\u62a5\u6587\u3002\u8fd9\u540c\u6837\u52a0\u5feb\u4e86\u7f51\u7edc\u7684\u8f6c\u53d1\u901f\u5ea6\u3002 IPv6 \u53bb\u9664\u4e86\u9996\u90e8\u68c0\u9a8c\u548c\uff0c\u800c\u5728 IPv4 \u4e2d\u6bcf\u53f0\u8def\u7531\u5668\u90fd\u9700\u8981\u91cd\u65b0\u8ba1\u7b97\u9996\u90e8\u68c0\u9a8c\u548c\u3002 4.4 \u901a\u7528\u8f6c\u53d1\u548c SDN \u00b6 \u7565\u3002","title":"\u8ba1\u7b97\u673a\u7f51\u7edc\uff1a\u81ea\u9876\u5411\u4e0b\u65b9\u6cd5"},{"location":"books/CNATDA2/#_1","text":"Computer Networking: A Top-Down Approach Seventh Edition \u51fa\u7248\u793e \u4f5c\u8005 \u51fa\u7248\u65f6\u95f4 \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e James F. Kurose, Keith W. Ross 2017","title":"\u8ba1\u7b97\u673a\u7f51\u7edc\uff1a\u81ea\u9876\u5411\u4e0b\u65b9\u6cd5"},{"location":"books/CNATDA2/#ch2","text":"Abstract \u5b9a\u4e49\u57fa\u672c\u6982\u5ff5\uff1a\u7f51\u7edc\u670d\u52a1\u3001\u5ba2\u6237\u548c\u670d\u52a1\u5668\u3001\u8fdb\u7a0b\u548c\u8fd0\u8f93\u5c42\u63a5\u53e3 \u51e0\u79cd\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\uff1aWeb\u3001\u7535\u5b50\u90ae\u4ef6\u3001DNS\u3001\u5bf9\u7b49\u6587\u4ef6\u5206\u53d1\u548c\u89c6\u9891\u6d41 \u5f00\u53d1\u7b80\u5355\u7684\u8fd0\u884c\u5728 TCP \u548c UDP \u4e0a\u7684\u5e94\u7528\u7a0b\u5e8f","title":"Ch2. \u5e94\u7528\u5c42"},{"location":"books/CNATDA2/#ch4","text":"","title":"Ch4. \u7f51\u7edc\u5c42\uff1a\u6570\u636e\u5e73\u9762"},{"location":"books/CTP/","text":"C \u9677\u9631\u4e0e\u7f3a\u9677 \u00b6 C Traps and Pitfalls \u51fa\u7248\u793e \u4f5c\u8005 \u539f\u4e66\u5e74\u4efd \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e Andrew Koening 1989 \u60f3\u8981\u5b66\u597d\u4e00\u95e8\u7f16\u7a0b\u8bed\u8a00\uff0c\u5e94\u8be5\u9605\u8bfb\u4ec0\u4e48\u6837\u7684\u56fe\u4e66\uff1f\u5728\u5927\u591a\u6570\u573a\u5408\u4e0b\uff0c\u6211\u90fd\u4f1a\u5411\u4ed6\u63a8\u8350\u5e02\u9762\u4e0a\u6700\u65b0\u51fa\u7248\u7684\u56fe\u4e66\u3002\u539f\u56e0\u5c31\u662f\uff1a\u4ee5\u73b0\u5728\u8ba1\u7b97\u673a\u9886\u57df\u5185\u6280\u672f\u7684\u53d1\u5c55\u901f\u5ea6\uff0c\u51e0\u4e4e\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\uff0c\u6211\u4eec\u5c31\u9700\u8981\u5bf9\u81ea\u5df1\u73b0\u6709\u7684\u77e5\u8bc6\u8fdb\u884c\u66f4\u65b0\u3002\u8fd9\u6837\u770b\u6765\uff0c\u4f7f\u7528\u4e00\u672c\u6bd4\u8f83\u65b0\u7684\u56fe\u4e66\uff0c\u91cc\u9762\u7684\u4e1c\u897f\u4f1a\u6bd4\u8f83\u8d34\u8fd1\u5f53\u524d\u6280\u672f\u7684\u53d1\u5c55\uff0c\u56e0\u800c\u4e5f\u5c31\u80fd\u591f\u8ba9\u4f60\u66f4\u5bb9\u6613\u638c\u63e1\u6240\u8981\u5b66\u7684\u4e1c\u897f\u3002 Ch0. \u5bfc\u8bfb \u00b6 \u56de\u5fc6\uff1a\u8bcd\u6cd5\u3001\u8bed\u6cd5\u3001\u8bed\u4e49 \u5728\u8fdb\u5165\u63a5\u4e0b\u6765\u7684\u7ae0\u8282\u524d\uff0c\u8ba9\u6211\u4eec\u56de\u987e\u4e00\u4e9b\u77e5\u8bc6\u3002 \u5728 \u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u7b2c 9 \u7ae0 \u4e2d\u6211\u4eec\u5b66\u5230\uff0c\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7684\u7f16\u8bd1\u6b65\u9aa4\u7531\u4ee5\u4e0b\u56db\u4e2a\u6b65\u9aa4\u7ec4\u6210\uff1a \u8bcd\u6cd5\u5206\u6790\u5668 \u8bed\u6cd5\u5206\u6790\u5668 \u8bed\u4e49\u5206\u6790\u5668 \u7f16\u8bd1\u6a21\u5757 \u8bf7\u56de\u5fc6\u5b83\u4eec\u7684\u5de5\u4f5c\u548c\u4f5c\u7528\u3002 \u672c\u7ae0\u7b80\u5355\u4ecb\u7ecd\u4e86\u5168\u4e66\u5404\u4e2a\u90e8\u5206\u5c06\u8981\u8ba8\u8bba\u7684\u5185\u5bb9\u3002 Ch1. \u8bcd\u6cd5\u9677\u9631 \u00b6 \u672c\u7ae0\u6211\u4eec\u5173\u6ce8\u5b57\u7b26\u662f\u5982\u4f55\u7ec4\u6210\u7b26\u53f7\u7684\u3002 \u672f\u8bed token \uff08\u7b26\u53f7\uff09\u662f\u8bed\u8a00\u7684\u57fa\u672c\u8868\u610f\u5355\u5143\u3002\u5b57\u7b26\u7ec4\u6210\u7b26\u53f7\u3002\u4f8b\u5b50: -> \u3001 file \u90fd\u662f\u7b26\u53f7. \u540c\u4e00\u7ec4\u5b57\u7b26\u5e8f\u5217\u5728 \u4e0d\u540c\u4e0a\u4e0b\u6587 \u4e2d\u53ef\u80fd\u5c5e\u4e8e\u4e0d\u540c\u7b26\u53f7\u3002 \u6211\u4eec\u6765\u770b\u51e0\u4e2a\u4f8b\u5b50\uff0c\u8bf7\u601d\u8003\u8fd9\u4e9b\u7a0b\u5e8f\u7684\u884c\u4e3a\uff08\u6ce8\u610f\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7\uff09\u3002 = \u4e0e == \u6df7\u7528 \u00b6 while ( c = ' ' || c == '\\t' ) c = getc ( f ); if (( filedesc == open ( argv [ i ], 0 )) < 0 ) error (); open() \u51fd\u6570 \u8fd9\u662f\u4e00\u4e2a\u7cfb\u7edf\u8c03\u7528\uff1a #include int open ( const char * pathname , int flags ) \u6211\u4eec\u5c06\u5728 Linux \u8fdb\u9636\u4e2d\u5b66\u4e60\u5230\u4e0e\u7cfb\u7edf\u8c03\u7528\u6709\u5173\u7684\u77e5\u8bc6\u3002 \u8d2a\u5fc3\u6cd5 \u00b6 C \u7684\u8bcd\u6cd5\u5206\u6790\u9075\u5faa \u8d2a\u5fc3\u6cd5 \uff1a \u5982\u679c\u8be5\u5b57\u7b26\u53ef\u80fd\u7ec4\u6210\u7b26\u53f7\uff0c\u90a3\u4e48\u518d\u8bfb\u5165\u4e0b\u4e00\u4e2a\u5b57\u7b26\uff0c\u76f4\u5230\u8bfb\u5165\u7684\u5b57\u7b26\u4e32\u5df2\u7ecf\u4e0d\u53ef\u80fd\u518d\u7ec4\u6210\u4e00\u4e2a\u6709\u610f\u4e49\u7684\u7b26\u53f7\u3002 \u6211\u4eec\u4e3e\u51e0\u4e2a\u53ef\u80fd\u4e0d\u6070\u5f53\u7684\u4f8b\u5b50\u6765\u8bf4\u660e\u8d2a\u5fc3\u6cd5\uff1a a --- b a -- - b a - -- b y = x /*p /* p point to the dividen */ y = x / * p n --> 0 n -- > 0 n - -> 0 a +++++ b \u8bf7\u601d\u8003\u4e0a\u9762\u51e0\u4e2a\u8868\u8fbe\u5f0f\u7684\u884c\u4e3a\u3002 \u6574\u5f62\u5e38\u91cf \u00b6 10 \u4e0e 010 \u7684\u542b\u4e49\u622a\u7136\u4e0d\u540c\u3002 ANSI C \u4ee5\u540e\u7981\u6b62\u5728\u516b\u8fdb\u5236\u6570\u4e2d\u4f7f\u7528\u5b57\u7b26 8 \u548c 9 \u3002 \u6df7\u7528\u7684\u60c5\u51b5\u53ef\u80fd\u5728\u9700\u8981\u683c\u5f0f\u5bf9\u9f50\u65f6\u51fa\u73b0\uff0c\u6b64\u65f6\u4e0d\u8981\u4e3a\u6570\u5b57\u6dfb 0 \uff0c\u53ef\u80fd\u9020\u6210\u516b\u8fdb\u5236\u7ed3\u679c\u3002 \u5b57\u7b26\u4e32\u548c\u5b57\u7b26\u5e38\u91cf \u00b6 \u5355\u5f15\u53f7\u5f15\u8d77\u7684\u5b57\u7b26\u5b9e\u9645\u4e0a\u4ee3\u8868\u4e00\u4e2a\u6574\u6570\uff0c\u800c\u6574\u6570\u7684\u5b58\u50a8\u7a7a\u95f4\uff0816 \u4f4d\u6216 32 \u4f4d\uff09\u53ef\u4ee5\u540c\u65f6\u5bb9\u7eb3\u591a\u4e2a\u5b57\u7b26\u3002\u56e0\u6b64\uff0c\u6709\u4e9b C \u7f16\u8bd1\u5668\u5141\u8bb8\u5728\u4e00\u4e2a\u5b57\u7b26\u5e38\u91cf\u4e2d\u5305\u62ec\u591a\u4e2a\u5b57\u7b26\u3002\u4f46\u5bf9\u4e8e\u8fd9\u6837\u7684\u884c\u4e3a\u6ca1\u6709\u51c6\u786e\u7684\u5b9a\u4e49 ' yes ' \u6709\u7684\u7f16\u8bd1\u5668\u53ef\u80fd\u5ffd\u7565\u540e\u9762\u7684\u5b57\u7b26\uff0c\u6709\u7684\u7f16\u8bd1\u5668\u53ef\u80fd\u7528\u540e\u9762\u7684\u5b57\u7b26\u9010\u4e2a\u8986\u76d6\u524d\u9762\u7684\u5b57\u7b26\u3002GCC \u548c Clang \u91c7\u7528\u540e\u4e00\u79cd\u65b9\u6cd5\u3002 Ch2. \u8bed\u6cd5\u9677\u9631 \u00b6 \u672c\u7ae0\u6211\u4eec\u5173\u6ce8\u7b26\u53f7\u662f\u5982\u4f55\u7ec4\u6210\u58f0\u660e\u3001\u8868\u8fbe\u5f0f\u3001\u8bed\u53e5\u548c\u7a0b\u5e8f\u7684\u3002 \u51fd\u6570\u58f0\u660e \u00b6 Question \u8bf7\u8bbe\u8ba1\u4e00\u4e2a C \u8bed\u53e5\uff0c\u8c03\u7528\u9996\u5730\u5740\u4e3a 0 \u7684\u51fd\u6570\u3002 \u5bf9\u4e8e\u4e0a\u9762\u8fd9\u4e2a\u95ee\u9898\uff0c\u6807\u51c6\u7b54\u6848\u662f (*(void(*)())0)() \u3002 \u63a5\u4e0b\u6765\u6211\u4eec\u4e00\u6b65\u6b65\u89e3\u91ca\u8fd9\u4e00\u51fd\u6570\u8c03\u7528\u3002 \u58f0\u660e\u7684\u7ec4\u6210 \u00b6 \u672c\u4e66\u5c06\u58f0\u660e\u770b\u505a\u7531\uff1a \u7c7b\u578b \u548c\u4e00\u7ec4 \u7c7b\u4f3c\u8868\u8fbe\u5f0f\u7684\u58f0\u660e\u7b26 \u7ec4\u6210\u3002\u7b80\u5355\u7684\u903b\u8f91\u5c31\u662f\uff1a\u5bf9\u58f0\u660e\u7b26\u6c42\u503c\u65f6\u5e94\u5f53\u8fd4\u56de\u6307\u5b9a\u7c7b\u578b\u7684\u7ed3\u679c\u3002 float f, g \u5bf9 f \u548c g \u6c42\u503c\u5e94\u8fd4\u56de float float ff() \u5bf9 ff() \u6c42\u503c\u5e94\u8fd4\u56de float float *pf \u5bf9 *pf \u6c42\u503c\u5e94\u8fd4\u56de float float *g(), (*h)() \u5bf9 *(g()) \u548c h() \u6c42\u503c\u5e94\u8fd4\u56de float \uff08\u672c\u4f8b\u4e2d\uff0c\u6ce8\u610f\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7\u548c\u51fd\u6570\u6307\u9488\u7684\u610f\u4e49\uff09 \u51fd\u6570\u6307\u9488 \u5e94\u5f53\u59cb\u7ec8\u7406\u89e3\uff1a\u51fd\u6570\u6307\u9488\u5b9e\u9645\u8868\u8fbe\u7684\u610f\u4e49\u662f (*fp)() \u3002 fp() \u53ea\u662f\u7b80\u5199\u3002\u5728\u58f0\u660e\u4e2d\uff0c\u5fc5\u987b\u4f7f\u7528\u524d\u4e00\u79cd\u5f62\u5f0f\u3002\u8fd9\u662f\u56e0\u4e3a () \u7684\u4f18\u5148\u7ea7\u6bd4 * \u9ad8\uff0c\u6240\u4ee5\u5fc5\u987b\u7528\u5706\u62ec\u53f7\u5c06\u6307\u9488 (*fp) \u62ec\u8d77\u6765\u3002\u4e8b\u5b9e\u4e0a\uff0cK&R C \u4e0d\u5141\u8bb8\u7b2c\u4e8c\u79cd\u5f62\u5f0f\u7684\u4f7f\u7528\u3002 \u518d\u56de\u5fc6\u4e00\u4e9b\u76f8\u5173\u7684\u77e5\u8bc6\uff1a \u51fd\u6570\u540d\u53ef\u4ee5\u4ee3\u8868\u51fd\u6570\u7684\u5730\u5740 \u51fd\u6570\u6307\u9488\u7c7b\u578b\u540d\u6700\u597d\u8fd9\u6837\u58f0\u660e\uff1a V_FP_CHARP \uff0c\u5373\u8bf4\u660e\u8fd4\u56de\u503c\u3001\u540d\u79f0\u3001\u53c2\u6570\u5217\u8868\u3002 \u7c7b\u578b\u8f6c\u6362\u7b26 \u00b6 \u628a\u58f0\u660e\u4e2d\u7684\u53d8\u91cf\u540d\u53bb\u6389\uff0c\u518d\u7528\u62ec\u53f7\u5c01\u88c5\uff0c\u5c31\u53d8\u6210\u4e86\u7c7b\u578b\u8f6c\u6362\u7b26\uff0c\u6bd4\u5982\u5bf9\u4e0a\u9762\u7684\u6bcf\u4e00\u4f8b\uff1a (float) (float (*)()) (float *) (float *()) , (float (*)()) \u6211\u4eec\u8981\u60f3\u8c03\u7528\u5730\u5740\u4e3a 0 \u7684\u51fd\u6570\uff0c\u53ef\u80fd\u4f1a\u8fd9\u6837\u60f3\uff1a ( * 0 )() \u4f46\u662f\uff0c 0 \u5e94\u5f53\u4f7f\u7528\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u4e3a\u6211\u4eec\u9700\u8981\u7684\u7c7b\u578b\uff0c\u7c7b\u578b\u8f6c\u6362\u7b26\u662f\uff1a (void(*)()) \u4f7f\u7528 typedef \u53ef\u4ee5\u66f4\u6e05\u6670\u5730\u89e3\u51b3\u8be5\u95ee\u9898\uff1a typedef void ( * funcptr )(); ( * ( funcptr ) 0 )(); \u7406\u89e3 typedef \u00b6 \u672c\u4e66\u7ed9\u51fa\u7684\u7406\u89e3\u58f0\u660e\u7684\u65b9\u5f0f\u4e5f\u80fd\u8ba9\u6211\u4eec\u66f4\u597d\u5730\u7406\u89e3 typedef \uff1a\u76f4\u63a5\u5728\u58f0\u660e\u8bed\u53e5\u524d\u9762\u52a0\u4e0a typedef \u5c31\u5c06\u8be5\u58f0\u660e\u7b26\u4f5c\u4e3a\u8be5\u58f0\u660e\u7b26\u7684\u7c7b\u578b\u7684\u66ff\u4ee3\u3002 typedef float *pf \u4e2d pf \u4ee3\u8868 float * typedef float *g() \u4e2d g \u4ee3\u8868 float *() \u4f8b\u5b50\uff1a signal() \u00b6 signal() \u51fd\u6570 \u58f0\u660e\u5728 \u4e2d\uff0c\u5b83\u63a5\u53d7\u4e00\u4e2a\u4ee3\u8868\u9700\u8981\u88ab\u6355\u83b7\u7684\u7279\u5b9a signal \u7684\u6574\u6570\u503c\uff0c\u548c\u4e00\u4e2a\u7528\u6237\u63d0\u4f9b\u7684\u7528\u4e8e\u5904\u7406 signal \u51fd\u6570\u7684\u6307\u9488\u3002 \u6211\u4eec\u5148\u4ece\u7528\u6237\u5b9a\u4e49\u7684\u51fd\u6570\u5f00\u59cb\u8bbe\u8ba1\u3002\u7528\u6237\u53ef\u80fd\u4f1a\u5b9a\u4e49\u8fd9\u6837\u7684\u5904\u7406\u51fd\u6570\uff1a void sigfunc ( int ); \u56e0\u6b64\uff0c\u6211\u4eec\u5c06 signal \u51fd\u6570\u58f0\u660e\u4e3a\uff1a void ( * signal ( int , void ( * )( int )))( int ); \u89e3\u91ca\uff1a\u4f20\u9012 (int, void(*)(int)) \u53c2\u6570\u4ee5\u8c03\u7528 signal \u51fd\u6570\uff0c\u5bf9 signal \u7684\u8fd4\u56de\u503c\uff08\u662f\u4e00\u4e2a\u51fd\u6570\u6307\u9488\u7c7b\u578b\uff09\u89e3\u5f15\u7528\u5f97\u5230\u4e00\u4e2a\u51fd\u6570\uff0c\u7136\u540e\u4f20\u9012\u4e00\u4e2a\u6574\u6570\u7ed9\u8fd9\u4e2a\u51fd\u6570\uff0c\u6700\u540e\u8fd4\u56de\u503c\u662f void \u3002 \u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7 \u00b6 \uff08\u7565\uff09 \u5206\u53f7 \u00b6 \u6709\u51e0\u79cd\u60c5\u51b5\u4e0b\u7684\u5206\u53f7\u4f1a\u5bfc\u81f4\u91cd\u5927\u95ee\u9898\uff1a if \u548c while \u7b49\u8bed\u53e5\u7684\u7ed3\u5c3e \u4e0a\u9762\u8bed\u53e5\u548c return \u7684\u7ed3\u5408\uff0c\u5982\uff1a if ( n < 3 ) return logrec . date = x [ 0 ]; logrec . time = x [ 1 ]; \u7ed3\u6784\u58f0\u660e\u7684\u7ed3\u5c3e\uff0c\u518d\u78b0\u5230\u51fd\u6570\u5b9a\u4e49\uff1a struct logrec { int date ; } main () { //... } \u8fd9\u79cd\u60c5\u51b5\u4e0b\u7ed3\u6784\u4f1a\u88ab\u5f53\u505a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002 switch \u8bed\u53e5 \u00b6 \u6d3b\u7528 switch \u8bed\u53e5\u5904\u7406\u6b65\u9aa4\u6bd4\u8f83\u76f8\u8fd1\u7684\u5206\u652f\u3002 \u60ac\u6302\u7684 else \u8bed\u53e5 \u00b6 \u7262\u8bb0\uff1a else \u4e0e\u62ec\u53f7\u5185\u6700\u8fd1\u7684\u4e00\u4e2a if \u5339\u914d\uff0c\u5e76\u5728\u591a\u91cd\u9009\u62e9\u3001\u5d4c\u5957\u7684\u60c5\u51b5\u4e0b\u7528\u597d\u82b1\u62ec\u53f7\u5373\u53ef\u907f\u514d\u8be5\u9519\u8bef\u3002 Ch3. \u8bed\u4e49\u9677\u9631 \u00b6 \u672c\u7ae0\u8003\u5bdf\u770b\u8d77\u6765\u4e00\u5207\u90fd\u663e\u5f97\u5408\u60c5\u5408\u7406\uff0c\u4f46\u5728\u6240\u6709 C \u5b9e\u73b0\u4e2d\u90fd\u662f\u672a\u5b9a\u4e49\u7684\u884c\u4e3a\u3002 \u6307\u9488\u4e0e\u6570\u7ec4 \u00b6 \u672c\u8282\u91cd\u70b9\u7406\u89e3\u6570\u7ec4\u540d\u4e0e\u6307\u9488\u7684\u6982\u5ff5\u3001\u6570\u7ec4\u4e0e\u6307\u9488\u7684\u8f6c\u5316\u3002 \u9664\u4e86\u88ab\u7528\u4f5c sizeof \u7684\u53c2\u6570\u8fd9\u4e00\u60c5\u5f62\uff0c\u5176\u4ed6\u60c5\u51b5\u4e0b\u6570\u7ec4\u540d\u90fd\u4ee3\u8868\u6307\u5411\u6570\u7ec4\u9996\u5143\u7d20\u5730\u5740\u7684\u6307\u9488\u3002 \u6ce8\u610f\uff0c\u8fd9\u4e2a\u9996\u5143\u7d20\u53ef\u80fd\u8fd8\u662f\u6570\u7ec4\uff0c\u8ba9\u6211\u4eec\u6765\u770b\u4e00\u4e2a\u591a\u7ef4\u6570\u7ec4\u7684\u60c5\u51b5\uff1a int calendar [ 12 ][ 31 ]; p = calendar ; \u8fd9\u91cc\u7684 calendar \u662f\u4e00\u4e2a\u6307\u5411\u6570\u7ec4\u7684\u6307\u9488\u3002 \u8fd8\u6709 &array_name \u7684\u60c5\u51b5\uff0c\u5f97\u5230\u4e00\u4e2a\u6307\u5411\u6570\u7ec4\u7684\u6307\u9488\u3002 \u56e0\u4e3a *(a+i) \u4e0e *(i+a) \u542b\u4e49\u76f8\u540c\uff0c\u56e0\u6b64 a[i] \u4e0e i[a] \u76f8\u540c\u3002 \u5bf9\u4e8e\u4e0a\u9762\u7684\u65e5\u5386\u591a\u7ef4\u6570\u7ec4\uff0c\u6211\u4eec\u5199\u4e00\u4e2a\u4f60\u53ef\u80fd\u4ece\u6765\u4e0d\u4f1a\u8fd9\u6837\u5199\u7684\u5faa\u73af\uff1a int ( * montp )[ 31 ]; for ( monthp = calendar ; monthp < & calendar [ 12 ]; monthp ++ ){ int * dayp ; for ( dayp = * monthp ; dayp < & ( * monthp )[ 31 ]; dayp ++ ) * dayp = 0 ; } \u8fd9\u4e2a\u4f8b\u5b50\u4ec5\u7528\u4e8e\u63ed\u793a\u6570\u7ec4\u4e0e\u6307\u9488\u7684\u5173\u7cfb\uff0c\u5728\u5b9e\u9645\u5199\u4ee3\u7801\u65f6\uff0c\u5343\u4e07\u4e0d\u8981\u8fd9\u6837\u505a\u3002 \u975e\u6570\u7ec4\u7684\u6307\u9488 \u00b6 \u672c\u8282\u4e3b\u8981\u8ba8\u8bba\u5b57\u7b26\u4e32\u7684\u5927\u5c0f\u3001\u7a7a\u5b57\u7b26\u7684\u5f71\u54cd\uff0c\u7565\u8fc7\u3002 \u4f5c\u4e3a\u53c2\u6570\u7684\u6570\u7ec4\u58f0\u660e \u00b6 \u5c06\u6570\u7ec4\u4f5c\u4e3a\u53c2\u6570\u6beb\u65e0\u610f\u4e49\uff0c\u5c06\u88ab\u81ea\u52a8\u8f6c\u6362\u4e3a\u6307\u5411\u9996\u5143\u7d20\u7684\u6307\u9488\u3002 \u4f46\u662f\uff0c\u8bf7\u4e0d\u8981\u5047\u8bbe\u5728\u5176\u4ed6\u60c5\u51b5\u4e0b\u4e5f\u6709\u8fd9\u6837\u7684\u8f6c\u6362\u3002\u4ee5\u4e0b\u4e24\u4e2a\u8bed\u53e5\u6709\u7740\u5929\u58e4\u4e4b\u522b\uff1a extern char * hello ; extern char hello []; Note \u7f16\u5199\u51fd\u6570\u58f0\u660e\u65f6\uff0c\u9009\u62e9\u80fd\u6700\u6e05\u6670\u8868\u8fbe\u81ea\u5df1\u610f\u56fe\u7684\u65b9\u5f0f\u3002 \u907f\u514d\u201c\u4e3e\u9685\u6cd5\u201d \u00b6 \u4e3e\u9685\u6cd5\u7684\u610f\u601d\u662f\uff0c\u4ee5\u9690\u55bb\u8868\u793a\u6307\u4ee3\u7269\u4e0e\u88ab\u6307\u4ee3\u7269\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u672c\u8282\u4e3b\u8981\u8ba8\u8bba\u6df7\u6dc6\u6307\u9488\u548c\u6307\u9488\u6240\u6307\u5411\u6570\u636e\u7684\u60c5\u51b5\uff0c\u7565\u8fc7\u3002 \u7a7a\u6307\u9488\u4e0e\u7a7a\u4e32 \u00b6 \u6e05\u695a\u8fd9\u4e24\u8005\u7684\u4e0d\u540c\u5373\u53ef\u3002 \u8fb9\u754c\u8ba1\u7b97\u4e0e\u4e0d\u5bf9\u79f0\u8fb9\u754c \u00b6","title":"C \u9677\u9631\u4e0e\u7f3a\u9677"},{"location":"books/CTP/#c","text":"C Traps and Pitfalls \u51fa\u7248\u793e \u4f5c\u8005 \u539f\u4e66\u5e74\u4efd \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e Andrew Koening 1989 \u60f3\u8981\u5b66\u597d\u4e00\u95e8\u7f16\u7a0b\u8bed\u8a00\uff0c\u5e94\u8be5\u9605\u8bfb\u4ec0\u4e48\u6837\u7684\u56fe\u4e66\uff1f\u5728\u5927\u591a\u6570\u573a\u5408\u4e0b\uff0c\u6211\u90fd\u4f1a\u5411\u4ed6\u63a8\u8350\u5e02\u9762\u4e0a\u6700\u65b0\u51fa\u7248\u7684\u56fe\u4e66\u3002\u539f\u56e0\u5c31\u662f\uff1a\u4ee5\u73b0\u5728\u8ba1\u7b97\u673a\u9886\u57df\u5185\u6280\u672f\u7684\u53d1\u5c55\u901f\u5ea6\uff0c\u51e0\u4e4e\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\uff0c\u6211\u4eec\u5c31\u9700\u8981\u5bf9\u81ea\u5df1\u73b0\u6709\u7684\u77e5\u8bc6\u8fdb\u884c\u66f4\u65b0\u3002\u8fd9\u6837\u770b\u6765\uff0c\u4f7f\u7528\u4e00\u672c\u6bd4\u8f83\u65b0\u7684\u56fe\u4e66\uff0c\u91cc\u9762\u7684\u4e1c\u897f\u4f1a\u6bd4\u8f83\u8d34\u8fd1\u5f53\u524d\u6280\u672f\u7684\u53d1\u5c55\uff0c\u56e0\u800c\u4e5f\u5c31\u80fd\u591f\u8ba9\u4f60\u66f4\u5bb9\u6613\u638c\u63e1\u6240\u8981\u5b66\u7684\u4e1c\u897f\u3002","title":"C \u9677\u9631\u4e0e\u7f3a\u9677"},{"location":"books/CTP/#ch0","text":"\u56de\u5fc6\uff1a\u8bcd\u6cd5\u3001\u8bed\u6cd5\u3001\u8bed\u4e49 \u5728\u8fdb\u5165\u63a5\u4e0b\u6765\u7684\u7ae0\u8282\u524d\uff0c\u8ba9\u6211\u4eec\u56de\u987e\u4e00\u4e9b\u77e5\u8bc6\u3002 \u5728 \u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u7b2c 9 \u7ae0 \u4e2d\u6211\u4eec\u5b66\u5230\uff0c\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7684\u7f16\u8bd1\u6b65\u9aa4\u7531\u4ee5\u4e0b\u56db\u4e2a\u6b65\u9aa4\u7ec4\u6210\uff1a \u8bcd\u6cd5\u5206\u6790\u5668 \u8bed\u6cd5\u5206\u6790\u5668 \u8bed\u4e49\u5206\u6790\u5668 \u7f16\u8bd1\u6a21\u5757 \u8bf7\u56de\u5fc6\u5b83\u4eec\u7684\u5de5\u4f5c\u548c\u4f5c\u7528\u3002 \u672c\u7ae0\u7b80\u5355\u4ecb\u7ecd\u4e86\u5168\u4e66\u5404\u4e2a\u90e8\u5206\u5c06\u8981\u8ba8\u8bba\u7684\u5185\u5bb9\u3002","title":"Ch0. \u5bfc\u8bfb"},{"location":"books/CTP/#ch1","text":"\u672c\u7ae0\u6211\u4eec\u5173\u6ce8\u5b57\u7b26\u662f\u5982\u4f55\u7ec4\u6210\u7b26\u53f7\u7684\u3002 \u672f\u8bed token \uff08\u7b26\u53f7\uff09\u662f\u8bed\u8a00\u7684\u57fa\u672c\u8868\u610f\u5355\u5143\u3002\u5b57\u7b26\u7ec4\u6210\u7b26\u53f7\u3002\u4f8b\u5b50: -> \u3001 file \u90fd\u662f\u7b26\u53f7. \u540c\u4e00\u7ec4\u5b57\u7b26\u5e8f\u5217\u5728 \u4e0d\u540c\u4e0a\u4e0b\u6587 \u4e2d\u53ef\u80fd\u5c5e\u4e8e\u4e0d\u540c\u7b26\u53f7\u3002 \u6211\u4eec\u6765\u770b\u51e0\u4e2a\u4f8b\u5b50\uff0c\u8bf7\u601d\u8003\u8fd9\u4e9b\u7a0b\u5e8f\u7684\u884c\u4e3a\uff08\u6ce8\u610f\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7\uff09\u3002","title":"Ch1. \u8bcd\u6cd5\u9677\u9631"},{"location":"books/CTP/#ch2","text":"\u672c\u7ae0\u6211\u4eec\u5173\u6ce8\u7b26\u53f7\u662f\u5982\u4f55\u7ec4\u6210\u58f0\u660e\u3001\u8868\u8fbe\u5f0f\u3001\u8bed\u53e5\u548c\u7a0b\u5e8f\u7684\u3002","title":"Ch2. \u8bed\u6cd5\u9677\u9631"},{"location":"books/CTP/#ch3","text":"\u672c\u7ae0\u8003\u5bdf\u770b\u8d77\u6765\u4e00\u5207\u90fd\u663e\u5f97\u5408\u60c5\u5408\u7406\uff0c\u4f46\u5728\u6240\u6709 C \u5b9e\u73b0\u4e2d\u90fd\u662f\u672a\u5b9a\u4e49\u7684\u884c\u4e3a\u3002","title":"Ch3. \u8bed\u4e49\u9677\u9631"},{"location":"books/DSAAC/","text":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u5206\u6790 C \u8bed\u8a00\u63cf\u8ff0 \u00b6 Data Structures and Algorithm Analysis in C, Second Edition \u51fa\u7248\u793e \u4f5c\u8005 \u539f\u4e66\u5e74\u4efd \u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e Mark Allen Weiss 1997 Ch1. \u5f15\u8a00 \u00b6 \u4e24\u4e2a\u95ee\u9898\u5f15\u5165\uff1a \u5bfb\u627e\u6570\u7ec4\u4e2d\u7b2c k \u5927\u7684\u5143\u7d20 \u7b2c\u4e00\u79cd\u65b9\u6cd5\uff1a\u964d\u5e8f\u6392\u5217\u53d6\u7b2c k \u4e2a\u5143\u7d20\u3002 \u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff1a\u5c06\u5143\u7d20\u4f9d\u6b21\u63d2\u5165\u4e00\u4e2a\u5927\u5c0f\u4e3a k \u7684\u964d\u5e8f\u6570\u7ec4\uff0c\u5c0f\u4e8e\u672b\u4f4d\u5143\u7d20\u5219\u5ffd\u7565\uff0c\u8fd4\u56de\u6700\u540e\u4e00\u4e2a\u3002 \u6700\u4f18\u89e3\uff1a\u7b2c\u4e03\u7ae0\u4ecb\u7ecd Word puzzle \u56de\u5fc6\u4e00\u4e9b\u6570\u5b66\u57fa\u7840\uff1a \u51e0\u4f55\u7ea7\u6570\u3001\u7b49\u5dee\u6570\u5217\u3001\u5176\u4ed6\u5e38\u89c1\u7ea7\u6570\u7684\u6c42\u548c\u516c\u5f0f \u8bc1\u660e\u65b9\u6cd5\uff1a\u6570\u5b66\u5f52\u7eb3\u6cd5\u3001\u53cd\u8bc1\u6cd5\u3001\u4e3e\u53cd\u4f8b\u6cd5 \u9012\u5f52\u57fa\u7840\uff1a \u5fc5\u987b\u5177\u5907\u4e24\u79cd\u60c5\u51b5\uff1a\u57fa\u672c\u60c5\u51b5\u548c\u9012\u5f52\u60c5\u51b5 \u5728\u4e0d\u540c\u7684\u9012\u5f52\u8c03\u7528\u4e2d\uff0c\u4e0d\u5e94\u8be5\u505a\u91cd\u590d\u7684\u4e8b\u60c5\uff08\u6590\u6ce2\u90a3\u5951\u6570\u5217\uff09 \u8bc1\u660e\u9012\u5f52\u7684\u6b63\u786e\u6027\uff1a\u4f7f\u7528\u5f52\u7eb3\u6cd5 Ch2. \u7b97\u6cd5\u5206\u6790 \u00b6 \u5f15\u5165\u8bb0\u53f7\uff1a O\uff1a\u6e10\u8fdb\u4e0a\u754c \u03a9\uff1a\u6e10\u8fdb\u4e0b\u754c \u0398\uff1a\u6e10\u8fdb\u7d27\u5bc6\u754c o\uff1a\u6e10\u8fdb\u4e0a\u754c\uff0c\u4f46\u4e0d\u662f\u7d27\u5bc6\u754c \u5b66\u4f1a\u4f7f\u7528 \\(\\lim_{n \\to \\infty} \\frac{f(n)}{g(n)}\\) \u5224\u65ad\u6e10\u8fdb\u754c \u4e09\u6761\u6cd5\u5219\uff1a \u4e58\u6cd5\u6cd5\u5219\uff1a \\(T(n) = O(f(n)) * O(g(n)) = O(f(n) * g(n))\\) \u52a0\u6cd5\u6cd5\u5219\uff1a \\(T(n) = O(f(n)) + O(g(n)) = O(f(n) + g(n))\\) \u5bf9\u6570\u6cd5\u5219\uff1a \\(\\log^k N = O(N)\\)","title":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u5206\u6790 C \u8bed\u8a00\u63cf\u8ff0"},{"location":"books/DSAAC/#c","text":"Data Structures and Algorithm Analysis in C, Second Edition \u51fa\u7248\u793e \u4f5c\u8005 \u539f\u4e66\u5e74\u4efd \u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e Mark Allen Weiss 1997","title":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\u5206\u6790 C \u8bed\u8a00\u63cf\u8ff0"},{"location":"books/DSAAC/#ch1","text":"\u4e24\u4e2a\u95ee\u9898\u5f15\u5165\uff1a \u5bfb\u627e\u6570\u7ec4\u4e2d\u7b2c k \u5927\u7684\u5143\u7d20 \u7b2c\u4e00\u79cd\u65b9\u6cd5\uff1a\u964d\u5e8f\u6392\u5217\u53d6\u7b2c k \u4e2a\u5143\u7d20\u3002 \u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff1a\u5c06\u5143\u7d20\u4f9d\u6b21\u63d2\u5165\u4e00\u4e2a\u5927\u5c0f\u4e3a k \u7684\u964d\u5e8f\u6570\u7ec4\uff0c\u5c0f\u4e8e\u672b\u4f4d\u5143\u7d20\u5219\u5ffd\u7565\uff0c\u8fd4\u56de\u6700\u540e\u4e00\u4e2a\u3002 \u6700\u4f18\u89e3\uff1a\u7b2c\u4e03\u7ae0\u4ecb\u7ecd Word puzzle \u56de\u5fc6\u4e00\u4e9b\u6570\u5b66\u57fa\u7840\uff1a \u51e0\u4f55\u7ea7\u6570\u3001\u7b49\u5dee\u6570\u5217\u3001\u5176\u4ed6\u5e38\u89c1\u7ea7\u6570\u7684\u6c42\u548c\u516c\u5f0f \u8bc1\u660e\u65b9\u6cd5\uff1a\u6570\u5b66\u5f52\u7eb3\u6cd5\u3001\u53cd\u8bc1\u6cd5\u3001\u4e3e\u53cd\u4f8b\u6cd5 \u9012\u5f52\u57fa\u7840\uff1a \u5fc5\u987b\u5177\u5907\u4e24\u79cd\u60c5\u51b5\uff1a\u57fa\u672c\u60c5\u51b5\u548c\u9012\u5f52\u60c5\u51b5 \u5728\u4e0d\u540c\u7684\u9012\u5f52\u8c03\u7528\u4e2d\uff0c\u4e0d\u5e94\u8be5\u505a\u91cd\u590d\u7684\u4e8b\u60c5\uff08\u6590\u6ce2\u90a3\u5951\u6570\u5217\uff09 \u8bc1\u660e\u9012\u5f52\u7684\u6b63\u786e\u6027\uff1a\u4f7f\u7528\u5f52\u7eb3\u6cd5","title":"Ch1. \u5f15\u8a00"},{"location":"books/DSAAC/#ch2","text":"\u5f15\u5165\u8bb0\u53f7\uff1a O\uff1a\u6e10\u8fdb\u4e0a\u754c \u03a9\uff1a\u6e10\u8fdb\u4e0b\u754c \u0398\uff1a\u6e10\u8fdb\u7d27\u5bc6\u754c o\uff1a\u6e10\u8fdb\u4e0a\u754c\uff0c\u4f46\u4e0d\u662f\u7d27\u5bc6\u754c \u5b66\u4f1a\u4f7f\u7528 \\(\\lim_{n \\to \\infty} \\frac{f(n)}{g(n)}\\) \u5224\u65ad\u6e10\u8fdb\u754c \u4e09\u6761\u6cd5\u5219\uff1a \u4e58\u6cd5\u6cd5\u5219\uff1a \\(T(n) = O(f(n)) * O(g(n)) = O(f(n) * g(n))\\) \u52a0\u6cd5\u6cd5\u5219\uff1a \\(T(n) = O(f(n)) + O(g(n)) = O(f(n) + g(n))\\) \u5bf9\u6570\u6cd5\u5219\uff1a \\(\\log^k N = O(N)\\)","title":"Ch2. \u7b97\u6cd5\u5206\u6790"},{"location":"books/ECP/","text":"C \u4e13\u5bb6\u7f16\u7a0b \u00b6 \u7b80\u4ecb \u672c\u4e66\u5177\u6709\u6d53\u539a\u7684\u82f1\u5f0f\u5e7d\u9ed8\u6c1b\u56f4\uff0c\u4e14\u672c\u4e66\u7684\u7ffb\u8bd1\u4e5f\u5c3d\u91cf\u4fdd\u7559\u4e86\u539f\u6587\u7684\u98ce\u683c\u3002\u4e0d\u8981\u5728\u610f\u4f5c\u8005\u7684\u90a3\u4e9b\u8c03\u4f83\u5c31\u597d\u5566\u3002","title":"C \u4e13\u5bb6\u7f16\u7a0b"},{"location":"books/ECP/#c","text":"\u7b80\u4ecb \u672c\u4e66\u5177\u6709\u6d53\u539a\u7684\u82f1\u5f0f\u5e7d\u9ed8\u6c1b\u56f4\uff0c\u4e14\u672c\u4e66\u7684\u7ffb\u8bd1\u4e5f\u5c3d\u91cf\u4fdd\u7559\u4e86\u539f\u6587\u7684\u98ce\u683c\u3002\u4e0d\u8981\u5728\u610f\u4f5c\u8005\u7684\u90a3\u4e9b\u8c03\u4f83\u5c31\u597d\u5566\u3002","title":"C \u4e13\u5bb6\u7f16\u7a0b"},{"location":"books/LinuxServer/","tags":["Ongoing"],"text":"Linux \u5e94\u7528\u5927\u5168\uff1a\u670d\u52a1\u5668\u67b6\u8bbe \u00b6 \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e \u65bc\u5cb3 2014 \u672c\u4e66\u5148\u4ecb\u7ecd\u4e86 Linux \u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u548c\u7f51\u7edc\u547d\u4ee4\uff0c\u7136\u540e\u8bb2\u8ff0\u4e86 OpenSSH\u3001DHCP\u3001Nginx \u7b49\u670d\u52a1\u5668\u914d\u7f6e\u7684\u77e5\u8bc6\u3002\u6211\u53ea\u6311\u9009\u4e86\u4e00\u4e9b\u81ea\u5df1\u9700\u8981\u7684\u7ae0\u8282\u3002 \u9605\u8bfb\u672c\u4e66\u524d\uff0c\u8bfb\u8005\u5e94\u5f53\u5177\u6709\u57fa\u672c\u7684 Linux \u670d\u52a1\u5668\u4f7f\u7528\u7ecf\u5386\uff0c\u5177\u5907\u4e00\u5b9a\u7684\u8ba1\u7b97\u673a\u7f51\u7edc\u77e5\u8bc6\u3002 Ch1. Linux \u7f51\u7edc\u914d\u7f6e \u00b6 \u672c\u4e66\u4f7f\u7528\u7684 Linux \u53d1\u884c\u7248 \u672c\u4e66\u4f7f\u7528\u7684 Linux \u53d1\u884c\u7248\u5e94\u8be5\u662f CentOS / RHEL\u3002\u7b2c\u4e00\u7ae0 /etc/sysconfig/network-scripts/ifcfg-eth0 \u5728 Debian \u7cfb\u7cfb\u7edf\u4e2d\u5bf9\u5e94\u7684\u8def\u5f84\u4e3a /etc/NetworkManager/ \u3002\u5728 WSL \u4e2d\u5176\u8def\u5f84\u53c8\u53d1\u751f\u4e86\u53d8\u5316\u3002 1.1 \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6 \u00b6 \u7f51\u7edc\u8bbe\u5907\u76f8\u5173 \u00b6 \u5728 Debian \u7c7b\u7cfb\u7edf\u4e2d\uff0c\u7cfb\u7edf\u7f51\u7edc\u8bbe\u5907\u7684\u914d\u7f6e\u6587\u4ef6\u4fdd\u5b58\u5728 /etc/NetworkManager/system-connections \u4e2d\u3002\u6bcf\u4e2a\u7f51\u7edc\u8bbe\u5907\u5bf9\u5e94\u4e00\u4e2a\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u56de\u8def IP \u5730\u5740\u7b49\u4fe1\u606f\u3002 /etc/networks \u7f51\u7edc\u540d\u548c\u7f51\u7edc\u5730\u5740\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\u3002 /etc/protocols \u4f7f\u7528\u7684\u534f\u8bae\u548c\u534f\u8bae\u53f7\u3002 /etc/services \u7cfb\u7edf\u4e2d\u6240\u6709\u670d\u52a1\u7684\u540d\u79f0\u3001 \u7aef\u53e3/\u534f\u8bae\u7c7b\u578b\u3001 \u522b\u540d\u3001\u6ce8\u91ca\u7b49\u4fe1\u606f\u3002 /etc/services fsp 21/udp fspd #xxxx \u57df\u540d\u89e3\u6790\u76f8\u5173 \u00b6 /etc/resolv.conf \u662f\u57df\u540d\u89e3\u6790\u5668\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5305\u542b\u57df\u540d\u670d\u52a1\u5668\u3001DNS \u641c\u7d22\u8def\u5f84\u7b49\u3002 /etc/host.conf \u6307\u5b9a\u5982\u4f55\u89e3\u6790\u4e3b\u673a\u540d\u3002 /etc/hosts \u5b58\u653e\u4e00\u4e9b\u5339\u914d\u4fe1\u606f\u3002 resolv.conf order bind, hosts multi on order \u6307\u5b9a\u4e3b\u673a\u540d\u67e5\u8be2\u7684\u987a\u5e8f\uff0c\u5728\u4e0a\u9762\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u5148\u67e5\u8be2 DNS \u670d\u52a1\u5668\uff0c\u518d\u67e5\u8be2 /etc/hosts \u6587\u4ef6\u3002 1.2 Linux \u7f51\u7edc\u547d\u4ee4 \u00b6 ping \u6d4b\u8bd5\u8fde\u901a\u6027\uff0c\u4f7f\u7528 ICMP \u534f\u8bae\u3002 traceroute \u6570\u636e\u5305\u5230\u8fbe\u4e3b\u673a\u7684\u8def\u5f84 mii-tool \u67e5\u770b\u7f51\u5361\u7684\u5de5\u4f5c\u6a21\u5f0f\u3002\u865a\u62df\u8bbe\u5907\u5982 lo \u3001 virbr0 \u7b49\u53ef\u80fd\u4e0d\u652f\u6301\u64cd\u4f5c\u3002 ifconfig \u663e\u793a\u548c\u914d\u7f6e\u7f51\u7edc\u63a5\u53e3\u3002 ifdown \u5173\u95ed\u7f51\u7edc\u63a5\u53e3 ifup \u5f00\u542f\u7f51\u7edc\u63a5\u53e3 Tip \u8fd9\u4e9b\u547d\u4ee4\u4e2d\u7684 if \u90fd\u662f interface \u7684\u7f29\u5199\u3002 netstat \u663e\u793a\u7f51\u7edc\u72b6\u6001\u4fe1\u606f\uff1a\u7f51\u7edc\u8fde\u63a5\u3001\u8def\u7531\u8868\u3001\u63a5\u53e3\u7edf\u8ba1\u7b49\u3002 arp \u4fee\u6539 ARP \u7f13\u5b58\u6761\u76ee\u3002 ARP Cache Address Resolution Protocol\uff0c\u5373 MAC \u5730\u5740\u89e3\u6790\u7f13\u5b58\u3002 rpcinfo \u663e\u793a\u4f7f\u7528 protmap \u6ce8\u518c\u7684\u7a0b\u5e8f\uff0c\u5e76\u8fdb\u884c RPC \u8c03\u7528\u68c0\u67e5\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u3002 \u8be5\u547d\u4ee4\u5c5e\u4e8e rpcbind \u5305\uff0c\u4e00\u822c\u6ca1\u6709\u9ed8\u8ba4\u5b89\u88c5\u3002 ip \u64cd\u7eb5\u8def\u7531\u8bbe\u5907\u548c\u96a7\u9053\u7b49\u3002 \u9ad8\u7ea7\u7f51\u7edc\u5de5\u5177 \u00b6 \u7565\u8fc7 \u6682\u65f6\u8fd8\u6ca1\u6709\u5b66\u4e60\u8fd9\u90e8\u5206\uff0c\u5148\u8df3\u8fc7\u5566~ nmap Network Mapper \u7f51\u7edc\u6620\u5c04\u5668\uff0c\u662f\u4e00\u6b3e\u7f51\u7edc\u63a2\u6d4b\u548c\u5b89\u5168\u5ba1\u6838\u7a0b\u5e8f\u3002\u5b83\u4f7f\u7528\u539f\u59cb IP \u62a5\u6587\u6765\u53d1\u73b0\u7f51\u7edc\u4e0a\u6709\u54ea\u4e9b\u4e3b\u673a\u3001\u63d0\u4f9b\u4ec0\u4e48\u670d\u52a1\u3001\u6709\u4ec0\u4e48\u670d\u52a1\u8fd0\u884c\u5728\u54ea\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u3001\u4f7f\u7528\u4ec0\u4e48\u7c7b\u578b\u7684\u62a5\u6587\u8fc7\u6ee4\u5668/\u9632\u706b\u5899\u3002 tcpdump \u8fd9\u662f Linux \u7cfb\u7edf\u4e2d\u5f3a\u5927\u7684\u7f51\u7edc\u6570\u636e\u91c7\u96c6\u5206\u6790\u5de5\u5177\u4e4b\u4e00\uff0c\u53ef\u5c06\u7f51\u7edc\u4e2d\u4f20\u8f93\u7684\u6570\u636e\u5305\u7684\u5934\u5b8c\u5168\u622a\u83b7\u4e0b\u6765\u63d0\u4f9b\u5206\u6790\u3002 Wireshark \u7f51\u7edc\u6570\u636e\u5305\u5206\u6790\u8f6f\u4ef6\u3002 TCP Wrapper \u4fdd\u62a4\u673a\u5236 \u00b6 \u7565\u8fc7 \u6682\u65f6\u8fd8\u6ca1\u6709\u5b66\u4e60\u8fd9\u90e8\u5206\uff0c\u5148\u8df3\u8fc7\u5566~ \u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u9632\u706b\u5899\u673a\u5236\uff0c\u5b9a\u4e49\u54ea\u4e9b\u4e3b\u673a\u5141\u8bb8\u6216\u4e0d\u5141\u8bb8\u8fde\u63a5\u5230\u7f51\u7edc\u670d\u52a1\u3002\u4f9d\u8d56\u4e8e /etc/hosts.allow \u548c /etc/hosts.deny \u4e24\u4e2a\u6587\u4ef6\u3002 ADSL \u8fde\u63a5\u914d\u7f6e \u00b6 \u7565\u8fc7 \u8fd9\u90e8\u5206\u7684\u5185\u5bb9\u5df2\u7ecf\u6709\u4e9b\u8fc7\u65f6\uff0c\u4e5f\u5148\u8df3\u8fc7\u5566~ OpenSSH \u00b6 \u56de\u5fc6\u57fa\u7840 \u00b6 Secure Shell \u662f\u5efa\u7acb\u5728\u5e94\u7528\u5c42\u548c\u4f20\u8f93\u5c42\u4e0a\u7684\u5b89\u5168\u534f\u8bae\uff0c\u80fd\u6709\u6548\u9632\u6b62\u8fdc\u7a0b\u7ba1\u7406\u8fc7\u7a0b\u4e2d\u7684\u4fe1\u606f\u6cc4\u9732\u95ee\u9898\u3002 SSH \u80fd\u591f\u4ee3\u66ff telent\uff0c\u53ef\u4ee5\u4e3a ftp\u3001pop \u548c ppp \u63d0\u4f9b\u5b89\u5168\u901a\u9053\u3002 SSH \u5de5\u4f5c\u539f\u7406 \u00b6 \u670d\u52a1\u7aef\uff1a\u4e00\u4e2a\u5b88\u62a4\u8fdb\u7a0b sshd \uff0c\u54cd\u5e94\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u8bf7\u6c42\u3002 \u63d0\u4f9b \u5bf9\u8fdc\u7a0b\u8fde\u63a5\u7684\u5904\u7406 \uff0c\u5305\u62ec\u5bc6\u94a5\u8ba4\u8bc1\u7b49\u3002 \u5ba2\u6237\u7aef\uff1a ssh \u3001 scp \u3001 sftp \u7b49\u5e94\u7528\u7a0b\u5e8f\u3002 \u7565\u8fc7 SSH \u670d\u52a1\u5668\u914d\u7f6e\u7684\u5185\u5bb9\u5148\u8df3\u8fc7\u5566~ Nginx \u00b6 \u540c\u7c7b\u53c2\u8003\u6587\u732e \u00b6 \u9e1f\u54e5\u7684 Linux \u79c1\u623f\u83dc\uff1a\u670d\u52a1\u5668\u67b6\u8bbe\u7bc7 \u7b2c\u4e09\u7248","title":"Linux \u5e94\u7528\u5927\u5168\uff1a\u670d\u52a1\u5668\u67b6\u8bbe"},{"location":"books/LinuxServer/#linux","text":"\u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e \u65bc\u5cb3 2014 \u672c\u4e66\u5148\u4ecb\u7ecd\u4e86 Linux \u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u548c\u7f51\u7edc\u547d\u4ee4\uff0c\u7136\u540e\u8bb2\u8ff0\u4e86 OpenSSH\u3001DHCP\u3001Nginx \u7b49\u670d\u52a1\u5668\u914d\u7f6e\u7684\u77e5\u8bc6\u3002\u6211\u53ea\u6311\u9009\u4e86\u4e00\u4e9b\u81ea\u5df1\u9700\u8981\u7684\u7ae0\u8282\u3002 \u9605\u8bfb\u672c\u4e66\u524d\uff0c\u8bfb\u8005\u5e94\u5f53\u5177\u6709\u57fa\u672c\u7684 Linux \u670d\u52a1\u5668\u4f7f\u7528\u7ecf\u5386\uff0c\u5177\u5907\u4e00\u5b9a\u7684\u8ba1\u7b97\u673a\u7f51\u7edc\u77e5\u8bc6\u3002","title":"Linux \u5e94\u7528\u5927\u5168\uff1a\u670d\u52a1\u5668\u67b6\u8bbe"},{"location":"books/LinuxServer/#ch1-linux","text":"\u672c\u4e66\u4f7f\u7528\u7684 Linux \u53d1\u884c\u7248 \u672c\u4e66\u4f7f\u7528\u7684 Linux \u53d1\u884c\u7248\u5e94\u8be5\u662f CentOS / RHEL\u3002\u7b2c\u4e00\u7ae0 /etc/sysconfig/network-scripts/ifcfg-eth0 \u5728 Debian \u7cfb\u7cfb\u7edf\u4e2d\u5bf9\u5e94\u7684\u8def\u5f84\u4e3a /etc/NetworkManager/ \u3002\u5728 WSL \u4e2d\u5176\u8def\u5f84\u53c8\u53d1\u751f\u4e86\u53d8\u5316\u3002","title":"Ch1. Linux \u7f51\u7edc\u914d\u7f6e"},{"location":"books/LinuxServer/#openssh","text":"","title":"OpenSSH"},{"location":"books/LinuxServer/#nginx","text":"","title":"Nginx"},{"location":"books/LinuxServer/#_5","text":"\u9e1f\u54e5\u7684 Linux \u79c1\u623f\u83dc\uff1a\u670d\u52a1\u5668\u67b6\u8bbe\u7bc7 \u7b2c\u4e09\u7248","title":"\u540c\u7c7b\u53c2\u8003\u6587\u732e"},{"location":"books/PCC/","tags":["Todo"],"text":"Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5 \u00b6 Python Crash Course: A Hands-On, Project-Based Introduction to Programming \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e Eric Matthes 2016 Abstract \u672c\u4e66\u4ec5\u4f5c\u9879\u76ee\u90e8\u5206\u7b14\u8bb0\u3002 \u524d\u7f6e\u77e5\u8bc6 \u00b6 Abstract \u8fd9\u91cc\u4ecb\u7ecd\u4e00\u4e9b\u521b\u5efa Python \u9879\u76ee\u7684\u57fa\u672c\u77e5\u8bc6\uff0c\u6bd4\u5982\u865a\u62df\u73af\u5883\u3001 pip \u5305\u7ba1\u7406\u5668\u7b49\u3002 \u547d\u4ee4\u76f8\u5173 \u00b6 Python \u7684\u547d\u4ee4\u5bb9\u6613\u5f15\u8d77\u56f0\u60d1\uff0c\u6211\u73b0\u5728\u4e5f\u4f9d\u65e7\u6ca1\u6709\u641e\u61c2\u3002\u5982\u679c\u4f60\u5b89\u88c5\u4e86 Python \u540e\u6267\u884c python3 \u663e\u793a\u627e\u4e0d\u5230\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u66ff\u6362\u4e3a python \u6216 py \u3002\u5982\u679c\u8fd8\u627e\u4e0d\u5230\uff0c\u8bf7\u68c0\u67e5 $PATH \u73af\u5883\u53d8\u91cf\u3002\u4e00\u822c\u6765\u8bf4\uff0cWindows \u7cfb\u7edf\u4e2d\u9ed8\u8ba4\u547d\u4ee4\u4e3a py \uff0c\u800c Unix \u7cfb\u7edf\u4e2d\u9ed8\u8ba4\u547d\u4ee4\u4e3a python3 \u3002 pip \u5305\u7ba1\u7406\u5668\u4e5f\u4f1a\u9ed8\u8ba4\u5b89\u88c5\uff0c\u5982\u679c\u627e\u4e0d\u5230\u53ef\u4ee5\u5c1d\u8bd5\u66ff\u6362\u4e3a pip3 \u3002 \u865a\u62df\u73af\u5883 \u00b6 \u521b\u5efa\u865a\u62df\u73af\u5883\u7684\u7406\u7531\u6709\u5f88\u591a\uff1a\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\u4e0d\u540c\u3001\u7248\u672c\u4e0d\u540c\uff0c\u6216\u8005\u662f\u4e3a\u4e86\u4fdd\u6301\u7cfb\u7edf\u7684\u5e72\u51c0\u6574\u6d01\u3002 \u4ece Python 3.3 \u5f00\u59cb\uff0c\u4e00\u822c\u4f7f\u7528 Python \u81ea\u5e26\u7684\u6a21\u5757 venv \u6765\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a python3 -m venv source /bin/activate \u7b2c\u4e00\u884c\u7684\u547d\u4ee4\u521b\u5efa\u4e86\u865a\u62df\u73af\u5883\uff0c\u7b2c\u4e8c\u884c\u547d\u4ee4\uff08\u9650 Unix \u7cfb\u7edf\uff09\u5c06\u865a\u62df\u73af\u5883\u7684\u73af\u5883\u53d8\u91cf\u8f7d\u5165\u7ec8\u7aef\u3002 \u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u52a0\u8f7d\u73af\u5883\u53d8\u91cf\u540e\uff0c\u5c31\u80fd\u4f7f\u7528 pip \u547d\u4ee4\u6765\u5b89\u88c5\u4f9d\u8d56\u5305\u4e86\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cWindows \u548c Linux \u4e0b\u7684\u865a\u62df\u73af\u5883\u5e76\u4e0d\u80fd\u901a\u7528\uff0c\u56e0\u4e3a\u5176\u914d\u7f6e\u6587\u4ef6\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u3002\u56e0\u6b64\u5e94\u5f53\u4e3a\u4e0d\u540c\u7684\u7cfb\u7edf\u914d\u7f6e\u4e0d\u540c\u7684\u865a\u62df\u73af\u5883\uff0c\u6700\u597d\u7684\u65b9\u5f0f\u662f\u4f7f\u7528 requirements.txt \u6587\u4ef6\u6765\u8bb0\u5f55\u4f9d\u8d56\u5305\uff0c\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u540c\u7cfb\u7edf\u4e0b\u7684\u4f9d\u8d56\u5305\u4e00\u81f4\u3002 \u57fa\u7840\u77e5\u8bc6\u8865\u5168 \u00b6 \u590d\u4e60\u4ee5\u53ca\u8865\u5145 SOP4 \u4e2d\u6ca1\u6709\u6d89\u53ca\u7684\u77e5\u8bc6\u3002 \u5173\u952e\u5b57\u548c\u5185\u7f6e\u51fd\u6570 \u00b6 \u5b9a\u4e49\uff1a def \u3001 class \u7b49 \u5e03\u5c14\u7b49\u8868\u8fbe\u5f0f\u8fd0\u7b97\uff1a False \u3001 True \u3001 None \u3001 and \u3001 or \u3001 not \u7b49 \u63a7\u5236\u7ed3\u6784\uff1a while \u3001 for \u3001 if \u3001 else \u3001 elif \u7b49 \u5176\u4ed6 \u5b57\u7b26\u4e32 \u00b6 \u4fee\u6539\u5927\u5c0f\u5199 .title() \u3001 .upper() \u3001 .lower() \u62fc\u63a5 \u5220\u9664\u7a7a\u767d .rstrip() \u3001 .lstrip() \u3001 .strip() \u7a7a\u767d \u7a7a\u767d\u6307\u4efb\u4f55\u975e\u6253\u5370\u5b57\u7b26\u3002 \u5c06\u5176\u4ed6\u6570\u636e\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32 str(value) \u5217\u8868 \u00b6 list = [ 1 , 2 , 3 ] \u57fa\u7840\uff1a \u6dfb\u52a0\u5143\u7d20\uff1a .append(value) \u3001 .insert(index, value) \u5220\u9664\u8bed\u53e5\uff1a del list[index] \u3001 .pop(index) \uff08\u5c3e\u90e8\u5220\u9664\uff09\u3001 .remove(value) \u6392\u5e8f\uff1a .sort() \u3001 .sort(reverse=True) \u53cd\u8f6c\uff1a .reverse() \u957f\u5ea6\uff1a len(list) \u66f4\u591a\u64cd\u4f5c\uff1a \u904d\u5386 \u5faa\u73af\u7ed3\u675f\u540e for \u5faa\u73af\u7ed3\u675f\u540e\uff0c\u8fed\u4ee3\u4f7f\u7528\u7684\u53d8\u91cf\u4ecd\u7136\u5b58\u5728\u3002 range(start, end, step) \uff1a\u751f\u6210\u4e00\u4e2a\u6574\u6570\u5e8f\u5217\uff0c\u4e0d\u5305\u542b end \uff0c\u9ed8\u8ba4 start=0 \uff0c step=1 \u3002 \u5207\u7247 list[start:end:step] \uff1a\u4e0d\u5305\u542b end \uff0c\u9ed8\u8ba4 start=0 \uff0c step=1 \u3002 \u5229\u7528\u5207\u7247\u590d\u5236\u5217\u8868 list[:] \u3002 \u5217\u8868\u89e3\u6790 \u8fd9\u662f\u4e00\u79cd\u6bd4\u8f83\u9ad8\u9636\u4f46\u5e38\u7528\u7684\u6280\u5de7\uff0c\u4f7f\u7528\u4e00\u884c\u4ee3\u7801\u751f\u6210\u7279\u5b9a\u7684\u5217\u8868\uff1a squares = [ value ** 2 for value in range ( 1 , 11 )] \u9996\u5148\u6307\u5b9a\u5217\u8868\u540d \u518d\u5b9a\u4e49\u4e00\u4e2a\u8868\u8fbe\u5f0f value**2 \u751f\u6210\u4f60\u8981\u5b58\u50a8\u5230\u5217\u8868\u4e2d\u7684\u503c \u63a5\u4e0b\u6765\u5199\u4e00\u4e2a for \u5faa\u73af\u7ed9\u8868\u8fbe\u5f0f\u63d0\u4f9b\u503c \u8bf7\u7ec3\u4e60\u751f\u6210\u4e00\u4e2a 3 \u7684\u500d\u6570\u7684\u5217\u8868\u3002 if \u8bed\u53e5 \u00b6 \u6bd4\u8f83\u65b9\u6cd5\uff1a in \u68c0\u67e5\u7279\u5b9a\u503c\u662f\u5426\u5728\u5217\u8868\u4e2d \u4f7f\u7528 .lower() \u68c0\u67e5\u5b57\u7b26\u4e32\u662f\u5426\u4e3a\u5c0f\u5199\uff08\u6ce8\u610f\u4e2a\u8fd9\u4e2a\u51fd\u6570\u5e76\u4e0d\u80fd\u76f4\u63a5\u68c0\u6d4b\uff0c\u600e\u4e48\u7528\u5462\uff1f\uff09 if-elif-else \u7ed3\u6784 \u4e00\u4e9b\u5e03\u5c14\u8868\u8fbe\u5f0f\uff1a Python \u4e2d\u652f\u6301\u8fde\u7eed\u7684\u6bd4\u8f83\uff0c\u5982 age >= 18 and age <= 65 \u53ef\u4ee5\u7b80\u5199\u4e3a 18 <= age <= 65 \u3002 \u5b57\u5178 \u00b6 dict = { 'key' : 'value' } \u57fa\u7840\uff1a \u8bbf\u95ee\uff1a dict['key'] \u6dfb\u52a0\uff1a dict['key'] = 'value' \u521b\u5efa\u7a7a\u5b57\u5178\uff1a dict = {} \u4fee\u6539\u503c\uff1a dict['key'] = 'new value' \u5220\u9664\u952e\u503c\u5bf9\uff1a del dict['key'] \u8f83\u957f\u5b57\u5178\u7684\u7f29\u8fdb\u65b9\u6cd5\uff1a dict = { 'key1' : 'value1' , 'key2' : 'value2' , 'key3' : 'value3' , } \u904d\u5386\uff1a for key, value in dict.items(): for key in dict.keys(): for value in dict.values(): \u6309\u987a\u5e8f\u904d\u5386 for key in sorted(dict.keys()): \u66f4\u591a\u64cd\u4f5c\uff1a \u5b57\u5178\u7684\u5217\u8868 \u5b57\u5178\u4e2d\u5d4c\u5957\u5217\u8868 \u5b57\u5178\u5d4c\u5957\u5b57\u5178 \u5faa\u73af \u00b6 \u4f7f\u7528 break \u548c continue \u8bbe\u7f6e\u6807\u5fd7 \u7528\u5faa\u73af\u5904\u7406\u5217\u8868\u548c\u5b57\u5178 \u5220\u9664\u6307\u5b9a\u503c \u79fb\u52a8\u5143\u7d20 \u5b66\u4e60\u4e0b\u9762\u8fd9\u79cd\u7528\u6cd5\uff0c\u4ee5\u5217\u8868\u4f5c\u4e3a\u5faa\u73af\u6761\u4ef6\uff1a users = [ 'user1' , 'user2' , 'user3' ] while users : user = users . pop () print ( user ) \u51fd\u6570 \u00b6 def function_name ( parameters ): \"\"\"docstring\"\"\" function body \u53c2\u6570 \u00b6 \u5173\u952e\u5b57\u5b9e\u53c2\uff1a function_name(parameter=value) ' \u9ed8\u8ba4\u503c\uff1a def function_name(parameter=value) \u5728\u51fd\u6570\u5b9a\u4e49\u4e2d\uff0c\u5e94\u5f53\u5c06\u6ca1\u6709\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u653e\u5728\u524d\u9762\uff0c\u6709\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u653e\u5728\u540e\u9762\uff0c\u4ee5\u4fbf Python \u4f9d\u7136\u80fd\u591f\u6b63\u786e\u89e3\u8bfb\u4f4d\u7f6e\u5b9e\u53c2\u3002 \u7981\u6b62\u51fd\u6570\u4fee\u6539\u5217\u8868\uff1a function_name(list_name[:]) \uff08\u521b\u5efa\u526f\u672c\uff09 \u4efb\u610f\u6570\u91cf\u5b9e\u53c2\uff1a def function_name(*parameters) \uff0c * \u4f1a\u521b\u5efa\u4e00\u4e2a\u7a7a\u5143\u7ec4\uff0c\u5c06\u6240\u6709\u503c\u90fd\u5c01\u88c5\u5230\u8fd9\u4e2a\u5143\u7ec4\u4e2d\u3002 \u4efb\u610f\u6570\u91cf\u7684\u5173\u952e\u5b57\u5b9e\u53c2\uff1a def function_name(**parameters) \uff0c ** \u4f1a\u521b\u5efa\u4e00\u4e2a\u7a7a\u5b57\u5178\uff0c\u5c06\u6240\u6709\u503c\u90fd\u5c01\u88c5\u5230\u8fd9\u4e2a\u5b57\u5178\u4e2d\u3002 \u53c2\u6570\u7684\u987a\u5e8f \u5728\u5b9a\u4e49\u548c\u8c03\u7528\u4e2d\uff0c\u90fd\u5e94\u5f53\u6309\u666e\u901a\u5f62\u53c2\u3001\u5e26\u9ed8\u8ba4\u503c\u7684\u5f62\u53c2\u3001\u4efb\u610f\u6570\u91cf\u5f62\u53c2\u7684\u987a\u5e8f\u6392\u5217\u3002 \u5c06\u51fd\u6570\u5b58\u50a8\u5728\u6a21\u5757\u4e2d \u00b6 \u5bfc\u5165\u6574\u4e2a\u6a21\u5757\uff1a import module_name \u5bfc\u5165\u7279\u5b9a\u51fd\u6570\uff1a from module_name import function_name \u51fd\u6570\u522b\u540d\uff1a from module_name import function_name as fn \u6a21\u5757\u522b\u540d\uff1a import module_name as mn \u5bfc\u5165\u6240\u6709\u51fd\u6570\uff1a from module_name import * \u51fd\u6570\u4ee3\u7801\u89c4\u8303 \u5f62\u53c2\u6307\u5b9a\u9ed8\u8ba4\u503c\u65f6\u7b49\u53f7\u4e24\u8fb9\u4e0d\u8981\u6709\u7a7a\u683c \u51fd\u6570\u8c03\u7528\u65f6\uff0c\u5173\u952e\u5b57\u5b9e\u53c2\u7b49\u53f7\u4e24\u8fb9\u4e0d\u8981\u6709\u7a7a\u683c \u5bf9\u9f50\u53c2\u6570\u5217\u8868\u884c def function_name ( parameter_0 , parameter_1 , parameter_2 , parameter_3 , parameter_4 , parameter_5 ): function body ... \u7c7b \u00b6 \u7f16\u5199\u7c7b\u7684\u57fa\u7840 \u00b6 \u4e0e\u7c7b\u6709\u5173\u7684\u6bcf\u4e2a\u65b9\u6cd5\u90fd\u9700\u8981 self \u53c2\u6570\uff0c\u4e14\u5fc5\u987b\u4f4d\u4e8e\u53c2\u6570\u5217\u8868\u7684\u7b2c\u4e00\u4e2a\u4f4d\u7f6e\u3002 \u7c7b\u7684\u6bcf\u4e2a\u5c5e\u6027\u90fd\u5fc5\u987b\u6709\u521d\u59cb\u503c\u3002 \u7ee7\u627f \u00b6 class ChildClass ( ParentClass ): \"\"\"docstring\"\"\" def __init__ ( self , parameters ): super () . __init__ ( parameters ) self . attribute = value \u5b50\u7c7b\u7684\u65b9\u6cd5 __init__() \u9700\u8981\u7236\u7c7b\u7684\u65b9\u6cd5 __init__() \u6765\u521d\u59cb\u5316\u7236\u7c7b\u7684\u5c5e\u6027\u3002 super() \u662f\u4e00\u4e2a\u7279\u6b8a\u51fd\u6570\uff0c\u5e2e\u52a9 Python \u5c06\u7236\u7c7b\u548c\u5b50\u7c7b\u5173\u8054\u8d77\u6765\u3002 super().__init__(parameters) \uff1a\u8c03\u7528\u7236\u7c7b\u7684\u65b9\u6cd5 __init__() \u3002 \u91cd\u5199\u7236\u7c7b\u7684\u65b9\u6cd5 \u5c06\u5b9e\u4f8b\u7528\u4f5c\u5c5e\u6027\uff08\u5176\u5b9e\u5c31\u662f\u7c7b\u7684\u5d4c\u5957\uff09\uff1a\u4e00\u4e9b\u7c7b\u7684\u7ec6\u8282\u8d8a\u6765\u8d8a\u591a\uff0c\u5e94\u5f53\u62c6\u5206\u6210\u591a\u4e2a\u534f\u540c\u5de5\u4f5c\u7684\u5c0f\u7c7b\u3002 Python \u6807\u51c6\u5e93 \u00b6 collections \u6a21\u5757\uff1a\u5305\u542b\u5f88\u591a\u6709\u7528\u7684\u7c7b OrderedDict \u7c7b\uff1a\u8bb0\u5f55\u952e\u503c\u5bf9\u7684\u6dfb\u52a0\u987a\u5e8f \u6587\u4ef6\u548c\u5f02\u5e38 \u00b6 with \u8bed\u53e5\uff1a\u5728\u4e0d\u518d\u9700\u8981\u8bbf\u95ee\u6587\u4ef6\u540e\u5c06\u5176\u5173\u95ed\u3002 with open ( filename ) as file_object : contents = file_object . read () # \u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6 for line in file_object : # \u9010\u884c\u8bfb\u53d6 print ( line . rstrip ()) open() \uff1a\u9ed8\u8ba4\u4ee5\u53ea\u8bfb\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\u3002 \u8003\u8003\u4f60 \u4ee5\u4e0b\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f \u8bfb\u53d6\u6587\u4ef6\u65f6\uff0c\u7a7a\u884c\u4f1a\u51fa\u73b0\u4e24\u6b21\u6362\u884c \u5c06\u6587\u4ef6\u5185\u5bb9\u5168\u90e8\u5408\u5e76\u6210\u4e00\u884c \u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u6570\u5b57\u7b49\u5176\u4ed6\u7c7b\u578b\u7684\u503c \u6587\u4ef6\u5bf9\u8c61\u64cd\u4f5c\uff1a .read() \uff1a\u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6 .write() \uff1a\u5199\u5165\u6587\u4ef6\u3002\u6ce8\u610f\u4e0d\u4f1a\u5728\u672b\u5c3e\u6dfb\u52a0\u6362\u884c\u7b26\u3002 \u5f02\u5e38\uff1a try-except-else \u4ee3\u7801\u5757 pass \u8bed\u53e5\uff1a\u4ec0\u4e48\u90fd\u4e0d\u505a\uff0c\u53ea\u662f\u5360\u4f4d\u7b26\uff0c\u4f7f\u4ee3\u7801\u7ed3\u6784\u6b63\u786e\u3002 \u6d4b\u8bd5\u4ee3\u7801 \u00b6 unittest \u6a21\u5757\uff1a\u7528\u4e8e\u6838\u5b9e\u51fd\u6570\u7684\u884c\u4e3a\u662f\u5426\u7b26\u5408\u9884\u671f\u3002 \u5bfc\u5165 unittest \u6a21\u5757\u548c\u8981\u6d4b\u8bd5\u7684\u51fd\u6570 \u521b\u5efa\u4e00\u4e2a\u7ee7\u627f unittest.TestCase \u7684\u7c7b import unittest from name_function import get_formatted_name class NamesTestCase ( unittest . TestCase ): \"\"\"\u6d4b\u8bd5name_function.py\"\"\" def test_first_last_name ( self ): \"\"\"\u80fd\u591f\u6b63\u786e\u5730\u5904\u7406\u50cfJanis Joplin\u8fd9\u6837\u7684\u59d3\u540d\u5417\uff1f \"\"\" formatted_name = get_formatted_name ( 'janis' , 'joplin' ) self . assertEqual ( formatted_name , 'Janis Joplin' ) unittest . main () NamesTestCase \u4e2d\u6240\u6709\u4ee5 test_ \u5f00\u5934\u7684\u65b9\u6cd5\u90fd\u5c06\u81ea\u52a8\u8fd0\u884c\u3002 \u5e38\u7528\u7684\u65ad\u8a00\u65b9\u6cd5\uff1a assertEqual(a, b) \uff1a\u6838\u5b9e a == b assertNotEqual(a, b) \uff1a\u6838\u5b9e a != b assertTrue(x) \uff1a\u6838\u5b9e x \u4e3a True assertFalse(x) \uff1a\u6838\u5b9e x \u4e3a False assertIn(item, list) \uff1a\u6838\u5b9e item \u5728 list \u4e2d assertNotIn(item, list) \uff1a\u6838\u5b9e item \u4e0d\u5728 list \u4e2d setUp() \u65b9\u6cd5\uff1a\u53ea\u9700\u521b\u5efa\u4e00\u6b21\u5bf9\u8c61\uff0c\u7136\u540e\u5728\u6bcf\u4e2a\u6d4b\u8bd5\u65b9\u6cd5\u4e2d\u4f7f\u7528\u5b83\u3002 \u6d4b\u8bd5\u7ed3\u679c\uff1a . \uff1a\u6d4b\u8bd5\u901a\u8fc7 E \uff1a\u6d4b\u8bd5\u5f15\u53d1\u9519\u8bef F \uff1a\u6d4b\u8bd5\u65ad\u8a00\u5931\u8d25 \u6700\u540e\u4e00\u70b9\u9a6c\u8702\u5c0f\u5efa\u8bae \u00b6 \u7c7b\u540d\u4f7f\u7528\u9a7c\u5cf0\u547d\u540d\u6cd5 \u5b9e\u4f8b\u540d\u548c\u6a21\u5757\u540d\u4f7f\u7528\u5c0f\u5199\u5b57\u6bcd\u548c\u4e0b\u5212\u7ebf \u6bcf\u4e2a\u7c7b\u5b9a\u4e49\u540e\u90fd\u5e94\u5f53\u5305\u542b\u4e00\u4e2a\u6587\u6863\u5b57\u7b26\u4e32 \u6bcf\u4e2a\u6a21\u5757\u90fd\u5e94\u5305\u542b\u4e00\u4e2a\u6587\u6863\u5b57\u7b26\u4e32 Projects \u00b6 Project 2 \u6570\u636e\u53ef\u89c6\u5316 \u00b6 json \u6a21\u5757 \u00b6 \u5728\u7b2c 10 \u7ae0\u6211\u4eec\u5b66\u4e60\u4e86 json \u6a21\u5757\uff0c\u73b0\u5728\u7b80\u5355\u56de\u987e\u590d\u4e60\u6587\u4ef6\u64cd\u4f5c\u548c\u6a21\u5757\u4f7f\u7528\uff1a json.dump(data, file_object) \uff1a\u5c06 Python \u6570\u636e\u7ed3\u6784\u8f6c\u6362\u4e3a JSON \u683c\u5f0f\u5e76\u5199\u5165\u6587\u4ef6\u3002 json.load(file_object) \uff1a\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6 JSON \u683c\u5f0f\u7684\u6570\u636e\u5e76\u8f6c\u6362\u4e3a Python \u6570\u636e\u7ed3\u6784\u3002 \u793a\u4f8b\uff1a remember_me.py import json filename = 'username.json' try : with open ( filename ) as file_object : username = json . load ( file_object ) except FileNotFoundError : username = input ( \"What's your name? \" ) with open ( filename , 'w' ) as file_object : json . dump ( username , file_object ) print ( \"We'll remember you when you come back, \" + username + \"!\" ) else : print ( \"Welcome back, \" + username + \"!\" ) matplotlib \u00b6 \u67e5\u9605\u624b\u518c \u9700\u8981\u65f6\u8bf7\u7ffb\u9605\u624b\u518c\u67e5\u627e\u7528\u6cd5 \u4ee5\u4e0b\u529f\u80fd\u5e94\u8be5\u5982\u4f55\u5b9e\u73b0\uff1f \u7ed8\u5236\uff1a\u6298\u7ebf\u56fe\u3001\u6563\u70b9\u56fe \u8bbe\u7f6e\u6837\u5f0f\uff1a \u6587\u5b57\uff1a\u6807\u9898\u3001\u5750\u6807\u8f74\u6807\u9898 \u523b\u5ea6\uff08 tick_params \uff09\uff1a\u6807\u8bb0\u3001\u5927\u5c0f\u3001\u989c\u8272 \u7ebf\u6761\uff1a\u7c97\u7ec6\u3001\u989c\u8272 \u70b9\uff1a\u5927\u5c0f\u3001\u989c\u8272 \u5404\u90e8\u5206\u7684\u5b57\u4f53\u5927\u5c0f \u751f\u6210\u6570\u636e \u00b6 \u5b8c\u6210\u4ee5\u4e0b\u4efb\u52a1\uff1a \u7ed8\u5236\u4ece 1 \u5230 100 \u7684\u5e73\u65b9\u56fe\u50cf\uff08\u5217\u8868\u89e3\u6790\uff09\u3002 \u7528\u968f\u673a\u6f2b\u6b65\u65b9\u6cd5\u7ed8\u5236\u56fe\u50cf\uff0c\u53ef\u4ee5\u4f7f\u7528\u6563\u70b9\u56fe\u548c\u6298\u7ebf\u56fe\uff08 random.choice() \uff09\u3002 \u4e3a\u56fe\u8868\u4f7f\u7528\u989c\u8272\u6620\u5c04\u3002 \u4f7f\u7528 Pygal \u751f\u6210\u77e2\u91cf\u56fe\u5f62\u6587\u4ef6\u3002 \u5199\u4e00\u4e2a\u63b7\u9ab0\u5b50\u5b9e\u9a8c\uff0c\u4e00\u4e2a\u548c\u591a\u4e2a\u9ab0\u5b50\u3002 CSV \u6587\u4ef6 \u00b6 csv \u6a21\u5757\uff1a\u7528\u4e8e\u8bfb\u53d6\u548c\u5199\u5165 CSV \u6587\u4ef6\u3002 csv.reader(file_object) \uff1a\u8bfb\u53d6\u6587\u4ef6\u5e76\u8fd4\u56de\u4e00\u4e2a\u8bfb\u53d6\u5668\u5bf9\u8c61\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u9017\u53f7\u5206\u9694\u7684\u503c\u3002 next(reader) \uff1a\u8fd4\u56de\u6587\u4ef6\u4e2d\u7684\u4e0b\u4e00\u884c\u3002 \u5176\u4ed6\u51fd\u6570\uff1a enumerate() \uff1a\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u7d22\u5f15\u548c\u503c\u7684\u5143\u7ec4\u5217\u8868\u3002 datetime \u6a21\u5757\uff1a - strptime() \uff1a\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65e5\u671f\u5bf9\u8c61\u3002 \u00b6","title":"Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5"},{"location":"books/PCC/#python","text":"Python Crash Course: A Hands-On, Project-Based Introduction to Programming \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u4eba\u6c11\u90ae\u7535\u51fa\u7248\u793e Eric Matthes 2016 Abstract \u672c\u4e66\u4ec5\u4f5c\u9879\u76ee\u90e8\u5206\u7b14\u8bb0\u3002","title":"Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5"},{"location":"books/PCC/#_1","text":"Abstract \u8fd9\u91cc\u4ecb\u7ecd\u4e00\u4e9b\u521b\u5efa Python \u9879\u76ee\u7684\u57fa\u672c\u77e5\u8bc6\uff0c\u6bd4\u5982\u865a\u62df\u73af\u5883\u3001 pip \u5305\u7ba1\u7406\u5668\u7b49\u3002","title":"\u524d\u7f6e\u77e5\u8bc6"},{"location":"books/PCC/#_4","text":"\u590d\u4e60\u4ee5\u53ca\u8865\u5145 SOP4 \u4e2d\u6ca1\u6709\u6d89\u53ca\u7684\u77e5\u8bc6\u3002","title":"\u57fa\u7840\u77e5\u8bc6\u8865\u5168"},{"location":"books/PCC/#projects","text":"","title":"Projects"},{"location":"books/PCC/#-strptime","text":"","title":"- strptime()\uff1a\u5c06\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u65e5\u671f\u5bf9\u8c61\u3002"},{"location":"books/ProGit/","tags":["Ongoing"],"text":"\u7cbe\u901a Git \u00b6 ProGit \u8bfb\u4e66\u7b14\u8bb0 Ch1. \u5165\u95e8 \u00b6 Abstract Git \u662f\u4ec0\u4e48\uff1f Git \u7531 Linux \u793e\u533a\u5f00\u53d1\uff0c\u80fd\u6709\u6548\u5730\u5904\u7406 Linux \u5185\u6838\u8fd9\u6837\u7684\u5927\u578b\u9879\u76ee\u3002 Git \u5c06\u6570\u636e\u4f5c\u4e3a\u4e00\u4e2a \u5feb\u7167\u6d41 \u3002\u540e\u7eed\u7ae0\u8282\u4f1a\u8bb2\u89e3\u5feb\u7167\u6d41\u7684\u4f18\u52bf\u3002 Git \u7684\u5927\u90e8\u5206\u64cd\u4f5c\u5728\u672c\u5730\u8fdb\u884c\uff0c\u4f7f\u7528 SHA-1 \u6563\u5217\uff0840 \u4e2a\u5341\u516d\u8fdb\u5236\u5b57\u7b26\uff09\u6821\u9a8c\u6587\u4ef6\u3002 Git \u7684\u5927\u90e8\u5206\u64cd\u4f5c\u53ea\u589e\u52a0\u6570\u636e \u3002 \u4e09\u79cd\u72b6\u6001 \u00b6 Committed Modified Staged \u4e09\u79cd\u533a\u57df \u00b6 Git \u4ed3\u5e93\uff08\u9879\u76ee\u5143\u6570\u636e\u3001\u5bf9\u8c61\u6570\u636e\u5e93\uff09 \u5de5\u4f5c\u76ee\u5f55\uff08\u4ece\u4ed3\u5e93\u4e2d\u5355\u6b21\u68c0\u51fa\u7684\u4e00\u4e2a\u7248\u672c\uff09 \u6682\u5b58\u533a\uff08Git \u76ee\u5f55\u4e2d\u7684\u4e00\u4e2a\u6587\u4ef6\uff09 \u57fa\u7840\u8bbe\u65bd \u00b6 Git \u6709\u4e09\u79cd\u5c42\u6b21\u7684\u914d\u7f6e /etc/gitconfig \uff1a\u7cfb\u7edf\u4e2d\u6240\u6709\u7528\u6237\u548c\u53c2\u6570\u7684\u503c\uff0c\u7528 --system \u4fee\u6539 ~/.gitconfig \u6216 .config/git/config \uff1a\u7528\u6237\uff0c\u7528 --global \u4fee\u6539 .git/config \uff1a\u5355\u4e2a\u4ed3\u5e93 \u6bcf\u4e00\u7ea7\u8986\u76d6\u4e0a\u4e00\u7ea7\u8bbe\u7f6e\u3002 \u5b89\u88c5\u540e\u505a\u7684\u7b2c\u4e00\u4ef6\u4e8b\u662f\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u7535\u5b50\u90ae\u4ef6\uff1a user.name \u548c user.email \u3002 core.editor \u7f16\u8f91\u5668 git config --list \u5217\u51fa Git \u627e\u5230\u7684\u6240\u6709\u53d8\u91cf\u3002\u91cd\u590d\u51fa\u73b0\u7684\u503c\u4f1a\u4f7f\u7528\u6700\u540e\u4e00\u4e2a\u3002 git config \u67e5\u770b\u67d0\u4e2a\u952e\u7684\u503c\u3002 \u83b7\u53d6\u5e2e\u52a9 \u00b6 git help git --help man git- Ch2. Git \u57fa\u7840 \u00b6","title":"\u7cbe\u901a Git"},{"location":"books/ProGit/#git","text":"ProGit \u8bfb\u4e66\u7b14\u8bb0","title":"\u7cbe\u901a Git"},{"location":"books/ProGit/#ch1","text":"Abstract Git \u662f\u4ec0\u4e48\uff1f Git \u7531 Linux \u793e\u533a\u5f00\u53d1\uff0c\u80fd\u6709\u6548\u5730\u5904\u7406 Linux \u5185\u6838\u8fd9\u6837\u7684\u5927\u578b\u9879\u76ee\u3002 Git \u5c06\u6570\u636e\u4f5c\u4e3a\u4e00\u4e2a \u5feb\u7167\u6d41 \u3002\u540e\u7eed\u7ae0\u8282\u4f1a\u8bb2\u89e3\u5feb\u7167\u6d41\u7684\u4f18\u52bf\u3002 Git \u7684\u5927\u90e8\u5206\u64cd\u4f5c\u5728\u672c\u5730\u8fdb\u884c\uff0c\u4f7f\u7528 SHA-1 \u6563\u5217\uff0840 \u4e2a\u5341\u516d\u8fdb\u5236\u5b57\u7b26\uff09\u6821\u9a8c\u6587\u4ef6\u3002 Git \u7684\u5927\u90e8\u5206\u64cd\u4f5c\u53ea\u589e\u52a0\u6570\u636e \u3002","title":"Ch1. \u5165\u95e8"},{"location":"books/ProGit/#ch2-git","text":"","title":"Ch2. Git \u57fa\u7840"},{"location":"books/SFJSRMJD/","text":"\u7b97\u6cd5\u7ade\u8d5b\u5165\u95e8\u7ecf\u5178 \u00b6 Ch4. \u9012\u5f52 \u00b6 \u6bb5\u9519\u8bef\u4e0e\u6808\u6ea2\u51fa \u00b6 \u53ef\u6267\u884c\u6587\u4ef6\u7684\u683c\u5f0f \u7cfb\u7edf \u683c\u5f0f Unix ELF DOS COFF Windows PE \u201c\u6bb5\u201d \u662f\u4e8c\u8fdb\u5236\u6587\u4ef6\u5185\u7684\u533a\u57df\uff0c\u67d0\u79cd\u7279\u5b9a\u7684\u4fe1\u606f\u88ab\u4fdd\u5b58\u5728\u91cc\u9762\u3002\u7528 size \u5de5\u5177\u53ef\u4ee5\u5f97\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u5404\u4e2a\u6bb5\u7684\u5927\u5c0f\uff1a $ size test text data bss dec hex filename 1934 616 8 2558 9fe test \u5176\u4e2d\uff1a Text Segment\uff1a\u6b63\u6587\u6bb5\uff0c\u5b58\u50a8\u6307\u4ee4 Data Segment\uff1a\u6570\u636e\u6bb5\uff0c\u5df2\u521d\u59cb\u5316\u7684\u5168\u5c40\u53d8\u91cf BSS Segment\uff1aBSS \u6bb5\uff0c\u672a\u8d4b\u503c\u7684\u5168\u5c40\u53d8\u91cf\u7684\u7a7a\u95f4 \u8c03\u7528\u6808\u4f4d\u4e8e \u5806\u6808\u6bb5\uff08Stack Segment\uff09 \uff0c\u5728\u8fd0\u884c\u65f6\u521b\u5efa\uff0c\u4e5f\u6709\u81ea\u5df1\u7684\u5927\u5c0f\uff0c\u4e0d\u80fd\u8d8a\u754c\u8bbf\u95ee\u3002\u8d8a\u754c\u9020\u6210 \u6bb5\u9519\u8bef\uff08Segmentation Fault\uff09 \u3002\u6bcf\u6b21\u9012\u5f52\u8c03\u7528\u6dfb\u52a0\u6808\u5e27\uff0c\u9020\u6210\u7684\u8d8a\u754c\u79f0\u4e3a \u6808\u6ea2\u51fa\uff08Stack Overflow\uff09 \u3002 \u5806\u6808\u6bb5\u4e2d\u4fdd\u5b58\u7740 \u51fd\u6570\u8c03\u7528\u5173\u7cfb\u548c\u5c40\u90e8\u53d8\u91cf \u3002\u5c40\u90e8\u53d8\u91cf\u8fc7\u5927\u4e5f\u53ef\u80fd\u9020\u6210\u6808\u6ea2\u51fa\u3002 \u6808\u7684\u5927\u5c0f\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u76f8\u5173\uff1a Linux \u4e2d\uff0c\u4f7f\u7528 ulimit \u547d\u4ee4\u6307\u5b9a\u3002 ulimit -a \u663e\u793a\u6808\u5927\u5c0f\u3002 Windows \u4e2d\uff0c\u6808\u5927\u5c0f\u50a8\u5b58\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002 gcc -W1,--stack=16777216 \u5c06\u6808\u5927\u5c0f\u8bbe\u7f6e\u4e3a 16 MB\u3002 > \u6808\u5927\u5c0f\u7531 ld \u6307\u5b9a\uff0c -W1 \u5c06\u5176\u540e\u7684\u53c2\u6570\u4f20\u9012\u7ed9 ld \u3002","title":"\u7b97\u6cd5\u7ade\u8d5b\u5165\u95e8\u7ecf\u5178"},{"location":"books/SFJSRMJD/#_1","text":"","title":"\u7b97\u6cd5\u7ade\u8d5b\u5165\u95e8\u7ecf\u5178"},{"location":"books/SFJSRMJD/#ch4","text":"","title":"Ch4. \u9012\u5f52"},{"location":"books/Archive/SOP4/","text":"Python \u7a0b\u5e8f\u8bbe\u8ba1\u57fa\u7840\uff08\u7b2c\u56db\u7248\uff09 \u00b6 Start Out with Python (Forth Edition) \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e Tony Gaddis 2019 \u7b80\u8bc4 \u5728\u6211\u770b\u6765\uff0c\u8fd9\u662f\u5bf9\u65b0\u624b\u5341\u5206\u53cb\u597d\u7684\u4e00\u672c\u4e66\u3002\u4e66\u4e2d\u5bf9\u6982\u5ff5\u7684\u8bb2\u89e3\u57fa\u7840\u4e14\u8be6\u7ec6\uff08\u4f46\u5bf9\u4e8e\u5bf9\u7f16\u7a0b\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u540c\u5b66\u6765\u8bf4\u4f1a\u6709\u4e9b\u7e41\u7410\uff09\uff0c\u6bcf\u8282\u540e\u4f1a\u6709 \u68c0\u67e5\u70b9 \u6a21\u5757\u95ee\u4f60\u4e00\u4e9b\u57fa\u7840\u7684\u6982\u5ff5\uff0c\u786e\u4fdd\u4f60\u638c\u63e1\u4e86\u91cd\u8981\u7684\u77e5\u8bc6\u3002\u7a7f\u63d2\u5728\u6587\u4e2d\u7684 \u805a\u5149\u706f \u6a21\u5757\u5bf9\u4e8e\u6bcf\u5757\u77e5\u8bc6\u70b9\uff0c\u7ed9\u51fa\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u4ece\u76ee\u6807\u5230\u8bbe\u8ba1\u5230\u5b9e\u73b0\u7684\u5b8c\u6574\u8fc7\u7a0b\u3002\u8fd9\u8ba9\u6211\u4eec\u53ef\u4ee5\u5f88\u597d\u5730\u89c2\u5bdf\u4ee3\u7801\u7ec6\u8282\uff0c\u4e0d\u65ad\u5de9\u56fa\u77e5\u8bc6\u3002\uff08\u4f46\u8fd9\u53ef\u80fd\u4e5f\u662f\u8ba9\u4eba\u6bd4\u8f83\u70e6\u7684\u4e00\u70b9\uff1a\u5b83\u7684\u4f8b\u7a0b\u51e0\u4e4e\u6bcf\u4e00\u884c\u90fd\u6709\u6ce8\u91ca\uff01Python \u8bed\u8a00\u7684\u4ee3\u7801\u672c\u8eab\u53ef\u8bfb\u6027\u5c31\u975e\u5e38\u9ad8\uff0c\u5e76\u4e0d\u9700\u8981\u592a\u591a\u6ce8\u91ca\u3002\uff09 \u672c\u4e66\u5bf9\u57fa\u7840\u77e5\u8bc6\u7684\u7f16\u6392\u6bd4\u300a Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5 \u300b\u8981\u597d\u4e00\u4e9b\uff0c\u4f46\u63d0\u4f9b\u7684\u9879\u76ee\u5b9e\u8df5\u4e0d\u8db3\u3002\u5728\u9605\u8bfb\u5b8c\u672c\u4e66\u540e\uff0c\u5efa\u8bae\u79fb\u6b65\u5230\u300aPython \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\u300b\u7684\u9879\u76ee\u90e8\u5206\u5f00\u59cb\u9605\u8bfb\u3002 \u672c\u4e66\u53d9\u8ff0\u5f88\u8be6\u7ec6\uff0c\u56e0\u6b64\u7ae0\u672b\u4e60\u9898\u53ef\u4ee5\u4e0d\u505a\u3002\u5fc5\u987b\u8981\u505a\u7684\u662f\u6bcf\u4e2a\u5c0f\u8282\u540e\u7684 \u68c0\u67e5\u70b9 \uff0c\u8fd9\u662f\u5bf9\u672c\u8282\u77e5\u8bc6\u7684\u4e00\u4e2a\u68c0\u9a8c\uff0c\u4e5f\u662f\u5bf9\u4e0b\u4e00\u8282\u77e5\u8bc6\u7684\u4e00\u4e2a\u94fa\u57ab\u3002\u805a\u5149\u706f\u7684\u4f8b\u7a0b\u90fd\u8981\u770b\u8fc7\u4e00\u904d\uff08\u4e0d\u7528\u5f88\u7ec6\uff09\uff0c\u5176\u4e2d\u6709\u7591\u95ee\u7684\u5730\u65b9\u8981\u81ea\u5df1\u52a8\u624b\u5199\u4ee3\u7801\u8bd5\u4e00\u8bd5\u3002 \u5b9e\u8df5\u975e\u5e38\u91cd\u8981 \u3002 Ch1. \u8ba1\u7b97\u673a\u4e0e\u7f16\u7a0b \u00b6 \u89e3\u91ca\u5668\u4e0e\u7f16\u8bd1\u5668\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f Python \u89e3\u91ca\u5668\u7684\u4e24\u79cd\u5de5\u4f5c\u6a21\u5f0f\uff1a\u4ea4\u4e92\u6a21\u5f0f\u548c\u811a\u672c\u6a21\u5f0f IDLE \u7684\u7b80\u5355\u4f7f\u7528\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u7f16\u5199\u7a0b\u5e8f\u3001\u81ea\u52a8\u7f29\u8fdb\u3001\u8fd0\u884c\u7b49\u3002 Ch2. \u8f93\u5165\u3001\u5904\u7406\u4e0e\u8f93\u51fa \u00b6 \u8bbe\u8ba1\u4e00\u4e2a\u7a0b\u5e8f \u00b6 \u8bbe\u8ba1\u7a0b\u5e8f \u4efb\u4f55\u4e00\u4e2a\u804c\u4e1a\u7684\u7a0b\u5e8f\u5458\u90fd\u4f1a\u544a\u8bc9\u4f60\uff1a\u5728\u6b63\u5f0f\u7f16\u5199\u4ee3\u7801\u524d\uff0c\u8981\u5bf9\u7a0b\u5e8f\u8fdb\u884c\u7cbe\u5fc3\u7684\u8bbe\u8ba1\u3002\u5728\u542f\u52a8\u4e00\u4e2a\u65b0\u9879\u76ee\u65f6\uff0c\u7a0b\u5e8f\u5458\u7edd\u4e0d\u4f1a\u9a6c\u4e0a\u9677\u5165\u7ec6\u8282\uff0c\u628a\u5f00\u59cb\u7f16\u5199\u4ee3\u7801\u4f5c\u4e3a\u7b2c\u4e00\u6b65\u3002\u4ed6\u4eec\u4f1a\u6309\u90e8\u5c31\u73ed\u5730\u4ece\u7a0b\u5e8f\u8bbe\u8ba1\u5f00\u59cb\u3002 \u91cd\u70b9\u8bb2\u89e3\u4e86\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4e24\u4e2a\u6b65\u9aa4\uff1a\u7406\u89e3\u4efb\u52a1\u3001\u51b3\u5b9a\u6b65\u9aa4 \u4f2a\u4ee3\u7801\u548c\u6d41\u7a0b\u56fe \u7b80\u5355\u6d41\u7a0b\u56fe\u4e2d\u7684\u4e09\u7c7b\u5143\u7d20\uff1a\u692d\u5706\uff08\u7ec8\u6b62\u7b26\uff09\u3001\u5e73\u884c\u56db\u8fb9\u5f62\uff08\u8f93\u5165\u8f93\u51fa\uff09\u3001\u77e9\u5f62\uff08\u5904\u7406\uff09 \u8f93\u51fa \u00b6 print() \u683c\u5f0f\u5316\u8f93\u51fa\u7684\u4e00\u4e9b\u6280\u672f\uff1a print('one', end='') \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u6253\u5370\u4f1a\u4ee5\u6362\u884c\u7b26\u7ed3\u5c3e\uff0c end \u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u672b\u5c3e\u3002 sep= \u6307\u5b9a\u8f93\u51fa\u5404\u9879\u4e4b\u95f4\u7684\u5206\u9694\u7b26\uff0c \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u7a7a\u683c \u3002 \u5d4c\u5957\u4f7f\u7528 format() \u51fd\u6570\u53ef\u4ee5\u5b9e\u73b0\u66f4\u591a\u7684\u683c\u5f0f\u5316\uff0c\u4f20\u9012\u7ed9\u5b83\u7684\u53c2\u6570\u79f0\u4e3a\u683c\u5f0f\u9650\u5b9a\u7b26\u3002 print('Your pay is$', format(1123.23, '12,.2f'), sep='') \u6700\u524d\u9762\u7684\u6570\u5b57\u662f\u57df\u5bbd\uff08\u53f3\u5bf9\u9f50\uff09\uff0c .2 \u7cbe\u5ea6\uff0c f \u6d6e\u70b9\u6570\u7c7b\u578b\uff0c d \u6574\u6570\uff0c e \u79d1\u5b66\u8ba1\u6570\u6cd5\uff0c , \u9017\u53f7\u5206\u9694\u6570\u5b57\uff0c % \u8f93\u51fa\u4e3a\u767e\u5206\u6bd4\u5f62\u5f0f\u3002 \u5b57\u7b26\u4e32 \u00b6 \u53ef\u4ee5\u7528 ' \u6216 \" \u62ec\u8d77 \u5b57\u7b26\u4e32\u4e2d\u542b\u6709\u5355\u5f15\u53f7\u6216\u6487\u53f7\u65f6\uff0c\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\uff1b\u542b\u6709\u53cc\u5f15\u53f7\u65f6\uff0c\u7528\u5355\u5f15\u53f7\u62ec\u8d77 \u4e09\u5f15\u53f7 \"\"\" \u6216 ' \u53ef\u4ee5\u62ec\u8d77\u4e0a\u8ff0\u4e24\u79cd\u6587\u672c\uff0c\u5e76\u53ef\u4ee5\u62ec\u8d77\u8de8\u884c\u7684\u5b57\u7b26\u4e32\uff08\u6362\u884c\u7b26\u88ab\u5305\u62ec\u8fdb\u6765\uff09 + \u5b57\u7b26\u4e32\u62fc\u63a5\u64cd\u4f5c Python \u4e2d\u7684\u5b57\u7b26\u4e32\u540c\u6837\u6709\u4e00\u4e9b\u8f6c\u4e49\u5e8f\u5217 \u53d8\u91cf \u00b6 \u201c\u5f15\u7528\u201d\u6982\u5ff5 \u53d8\u91cf\u547d\u540d\u89c4\u5219 == \u4e0b\u5212\u7ebf\u5206\u9694 ==\u7684\u547d\u540d\u6cd5\u5728 Python \u4e2d\u6bd4\u8f83\u5e38\u89c1 Python \u5173\u952e\u5b57 \u7c7b\u578b \u00b6 int \u548c float \u7c7b\u578b \u4f7f\u7528\u51fd\u6570 type() \u5224\u65ad\u53d8\u91cf\u7684\u7c7b\u578b str \u7c7b\u578b Python \u4e2d\u7684\u53d8\u91cf \u53ef\u4ee5\u5f15\u7528\u4efb\u4f55\u7c7b\u578b\u7684\u6570\u636e \uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u53ef\u4ee5\u7528\u5176\u4ed6\u7c7b\u578b\u7684\u6570\u636e\u9879\u91cd\u65b0\u8d4b\u503c \u8bfb\u53d6\u8f93\u5165 \u00b6 input(prompt) \u8fd4\u56de\u5b57\u7b26\u4e32\u5f62\u5f0f int() \u3001 float() \u4e0e input() \u5d4c\u5957\u8c03\u7528 \u5f02\u5e38\uff1a\u5982\u679c\u5f02\u5e38\u6ca1\u6709\u5f97\u5230\u6b63\u786e\u7684\u5904\u7406\uff0c\u8fd9\u4e2a\u610f\u5916\u5c06\u5bfc\u81f4\u7a0b\u5e8f\u7ec8\u6b62\u3002 \u8ba1\u7b97 \u00b6 // \u6574\u6570\u9664\u6cd5\uff1a\u4f9d\u636e\u7ed3\u679c\u6709\u4e0d\u540c\u7684\u820d\u5165\u65b9\u5f0f \u6b63\u6570\uff1a\u622a\u65ad \u8d1f\u6570\uff1a\u56db\u820d\u4e94\u5165 ** \u6307\u6570\u8fd0\u7b97 \u4f18\u5148\u7ea7 \u4f8b\u5916 \u6307\u6570\u8fd0\u7b97\u5171\u4eab\u64cd\u4f5c\u6570\u65f6\uff0c\u5e94\u5f53\u7406\u89e3\u4e3a\u4ece\u53f3\u5411\u5de6\uff0c\u5373\uff1a 2**3**4 = 2**(3**4) \u3002 \u6570\u636e\u7c7b\u578b\u8f6c\u6362 \u5728\u6df7\u5408\u7c7b\u578b\u8868\u8fbe\u5f0f\u4e2d\u53d1\u751f\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362 \u6574\u578b\u5347\u7ea7\u4e3a\u6d6e\u70b9\u578b \u53ef\u4ee5\u4f7f\u7528\u524d\u9762\u4ecb\u7ecd\u7684\u51fd\u6570\u5b9e\u73b0\u5f3a\u5236\u8f6c\u6362\u3002 int() \u622a\u65ad \u5176\u4ed6 \u00b6 # \u6ce8\u91ca \\ \u884c\u8fde\u63a5\u7b26 \u5706\u62ec\u53f7\u5185\u7684\u8bed\u53e5\u7247\u6bb5\uff0c\u65e0\u9700\u884c\u8fde\u63a5\u7b26 \u6709\u540d\u5e38\u91cf \u00b6 \u5e7b\u6570\uff08magic number\uff09\uff1a\u7a0b\u5e8f\u4ee3\u7801\u4e2d\u51fa\u73b0\u7684\u65e0\u6cd5\u89e3\u91ca\u7684\u6570\u503c\u3002 \u4f7f\u7528\u6709\u540d\u5e38\u91cf\u66ff\u4ee3\u5e7b\u6570 \uff0c\u589e\u5f3a\u7a0b\u5e8f\u7684\u81ea\u89e3\u91ca\u6027\uff08self-explanatory\uff09\u3002 \u673a\u5668\u9f9f\u56fe\u5f62\u5e93 \u00b6 ModuleNotFoundError: No module named 'tkinter' \u5728 WSL \u4e0a import turtle \u65f6\u53ef\u80fd\u51fa\u73b0\u5982\u4e0a\u62a5\u9519\u3002\u9700\u8981\u989d\u5916\u5b89\u88c5 tkinter \u5e93\uff1a apt-get install python3-tk turtle.showturtle() forward() , right() , left() , setheading() , heading() penup() , pendown() dot() , circle() \u503c\u5f97\u6ce8\u610f\u7684\u662f\u9f9f\u9f9f\u4f4d\u4e8e\u5706\u7684\u5207\u7ebf\u65b9\u5411\uff0c\u800c\u4e0d\u662f\u5706\u5fc3\u3002 pensize() , pencolor() , bgcolor() \u91cd\u8bbe\u5c4f\u5e55\uff1a reset() \u91cd\u7f6e\u753b\u7b14\u989c\u8272\u3001\u5f52\u4f4d\u3001\u64e6\u9664\u6240\u6709\u56fe\u5f62\u3002\u4e0d\u6539\u53d8\u80cc\u666f\u3002 clear() \u64e6\u9664\u6240\u6709\u56fe\u5f62\u3002 clearscreen() \u91cd\u7f6e\u3001\u5f52\u4e3a\u3001\u91cd\u7f6e\u80cc\u666f\u3002 \u672c\u8282\u7684\u5269\u4f59\u90e8\u5206\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u9f9f\u9f9f\u753b\u56fe\u7684\u5404\u79cd\u529f\u80fd\uff0c\u6b64\u5904\u7565\u8fc7\u3002 Ch3. \u9009\u62e9\u7ed3\u6784\u4e0e\u5e03\u5c14\u903b\u8f91 \u00b6 if \u8bed\u53e5 \u00b6 \u57fa\u672c\u5f62\u5f0f\u5982\u4e0b\uff1a if condition : block of statement elif condition : block of statement else : block of statement \u7f29\u8fdb Python \u89e3\u91ca\u5668\u901a\u8fc7\u7f29\u8fdb\u6765\u8bc6\u522b\u8bed\u53e5\u5757\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u3002 True \u548c False True \u548c False \u662f Python \u4e2d\u7684\u5173\u952e\u5b57\u3002 \u5e03\u5c14\u8868\u8fbe\u5f0f \u00b6 bool \u6570\u636e\u7c7b\u578b\u3002 \u5173\u7cfb\u8fd0\u7b97\u7b26 \u4e0e C \u4e2d\u76f8\u540c \u5b57\u7b26\u4e32\u53ef\u4ee5\u76f4\u63a5\u6bd4\u8f83 \uff0c\u6bd4\u8f83\u539f\u7406\u4e0e C \u4e2d\u7684 strcmp \u7c7b\u4f3c\u3002 ASCII \u7f16\u7801 \u518d\u56de\u5fc6\u4e00\u4e0b\u91cd\u8981\u7684 ASCII \u7801 \u5b57\u7b26 \u7801\u4f4d A~Z 65~90 a~z 97~122 0~9 48~57 space 32 Python \u4e2d\u7684 \u903b\u8f91\u8fd0\u7b97\u7b26 \u662f\uff1a and \u3001 or \u3001 not \u3002\u5b83\u4eec\u540c\u6837\u652f\u6301\u77ed\u8def\u5b9a\u503c\uff08Short-Circuit Evaluation\uff09\u3002 \u673a\u5668\u9f9f\u6e38\u620f \u00b6 3.7 \u8282\u4ecb\u7ecd\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u673a\u5668\u9f9f\u6295\u7403\u6e38\u620f\u3002\u6b64\u5904\u7565\u8fc7\u3002 Ch4. \u5faa\u73af\u7ed3\u6784 \u00b6 while \u5faa\u73af \u00b6 for \u5faa\u73af \u00b6 Python \u4e2d\u7684 for \u5faa\u73af\u7528\u4e8e\u9488\u5bf9\u4e00\u7ec4\u6570\u636e\u8fed\u4ee3\u5904\u7406\u3002 for variable in [ value1 , value2 , etc . ]: statment \u8fed\u4ee3\u5668 range() \u00b6 \u8be5\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u79f0\u4e3a iterable \u7684\u5bf9\u8c61\u7c7b\u578b\u3002 range ( start , end , step ) range ( end ) # \u4ece 0 \u5f00\u59cb \u521b\u5efa\u7684\u8fed\u4ee3\u5217\u8868\u662f\u5de6\u95ed\u53f3\u5f00\u7684\u3002 \u8003\u8003\u4f60 \u4f7f\u7528 range() \u51fd\u6570\u5b9e\u73b0\u4ee5\u4e0b\u529f\u80fd\uff1a \u7528\u6237\u63a7\u5236\u7684\u5faa\u73af\u6b21\u6570 \u964d\u5e8f\u8fed\u4ee3 \u5faa\u73af\u529f\u80fd \u00b6 \u672c\u7ae0\u7684\u5269\u4f59\u90e8\u5206\u8bb2\u8ff0\u4e86\u4e00\u4e9b\u5faa\u73af\u7f16\u7a0b\u6a21\u5f0f\uff1a \u7f16\u5199\u7d2f\u52a0\u5668 \u5e26\u53c2\u6570\u7684\u8d4b\u503c\u8fd0\u7b97\u7b26\uff08augmented assignment operator\uff09 \u4f7f\u7528\u6807\u8bb0\uff08Sentinel\uff0c\u4e00\u4e2a\u6807\u8bb0\u6570\u636e\u5e8f\u5217\u7ed3\u5c3e\u7684\u7279\u6b8a\u503c\uff09\u6765\u63a7\u5236\u5faa\u73af\u7ed3\u675f \u9a8c\u8bc1\u8f93\u5165\u7684\u5faa\u73af \u542f\u52a8\u8bfb\uff08priming read\uff09 \u5d4c\u5957\u5faa\u73af \u4f7f\u7528\u5faa\u73af\u7684\u673a\u5668\u9f9f\u7ed8\u56fe\u8bbe\u8ba1\uff08\u7565\uff09 Ch5. \u51fd\u6570 \u00b6 \u672c\u7ae0\u5148\u4ecb\u7ecd void \u51fd\u6570\uff0c\u518d\u4ecb\u7ecd\u6709\u8fd4\u56de\u503c\u7684\u51fd\u6570\u3002 \u51fd\u6570\u547d\u540d\u4e0e\u53d8\u91cf\u547d\u540d\u89c4\u5219\u76f8\u540c\u3002 \u51fd\u6570\u7684\u5b9a\u4e49\u548c\u8c03\u7528 \u00b6 def function_name (): statement function_name () \u7a0b\u5e8f\u542f\u52a8\u65f6\u4f1a\u8c03\u7528 main \u51fd\u6570\u3002 \u89e3\u91ca\u5668\u8bfb\u53d6 def \u8bed\u53e5\u65f6\uff0c\u5728\u5185\u5b58\u4e2d\u521b\u5efa\u4e00\u4e2a\u51fd\u6570\uff0c\u5728\u8c03\u7528\u8bed\u53e5\u5904\u6267\u884c\u8be5\u51fd\u6570\u3002 Python \u4e2d\u7684\u7f29\u8fdb Python \u7a0b\u5e8f\u5458\u4e60\u60ef\u4f7f\u7528\u56db\u4e2a\u7a7a\u683c\u7f29\u8fdb\u8bed\u53e5\u5757\u4e2d\u7684\u4ee3\u7801\u884c\u3002 \u53ea\u8981\u8bed\u53e5\u5757\u4e2d\u6240\u6709\u884c\u90fd\u7f29\u8fdb\u76f8\u540c\u7684\u6570\u91cf\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4efb\u610f\u6570\u91cf\u7684\u7a7a\u683c\u3002 Tab \u952e\u4e5f\u53ef\u4ee5\uff0c\u4f46\u4e0d\u8981\u4e0e\u7a7a\u683c\u6df7\u7528\u3002 Tip \u8bed\u53e5\u5757\u4e2d\u7684\u7a7a\u767d\u884c\u4f1a\u88ab\u5ffd\u7565\u3002 \u51fd\u6570\u8c03\u7528\u7684\u53c2\u6570 \u6309\u503c\u4f20\u9012 \u3002 \u4f7f\u7528\u51fd\u6570\u8bbe\u8ba1\u7a0b\u5e8f \u00b6 \u4e00\u822c\u9075\u4ece\u81ea\u9876\u5411\u4e0b\u7684\u8bbe\u8ba1\u65b9\u6cd5\u3002 \u6d41\u7a0b\u56fe\uff1a\u51fd\u6570\u8c03\u7528\u56fe\u793a || funciton || \u3002 \u5c42\u6b21\u56fe\uff1a\u63cf\u8ff0\u51fd\u6570\u95f4\u7684\u5173\u7cfb\u3002 Tip \u591a\u4f7f\u7528\u4e0a\u9762\u7684\u4e24\u79cd\u56fe\u6765\u601d\u8003\u81ea\u5df1\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u3002 \u53d8\u91cf\u548c\u4f5c\u7528\u57df \u00b6 \u4e0e C \u7c7b\u4f3c\uff0c\u5c40\u90e8\u53d8\u91cf\u5728\u51fd\u6570\u5185\u521b\u5efa\uff0c\u4e0d\u80fd\u88ab\u5176\u4ed6\u51fd\u6570\u8bbf\u95ee\u3002 \u663e\u7136\uff0c\u4e0d\u540c\u51fd\u6570\u53ef\u4ee5\u6709\u540c\u540d\u7684\u5c40\u90e8\u53d8\u91cf\u3002 Python \u5141\u8bb8\u6307\u5b9a\u5b9e\u53c2\u4f20\u9012\u7ed9\u5bf9\u5e94\u7684\u5f62\u53c2\uff0c\u79f0\u4e3a \u5173\u952e\u5b57\u53c2\u6570 \uff1a parameter_name = value \u6df7\u5408\u4f7f\u7528\u5173\u952e\u5b57\u53c2\u6570\uff08keyword argument\uff09\u548c\u4f4d\u7f6e\u53c2\u6570\uff08position argument\uff09\u65f6\uff0c\u4f4d\u7f6e\u53c2\u6570\u5fc5\u987b\u5148\u51fa\u73b0\u3002 \u5168\u5c40\u53d8\u91cf \u00b6 \u4e0d\u5e94\u8be5\u4f7f\u7528\u5168\u5c40\u53d8\u91cf \u5927\u591a\u6570\u7a0b\u5e8f\u5458\u90fd\u8ba4\u4e3a\u5e94\u8be5\u9650\u5236\u4f7f\u7528\u5168\u5c40\u53d8\u91cf \u5728\u51fd\u6570\u5185\u90e8 \u4e3a\u5168\u5c40\u53d8\u91cf\u8d4b\u503c \uff0c\u5e94\u5f53\u7528 global \u5173\u952e\u5b57\u58f0\u660e\u8fd9\u4e2a\u53d8\u91cf\u662f\u5168\u5c40\u53d8\u91cf\u3002 \u4f7f\u7528\u65f6\u5219\u4e0d\u9700\u8981\u3002 \u8d4b\u503c\u8bed\u53e5\u7684\u601d\u8003 \u4ece\u8fd9\u70b9\u53ef\u4ee5\u770b\u51fa\uff0cPython \u7684\u8d4b\u503c\u8bed\u53e5\u540c\u65f6\u5177\u5907\u4e86\u521b\u5efa\u53d8\u91cf\u7684\u529f\u80fd\u3002 number = 0 def main (): global number number = int ( input ()) Python \u4e2d\u6ca1\u6709\u5168\u5c40\u5e38\u91cf\u4e00\u8bf4\uff0c\u4f46\u53ef\u4ee5\u7528\u5168\u5c40\u53d8\u91cf\u6a21\u62df\u3002\u5728\u51fd\u6570\u4e2d\u4e0d\u7528 global \u58f0\u660e\uff0c\u5c31\u4e0d\u80fd\u66f4\u6539\u8be5\u5168\u5c40\u53d8\u91cf\u7684\u503c\u3002 import \u548c\u6807\u51c6\u5e93\u51fd\u6570 \u00b6 \u4f7f\u7528\u6807\u51c6\u5e93\u51fd\u6570 \u00b6 \u4e00\u4e9b\u5e93\u51fd\u6570\u5185\u7f6e\u5728 Python \u89e3\u91ca\u5668\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u5982 print \u3001 input \u3001 range \u7b49\u3002\u8bb8\u591a\u5e93\u51fd\u6570\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\uff0c\u79f0\u4e3a \u6a21\u5757\uff08module\uff09 \uff0c\u5728\u5b89\u88c5 Python \u65f6\u62f7\u8d1d\u5230\u8ba1\u7b97\u673a\u4e0a\u3002 \u4f7f\u7528\u6a21\u5757\u4e2d\u7684\u51fd\u6570\uff0c\u9700\u8981\u7528 import \u8bed\u53e5\u5bfc\u5165\u6a21\u5757\uff0c\u5e76\u7528 module.function() \u8c03\u7528\u51fd\u6570\u3002 import random random . randint () \u968f\u673a\u6570\u5e93\u51fd\u6570 \u00b6 random \u5e93\u4e2d\u6709\u4e00\u4e9b\u51fd\u6570\uff1a randint(start, end) \u4ea7\u751f\u95ed\u533a\u95f4\u5185\u7684\u968f\u673a\u6574\u6570 randrange(start, end, step) \u548c range() \u7684\u53c2\u6570\u4e00\u81f4\uff0c\u8fd4\u56de\u5217\u8868\u4e2d\u7684\u968f\u673a\u6574\u6570 random() \u4ea7\u751f 0.0 \u5230 1.0 \uff08\u4e0d\u5305\u62ec\uff09\u7684\u968f\u673a\u6d6e\u70b9\u6570 uniform(start, end) \u8303\u56f4\u5185\u968f\u673a\u6d6e\u70b9\u6570 random \u5e93\u751f\u6210\u7684\u4e5f\u662f\u4f2a\u968f\u673a\u6570\u3002\u5bfc\u5165 random \u5e93\u65f6\uff0c\u5b83\u83b7\u53d6\u7cfb\u7edf\u65f6\u949f\u5e76\u5c06\u5176\u4f5c\u4e3a\u79cd\u5b50\u503c\u3002 \u5b89\u5168\u4e0a\u7684\u63d0\u793a \u7cfb\u7edf\u65f6\u949f\u7684\u7cbe\u786e\u5ea6\u4e00\u822c\u4e3a 0.01 \u79d2 \u3002 \u4f7f\u7528 seed() \u53ef\u4ee5\u8bbe\u7f6e\u79cd\u5b50\u503c\uff0c\u8fd9\u6837\u5c31\u80fd\u5236\u9020\u76f8\u540c\u7684\u968f\u673a\u6570\u5e8f\u5217\u3002 \u7f16\u5199\u6709\u8fd4\u56de\u503c\u7684\u51fd\u6570 \u00b6 \u53ea\u9700\u8981\u7528 return \u8bed\u53e5\u5c06\u503c\u8fd4\u56de\u5230\u8c03\u7528\u8005\u5373\u53ef\u3002 \u672c\u8282\u8fd8\u4ecb\u7ecd\u4e86\u4f7f\u7528 IPO \u56fe \u6765\u63cf\u8ff0\u51fd\u6570\u7684\u8f93\u5165\u3001\u5904\u7406\u548c\u8f93\u51fa\u3002 \u5728 Python \u4e2d\uff0c\u51fd\u6570\u53ef\u4ee5\u8fd4\u56de\u591a\u4e2a\u503c\u3002\u5728\u8d4b\u503c\u8bed\u53e5\u4e2d\u8c03\u7528\u65f6\uff0c\u9700\u8981\u5728\u7b49\u53f7\u53f3\u8fb9\u653e\u7f6e\u5bf9\u5e94\u6570\u91cf\u7684\u53d8\u91cf\u3002 def multi_ret ( val1 , val2 ): return val1 , val2 a , b = multiret ( c , d ) math \u5e93 \u00b6 \u9664\u4e86\u548c C \u5e93\u7c7b\u4f3c\u7684\u4e00\u4e9b\u51fd\u6570\uff0c\u8fd8\u6709\uff1a ceil() degrees() , radians() exp() floor() hypot(x, y) log10() \u5e38\u91cf\uff1a math.pi math.e \u6a21\u5757\u5316\u7f16\u7a0b \u00b6 \u53ef\u4ee5\u7f16\u5199\u81ea\u5df1\u7684\u6a21\u5757\u3002Python \u89e3\u91ca\u5668\u4f1a\u5c1d\u8bd5\u5728\u5f53\u524d\u6587\u4ef6\u5939\u548c\u9884\u5b9a\u4e49\u7684\u8def\u5f84\u67e5\u627e\u6a21\u5757\u3002 \u673a\u5668\u9f9f\u6765\u54af\uff01 \u00b6 \u672c\u8282\u4f7f\u7528\u6a21\u5757\u5316\u65b9\u6cd5\u5199\u4e86\u4e00\u4e9b\u673a\u5668\u9f9f\u7a0b\u5e8f\uff0c\u7565\u8fc7\u3002 Ch6. \u6587\u4ef6\u548c\u5f02\u5e38 \u00b6 \u6587\u4ef6\u7b80\u4ecb \u00b6 Python \u5141\u8bb8\u5904\u7406 \u6587\u672c\u6587\u4ef6 \u548c \u4e8c\u8fdb\u5236\u6587\u4ef6 \uff0c\u672c\u4e66\u53ea\u8bb2\u89e3\u6587\u672c\u6587\u4ef6\u3002Python \u540c\u6837\u63d0\u4f9b \u987a\u5e8f\u5b58\u53d6 \u548c \u968f\u673a\u5b58\u53d6 \uff08\u76f4\u63a5\u5b58\u53d6\uff09\u7684\u6587\u4ef6\u8bbf\u95ee\u65b9\u6cd5\uff0c\u672c\u4e66\u53ea\u8bb2\u89e3\u987a\u5e8f\u5b58\u53d6\u3002 \u6587\u4ef6\u5bf9\u8c61\u7684\u6982\u5ff5 \u6587\u4ef6\u5bf9\u8c61\u662f\u4e0e\u7279\u5b9a\u6587\u4ef6\u76f8\u5173\u8054\u7684\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5e76\u4e3a\u7a0b\u5e8f\u63d0\u4f9b\u4f7f\u7528\u8be5\u6587\u4ef6\u7684\u65b9\u6cd5\u3002Python \u53d8\u91cf\u53ef\u4ee5\u5f15\u7528\u4e00\u4e2a\u6587\u4ef6\u5bf9\u8c61\u3002 open(filename, mode) \u51fd\u6570 \u8be5\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u6587\u4ef6\u5bf9\u8c61\u3002 \u672c\u4e66\u53ea\u4ecb\u7ecd\u4e09\u79cd\u7b80\u5355\u7684\u6a21\u5f0f\uff1a r , w , a \uff0c\u8fd9\u4e9b\u6a21\u5f0f\u4e0e C \u7c7b\u4f3c\u3002 \u5982\u679c\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\u6307\u5b9a\u6587\u4ef6\u8def\u5f84\uff0c\u7279\u522b\u662f Windows \u7cfb\u7edf\u4e0a\uff0c\u5e94\u5f53\u5728\u5b57\u7b26\u4e32\u524d\u52a0\u4e0a r \uff1a test_file = open ( r 'C:\\User\\test.txt' , 'w' ) \u5b57\u7b26\u4e32\u524d\u7f00 \u5b57\u7b26\u4e32\u524d\u7f00 r \u6307\u5b9a\u7684\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u539f\u59cb\u5b57\u7b26\u4e32\uff0c\u89e3\u91ca\u5668\u5c06\u4e0d\u4f1a\u89e3\u91ca\u5176\u4e2d\u7684\u8f6c\u4e49\u5e8f\u5217\u3002 \u5199\u5165\u6587\u4ef6 \u6587\u4ef6\u5bf9\u8c61\u6709 write() \u65b9\u6cd5\uff0c\u53ea\u63a5\u53d7\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\uff1a test_file . write ( string ) \u8bfb\u53d6\u6587\u4ef6 read() \u8fd4\u56de\u6587\u4ef6\u5168\u90e8\u5185\u5bb9\u7684\u5b57\u7b26\u4e32\uff0c readLine() \u8fd4\u56de\u5305\u62ec \\n \u7684\u4e00\u884c\u3002\u8bfb\u53d6\u5230\u6587\u4ef6\u7ed3\u5c3e\u65f6\uff0c\u8fd9\u4e9b\u51fd\u6570\u8fd4\u56de\u7a7a\u4e32\uff0c\u8fd9\u53ef\u4ee5\u7528\u4e8e\u5faa\u73af\u63a7\u5236\u3002 \u5173\u95ed\u6587\u4ef6 close() \u3002 rstrip(str) \u4ece\u53f3\u4fa7\u53bb\u9664\u7279\u5b9a\u5b57\u7b26\uff0c\u53ef\u4ee5\u7528\u4e8e\u6d88\u9664\u6362\u884c\u7b26\u3002 str() \u5c06\u6570\u636e\u8f6c\u5316\u4e3a\u5b57\u7b26\u4e32 \u6587\u4ef6\u5faa\u73af\u63a7\u5236 \u00b6 Python \u4e2d\u53ef\u4ee5\u4e3a\u6587\u4ef6\u7f16\u5199\u4f18\u96c5\u7684 for \u5faa\u73af\uff1a for variable in file_object : statement \u8be5\u5faa\u73af\u5728\u6587\u4ef6\u7684\u6bcf\u884c\u8fed\u4ee3\u4e00\u6b21\u3002 \u5904\u7406\u8bb0\u5f55 \u00b6 \u7b2c 6.3 \u8282\u7ed9\u51fa\u4e86\u51e0\u4e2a \u91cd\u8981\u7684\u5904\u7406\u8bb0\u5f55\u7684\u4f8b\u7a0b \uff0c\u5e94\u5f53\u4ed4\u7ec6\u7814\u8bfb\uff0c\u5199\u4e00\u904d\u8fdb\u884c\u64cd\u4f5c\u3002 \u5728\u672c\u8282\u5e94\u5f53\u638c\u63e1\uff1a \u8bb0\u5f55\u548c\u5b57\u6bb5\u7684\u6982\u5ff5 \u6dfb\u52a0\u548c\u663e\u793a\u8bb0\u5f55 \u641c\u7d22\u8bb0\u5f55 \u4fee\u6539\u8bb0\u5f55 \u5220\u9664\u8bb0\u5f55 \u968f\u673a\u5b58\u53d6\u65b9\u6cd5 \u5728\u672c\u4e66\u4e2d\uff0c\u6211\u4eec\u4ec5\u91c7\u7528\u987a\u5e8f\u5b58\u53d6\u7684\u65b9\u6cd5\uff0c\u56e0\u6b64\u4fee\u6539\u548c\u5220\u9664\u90fd\u9700\u8981\u64cd\u4f5c\u4e24\u4e2a\u6587\u4ef6\u3002\u5728\u540e\u7eed\u7684\u8bfe\u7a0b\u4e2d\uff0c\u6211\u4eec\u4f1a\u5b66\u4e60\u4f7f\u7528\u968f\u673a\u8bfb\u5199\u65b9\u6cd5\u5b58\u53d6\u6587\u4ef6\u3002 \u5728\u4fee\u6539\u6587\u4ef6\u7684\u4f8b\u7a0b\u4e2d\u51fa\u73b0\u4e86\u7cfb\u7edf\u8c03\u7528\uff1a os.remove() \u5220\u9664\u6587\u4ef6\u548c os.rename() \u91cd\u547d\u540d\u6587\u4ef6\u3002 \u5f02\u5e38 \u00b6 \u5f02\u5e38 \u662f\u5bfc\u81f4\u7a0b\u5e8f\u7a81\u7136\u505c\u6b62\u7684\u4e00\u4e2a\u9519\u8bef\uff0c\u53ef\u4ee5\u4f7f\u7528 try \u548c except \u5904\u7406\u5f02\u5e38\u3002 \u5982\u679c\u4f60\u5728\u7a0b\u5e8f\u4e2d\u7528\u67d0\u4e2a\u6570\u9664\u4ee5 0\uff0c\u4f60\u4f1a\u770b\u89c1\u8fd9\u6837\u7684\u6d88\u606f\uff0c\u79f0\u4e3a traceback \u3002 Traceback (most recent call last): File \"C:\\Python\\division.py,\" line 13, in main() ZeroDivisionError: integer division or modulo by zero traceback \u7684\u6700\u540e\u4e00\u884c\u663e\u793a\u5f15\u53d1\u7684\u5f02\u5e38\u540d\u79f0\u548c\u7b80\u8981\u8bf4\u660e\u3002 \u6709\u4e00\u4e9b\u5f02\u5e38\u603b\u662f\u4e0d\u80fd\u907f\u514d\uff0c\u6bd4\u5982\u4f60\u5e0c\u671b\u7528\u6237 input \u4e00\u4e2a\u6574\u6570\uff0c\u5c06\u5176\u4e0e\u5176\u4ed6\u6570\u76f8\u4e58\u3002\u5982\u679c\u7528\u6237\u8f93\u5165\u5b57\u7b26\u4e32\uff0c\u5c06\u5176\u4f5c\u4e3a int() \u7684\u53c2\u6570\u5c31\u4f1a\u5bfc\u81f4 ValueError \u5f02\u5e38\u3002 \u5f02\u5e38\u5904\u7406\u53e5\u67c4 \u00b6 \u8fd9\u4e9b\u4ee3\u7801\u7528\u4e8e\u5f02\u5e38\u629b\u51fa\u65f6\u7684\u54cd\u5e94\u3002\u4e0b\u9762\u662f\u4e00\u822c\u683c\u5f0f\uff1a try : statement except ExceptionName : statement else : statement finally : statement try \u8bed\u53e5\u5757\u662f\u6709\u53ef\u80fd\u5f15\u53d1\u5f02\u5e38\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u8bed\u53e5 \u5f53 try \u4e2d\u7684\u4e00\u4e2a\u8bed\u53e5\u629b\u51fa\u5f02\u5e38\u540e\uff1a \u82e5\u662f except \u8bed\u53e5\u6307\u5b9a\u7684\u5f02\u5e38\uff0c\u5219\u7acb\u523b\u6267\u884c except \u8bed\u53e5\uff0c\u7136\u540e\u6267\u884c try/except \u5757\u540e\u7684\u8bed\u53e5\u3002 \u82e5\u4e0d\u662f except \u8bed\u53e5\u6307\u5b9a\u7684\u5f02\u5e38\uff0c\u5219\u8f93\u51fa traceback \u5e76\u505c\u6b62 \u82e5\u6ca1\u6709\u629b\u51fa\u5f02\u5e38\uff0c\u5219 except \u5757\u88ab\u5ffd\u7565\u3002 \u53ef\u4ee5\u6709\u4e0d\u6307\u5b9a\u5f02\u5e38\u540d\u79f0\u7684 except \u8bed\u53e5\u3002 else \u8bed\u53e5\u5757\u53ea\u5728\u6ca1\u6709\u5f02\u5e38\u7684\u60c5\u51b5\u4e0b\u6267\u884c\u3002 finally \u8bed\u53e5\u5757\u5728 try \u548c\u6240\u6709\u5f02\u5e38\u53e5\u67c4\u6267\u884c\u540e\u6267\u884c\uff08\u4e0d\u8bba\u662f\u5426\u6709\u5f02\u5e38\uff09\uff0c\u76ee\u7684\u662f\u6267\u884c\u6e05\u7406\u64cd\u4f5c\uff0c\u5982\u5173\u95ed\u6587\u4ef6\u7b49\u3002 \u5f02\u5e38\u5bf9\u8c61 \u00b6 \u629b\u51fa\u5f02\u5e38\u65f6\uff0c\u5185\u5b58\u4e2d\u5c06\u521b\u5efa\u4e00\u4e2a \u5f02\u5e38\u5bf9\u8c61 \uff0c\u5305\u542b\u5173\u4e8e\u8be5\u9519\u8bef\u7684\u9ed8\u8ba4\u9519\u8bef\u6d88\u606f\u3002 except ValueError as err : \u4e0a\u9762\u8fd9\u4e2a\u505a\u6cd5\u5c06\u5f02\u5e38\u5bf9\u8c61\u8d4b\u7ed9 err \u53d8\u91cf\uff0c\u53ef\u4ee5\u4f20\u9012\u7ed9 print() \u7b49\u51fd\u6570\uff0c\u663e\u793a Python \u4e3a\u8be5\u7c7b\u9519\u8bef\u63d0\u4f9b\u7684\u9ed8\u8ba4\u9519\u8bef\u6d88\u606f\u3002 Ch7. \u5217\u8868\u548c\u5143\u7ec4 \u00b6 \u5e8f\u5217 \u662f\u4fdd\u5b58\u591a\u4e2a\u6570\u636e\u9879\u7684\u5bf9\u8c61\uff0c\u5b83\u4eec\u4e00\u4e2a\u63a5\u4e00\u4e2a\u5730\u5b58\u50a8\u3002\u4e24\u79cd \u57fa\u672c\u5e8f\u5217\u7c7b\u578b \u662f\uff1a\u5217\u8868\u548c\u5143\u7ec4\uff0c\u5b83\u4eec\u90fd\u662f\u53ef\u4ee5\u5bb9\u7eb3\u5404\u79cd\u7c7b\u578b\u6570\u636e\u7684\u5e8f\u5217\u3002\u5217\u8868\u662f\u53ef\u53d8\u7684\uff0c\u5143\u7ec4\u662f\u4e0d\u53ef\u53d8\u7684\u3002 \u5217\u8868 \u00b6 even_numbers = [ 2 , 4 , 6 , 8 , 10 ] info = [ 'Alice' , 27 , 10.45 ] \u64cd\u4f5c\uff1a list() \u5c06\u7279\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61\u8f6c\u6362\u4e3a\u5217\u8868\u3002 numbers = list ( range ( 5 )) * \u91cd\u590d\u64cd\u4f5c\u7b26\uff1a\u5f53\u5b83\u7684\u5de6\u8fb9\u662f\u4e00\u4e2a\u5e8f\u5217\uff0c\u53f3\u8fb9\u662f\u4e00\u4e2a\u6574\u6570\u65f6\uff0c\u5b83\u5c06\u590d\u5236\u5217\u8868\u7684\u591a\u4e2a\u526f\u672c\u5e76\u8fde\u63a5 numbers = [ 0 ] * 5 for \u5faa\u73af\u53ef\u4ee5\u5728\u5217\u8868\u4e0a\u8fed\u4ee3 list[1] \u4e0b\u6807\u8bbf\u95ee\u79f0\u4e3a \u7d22\u5f15 \u3002 \u8d1f\u7d22\u5f15\u5c06\u4ece\u5217\u8868\u5c3e\u90e8\u5f00\u59cb\uff0c\u8d1f\u7d22\u5f15\u4e0e\u5217\u8868\u957f\u5ea6\u76f8\u52a0\u5f97\u5230\u7d22\u5f15\u3002\u6700\u540e\u4e00\u4e2a\u7d22\u5f15\u662f [-1] \u3002 \u65e0\u6548\u7d22\u5f15\u5f15\u53d1 IndexError \u5f02\u5e38\u3002 len() \u8fd4\u56de\u5217\u8868\u957f\u5ea6\u3002 \u5207\u7247\uff1a days[2:5] \u5c06\u8fd4\u56de\u4ece\u7d22\u5f15 2 \u5230\u7d22\u5f15 5 \u7684\u5143\u7d20\u5217\u8868\uff08\u5de6\u95ed\u53f3\u5f00\uff09\u3002 \u4ece\u5934\u5f00\u59cb\uff1a days[:5] \u76f4\u5230\u5c3e\u90e8\uff1a days[2:] \u6574\u4e2a\u526f\u672c\uff1a days[:] \u8bbe\u7f6e\u6b65\u957f\uff1a days[1:8:2] \u65e0\u6548\u7684\u5207\u7247\u7d22\u5f15 \u65e0\u6548\u7684\u5207\u7247\u7d22\u5f15\u4e0d\u4f1a\u5f15\u53d1\u5f02\u5e38\uff1a \u8d85\u8fc7\u5c3e\u90e8\u4f1a\u81ea\u52a8\u66ff\u6362\u4e3a\u5217\u8868\u957f\u5ea6 \u8d85\u8fc7\u5934\u90e8\u4f1a\u81ea\u52a8\u66ff\u6362\u4e3a\u5f00\u59cb\u4f4d\u7f6e start \u5927\u4e8e end \u5c06\u8fd4\u56de\u7a7a\u5217\u8868 \u67e5\u627e\uff1a item in list \uff0c\u5982\u679c\u5217\u8868\u4e2d\u80fd\u627e\u5230\u5143\u7d20\uff0c\u5219\u8868\u8fbe\u5f0f\u4e3a\u771f\u3002 list.append(item) list.index(item) \uff0c\u5982\u679c\u627e\u4e0d\u5230\uff0c\u629b\u51fa ValueError \u5f02\u5e38 list.insert(index, item) \uff0c\u6307\u5b9a\u65e0\u6548\u7d22\u5f15\u4e0d\u4f1a\u5f15\u53d1\u5f02\u5e38\uff0c\u81ea\u52a8\u66ff\u4ee3\u3002 list.sort() \uff0c\u5347\u5e8f\u6392\u5217 list.remove(item) \uff0c\u79fb\u9664\u51fa\u73b0\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u627e\u4e0d\u5230\uff0c\u629b\u51fa ValueError \u5f02\u5e38\u3002 list.reverse() \u5220\u9664\uff1a del list[2] \u6700\u503c\uff1a max() \u548c min() \u62f7\u8d1d\u5217\u8868 \u56de\u5fc6\uff1a\u5728 Python \u4e2d\uff0c\u5c06\u4e00\u4e2a\u53d8\u91cf\u8d4b\u7ed9\u53e6\u4e00\u4e2a\u53d8\u91cf\uff0c\u53ea\u662f\u4f7f\u8fd9\u4e24\u4e2a\u53d8\u91cf\u5f15\u7528\u5185\u5b58\u4e2d\u7684\u540c\u4e00\u4e2a\u5bf9\u8c61\u3002 \u4f60\u53ef\u4ee5\uff1a \u4f7f\u7528\u5faa\u73af\u548c .append() \u590d\u5236\u5217\u8868 \u4f7f\u7528\u8fde\u63a5\u64cd\u4f5c\u7b26\uff1a list2 = [] + list1 \u5904\u7406\u5217\u8868 \u00b6 \u521b\u5efa\u5217\u8868\u5e76\u904d\u5386\uff1a hours = [ 0 ] * NUM for index in range ( NUM ) statement \u53d8\u91cf\u53ef\u4ee5\u9009\u7528\u4e0b\u6807\uff0c\u4e5f\u53ef\u4ee5\u9009\u7528\u5217\u8868\u4e2d\u7684\u5143\u7d20\u3002 \u5217\u8868\u53ef\u4ee5\u4f5c\u4e3a\u53c2\u6570\uff0c\u4e5f\u53ef\u4ee5\u4f5c\u4e3a\u8fd4\u56de\u503c\u3002 \u5217\u8868\u4e0e\u6587\u4ef6 \u00b6 \u6587\u4ef6\u5bf9\u8c61\u5177\u6709\uff1a file.writelines() \u65b9\u6cd5\uff0c\u5c06\u6574\u4e2a\u5217\u8868\u5199\u5165\u6587\u4ef6\u4e2d\u4e00\u884c\uff0c\u6bcf\u4e2a\u5143\u7d20\u4e4b\u95f4\u4e0d\u4f1a\u81ea\u52a8\u6dfb\u52a0\u7a7a\u683c file.readlines() \u65b9\u6cd5\uff0c\u5c06\u6574\u4e2a\u6587\u4ef6\u8fd4\u56de\u4e3a\u5b57\u7b26\u4e32\u5217\u8868 \u4e8c\u7ef4\u5217\u8868\uff08\u5d4c\u5957\u5217\u8868\uff09 \u00b6 \u5217\u8868\u7684\u5143\u7d20\u53ef\u4ee5\u662f\u4efb\u4f55\u4e1c\u897f\uff0c\u5305\u62ec\u5217\u8868\u3002 \u5143\u7ec4 \u00b6 \u5143\u7ec4\uff08tuple\uff09\u662f\u4e0d\u53ef\u53d8\u7684\u5e8f\u5217\u3002 tuple = ( 1 , 2 , 3 , 4 ) \u5143\u7ec4\u4e5f\u652f\u6301\u4e0e\u5217\u8868\u76f8\u540c\u7684\u4e00\u4e9b\u64cd\u4f5c\uff1a \u4e0b\u6807\u7d22\u5f15 \u5404\u79cd\u65b9\u6cd5\u5982 index() \u5185\u7f6e\u51fd\u6570\u5982 len() \u3001 min() \u548c max() \u5207\u7247 in + \u548c * \u4e0d\u652f\u6301 append \u3001 remove \u7b49\u64cd\u4f5c\u3002 \u5982\u679c\u521b\u5efa\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u5143\u7ec4\uff0c\u5e94\u5f53\u52a0\u9017\u53f7 tuple = (1,) \uff0c\u5426\u5219\u53ea\u662f\u8d4b\u503c\u3002 list() \u5c06\u5143\u7ec4\u8f6c\u6362\u6210\u5217\u8868 tuple() \u5c06\u5217\u8868\u8f6c\u6362\u4e3a\u5143\u7ec4 \u4e13\u9898\uff1a matplotlib \u5305 \u00b6 matplotlib \u4e0d\u662f\u6807\u51c6 Python \u5e93\u7684\u4e00\u90e8\u5206\uff0c\u9700\u8981\u5b89\u88c5\uff1a sudo pip3 install matplotlib \u9644\u5f55 F\uff1a pip \u5de5\u5177 \u8bb8\u591a\u72ec\u7acb\u7a0b\u5e8f\u5458\u7f16\u5199\u7684 Python \u6a21\u5757\u63d0\u4f9b\u6807\u51c6 Python \u5e93\u4e0d\u5177\u5907\u7684\u529f\u80fd\uff0c\u79f0\u4e3a\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u5728 PyPI \u7f51\u7ad9\u4e0a\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9\u6a21\u5757\u3002 PyPI \u63d0\u4f9b\u7684\u6a21\u5757\u7ec4\u7ec7\u4e3a \u5305 \uff0c\u4ece Python 3.4 \u5f00\u59cb\uff0c pip \u5de5\u5177\u8fdb\u5165\u6807\u51c6 Python\u3002\u4f7f\u7528 pip \u5de5\u5177\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u5e76\u9a8c\u8bc1\u8f6f\u4ef6\u5305\u662f\u5426\u5b89\u88c5\uff1a sudo pip3 install package_name python3 >>> import package_name \u5bfc\u5165\u6a21\u5757 \u00b6 matplotlib \u5305\u4e2d\u542b\u6709\u7684 pyplot \u6a21\u5757\u63d0\u4f9b\u7ed8\u56fe\u529f\u80fd\u3002 import matplotlib.pyplot as plt plt . plot ( arguments ... ) \u4e0a\u9762\u7684\u8bed\u53e5\u5bfc\u5165\u5e76\u4e3a\u6a21\u5757\u521b\u5efa\u4e86\u522b\u540d\u3002\u56de\u5fc6\uff1a\u8c03\u7528\u6a21\u5757\u4e2d\u7684\u51fd\u6570\uff0c\u5fc5\u987b\u52a0\u4e0a\u524d\u7f00\u3002 \u9644\u5f55 E\uff1a import \u8bed\u53e5\u8be6\u89e3 \u4ece\u6a21\u5757\u4e2d\u5bfc\u5165\u7279\u5b9a\u7684\u51fd\u6570\u6216\u7c7b\uff1a from math import sqrt \u8fd9\u5c06\u5141\u8bb8\u4f60\u76f4\u63a5\u8c03\u7528\u51fd\u6570\u800c\u4e0d\u7528\u52a0\u4e0a\u6a21\u5757\u540d\u79f0\u3002 \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u5143\u7d20\u7684\u540d\u79f0\uff1a from math import sqrt, radians \u652f\u6301\u901a\u914d\u5bfc\u5165\uff1a from math import * \u522b\u540d\uff1a as \u5173\u952e\u5b57\u4e3a\u6a21\u5757\u5206\u914d\u522b\u540d\u3002 \u53ef\u4ee5\u4e0e\u4e0a\u9762\u7684 from \u7ed3\u5408\u8d77\u6765\u4f7f\u7528\uff1a from math import sqrt as sqaure_root, tan as tangent \u6298\u7ebf\u56fe \u00b6 \u521b\u5efa\u6298\u7ebf\u56fe\uff0c\u9700\u8981\u81ea\u53d8\u91cf\u548c\u56e0\u53d8\u91cf\u7684\u5217\u8868 x_coords = [ 0 , 1 , 2 ] y_coords = [ 0 , 3 , 1 ] plt . plot ( x_coords , y_coords , marker = 'o' ) plt . title ( 'title' ) plt . xlabel ( 'x axis' ) plt . ylabel ( 'y axis' ) plt . xlim ( xmin = 1 , xmax = 100 ) plt . xticks ([ 0 , 1 , 2 ], [ 'Baseball' , 'Basketball' , 'Football' ]) plt . grid ( True ) plt . show () marker \u6807\u8bb0\u7b26\u53f7\uff1a s \u25a0 \u65b9\u5f62 square o \u26aa \u5706\u70b9 dot * \u2b50 \u661f\u5f62 D \ud83d\udc8e \u94bb\u77f3\u5f62 \u5982\u679c\u5c06\u6807\u8bb0\u5b57\u7b26\u4f5c\u4e3a\u4f4d\u7f6e\u53c2\u6570\u800c\u4e0d\u662f\u5173\u952e\u5b57\u53c2\u6570\u4f20\u5165\uff0c\u5219\u4e0d\u4f1a\u7528\u7ebf\u8fde\u63a5\u8d77\u6765\uff1a plt.plot(x, y, 'o') \u3002 \u6761\u5f62\u56fe \u00b6 \u6761\u5f62\u56fe\u7684\u4e24\u4e2a\u5217\u8868\u5206\u522b\u4ee3\u8868\uff1a\u6bcf\u4e2a\u6761\u5f62 \u5de6\u8fb9\u7f18 \u7684 X \u5750\u6807\uff0c\u4ee5\u53ca\u6bcf\u4e2a\u6761\u5f62\u7684\u9ad8\u5ea6\u3002 left_edges = [ 0 , 10 , 20 , 30 , 40 ] heights = [ 100 , 200 , 300 , 400 , 500 ] plt . bar ( left_edges , heights , color = ( 'r' , 'g' , 'b' , 'w' , 'k' )) plt . show () width \u5173\u952e\u5b57\u53c2\u6570\u53ef\u4ee5\u81ea\u5b9a\u4e49\u6761\u5f62\u56fe\u7684\u5bbd\u5ea6\u3002 \u652f\u6301\u4e0e\u6298\u7ebf\u56fe\u7c7b\u4f3c\u7684\u5176\u4ed6\u529f\u80fd\u3002 plt.barh() \u7ed8\u5236\u6c34\u5e73\u6761\u5f62\u56fe\u3002 \u997c\u56fe \u00b6 \u997c\u56fe\u4f7f\u7528 pie() \u51fd\u6570\u7ed8\u5236\uff0c\u9700\u8981\u4e00\u4e2a\u5217\u8868\uff0c\u5176\u4e2d\u5305\u542b\u6bcf\u4e2a\u6247\u5f62\u7684\u5927\u5c0f\u3002 pie() \u4f1a\u6309\u7167\u6bcf\u4e2a\u5143\u7d20\u76f8\u5bf9\u6574\u4f53\u7684\u5927\u5c0f\u8ba1\u7b97\u6bcf\u4e2a\u6247\u5f62\u7684\u89d2\u5ea6\u3002 slices = [ 10 , 20 , 30 , 40 ] plt . pie ( slices ) plt . show () labels \u5173\u952e\u5b57\u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u6bcf\u4e2a\u6247\u5f62\u7684\u6807\u7b7e\u3002 colors \u5173\u952e\u5b57\u53c2\u6570\u53ef\u4ee5\u6307\u5b9a\u6bcf\u4e2a\u6247\u5f62\u7684\u989c\u8272\u3002 Ch8. \u6df1\u5165\u5b57\u7b26\u4e32 \u00b6 Abstract \u57fa\u672c\u64cd\u4f5c \u9010\u5b57\u7b26\u8bbf\u95ee \u8fde\u63a5 \u5207\u7247 \u67e5\u627e\u5b50\u4e32 \u91cd\u590d \u5bf9\u8c61\u65b9\u6cd5 \u6d4b\u8bd5 \u67e5\u627e\u4e0e\u66ff\u6362 \u5206\u5272 \u5b57\u7b26\u4e32\u4e5f\u662f\u4e00\u79cd\u5e8f\u5217\uff0c\u9002\u7528\u524d\u4e00\u7ae0\u5b66\u8fc7\u7684\u90e8\u5206\u5185\u5bb9\u3002 \u4f7f\u7528 for \u5faa\u73af\u53ef\u4ee5\u9010\u4e00\u8bbf\u95ee\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26 \u526f\u672c \u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e0d\u80fd\u6539\u53d8\u5b57\u7b26\u4e32\u4e2d\u7684\u503c\u3002 \u4f7f\u7528\u7d22\u5f15\u53ef\u4ee5\u53d6\u5f97\u5b57\u7b26\u4e32\u4e2d\u5355\u4e2a\u5b57\u7b26\u7684 \u526f\u672c \u3002\u7d22\u5f15\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u4ece\u53f3\u5411\u5de6\u8ba1\u6570\u3002\u5982\u679c\u8d85\u51fa\u8303\u56f4\uff0c\u4f1a\u5f15\u8d77 IndexError \u5f02\u5e38\u3002 \u4e00\u4e9b\u5de5\u5177\uff1a len() \u8fd4\u56de\u5b57\u7b26\u4e32\u957f\u5ea6 + \u8fde\u63a5\u5b57\u7b26\u4e32\uff0c += \u8fde\u63a5\u5e76\u8d4b\u503c\uff0c\u6ce8\u610f\u5de6\u4fa7\u5fc5\u987b\u662f\u53d8\u91cf\u3002 \u5b57\u7b26\u4e32\u4e5f\u53ef\u4ee5\u5207\u7247\u3002 \u5b57\u7b26\u4e32\u662f\u4e0d\u53ef\u53d8\u7684 Python \u4e2d\u7684\u5b57\u7b26\u4e32\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u4e0d\u80fd\u6539\u53d8\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\u3002\u5982\u679c\u4f60\u60f3\u6539\u53d8\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\uff0c\u4f60\u5fc5\u987b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\u3002 in \u68c0\u67e5\u5b50\u4e32\u662f\u5426\u5b58\u5728\u4e8e\u5b57\u7b26\u4e32\u4e2d\u3002 not in \u68c0\u67e5\u5b50\u4e32\u662f\u5426\u4e0d\u5b58\u5728\u4e8e\u5b57\u7b26\u4e32\u4e2d\u3002 \u5bf9\u8c61\u65b9\u6cd5 \u00b6 \u4e0d\u5217\u51fa\u5168\u90e8\uff0c\u53ef\u81ea\u5df1\u7c7b\u63a8\u3002 \u6d4b\u8bd5\u65b9\u6cd5\uff1a isdigit() isalnum() islower() \u548c C \u633a\u50cf\u7684\u3002 \u4fee\u6539\u65b9\u6cd5\uff1a lower() lstrip() \u4ece\u5de6\u4fa7\u5220\u9664\u7a7a\u767d\u5b57\u7b26 lstrip(char) \u4ece\u5de6\u4fa7\u5220\u9664\u5b57\u7b26 rstrip() strip() \u4ece\u5de6\u53f3\u5220\u9664\u7a7a\u767d \u67e5\u627e\u4e0e\u66ff\u6362\uff1a endswith(substring) \u662f\u5426\u4ee5\u5b50\u4e32\u7ed3\u5c3e find(substring) replace(old, new) startswith(substring) \u91cd\u590d\u64cd\u4f5c\u7b26 * \uff1a for count in range ( 8 , 0 , - 1 ): print ( 'z' * count ) split(char) \u9ed8\u8ba4\u4ee5\u7a7a\u683c\u5206\u5272\uff0c\u8fd4\u56de\u5b57\u7b26\u4e32\u5217\u8868 Ch9. \u5b57\u5178\u4e0e\u96c6\u5408 \u00b6 Abstract \u5b57\u5178 \u96c6\u5408 \u5bf9\u8c61\u5e8f\u5217\u5316 \u5b57\u5178 \u00b6 \u5b57\u5178\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6709\u4e24\u4e2a\u90e8\u5206\uff1a \u952e\uff1a\u5fc5\u987b\u662f\u4e0d\u53ef\u53d8\u5bf9\u8c61\uff0c\u5982\u5b57\u7b26\u4e32\u3001\u6574\u6570\u3001\u5143\u7ec4 \u503c\uff1a\u53ef\u4ee5\u662f\u4efb\u4f55\u7c7b\u578b\u5bf9\u8c61 \u521b\u5efa\u5b57\u5178\uff1a\u5c06\u952e\u503c\u5bf9\u653e\u5728\u5927\u62ec\u53f7\u5185\u521b\u5efa\uff1a book = { 'xxx' : '555-111' , 'www' : '666-111' } \u53ef\u4ee5\u521b\u5efa\u7a7a\u5b57\u5178\u3002 \u5b57\u5178\u4e2d\u7684\u5143\u7d20\u5e76\u4e0d\u662f\u6709\u5e8f\u5b58\u50a8\u7684\u3002 \u5b57\u5178\u64cd\u4f5c\uff1a \u68c0\u7d22\uff1a dictionary[key] \u627e\u4e0d\u5230\u65f6\u629b\u51fa KeyError \u68c0\u67e5 in , not in \u6dfb\u52a0\u6216\u66ff\u6362\u5143\u7d20\uff1a dictionary[key] = value \u5220\u9664\uff1a del dictionary[key] \u6570\u91cf\uff1a len() for \u5faa\u73af\u53ef\u4ee5\u904d\u5386\u5b57\u5178\u4e2d\u6240\u6709\u952e \u5bf9\u8c61\u65b9\u6cd5\uff1a clear() get(key, default) \u627e\u4e0d\u5230\u65f6\u4f1a\u8fd4\u56de\u9ed8\u8ba4\u503c\u800c\u4e0d\u662f\u629b\u51fa\u5f02\u5e38 items() \u4ee5\u5143\u7ec4\u5f62\u5f0f\u8fd4\u56de\u6240\u6709\u952e\u503c\u5bf9\uff0c\u79f0\u4e3a\u5b57\u5178\u89c6\u56fe\uff0c\u957f\u8fd9\u6837\uff1a [('xxx', '555-111'), ('www', '666-111')] keys() \u8fd4\u56de\u6240\u6709\u952e pop(key, default) \u8fd4\u56de\u5bf9\u5e94\u503c\u5e76\u5220\u9664\u952e\u503c\u5bf9 popitem() \u4ee5\u5143\u7ec4\u5f62\u5f0f\u8fd4\u56de\u968f\u673a\u952e\u503c\u5bf9\u5e76\u5220\u9664 \u5b83\u53ef\u4ee5\u8fdb\u884c \u591a\u91cd\u8d4b\u503c \uff1a key, value = dictionary.popitem() \uff0c\u591a\u91cd\u8d4b\u503c\u5c06\u8fd4\u56de\u7684\u952e\u548c\u503c \u5206\u522b \u5206\u914d\u7ed9\u591a\u4e2a\u5355\u72ec\u7684\u53d8\u91cf\u3002 values() \u96c6\u5408 \u00b6 \u8fd9\u91cc\u7684\u96c6\u5408\u548c\u6570\u5b66\u4e2d\u7684\u96c6\u5408\u7c7b\u4f3c\uff0c\u5305\u542b\u4e00\u7ec4 \u552f\u4e00 \u503c\u3002\u6b64\u5916\u5b83\u65e0\u5e8f\u3001\u53ef\u4ee5\u662f\u4efb\u4f55\u7c7b\u578b\u5bf9\u8c61\u3002 \u521b\u5efa\u96c6\u5408\uff1a myset = set () \u53ef\u4ee5\u4e3a set() \u4f20\u5165\u4e00\u4e2a\u5217\u8868\u3001\u5143\u7ec4\u6216\u5b57\u7b26\u4e32\uff0c\u8fd9\u4e9b\u5bf9\u8c61\u4e2d\u7684 \u53ef\u8fed\u4ee3\u5143\u7d20 \u4f1a\u81ea\u52a8 \u53bb\u91cd \u5e76\u8f6c\u6362\u6210\u96c6\u5408\u7684\u5143\u7d20\u3002\u6ce8\u610f\uff0c\u4e0d\u80fd\u4f20\u9012\u591a\u4e2a\u53c2\u6570\uff0c\u5982 set('aa', 'bb') \u3002 \u57fa\u672c\u64cd\u4f5c\uff1a len() for \u5faa\u73af\u8fed\u4ee3 in \u548c not in \u5bf9\u8c61\u64cd\u4f5c\uff1a .add() .update() \u53ef\u4ee5\u6dfb\u52a0\u53ef\u8fed\u4ee3\u5143\u7d20 .remove() \u6216 .discard() \u5220\u9664\u5143\u7d20 remove() \u4f1a\u629b\u51fa KeyError \u5f02\u5e38\uff0c\u800c discard() \u4e0d\u4f1a .clear() \u96c6\u5408\u64cd\u4f5c\uff1a union(set2) intersection(set2) difference(set2) \u4e5f\u53ef\u4ee5\u4f7f\u7528 - \u8fd0\u7b97\u7b26 symmetric_difference(set2) \u8fd4\u56de\u4e24\u4e2a\u96c6\u5408\u4e2d\u4e0d\u91cd\u590d\u7684\u5143\u7d20\uff08\u5bf9\u79f0\u5dee\u96c6\uff09 \u4e5f\u53ef\u4ee5\u4f7f\u7528 ^ \u8fd0\u7b97\u7b26 issubset(set2) \u662f\u5426\u662f\u5b50\u96c6 issuperset() \u7ed3\u5c3e\u7684\u4e24\u4e2a\u64cd\u4f5c\u4e5f\u53ef\u4ee5\u7528 <= \u548c => \u64cd\u4f5c\u7b26\u4ee3\u66ff\u3002 \u5bf9\u8c61\u5e8f\u5217\u5316\uff08Pickling\uff09 \u00b6 \u5c06\u5bf9\u8c61\u8f6c\u6362\u4e3a\u5b57\u8282\u6d41\u7684\u8fc7\u7a0b\u79f0\u4e3a \u5bf9\u8c61\u5e8f\u5217\u5316 \u3002\u6807\u51c6\u5e93\u4e2d\u7684 pickle \u6a21\u5757\u63d0\u4f9b\u4e86\u76f8\u5173\u7684\u529f\u80fd\u3002 import pickle outputfile = open ( 'mydata.dat' , 'wb' ) pickle . dump ( object , outputfile ) outputfile . close () inputfile = open ( 'mydata.dat' , 'rb' ) object = pickle . load ( file ) inputfile . close () \u5f53\u8bfb\u53d6\u8d85\u8fc7\u6587\u4ef6\u672b\u5c3e\u65f6\uff0c load() \u629b\u51fa EOFError \u5f02\u5e38\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u524d\u9762\u5b66\u8fc7\u7684\u5f02\u5e38\u5904\u7406\u6765\u8bc6\u522b\u6587\u4ef6\u672b\u5c3e\uff1a while not end_of_file : try : person = pickle . load ( input_file ) except EOFError : end_of_file = True Note Python \u5e8f\u5217\u5316\u540e\u7684\u6570\u636e\uff0c\u5e76\u4e0d\u5982 C \u90a3\u6837\u7eaf\u51c0\u3002\u6bd4\u5982\uff0c\u5728 C \u4e2d\u4f7f\u7528 fwrite() \u5411\u6587\u4ef6\u4e2d\u5199\u5165\u4e00\u4e2a\u5b57\u7b26\u6570\u7ec4\uff0c\u90a3\u4e48\u6587\u4ef6\u4e2d\u53ea\u6709\u5b57\u7b26\u6570\u7ec4\u3002\u82e5\u5c06 Python \u7684\u5b57\u7b26\u4e32\u5bf9\u8c61\u5199\u5165\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u89e3\u7801\u51fa\u7684\u5b57\u7b26\u4e32\uff0c\u4f46\u5176\u5219\u524d\u540e\u8fd8\u6709\u4e00\u4e9b\u989d\u5916\u7684\u5b57\u8282\u3002\u8fd9\u53ef\u80fd\u662f\u7528\u4e8e\u6807\u8bb0\u5bf9\u8c61\u7684\u7c7b\u578b\u3002 Ch10. \u7c7b\u4e0e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b \u00b6 Abstract \u521b\u5efa\u7c7b \u4f7f\u7528\u7c7b \u65b9\u6cd5\u548c\u5b9e\u4f8b \u5982\u4f55\u8bbe\u8ba1\u4e00\u4e2a\u7c7b \u9762\u5411\u5bf9\u8c61\u601d\u60f3\u5728 C++ \u548c\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u4e2d\u6709\u4ecb\u7ecd\uff0c\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\u3002\u4f60\u53ea\u9700\u8981\u6709\u8fd9\u4e9b\u6982\u5ff5\uff1a\u5bf9\u8c61\u3001\u5c01\u88c5\u3001\u516c\u5171\u65b9\u6cd5\u3001\u79c1\u6709\u65b9\u6cd5\u3001\u5c5e\u6027\u3001\u7c7b\u3001\u5b9e\u4f8b\u3002 \u521b\u5efa\u7c7b \u00b6 class Coin : def __init__ ( self ): self . sideup = 'heads' def toss ( self ): if random . randint ( 0 , 1 ) == 0 self . sideup = 'heads' else : self . sideup = 'tails' \u6bcf\u4e2a\u7c7b\u7684\u65b9\u6cd5\u90fd\u9700\u8981 self \u53c2\u6570\uff0c\u5b83\u662f\u64cd\u4f5c\u7684\u5bf9\u8c61\u7684\u5f15\u7528\u3002\u5b83\u4e0d\u4e00\u5b9a\u8981\u547d\u540d\u4e3a self \u4f46\u8fd9\u662f\u60ef\u4f8b\u3002 \u5927\u591a\u6570\u7c7b\u90fd\u5177\u6709 __init__() \u65b9\u6cd5\u7528\u4e8e\u521d\u59cb\u5316\uff0c\u5b83\u901a\u5e38\u662f\u7c7b\u5b9a\u4e49\u4e2d\u7684\u7b2c\u4e00\u4e2a\u65b9\u6cd5\u3002 \u4e0a\u9762\u521b\u5efa\u7684\u7c7b\u4e2d\uff0c sideup \u5c5e\u6027\u5e76\u4e0d\u662f\u79c1\u6709\u7684\u3002\u8981\u9690\u85cf\u4e00\u4e2a\u5c5e\u6027\uff0c \u4f7f\u7528\u4e24\u4e2a\u4e0b\u5212\u7ebf\u4f5c\u4e3a\u5c5e\u6027\u7684\u5f00\u5934 \uff0c\u5982 __sideup \u3002 \u4f7f\u7528\u7c7b \u00b6 def main (): mycoin = Coin () \u53d1\u751f\u4e86\u4e24\u4ef6\u4e8b\u60c5\uff1a\u5bf9\u8c61\u7684\u5b9e\u4f8b\u5728\u5185\u5b58\u4e2d\u88ab\u521b\u5efa\uff0c\u521d\u59cb\u5316\u65b9\u6cd5\u88ab\u8c03\u7528\u3002 \u6a21\u5757\u5316 \u00b6 \u628a\u7c7b\u5b58\u50a8\u5728\u6587\u4ef6\u91cc\uff0c\u4f7f\u7528 import \u4f7f\u7528\u5b83\uff1a import coin def main (): mycoin = coin . Coin () \u8bb0\u5f97\u52a0\u4e0a\u5305\u540d\u3002 \u65b9\u6cd5 \u00b6 __str__() \u628a\u5bf9\u8c61\u4f20\u9012\u7ed9 print() \u51fd\u6570\u65f6\u81ea\u52a8\u8c03\u7528\u3002 \u65b9\u6cd5\u6709\u5982\u4e0b\u5206\u7c7b\uff1a \u8bbf\u95ee\u5668\uff08Accessor \u6216 getter\uff09\uff1a\u8fd4\u56de\u5bf9\u8c61\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u4f46\u4e0d\u4fee\u6539\u5b83\u3002 \u4fee\u6539\u5668\uff08Mutator \u6216 setter\uff09\uff1a\u4fee\u6539\u5bf9\u8c61\u7684\u72b6\u6001\u4fe1\u606f\u3002 \u5b9e\u4f8b \u00b6 \u5bf9\u8c61\u7684\u5b9e\u4f8b\u53ef\u4ee5\u653e\u7f6e\u5728\u5e8f\u5217\u3001\u5b57\u5178\u7b49\u4e2d\uff0c\u5c31\u50cf\u6211\u4eec\u4e4b\u524d\u4e00\u76f4\u505a\u7684\u90a3\u6837\u3002 \u8bbe\u8ba1\u7c7b\u7684\u6280\u5de7 \u4e66\u672c 10.4 \u8282\u4ecb\u7ecd\u4e86\u7c7b\u7684\u8bbe\u8ba1\u8303\u5f0f\u3002\u8fd9\u5957\u89c4\u5219\u6bd4\u8f83\u7cfb\u7edf\uff0c\u5efa\u8bae\u5b8c\u6574\u9605\u8bfb\u4e00\u904d\u3002\u5982\u679c\u4f60\u60f3\u5199\u4e00\u4e2a\u81ea\u52a8\u4ece\u6587\u5b57\u63cf\u8ff0\u4e2d\u751f\u6210\u7c7b\u7684\u4ee3\u7801\u7684 AI \u7a0b\u5e8f\uff0c\u6216\u8bb8\u4e5f\u53ef\u4ee5\u53c2\u8003\u8fd9\u4e00\u8303\u5f0f\u3002 Ch.11 \u7ee7\u627f \u00b6 \u672c\u4e66\u7684\u7528\u8bcd \u672c\u4e66\u8ba4\u4e3a\uff1a \u8d85\u7c7b = \u57fa\u7c7b \u5b50\u7c7b = \u6d3e\u751f\u7c7b \u7ee7\u627f\u662f\u4e00\u79cd is a \u5173\u7cfb \uff0c\u5373\u5b50\u7c7b\u5177\u6709\u8d85\u7c7b\u7684\u6240\u6709\u7279\u5f81\uff0c\u4ee5\u53ca\u4f7f\u81ea\u5df1\u7279\u6b8a\u5316\u7684\u5176\u4ed6\u7279\u5f81\u3002 \u521b\u5efa\u4e00\u4e2a\u7ee7\u627f\u7684\u7c7b\uff0c\u5728\u7c7b\u540d\u540e\u8ddf\u4e0a\u8d85\u7c7b\u7684\u7c7b\u540d\u5373\u53ef\uff1a class Car ( Automobile ): def __init__ ( self , ... ): Automobile . __init__ ( self , ... ) self . __xxx = xxx \u5b50\u7c7b\u7ee7\u627f\u4e86\u8d85\u7c7b\u7684\u6240\u6709\u65b9\u6cd5\u548c\u6570\u636e\u5c5e\u6027\u3002 \u4e00\u822c\u8c03\u7528\u8d85\u7c7b\u7684\u521d\u59cb\u5316\u65b9\u6cd5\u521d\u59cb\u5316\u5bf9\u5e94\u7684\u5c5e\u6027\u3002 \u540e\u7eed\u7ae0\u8282 \u00b6 \u672c\u4e66\u7b2c 12\u300113 \u5f20\u5206\u522b\u4ecb\u7ecd\u4e86\u9012\u5f52\u548c GUI \u7f16\u7a0b\uff0c\u6211\u4eec\u8df3\u8fc7\u3002\u63a5\u4e0b\u6765\uff0c\u8bf7\u79fb\u6b65\u81f3\uff1a Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5","title":"Python \u7a0b\u5e8f\u8bbe\u8ba1\u57fa\u7840\uff08\u7b2c\u56db\u7248\uff09"},{"location":"books/Archive/SOP4/#python","text":"Start Out with Python (Forth Edition) \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e Tony Gaddis 2019 \u7b80\u8bc4 \u5728\u6211\u770b\u6765\uff0c\u8fd9\u662f\u5bf9\u65b0\u624b\u5341\u5206\u53cb\u597d\u7684\u4e00\u672c\u4e66\u3002\u4e66\u4e2d\u5bf9\u6982\u5ff5\u7684\u8bb2\u89e3\u57fa\u7840\u4e14\u8be6\u7ec6\uff08\u4f46\u5bf9\u4e8e\u5bf9\u7f16\u7a0b\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u540c\u5b66\u6765\u8bf4\u4f1a\u6709\u4e9b\u7e41\u7410\uff09\uff0c\u6bcf\u8282\u540e\u4f1a\u6709 \u68c0\u67e5\u70b9 \u6a21\u5757\u95ee\u4f60\u4e00\u4e9b\u57fa\u7840\u7684\u6982\u5ff5\uff0c\u786e\u4fdd\u4f60\u638c\u63e1\u4e86\u91cd\u8981\u7684\u77e5\u8bc6\u3002\u7a7f\u63d2\u5728\u6587\u4e2d\u7684 \u805a\u5149\u706f \u6a21\u5757\u5bf9\u4e8e\u6bcf\u5757\u77e5\u8bc6\u70b9\uff0c\u7ed9\u51fa\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u4ece\u76ee\u6807\u5230\u8bbe\u8ba1\u5230\u5b9e\u73b0\u7684\u5b8c\u6574\u8fc7\u7a0b\u3002\u8fd9\u8ba9\u6211\u4eec\u53ef\u4ee5\u5f88\u597d\u5730\u89c2\u5bdf\u4ee3\u7801\u7ec6\u8282\uff0c\u4e0d\u65ad\u5de9\u56fa\u77e5\u8bc6\u3002\uff08\u4f46\u8fd9\u53ef\u80fd\u4e5f\u662f\u8ba9\u4eba\u6bd4\u8f83\u70e6\u7684\u4e00\u70b9\uff1a\u5b83\u7684\u4f8b\u7a0b\u51e0\u4e4e\u6bcf\u4e00\u884c\u90fd\u6709\u6ce8\u91ca\uff01Python \u8bed\u8a00\u7684\u4ee3\u7801\u672c\u8eab\u53ef\u8bfb\u6027\u5c31\u975e\u5e38\u9ad8\uff0c\u5e76\u4e0d\u9700\u8981\u592a\u591a\u6ce8\u91ca\u3002\uff09 \u672c\u4e66\u5bf9\u57fa\u7840\u77e5\u8bc6\u7684\u7f16\u6392\u6bd4\u300a Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5 \u300b\u8981\u597d\u4e00\u4e9b\uff0c\u4f46\u63d0\u4f9b\u7684\u9879\u76ee\u5b9e\u8df5\u4e0d\u8db3\u3002\u5728\u9605\u8bfb\u5b8c\u672c\u4e66\u540e\uff0c\u5efa\u8bae\u79fb\u6b65\u5230\u300aPython \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\u300b\u7684\u9879\u76ee\u90e8\u5206\u5f00\u59cb\u9605\u8bfb\u3002 \u672c\u4e66\u53d9\u8ff0\u5f88\u8be6\u7ec6\uff0c\u56e0\u6b64\u7ae0\u672b\u4e60\u9898\u53ef\u4ee5\u4e0d\u505a\u3002\u5fc5\u987b\u8981\u505a\u7684\u662f\u6bcf\u4e2a\u5c0f\u8282\u540e\u7684 \u68c0\u67e5\u70b9 \uff0c\u8fd9\u662f\u5bf9\u672c\u8282\u77e5\u8bc6\u7684\u4e00\u4e2a\u68c0\u9a8c\uff0c\u4e5f\u662f\u5bf9\u4e0b\u4e00\u8282\u77e5\u8bc6\u7684\u4e00\u4e2a\u94fa\u57ab\u3002\u805a\u5149\u706f\u7684\u4f8b\u7a0b\u90fd\u8981\u770b\u8fc7\u4e00\u904d\uff08\u4e0d\u7528\u5f88\u7ec6\uff09\uff0c\u5176\u4e2d\u6709\u7591\u95ee\u7684\u5730\u65b9\u8981\u81ea\u5df1\u52a8\u624b\u5199\u4ee3\u7801\u8bd5\u4e00\u8bd5\u3002 \u5b9e\u8df5\u975e\u5e38\u91cd\u8981 \u3002","title":"Python \u7a0b\u5e8f\u8bbe\u8ba1\u57fa\u7840\uff08\u7b2c\u56db\u7248\uff09"},{"location":"books/Archive/SOP4/#ch1","text":"\u89e3\u91ca\u5668\u4e0e\u7f16\u8bd1\u5668\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f Python \u89e3\u91ca\u5668\u7684\u4e24\u79cd\u5de5\u4f5c\u6a21\u5f0f\uff1a\u4ea4\u4e92\u6a21\u5f0f\u548c\u811a\u672c\u6a21\u5f0f IDLE \u7684\u7b80\u5355\u4f7f\u7528\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u3001\u7f16\u5199\u7a0b\u5e8f\u3001\u81ea\u52a8\u7f29\u8fdb\u3001\u8fd0\u884c\u7b49\u3002","title":"Ch1. \u8ba1\u7b97\u673a\u4e0e\u7f16\u7a0b"},{"location":"books/Archive/SOP4/#ch2","text":"","title":"Ch2. \u8f93\u5165\u3001\u5904\u7406\u4e0e\u8f93\u51fa"},{"location":"books/Archive/SOP4/#ch3","text":"","title":"Ch3. \u9009\u62e9\u7ed3\u6784\u4e0e\u5e03\u5c14\u903b\u8f91"},{"location":"books/Archive/SOP4/#ch4","text":"","title":"Ch4. \u5faa\u73af\u7ed3\u6784"},{"location":"books/Archive/SOP4/#ch5","text":"\u672c\u7ae0\u5148\u4ecb\u7ecd void \u51fd\u6570\uff0c\u518d\u4ecb\u7ecd\u6709\u8fd4\u56de\u503c\u7684\u51fd\u6570\u3002 \u51fd\u6570\u547d\u540d\u4e0e\u53d8\u91cf\u547d\u540d\u89c4\u5219\u76f8\u540c\u3002","title":"Ch5. \u51fd\u6570"},{"location":"books/Archive/SOP4/#ch6","text":"","title":"Ch6. \u6587\u4ef6\u548c\u5f02\u5e38"},{"location":"books/Archive/SOP4/#ch7","text":"\u5e8f\u5217 \u662f\u4fdd\u5b58\u591a\u4e2a\u6570\u636e\u9879\u7684\u5bf9\u8c61\uff0c\u5b83\u4eec\u4e00\u4e2a\u63a5\u4e00\u4e2a\u5730\u5b58\u50a8\u3002\u4e24\u79cd \u57fa\u672c\u5e8f\u5217\u7c7b\u578b \u662f\uff1a\u5217\u8868\u548c\u5143\u7ec4\uff0c\u5b83\u4eec\u90fd\u662f\u53ef\u4ee5\u5bb9\u7eb3\u5404\u79cd\u7c7b\u578b\u6570\u636e\u7684\u5e8f\u5217\u3002\u5217\u8868\u662f\u53ef\u53d8\u7684\uff0c\u5143\u7ec4\u662f\u4e0d\u53ef\u53d8\u7684\u3002","title":"Ch7. \u5217\u8868\u548c\u5143\u7ec4"},{"location":"books/Archive/SOP4/#matplotlib","text":"matplotlib \u4e0d\u662f\u6807\u51c6 Python \u5e93\u7684\u4e00\u90e8\u5206\uff0c\u9700\u8981\u5b89\u88c5\uff1a sudo pip3 install matplotlib \u9644\u5f55 F\uff1a pip \u5de5\u5177 \u8bb8\u591a\u72ec\u7acb\u7a0b\u5e8f\u5458\u7f16\u5199\u7684 Python \u6a21\u5757\u63d0\u4f9b\u6807\u51c6 Python \u5e93\u4e0d\u5177\u5907\u7684\u529f\u80fd\uff0c\u79f0\u4e3a\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u5728 PyPI \u7f51\u7ad9\u4e0a\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9\u6a21\u5757\u3002 PyPI \u63d0\u4f9b\u7684\u6a21\u5757\u7ec4\u7ec7\u4e3a \u5305 \uff0c\u4ece Python 3.4 \u5f00\u59cb\uff0c pip \u5de5\u5177\u8fdb\u5165\u6807\u51c6 Python\u3002\u4f7f\u7528 pip \u5de5\u5177\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u5e76\u9a8c\u8bc1\u8f6f\u4ef6\u5305\u662f\u5426\u5b89\u88c5\uff1a sudo pip3 install package_name python3 >>> import package_name","title":"\u4e13\u9898\uff1amatplotlib \u5305"},{"location":"books/Archive/SOP4/#ch8","text":"Abstract \u57fa\u672c\u64cd\u4f5c \u9010\u5b57\u7b26\u8bbf\u95ee \u8fde\u63a5 \u5207\u7247 \u67e5\u627e\u5b50\u4e32 \u91cd\u590d \u5bf9\u8c61\u65b9\u6cd5 \u6d4b\u8bd5 \u67e5\u627e\u4e0e\u66ff\u6362 \u5206\u5272 \u5b57\u7b26\u4e32\u4e5f\u662f\u4e00\u79cd\u5e8f\u5217\uff0c\u9002\u7528\u524d\u4e00\u7ae0\u5b66\u8fc7\u7684\u90e8\u5206\u5185\u5bb9\u3002 \u4f7f\u7528 for \u5faa\u73af\u53ef\u4ee5\u9010\u4e00\u8bbf\u95ee\u5b57\u7b26\u4e32\u4e2d\u7684\u6bcf\u4e2a\u5b57\u7b26 \u526f\u672c \u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e0d\u80fd\u6539\u53d8\u5b57\u7b26\u4e32\u4e2d\u7684\u503c\u3002 \u4f7f\u7528\u7d22\u5f15\u53ef\u4ee5\u53d6\u5f97\u5b57\u7b26\u4e32\u4e2d\u5355\u4e2a\u5b57\u7b26\u7684 \u526f\u672c \u3002\u7d22\u5f15\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u4ece\u53f3\u5411\u5de6\u8ba1\u6570\u3002\u5982\u679c\u8d85\u51fa\u8303\u56f4\uff0c\u4f1a\u5f15\u8d77 IndexError \u5f02\u5e38\u3002 \u4e00\u4e9b\u5de5\u5177\uff1a len() \u8fd4\u56de\u5b57\u7b26\u4e32\u957f\u5ea6 + \u8fde\u63a5\u5b57\u7b26\u4e32\uff0c += \u8fde\u63a5\u5e76\u8d4b\u503c\uff0c\u6ce8\u610f\u5de6\u4fa7\u5fc5\u987b\u662f\u53d8\u91cf\u3002 \u5b57\u7b26\u4e32\u4e5f\u53ef\u4ee5\u5207\u7247\u3002 \u5b57\u7b26\u4e32\u662f\u4e0d\u53ef\u53d8\u7684 Python \u4e2d\u7684\u5b57\u7b26\u4e32\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u4e0d\u80fd\u6539\u53d8\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\u3002\u5982\u679c\u4f60\u60f3\u6539\u53d8\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\uff0c\u4f60\u5fc5\u987b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b57\u7b26\u4e32\u3002 in \u68c0\u67e5\u5b50\u4e32\u662f\u5426\u5b58\u5728\u4e8e\u5b57\u7b26\u4e32\u4e2d\u3002 not in \u68c0\u67e5\u5b50\u4e32\u662f\u5426\u4e0d\u5b58\u5728\u4e8e\u5b57\u7b26\u4e32\u4e2d\u3002","title":"Ch8. \u6df1\u5165\u5b57\u7b26\u4e32"},{"location":"books/Archive/SOP4/#ch9","text":"Abstract \u5b57\u5178 \u96c6\u5408 \u5bf9\u8c61\u5e8f\u5217\u5316","title":"Ch9. \u5b57\u5178\u4e0e\u96c6\u5408"},{"location":"books/Archive/SOP4/#ch10","text":"Abstract \u521b\u5efa\u7c7b \u4f7f\u7528\u7c7b \u65b9\u6cd5\u548c\u5b9e\u4f8b \u5982\u4f55\u8bbe\u8ba1\u4e00\u4e2a\u7c7b \u9762\u5411\u5bf9\u8c61\u601d\u60f3\u5728 C++ \u548c\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u4e2d\u6709\u4ecb\u7ecd\uff0c\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\u3002\u4f60\u53ea\u9700\u8981\u6709\u8fd9\u4e9b\u6982\u5ff5\uff1a\u5bf9\u8c61\u3001\u5c01\u88c5\u3001\u516c\u5171\u65b9\u6cd5\u3001\u79c1\u6709\u65b9\u6cd5\u3001\u5c5e\u6027\u3001\u7c7b\u3001\u5b9e\u4f8b\u3002","title":"Ch10. \u7c7b\u4e0e\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b"},{"location":"books/Archive/SOP4/#ch11","text":"\u672c\u4e66\u7684\u7528\u8bcd \u672c\u4e66\u8ba4\u4e3a\uff1a \u8d85\u7c7b = \u57fa\u7c7b \u5b50\u7c7b = \u6d3e\u751f\u7c7b \u7ee7\u627f\u662f\u4e00\u79cd is a \u5173\u7cfb \uff0c\u5373\u5b50\u7c7b\u5177\u6709\u8d85\u7c7b\u7684\u6240\u6709\u7279\u5f81\uff0c\u4ee5\u53ca\u4f7f\u81ea\u5df1\u7279\u6b8a\u5316\u7684\u5176\u4ed6\u7279\u5f81\u3002 \u521b\u5efa\u4e00\u4e2a\u7ee7\u627f\u7684\u7c7b\uff0c\u5728\u7c7b\u540d\u540e\u8ddf\u4e0a\u8d85\u7c7b\u7684\u7c7b\u540d\u5373\u53ef\uff1a class Car ( Automobile ): def __init__ ( self , ... ): Automobile . __init__ ( self , ... ) self . __xxx = xxx \u5b50\u7c7b\u7ee7\u627f\u4e86\u8d85\u7c7b\u7684\u6240\u6709\u65b9\u6cd5\u548c\u6570\u636e\u5c5e\u6027\u3002 \u4e00\u822c\u8c03\u7528\u8d85\u7c7b\u7684\u521d\u59cb\u5316\u65b9\u6cd5\u521d\u59cb\u5316\u5bf9\u5e94\u7684\u5c5e\u6027\u3002","title":"Ch.11 \u7ee7\u627f"},{"location":"books/Archive/SOP4/#_46","text":"\u672c\u4e66\u7b2c 12\u300113 \u5f20\u5206\u522b\u4ecb\u7ecd\u4e86\u9012\u5f52\u548c GUI \u7f16\u7a0b\uff0c\u6211\u4eec\u8df3\u8fc7\u3002\u63a5\u4e0b\u6765\uff0c\u8bf7\u79fb\u6b65\u81f3\uff1a Python \u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5","title":"\u540e\u7eed\u7ae0\u8282"},{"location":"books/CSAPP/","text":"\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf \u00b6 Abstract \u672c\u4e66\u7684\u76ee\u7684\u662f\u89e3\u91ca\u6240\u6709\u8ba1\u7b97\u673a\u7cfb\u7edf\u7684\u672c\u8d28\u6982\u5ff5\uff0c\u5e76\u5c55\u793a\u8fd9\u4e9b\u6982\u5ff5\u662f\u5982\u4f55\u5b9e\u5b9e\u5728\u5728\u5730\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u5730\u6b63\u786e\u6027\u3001\u6027\u80fd\u548c\u5b9e\u7528\u6027\u7684\u3002\u5b66\u4e60\u672c\u4e66\uff0c\u4f60\u80fd\u591f\u4e86\u89e3\u5982\u4f55\u5229\u7528\u7cfb\u7edf\u77e5\u8bc6\u6765\u7f16\u5199\u51fa\u66f4\u597d\u7684\u7a0b\u5e8f\u3002 \u5b66\u4e60\u672c\u4e66\u7684\u9884\u4fee\u8981\u6c42\u662f\uff1a \u5bf9 C/C++ \u8bed\u8a00\u6709\u4e00\u5b9a\u4e86\u89e3 \u5bf9 Linux \u7cfb\u7edf\u6709\u4e00\u5b9a\u4e86\u89e3 \u4e0d\u9700\u8981\u786c\u4ef6\u3001\u673a\u5668\u8bed\u8a00\u548c\u6c47\u7f16\u8bed\u8a00\u7ecf\u9a8c \u9605\u8bfb\u672c\u4e66\u7684\u6700\u597d\u65b9\u5f0f\u662f\uff1a\u8ddf\u7740\u505a\uff0c\u5728\u771f\u6b63\u7684\u7cfb\u7edf\u4e0a\u89e3\u51b3\u5177\u4f53\u7684\u95ee\u9898\uff0c\u6216\u662f\u7f16\u5199\u548c\u8fd0\u884c\u7a0b\u5e8f\u3002 \u6bcf\u7ae0\u4f5c\u4e1a\u7684\u7b54\u6848\u9644\u5728\u7b14\u8bb0\u6700\u540e\u4e00\u8282\u3002\u8be6\u7ec6\u4ee3\u7801\u76f4\u63a5\u8fde\u63a5\u5230\u4ed3\u5e93\uff0c\u4e0d\u5728\u7b14\u8bb0\u4e2d\u5c55\u793a\u3002","title":"\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf"},{"location":"books/CSAPP/#_1","text":"Abstract \u672c\u4e66\u7684\u76ee\u7684\u662f\u89e3\u91ca\u6240\u6709\u8ba1\u7b97\u673a\u7cfb\u7edf\u7684\u672c\u8d28\u6982\u5ff5\uff0c\u5e76\u5c55\u793a\u8fd9\u4e9b\u6982\u5ff5\u662f\u5982\u4f55\u5b9e\u5b9e\u5728\u5728\u5730\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u5730\u6b63\u786e\u6027\u3001\u6027\u80fd\u548c\u5b9e\u7528\u6027\u7684\u3002\u5b66\u4e60\u672c\u4e66\uff0c\u4f60\u80fd\u591f\u4e86\u89e3\u5982\u4f55\u5229\u7528\u7cfb\u7edf\u77e5\u8bc6\u6765\u7f16\u5199\u51fa\u66f4\u597d\u7684\u7a0b\u5e8f\u3002 \u5b66\u4e60\u672c\u4e66\u7684\u9884\u4fee\u8981\u6c42\u662f\uff1a \u5bf9 C/C++ \u8bed\u8a00\u6709\u4e00\u5b9a\u4e86\u89e3 \u5bf9 Linux \u7cfb\u7edf\u6709\u4e00\u5b9a\u4e86\u89e3 \u4e0d\u9700\u8981\u786c\u4ef6\u3001\u673a\u5668\u8bed\u8a00\u548c\u6c47\u7f16\u8bed\u8a00\u7ecf\u9a8c \u9605\u8bfb\u672c\u4e66\u7684\u6700\u597d\u65b9\u5f0f\u662f\uff1a\u8ddf\u7740\u505a\uff0c\u5728\u771f\u6b63\u7684\u7cfb\u7edf\u4e0a\u89e3\u51b3\u5177\u4f53\u7684\u95ee\u9898\uff0c\u6216\u662f\u7f16\u5199\u548c\u8fd0\u884c\u7a0b\u5e8f\u3002 \u6bcf\u7ae0\u4f5c\u4e1a\u7684\u7b54\u6848\u9644\u5728\u7b14\u8bb0\u6700\u540e\u4e00\u8282\u3002\u8be6\u7ec6\u4ee3\u7801\u76f4\u63a5\u8fde\u63a5\u5230\u4ed3\u5e93\uff0c\u4e0d\u5728\u7b14\u8bb0\u4e2d\u5c55\u793a\u3002","title":"\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf"},{"location":"books/CSAPP/Chapter1/","text":"Ch1. \u8ba1\u7b97\u673a\u7cfb\u7edf\u6f2b\u6e38 \u00b6 Abstract \u672c\u7ae0\u5feb\u901f\u8fc7\u4e86\u4e00\u904d\u672c\u4e66\u5c06\u8981\u5b66\u4e60\u7684\u5185\u5bb9\uff0c\u5efa\u7acb\u4e86\u51e0\u4e2a\u57fa\u672c\u6982\u5ff5\u3002 \u521d\u6b21\u9605\u8bfb\u65f6\u4e0d\u7406\u89e3\u6ca1\u5173\u7cfb\uff0c\u4e5f\u4e0d\u9700\u8981\u6b7b\u8bb0\u786c\u80cc\uff0c\u672c\u7ae0\u5185\u5bb9\u90fd\u4f1a\u5728\u4e66\u4e2d\u4e00\u4e00\u5c55\u5f00 \u3002 Amdahl \u5b9a\u5f8b \u5f53\u6211\u4eec\u5bf9\u7cfb\u7edf\u7684\u67d0\u4e2a\u90e8\u5206\u52a0\u901f\u65f6\uff0c\u5176\u5bf9\u7cfb\u7edf\u6574\u4f53\u6027\u80fd\u7684\u5f71\u54cd\u53d6\u51b3\u4e8e\u8be5\u90e8\u5206\u7684\u91cd\u8981\u6027\u548c\u52a0\u901f\u7a0b\u5ea6\uff1a \\[ S=\\frac1{(1-\\alpha)+\\alpha/k} \\] \u5176\u4e2d \\(S\\) \u662f\u52a0\u901f\u524d\u540e\u7684\u65f6\u95f4\u6bd4\uff0c \\(\\alpha\\) \u662f\u6240\u52a0\u901f\u90e8\u5206\u5360\u7cfb\u7edf\u65f6\u95f4\u6bd4\uff0c \\(k\\) \u662f\u8be5\u90e8\u5206\u6027\u80fd\u63d0\u5347\u6bd4\u4f8b\u3002 \u5e76\u53d1\u548c\u5e76\u884c \u4e66\u672c\u5b9a\u4e49\uff1a \u5e76\u53d1\uff08concurrency\uff09\u6307\u540c\u65f6\u5177\u6709\u591a\u4e2a\u6d3b\u52a8\u3002 \u5e76\u884c\uff08parallelism\uff09\u6307\u4f7f\u7528\u5e76\u53d1\u4f7f\u7cfb\u7edf\u8fd0\u884c\u5f97\u66f4\u5feb\u3002 \u66f4\u6613\u61c2\u7684\u89e3\u91ca\uff1a \u5e76\u884c\uff1a\u4e24\u4e2a\u4efb\u52a1\u5728 \u540c\u4e00\u65f6\u523b\u4e92\u4e0d\u5e72\u6270 \u7684\u540c\u65f6\u6267\u884c\u3002 \u5e76\u53d1\uff1a\u540c\u65f6\u5b89\u6392\u82e5\u5e72\u4e2a\u4efb\u52a1\uff0c\u8fd9\u4e9b\u4efb\u52a1\u53ef\u4ee5\u5f7c\u6b64\u7a7f\u63d2\u7740\u8fdb\u884c\uff1b\u6709\u4e9b\u4efb\u52a1\u53ef\u80fd\u662f\u5e76\u884c\u7684\uff0c\u6bd4\u5982\u4e70\u83dc\u3001\u53d1\u90ae\u4ef6\u548c\u53bb\u5e7c\u513f\u56ed\u7684\u67d0\u4e9b\u8def\u9014\u662f\u91cd\u53e0\u7684\uff0c\u8fd9\u65f6\u4f60\u7684\u786e\u540c\u65f6\u5728\u505a\u4e09\u4ef6\u4e8b\uff1b\u4f46\u8fdb\u83dc\u5e02\u573a\u548c\u53d1\u90ae\u4ef6\u548c\u63a5\u5a03\u4e09\u8005\u662f\u4e92\u65a5\u7684\uff0c\u6bcf\u4e2a\u65f6\u523b\u53ea\u80fd\u5b8c\u6210\u5176\u4e2d\u4e00\u4ef6\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5e76\u53d1\u5141\u8bb8\u4e24\u4e2a\u4efb\u52a1\u5f7c\u6b64\u5e72\u6270\u3002 \u4e32\u884c\u8fd8\u662f\u5e76\u53d1\uff0c\u8fd9\u90fd\u662f \u4efb\u52a1\u5b89\u6392\u8005 \u89c6\u89d2\u770b\u5230\u7684\u4e1c\u897f\u3002\u76f8\u6bd4\u4e4b\u4e0b\uff0c\u201c\u5e76\u884c\u201d\u662f \u4efb\u52a1\u6267\u884c\u8005 \u89c6\u89d2\u7684\u4e1c\u897f\u3002 \u7b80\u5355\u4e86\u89e3\u4e09\u4e2a\u5c42\u6b21\u7684\u5e76\u53d1\uff1a \u7ebf\u7a0b\u7ea7\u5e76\u53d1 \u7ebf\u7a0b\u3001\u8fdb\u7a0b \u8fdb\u7a0b\uff1a\u4e00\u4e2a\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u7a0b\u5e8f \u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8fd0\u884c\u591a\u4e2a\u8fdb\u7a0b\u3002 \u6bcf\u4e2a\u8fdb\u7a0b\u770b\u4e0a\u53bb\u662f\u72ec\u5360\u5730\u4f7f\u7528\u5904\u7406\u5668\u3001\u4e3b\u5b58\u548c I/O \u8bbe\u5907\u3002 \u4f7f\u7528 \u5e76\u53d1 \u8fd0\u884c\uff0c\u4e0d\u540c\u8fdb\u7a0b\u7684\u6307\u4ee4\u53ef\u4ee5\u4ea4\u9519\u8fdb\u884c\u3002\u8fd9\u662f\u901a\u8fc7 \u4e0a\u4e0b\u6587\u5207\u6362 \u5b9e\u73b0\u7684\u3002 \u7ebf\u7a0b\uff1a\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u8fdb\u7a0b\u7531\u591a\u4e2a\u7ebf\u7a0b\u7ec4\u6210\u3002 \u6bcf\u4e2a\u7ebf\u7a0b\u90fd\u8fd0\u884c\u5728\u8fdb\u7a0b\u7684\u4e0a\u4e0b\u6587\u4e2d\uff0c \u5171\u4eab\u4ee3\u7801\u548c\u5168\u5c40\u6570\u636e \u3002 \u5728\u7f51\u7edc\u670d\u52a1\u4e2d\uff0c\u7ebf\u7a0b\u80fd\u9ad8\u6548\u6ee1\u8db3\u5e76\u884c\u5904\u7406\u8981\u6c42\u3002 \u5728 \u591a\u5904\u7406\u5668 \u53ef\u7528\u65f6\uff0c\u7ebf\u7a0b\u80fd\u6781\u5927\u63d0\u5347\u7a0b\u5e8f\u7684\u6548\u7387\u3002 \u8d85\u7ebf\u7a0b\uff1a\u53c8\u79f0\u540c\u65f6\u591a\u7ebf\u7a0b\uff0c\u6307 CPU \u6267\u884c\u591a\u4e2a\u63a7\u5236\u6d41\u3002 \u5b9e\u73b0\u539f\u7406\u662f CPU \u7684\u67d0\u4e9b\u786c\u4ef6\u6709\u591a\u4e2a\u5907\u4efd\uff0c\u6bd4\u5982\u7a0b\u5e8f\u8ba1\u6570\u5668\u548c\u5bc4\u5b58\u5668\u3002","title":"Ch1. \u8ba1\u7b97\u673a\u7cfb\u7edf\u6f2b\u6e38"},{"location":"books/CSAPP/Chapter1/#ch1","text":"Abstract \u672c\u7ae0\u5feb\u901f\u8fc7\u4e86\u4e00\u904d\u672c\u4e66\u5c06\u8981\u5b66\u4e60\u7684\u5185\u5bb9\uff0c\u5efa\u7acb\u4e86\u51e0\u4e2a\u57fa\u672c\u6982\u5ff5\u3002 \u521d\u6b21\u9605\u8bfb\u65f6\u4e0d\u7406\u89e3\u6ca1\u5173\u7cfb\uff0c\u4e5f\u4e0d\u9700\u8981\u6b7b\u8bb0\u786c\u80cc\uff0c\u672c\u7ae0\u5185\u5bb9\u90fd\u4f1a\u5728\u4e66\u4e2d\u4e00\u4e00\u5c55\u5f00 \u3002 Amdahl \u5b9a\u5f8b \u5f53\u6211\u4eec\u5bf9\u7cfb\u7edf\u7684\u67d0\u4e2a\u90e8\u5206\u52a0\u901f\u65f6\uff0c\u5176\u5bf9\u7cfb\u7edf\u6574\u4f53\u6027\u80fd\u7684\u5f71\u54cd\u53d6\u51b3\u4e8e\u8be5\u90e8\u5206\u7684\u91cd\u8981\u6027\u548c\u52a0\u901f\u7a0b\u5ea6\uff1a \\[ S=\\frac1{(1-\\alpha)+\\alpha/k} \\] \u5176\u4e2d \\(S\\) \u662f\u52a0\u901f\u524d\u540e\u7684\u65f6\u95f4\u6bd4\uff0c \\(\\alpha\\) \u662f\u6240\u52a0\u901f\u90e8\u5206\u5360\u7cfb\u7edf\u65f6\u95f4\u6bd4\uff0c \\(k\\) \u662f\u8be5\u90e8\u5206\u6027\u80fd\u63d0\u5347\u6bd4\u4f8b\u3002 \u5e76\u53d1\u548c\u5e76\u884c \u4e66\u672c\u5b9a\u4e49\uff1a \u5e76\u53d1\uff08concurrency\uff09\u6307\u540c\u65f6\u5177\u6709\u591a\u4e2a\u6d3b\u52a8\u3002 \u5e76\u884c\uff08parallelism\uff09\u6307\u4f7f\u7528\u5e76\u53d1\u4f7f\u7cfb\u7edf\u8fd0\u884c\u5f97\u66f4\u5feb\u3002 \u66f4\u6613\u61c2\u7684\u89e3\u91ca\uff1a \u5e76\u884c\uff1a\u4e24\u4e2a\u4efb\u52a1\u5728 \u540c\u4e00\u65f6\u523b\u4e92\u4e0d\u5e72\u6270 \u7684\u540c\u65f6\u6267\u884c\u3002 \u5e76\u53d1\uff1a\u540c\u65f6\u5b89\u6392\u82e5\u5e72\u4e2a\u4efb\u52a1\uff0c\u8fd9\u4e9b\u4efb\u52a1\u53ef\u4ee5\u5f7c\u6b64\u7a7f\u63d2\u7740\u8fdb\u884c\uff1b\u6709\u4e9b\u4efb\u52a1\u53ef\u80fd\u662f\u5e76\u884c\u7684\uff0c\u6bd4\u5982\u4e70\u83dc\u3001\u53d1\u90ae\u4ef6\u548c\u53bb\u5e7c\u513f\u56ed\u7684\u67d0\u4e9b\u8def\u9014\u662f\u91cd\u53e0\u7684\uff0c\u8fd9\u65f6\u4f60\u7684\u786e\u540c\u65f6\u5728\u505a\u4e09\u4ef6\u4e8b\uff1b\u4f46\u8fdb\u83dc\u5e02\u573a\u548c\u53d1\u90ae\u4ef6\u548c\u63a5\u5a03\u4e09\u8005\u662f\u4e92\u65a5\u7684\uff0c\u6bcf\u4e2a\u65f6\u523b\u53ea\u80fd\u5b8c\u6210\u5176\u4e2d\u4e00\u4ef6\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5e76\u53d1\u5141\u8bb8\u4e24\u4e2a\u4efb\u52a1\u5f7c\u6b64\u5e72\u6270\u3002 \u4e32\u884c\u8fd8\u662f\u5e76\u53d1\uff0c\u8fd9\u90fd\u662f \u4efb\u52a1\u5b89\u6392\u8005 \u89c6\u89d2\u770b\u5230\u7684\u4e1c\u897f\u3002\u76f8\u6bd4\u4e4b\u4e0b\uff0c\u201c\u5e76\u884c\u201d\u662f \u4efb\u52a1\u6267\u884c\u8005 \u89c6\u89d2\u7684\u4e1c\u897f\u3002 \u7b80\u5355\u4e86\u89e3\u4e09\u4e2a\u5c42\u6b21\u7684\u5e76\u53d1\uff1a \u7ebf\u7a0b\u7ea7\u5e76\u53d1 \u7ebf\u7a0b\u3001\u8fdb\u7a0b \u8fdb\u7a0b\uff1a\u4e00\u4e2a\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u7a0b\u5e8f \u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8fd0\u884c\u591a\u4e2a\u8fdb\u7a0b\u3002 \u6bcf\u4e2a\u8fdb\u7a0b\u770b\u4e0a\u53bb\u662f\u72ec\u5360\u5730\u4f7f\u7528\u5904\u7406\u5668\u3001\u4e3b\u5b58\u548c I/O \u8bbe\u5907\u3002 \u4f7f\u7528 \u5e76\u53d1 \u8fd0\u884c\uff0c\u4e0d\u540c\u8fdb\u7a0b\u7684\u6307\u4ee4\u53ef\u4ee5\u4ea4\u9519\u8fdb\u884c\u3002\u8fd9\u662f\u901a\u8fc7 \u4e0a\u4e0b\u6587\u5207\u6362 \u5b9e\u73b0\u7684\u3002 \u7ebf\u7a0b\uff1a\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u8fdb\u7a0b\u7531\u591a\u4e2a\u7ebf\u7a0b\u7ec4\u6210\u3002 \u6bcf\u4e2a\u7ebf\u7a0b\u90fd\u8fd0\u884c\u5728\u8fdb\u7a0b\u7684\u4e0a\u4e0b\u6587\u4e2d\uff0c \u5171\u4eab\u4ee3\u7801\u548c\u5168\u5c40\u6570\u636e \u3002 \u5728\u7f51\u7edc\u670d\u52a1\u4e2d\uff0c\u7ebf\u7a0b\u80fd\u9ad8\u6548\u6ee1\u8db3\u5e76\u884c\u5904\u7406\u8981\u6c42\u3002 \u5728 \u591a\u5904\u7406\u5668 \u53ef\u7528\u65f6\uff0c\u7ebf\u7a0b\u80fd\u6781\u5927\u63d0\u5347\u7a0b\u5e8f\u7684\u6548\u7387\u3002 \u8d85\u7ebf\u7a0b\uff1a\u53c8\u79f0\u540c\u65f6\u591a\u7ebf\u7a0b\uff0c\u6307 CPU \u6267\u884c\u591a\u4e2a\u63a7\u5236\u6d41\u3002 \u5b9e\u73b0\u539f\u7406\u662f CPU \u7684\u67d0\u4e9b\u786c\u4ef6\u6709\u591a\u4e2a\u5907\u4efd\uff0c\u6bd4\u5982\u7a0b\u5e8f\u8ba1\u6570\u5668\u548c\u5bc4\u5b58\u5668\u3002","title":"Ch1. \u8ba1\u7b97\u673a\u7cfb\u7edf\u6f2b\u6e38"},{"location":"books/CSAPP/Chapter2/","tags":["Ongoing"],"text":"Ch2. \u4fe1\u606f\u7684\u8868\u793a\u548c\u5904\u7406 \u00b6 2.1 \u4fe1\u606f\u5b58\u50a8 \u00b6 Abstract \u672c\u7ae0\u4e3b\u8981\u8bb2\u89e3\u4e00\u4e9b\u548c\u5b57\u8282\u7f16\u7801\u6709\u5173\u7684\u57fa\u7840\u77e5\u8bc6\uff0c\u4e3a\u4e0b\u4e00\u7ae0\u9605\u8bfb\u6c47\u7f16\u4ee3\u7801\u548c\u4e8c\u8fdb\u5236\u6570\u636e\u5960\u5b9a\u57fa\u7840\u3002 \u5341\u516d\u8fdb\u5236\u8868\u793a\u6cd5\uff1a \u719f\u8bb0 A, C, F \u7684\u4e8c\u8fdb\u5236\u8868\u793a\u5373\u53ef\u3002 \u7ec3\u4e60\uff1a\u5bf9\u5341\u516d\u8fdb\u5236\u6570\u6216\u5176\u4ed6\u8fdb\u5236\u6570\u505a\u52a0\u51cf\u8fd0\u7b97\u3002\u5982\u4f55\u501f\u4f4d\uff1f \u5b57\u957f \u6211\u4eec\u5e38\u8bf4\u7684\u201c32 \u4f4d\u201d\u7b49\uff0c\u6307\u7684\u662f\u8ba1\u7b97\u673a\u7684\u5b57\u957f\uff0c\u5373\u6307\u9488\u53d8\u91cf\u7684\u6807\u79f0\u957f\u5ea6\u3002 \u6211\u4eec\u8bf4\u7a0b\u5e8f\u662f\u201c32 \u4f4d\u201d\u6216\u201c64 \u4f4d\u201d\u65f6\uff0c\u6307\u7684\u662f\u7a0b\u5e8f\u7f16\u8bd1\u65f6\u7684\u914d\u7f6e\u3002 gcc \u7f16\u8bd1\u65f6\u4f7f\u7528 -m32 \u548c -m64 \u9009\u9879\u53ef\u4ee5\u6307\u5b9a\u5b57\u957f\u3002 \u6570\u636e\u5927\u5c0f C \u6807\u51c6\u4e3a\u4e0d\u540c\u6570\u636e\u7c7b\u578b\u8303\u56f4\u8bbe\u7f6e\u4e86\u4e0b\u754c\uff0c\u5374\u6ca1\u6709\u8bbe\u7f6e\u4e0a\u754c\u3002 \u4f7f\u7528 C99 \u5f15\u5165\u7684 int32_t \u548c int64_t \u7b49\u7c7b\u578b\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u5927\u5c0f\u3002 \u5927\u90e8\u5206\u6570\u636e\u7c7b\u578b\u662f\u6709\u7b26\u53f7\u7684\uff0c char \u7c7b\u578b\u672a\u4f5c\u89c4\u5b9a\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u7a0b\u5e8f\u884c\u4e3a\u4e0d\u4f1a\u56e0\u6b64\u4e0d\u540c\u3002 \u5bfb\u5740\u548c\u5b57\u8282\u987a\u5e8f \u5927\u591a\u6570\u673a\u5668\u4e0a\uff0c\u5bf9\u8c61\u7684\u5730\u5740\u662f\u6240\u5360\u5b57\u8282\u7684\u6700\u5c0f\u7684\u5730\u5740\u3002 Intel \u673a\u5668\u4e00\u822c\u91c7\u7528\u5c0f\u7aef\u6cd5\uff1a\u6570\u5b57\u7684\u6700\u4f4e\u4f4d\u5b57\u8282\u653e\u5728\u6700\u524d\u9762\u3002\u6bd4\u5982 0x123456 \u5728\u5185\u5b58\u4e2d\u987a\u5e8f\u653e\u7f6e\u4e3a 56 34 12 \u3002 Android \u548c iOS \u90fd\u53ea\u80fd\u91c7\u7528\u5c0f\u7aef\u6cd5\u3002\u5b83\u4eec\u901a\u5e38\u8fd0\u884c\u5728 ARM \u5fae\u5904\u7406\u5668\u4e0a\uff0c\u5176\u786c\u4ef6\u53ef\u4ee5\u914d\u7f6e\u4e3a\u5927\u7aef/\u5c0f\u7aef\u4e24\u79cd\u6a21\u5f0f\u3002 \u5728\u8fd9\u4e9b\u65b9\u9762\uff0c\u5b57\u8282\u987a\u5e8f\u4f1a\u4ea7\u751f\u5f71\u54cd\uff1a\u901a\u8fc7\u7f51\u7edc\u4f20\u9001\u4e8c\u8fdb\u5236\u6570\u636e\u3001\u68c0\u67e5\u673a\u5668\u7ea7\u7a0b\u5e8f\u548c\u7f16\u5199\u89c4\u907f \u7c7b\u578b\u7cfb\u7edf \u7684\u7a0b\u5e8f\u65f6\u3002 \u7ec3\u4e60\uff1a\u4e66\u672c\u63d0\u4f9b\u4e86 show_bytes \u4f8b\u7a0b\uff0c\u53ef\u4ee5\u7528\u4e8e\u68c0\u67e5\u673a\u5668\u7684\u5b57\u8282\u987a\u5e8f\u3002 Note \u6307\u9488\u7684\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u5e76\u4e0d\u4f1a\u6539\u53d8\u6307\u9488\u7684\u503c\uff0c\u53ea\u662f\u544a\u8bc9 \u7f16\u8bd1\u5668 \u4ee5\u53e6\u4e00\u79cd\u7c7b\u578b\u770b\u5f85\u8be5\u6307\u9488\u3002\u6839\u636e\u4e66\u672c\u7684\u63cf\u8ff0\uff0c\u6307\u9488\u548c\u7c7b\u578b\u7cfb\u7edf\u90fd\u7531\u7f16\u8bd1\u5668\u6240\u63a7\u5236\u3002 \u5e03\u5c14\u4ee3\u6570 \u638c\u63e1\u7b80\u5355\u7684\u56db\u79cd\u5e03\u5c14\u8fd0\u7b97\u5373\u53ef\u3002\u6df1\u5165\u7684\u5b66\u4e60\u5728\u201c\u79bb\u6563\u6570\u5b66\u53ca\u5176\u5e94\u7528\u201d\u8bfe\u7a0b\u4e2d\u3002 \u4f4d\u5411\u91cf\u5e38\u7528\u4e8e\u4e3a\u96c6\u5408\u7f16\u7801\u3002 \u7ec3\u4e60\u9898\u63d0\u5230\u4e86\u5229\u7528 a^a=0 \u6027\u8d28\u7f16\u5199\u7684\u4e09\u53d8\u91cf\u4ea4\u6362\u7a0b\u5e8f\uff0c\u8fd9\u662f\u4e00\u4e2a\u6280\u5de7\uff0c\u4f46\u8bf7\u4e0d\u8981\u7528\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u3002\u5b83\u53ef\u80fd\u4f1a\u9047\u5230\u95ee\u9898\uff0c\u6bd4\u5982\u5bf9\u6307\u5411\u540c\u4e00\u4f4d\u7f6e\u7684\u6307\u9488\u8fdb\u884c\u4ea4\u6362\u65f6\u3002 \u9700\u8981\u638c\u63e1\u7684\u6280\u80fd\u662f\uff1a\u5982\u4f55\u6839\u636e\u5df2\u6709\u7684\u5e03\u5c14\u51fd\u6570\uff0c\u6784\u9020\u6240\u9700\u7684\u5e03\u5c14\u51fd\u6570\u3002\u53ef\u4ee5\u901a\u8fc7\u89c2\u5bdf\u771f\u503c\u8868\u5bfb\u627e\u5173\u7cfb\uff0c\u66f4\u91cd\u8981\u7684\u662f\u5b66\u4f1a\u4f7f\u7528\u4e24\u79cd\u65b9\u6cd5\u89e3\u6790\u5176\u4e2d\u7684\u5e03\u5c14\u8868\u8fbe\u5f0f\u3002 \u79fb\u4f4d\u8fd0\u7b97 \u7b80\u8bb0\uff1a\u53f3\u79fb\u65f6\uff0c\u903b\u8f91\u8865 0\uff0c\u7b97\u6570\u8865\u6700\u9ad8\u4f4d\u3002\u79fb\u52a8\u65f6\u53d6\u6a21\u3002 \u79fb\u4f4d\u8fd0\u7b97\u7684\u4f18\u5148\u7ea7\u4f4e\u4e8e\u52a0\u51cf\u8fd0\u7b97\uff0c\u9ad8\u4e8e\u903b\u8f91\u8fd0\u7b97\u3002 2.2 \u6574\u6570\u8868\u793a \u00b6 \u8df3\u8fc7\uff01 2.3 \u6574\u6570\u8fd0\u7b97 \u00b6","title":"Ch2. \u4fe1\u606f\u7684\u8868\u793a\u548c\u5904\u7406"},{"location":"books/CSAPP/Chapter2/#ch2","text":"","title":"Ch2. \u4fe1\u606f\u7684\u8868\u793a\u548c\u5904\u7406"},{"location":"books/CSAPP/Chapter2/#21","text":"Abstract \u672c\u7ae0\u4e3b\u8981\u8bb2\u89e3\u4e00\u4e9b\u548c\u5b57\u8282\u7f16\u7801\u6709\u5173\u7684\u57fa\u7840\u77e5\u8bc6\uff0c\u4e3a\u4e0b\u4e00\u7ae0\u9605\u8bfb\u6c47\u7f16\u4ee3\u7801\u548c\u4e8c\u8fdb\u5236\u6570\u636e\u5960\u5b9a\u57fa\u7840\u3002 \u5341\u516d\u8fdb\u5236\u8868\u793a\u6cd5\uff1a \u719f\u8bb0 A, C, F \u7684\u4e8c\u8fdb\u5236\u8868\u793a\u5373\u53ef\u3002 \u7ec3\u4e60\uff1a\u5bf9\u5341\u516d\u8fdb\u5236\u6570\u6216\u5176\u4ed6\u8fdb\u5236\u6570\u505a\u52a0\u51cf\u8fd0\u7b97\u3002\u5982\u4f55\u501f\u4f4d\uff1f \u5b57\u957f \u6211\u4eec\u5e38\u8bf4\u7684\u201c32 \u4f4d\u201d\u7b49\uff0c\u6307\u7684\u662f\u8ba1\u7b97\u673a\u7684\u5b57\u957f\uff0c\u5373\u6307\u9488\u53d8\u91cf\u7684\u6807\u79f0\u957f\u5ea6\u3002 \u6211\u4eec\u8bf4\u7a0b\u5e8f\u662f\u201c32 \u4f4d\u201d\u6216\u201c64 \u4f4d\u201d\u65f6\uff0c\u6307\u7684\u662f\u7a0b\u5e8f\u7f16\u8bd1\u65f6\u7684\u914d\u7f6e\u3002 gcc \u7f16\u8bd1\u65f6\u4f7f\u7528 -m32 \u548c -m64 \u9009\u9879\u53ef\u4ee5\u6307\u5b9a\u5b57\u957f\u3002 \u6570\u636e\u5927\u5c0f C \u6807\u51c6\u4e3a\u4e0d\u540c\u6570\u636e\u7c7b\u578b\u8303\u56f4\u8bbe\u7f6e\u4e86\u4e0b\u754c\uff0c\u5374\u6ca1\u6709\u8bbe\u7f6e\u4e0a\u754c\u3002 \u4f7f\u7528 C99 \u5f15\u5165\u7684 int32_t \u548c int64_t \u7b49\u7c7b\u578b\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u5927\u5c0f\u3002 \u5927\u90e8\u5206\u6570\u636e\u7c7b\u578b\u662f\u6709\u7b26\u53f7\u7684\uff0c char \u7c7b\u578b\u672a\u4f5c\u89c4\u5b9a\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u7a0b\u5e8f\u884c\u4e3a\u4e0d\u4f1a\u56e0\u6b64\u4e0d\u540c\u3002 \u5bfb\u5740\u548c\u5b57\u8282\u987a\u5e8f \u5927\u591a\u6570\u673a\u5668\u4e0a\uff0c\u5bf9\u8c61\u7684\u5730\u5740\u662f\u6240\u5360\u5b57\u8282\u7684\u6700\u5c0f\u7684\u5730\u5740\u3002 Intel \u673a\u5668\u4e00\u822c\u91c7\u7528\u5c0f\u7aef\u6cd5\uff1a\u6570\u5b57\u7684\u6700\u4f4e\u4f4d\u5b57\u8282\u653e\u5728\u6700\u524d\u9762\u3002\u6bd4\u5982 0x123456 \u5728\u5185\u5b58\u4e2d\u987a\u5e8f\u653e\u7f6e\u4e3a 56 34 12 \u3002 Android \u548c iOS \u90fd\u53ea\u80fd\u91c7\u7528\u5c0f\u7aef\u6cd5\u3002\u5b83\u4eec\u901a\u5e38\u8fd0\u884c\u5728 ARM \u5fae\u5904\u7406\u5668\u4e0a\uff0c\u5176\u786c\u4ef6\u53ef\u4ee5\u914d\u7f6e\u4e3a\u5927\u7aef/\u5c0f\u7aef\u4e24\u79cd\u6a21\u5f0f\u3002 \u5728\u8fd9\u4e9b\u65b9\u9762\uff0c\u5b57\u8282\u987a\u5e8f\u4f1a\u4ea7\u751f\u5f71\u54cd\uff1a\u901a\u8fc7\u7f51\u7edc\u4f20\u9001\u4e8c\u8fdb\u5236\u6570\u636e\u3001\u68c0\u67e5\u673a\u5668\u7ea7\u7a0b\u5e8f\u548c\u7f16\u5199\u89c4\u907f \u7c7b\u578b\u7cfb\u7edf \u7684\u7a0b\u5e8f\u65f6\u3002 \u7ec3\u4e60\uff1a\u4e66\u672c\u63d0\u4f9b\u4e86 show_bytes \u4f8b\u7a0b\uff0c\u53ef\u4ee5\u7528\u4e8e\u68c0\u67e5\u673a\u5668\u7684\u5b57\u8282\u987a\u5e8f\u3002 Note \u6307\u9488\u7684\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u5e76\u4e0d\u4f1a\u6539\u53d8\u6307\u9488\u7684\u503c\uff0c\u53ea\u662f\u544a\u8bc9 \u7f16\u8bd1\u5668 \u4ee5\u53e6\u4e00\u79cd\u7c7b\u578b\u770b\u5f85\u8be5\u6307\u9488\u3002\u6839\u636e\u4e66\u672c\u7684\u63cf\u8ff0\uff0c\u6307\u9488\u548c\u7c7b\u578b\u7cfb\u7edf\u90fd\u7531\u7f16\u8bd1\u5668\u6240\u63a7\u5236\u3002 \u5e03\u5c14\u4ee3\u6570 \u638c\u63e1\u7b80\u5355\u7684\u56db\u79cd\u5e03\u5c14\u8fd0\u7b97\u5373\u53ef\u3002\u6df1\u5165\u7684\u5b66\u4e60\u5728\u201c\u79bb\u6563\u6570\u5b66\u53ca\u5176\u5e94\u7528\u201d\u8bfe\u7a0b\u4e2d\u3002 \u4f4d\u5411\u91cf\u5e38\u7528\u4e8e\u4e3a\u96c6\u5408\u7f16\u7801\u3002 \u7ec3\u4e60\u9898\u63d0\u5230\u4e86\u5229\u7528 a^a=0 \u6027\u8d28\u7f16\u5199\u7684\u4e09\u53d8\u91cf\u4ea4\u6362\u7a0b\u5e8f\uff0c\u8fd9\u662f\u4e00\u4e2a\u6280\u5de7\uff0c\u4f46\u8bf7\u4e0d\u8981\u7528\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u3002\u5b83\u53ef\u80fd\u4f1a\u9047\u5230\u95ee\u9898\uff0c\u6bd4\u5982\u5bf9\u6307\u5411\u540c\u4e00\u4f4d\u7f6e\u7684\u6307\u9488\u8fdb\u884c\u4ea4\u6362\u65f6\u3002 \u9700\u8981\u638c\u63e1\u7684\u6280\u80fd\u662f\uff1a\u5982\u4f55\u6839\u636e\u5df2\u6709\u7684\u5e03\u5c14\u51fd\u6570\uff0c\u6784\u9020\u6240\u9700\u7684\u5e03\u5c14\u51fd\u6570\u3002\u53ef\u4ee5\u901a\u8fc7\u89c2\u5bdf\u771f\u503c\u8868\u5bfb\u627e\u5173\u7cfb\uff0c\u66f4\u91cd\u8981\u7684\u662f\u5b66\u4f1a\u4f7f\u7528\u4e24\u79cd\u65b9\u6cd5\u89e3\u6790\u5176\u4e2d\u7684\u5e03\u5c14\u8868\u8fbe\u5f0f\u3002 \u79fb\u4f4d\u8fd0\u7b97 \u7b80\u8bb0\uff1a\u53f3\u79fb\u65f6\uff0c\u903b\u8f91\u8865 0\uff0c\u7b97\u6570\u8865\u6700\u9ad8\u4f4d\u3002\u79fb\u52a8\u65f6\u53d6\u6a21\u3002 \u79fb\u4f4d\u8fd0\u7b97\u7684\u4f18\u5148\u7ea7\u4f4e\u4e8e\u52a0\u51cf\u8fd0\u7b97\uff0c\u9ad8\u4e8e\u903b\u8f91\u8fd0\u7b97\u3002","title":"2.1 \u4fe1\u606f\u5b58\u50a8"},{"location":"books/CSAPP/Chapter2/#22","text":"\u8df3\u8fc7\uff01","title":"2.2 \u6574\u6570\u8868\u793a"},{"location":"books/CSAPP/Chapter2/#23","text":"","title":"2.3 \u6574\u6570\u8fd0\u7b97"},{"location":"books/CSAPP/Chapter3/","tags":["Ongoing"],"text":"Ch3. \u7a0b\u5e8f\u7684\u673a\u5668\u7ea7\u8868\u793a \u00b6 Abstract \u672c\u7ae0\u5b66\u4e60\u6c47\u7f16\u8bed\u8a00\u548c\u673a\u5668\u8bed\u8a00\u3002\u5b66\u4e60\u672c\u7ae0\u540e\uff0c\u4f60\u5e94\u8be5\u638c\u63e1\u7f16\u8bd1\u3001\u53cd\u7f16\u8bd1\u5de5\u5177\u7684\u4f7f\u7528\uff0c\u5e76\u80fd\u591f\u9605\u8bfb\u7b80\u5355\u7684\u6c47\u7f16\u4ee3\u7801\u3002 \u672c\u7ae0\u9700\u8981\u7528\u5230\u7684\u547d\u4ee4\u884c\u5de5\u5177 \u00b6 gcc -Og -S test.c -S : \u8c03\u7528 \u7f16\u8bd1\u5668 \uff0c\u751f\u6210 \u6c47\u7f16\u4ee3\u7801 \uff08 .s \u540e\u7f00\uff09\u3002 -c : \u8c03\u7528 \u6c47\u7f16\u5668 \uff0c\u751f\u6210\u672a\u94fe\u63a5\uff08\u6ca1\u586b\u5165\u5168\u5c40\u503c\u7684\u5730\u5740\uff09\u7684\u4e8c\u8fdb\u5236 \u76ee\u6807\u6587\u4ef6\uff08\u673a\u5668\u4ee3\u7801\uff09 \uff08 .o \u6216 .obj \u540e\u7f00\uff09\u3002 -o : \u6307\u5b9a\u4ea7\u751f\u7684 \u53ef\u6267\u884c\u6587\u4ef6\uff08\u673a\u5668\u4ee3\u7801\uff09 \u540d\uff08 .exe \u6216\u65e0\u540e\u7f00\uff09\u3002 -Og : \uff08\u4e0d\u8fdb\u884c\u4f18\u5316\uff09\u751f\u6210\u7b26\u5408\u539f\u59cb C \u4ee3\u7801\u6574\u4f53\u7ed3\u6784\u7684\u673a\u5668\u4ee3\u7801\u3002\u672c\u7ae0\u4f7f\u7528\u8be5\u9009\u9879\u4f5c\u4e3a\u5b66\u4e60\u5de5\u5177\u3002 -O1, -O2 : \u8f83\u9ad8\u7ea7\u522b\u7684\u4f18\u5316 objdump -d test.o -f : display file header information GDB \u8c03\u8bd5\u7a0b\u5e8f\u7684\u5b57\u8282\u4ee3\u7801 \u9996\u5148\u901a\u8fc7\u53cd\u6c47\u7f16\u5668\u786e\u5b9a\u8be5\u8fc7\u7a0b\u7684\u4ee3\u7801\u957f\u5ea6 (gdb) x/14xb multstore 3.1 \u5386\u53f2\u89c2\u70b9 \u00b6 Intel \u5904\u7406\u5668\u7cfb\u5217\u79f0\u4e3a x86 \u3002 x86-64 \u662f\u4e00\u79cd \u673a\u5668\u8bed\u8a00 \uff0c\u662f\u76ee\u524d\u7b14\u8bb0\u672c\u7535\u8111\u548c\u53f0\u5f0f\u673a\u6700\u5e38\u89c1\u7684\u3002 \u5b83\u517c\u5bb9\u5b83\u7684 32 \u4f4d\u524d\u8eab\u2014\u2014 IA32 \uff08INtel Architecture 32-bit\uff09\u3002 8086 \u662f\u4e00\u6b3e\u5904\u7406\u5668\u3002\u5b83\u662f\u7b2c\u4e00\u4ee3\u5355\u82af\u7247\u300116 \u4f4d\u5fae\u5904\u7406\u5668\u4e4b\u4e00\u3002 i386 \u662f\u4e00\u6b3e\u5904\u7406\u5668\u3002\u5b83\u5c06\u4f53\u7cfb\u7ed3\u6784\u6269\u5c55\u5230 32 \u4f4d\uff0c\u589e\u52a0\u4e86 \u5e73\u5766\u5bfb\u5740\u6a21\u5f0f \uff0cLinux \u548c Windows \u7cfb\u7edf\u90fd\u4f7f\u7528\u8fd9\u79cd\u6a21\u5f0f\u3002 3.2 \u7a0b\u5e8f\u7f16\u7801 \u00b6 \u5b66\u4e60\u673a\u5668\u7ea7\u7f16\u7a0b\u524d\uff0c\u8981\u4e86\u89e3\u4e24\u79cd\u6982\u5ff5\uff1a\u6307\u4ee4\u96c6\u67b6\u6784\u548c\u865a\u62df\u5730\u5740\u3002\u5b83\u4eec\u5c06\u590d\u6742\u7684\u786c\u4ef6\u5b9e\u73b0\u62bd\u8c61\u4e3a\u7b80\u5355\u7684\u6a21\u578b\u3002 \u6307\u4ee4\u96c6\u67b6\u6784/\u6307\u4ee4\u96c6\u4f53\u7cfb\u7ed3\u6784 \uff08Instruction Set Architecture, ISA\uff09\uff1a\u5b83\u5b9a\u4e49\u5904\u7406\u5668\u72b6\u6001\u3001\u6307\u4ee4\u683c\u5f0f\u3001\u6307\u4ee4\u5bf9\u72b6\u6001\u7684\u5f71\u54cd\u3002 ISA \u5c06\u7a0b\u5e8f\u7684\u884c\u4e3a\u63cf\u8ff0\u4e3a\u6bcf\u6761\u6307\u4ee4\u987a\u5e8f\u6267\u884c\uff0c\u800c\u786c\u4ef6\u5904\u7406\u8fdc\u6bd4\u63cf\u8ff0\u7684\u7cbe\u7ec6\u590d\u6742\uff0c\u5e76\u53d1\u6267\u884c\u8bb8\u591a\u6307\u4ee4\u3002 \u865a\u62df\u5730\u5740 \uff1a\u5bf9\u4e8e\u673a\u5668\u7ea7\u7a0b\u5e8f\uff0c\u5185\u5b58\u6a21\u578b\u770b\u8d77\u6765\u662f\u4e00\u4e2a\u975e\u5e38\u5927\u7684\u5b57\u8282\u6570\u7ec4\u3002 \u800c\u5b58\u50a8\u5668\u7cfb\u7edf\u5b9e\u9645\u5b9e\u73b0\u662f\u5c06\u591a\u4e2a\u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u8f6f\u4ef6\u7ec4\u5408\u8d77\u6765\u3002 \u5b66\u4e60\u673a\u5668\u7ea7\u7f16\u7a0b\u65f6\uff0c\u4f60\u4f1a\u89c1\u5230 C \u5bf9\u4f60\u9690\u85cf\u7684 \u5904\u7406\u5668\u72b6\u6001 \uff1a \u7a0b\u5e8f\u8ba1\u6570\u5668\uff08Program Counter\uff09\uff1a %rip \uff0c\u5b58\u50a8\u4e0b\u4e00\u6761\u6307\u4ee4\u5728\u5185\u5b58\u4e2d\u7684\u5730\u5740\u3002 \u6574\u6570 \u5bc4\u5b58\u5668 \u6587\u4ef6\uff1a\u5305\u542b 16 \u4e2a\u547d\u540d\u4f4d\u7f6e\uff0c\u5206\u522b\u5b58\u50a8 64 \u4f4d \u503c\u3002\u53ef\u4ee5\u5b58\u50a8\u5730\u5740\uff08\u6307\u9488\uff09\u6216\u6574\u6570\u6570\u636e\u3002 \u53ef\u80fd\u7528\u4e8e\uff1a\u8bb0\u5f55\u7a0b\u5e8f\u72b6\u6001\uff0c\u4fdd\u5b58\u4e34\u65f6\u6570\u636e\uff0c\u5982\u53c2\u6570\u3001\u5c40\u90e8\u53d8\u91cf\u3001\u8fd4\u56de\u503c\u3002 \u6761\u4ef6\u7801 \u5bc4\u5b58\u5668\uff1a\u6700\u8fd1\u6267\u884c\u7684\u7b97\u672f\u6216\u903b\u8f91\u6307\u4ee4\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u5b9e\u73b0 \u63a7\u5236\u6216\u6570\u636e\u6d41 \u4e2d\u7684\u6761\u4ef6\u53d8\u5316 \u4e00\u7ec4 \u5411\u91cf \u5bc4\u5b58\u5668\uff1a\u4e00\u4e2a\u6216\u591a\u4e2a\u6574\u6570/\u6d6e\u70b9\u6570\u3002 \u4ece C \u5230\u673a\u5668\u8bed\u8a00\u9700\u8981\u4e86\u89e3\u7684\u4e0d\u540c\uff1a \u673a\u5668\u4ee3\u7801\u5c06\u5185\u5b58\u7b80\u5355\u5730\u770b\u4f5c \u6309\u5b57\u8282\u5bfb\u5740\u7684\u6570\u7ec4 \u3002\u8fd9\u610f\u5473\u7740 \u4e0d\u533a\u5206\u4efb\u4f55\u6570\u636e\u7c7b\u578b \u3002 \u7a0b\u5e8f\u5185\u5b58\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a\u7a0b\u5e8f\u7684\u673a\u5668\u4ee3\u7801\uff0c\u64cd\u4f5c\u7cfb\u7edf\u6240\u9700\u4fe1\u606f\uff0c\u8c03\u7528\u548c\u8fd4\u56de\u7684 \u8fd0\u884c\u65f6\u6808 \uff0c\u7528\u6237\u5206\u914d\u5185\u5b58\u5757\uff08malloc\uff09\u3002 \u64cd\u4f5c\u7cfb\u7edf\u8d1f\u8d23\u7ffb\u8bd1\u865a\u62df\u5730\u5740\u4e3a\u5b9e\u9645\u5904\u7406\u5668\u4e2d\u5185\u5b58\u7269\u7406\u5730\u5740 \u3002 \u673a\u5668\u6307\u4ee4\u4ec5\u6267\u884c\u975e\u5e38\u57fa\u672c\u7684\u64cd\u4f5c\uff1a \u5bc4\u5b58\u5668\u76f8\u52a0\u3001\u5b58\u50a8\u5668\u548c\u5bc4\u5b58\u5668\u4e4b\u95f4\u4f20\u9001\u3001\u6761\u4ef6\u5206\u652f\u5230\u65b0\u6307\u4ee4\u5730\u5740 \u3002\u7f16\u8bd1\u5668\u5fc5\u987b\u4ea7\u751f\u8fd9\u4e9b\u6307\u4ee4\u7684\u5e8f\u5217\uff0c\u4ece\u800c\u5b9e\u73b0\u7a0b\u5e8f\u7ed3\u6784\u3002 \u673a\u5668\u4ee3\u7801\u548c\u53cd\u6c47\u7f16\u7279\u6027\uff1a x86-64 \u7684\u6307\u4ee4\u957f\u5ea6\uff1a1-15 \u4e2a\u5b57\u8282\u4e0d\u7b49\uff0c\u5e38\u7528\u6307\u4ee4\u548c\u64cd\u4f5c\u6570\u8f83\u5c11\u7684\u6307\u4ee4\u6240\u9700\u5b57\u8282\u6570\u8f83\u5c11 \u6307\u4ee4\u8bbe\u8ba1\u683c\u5f0f\uff1a\u67d0\u7ed9\u5b9a\u4f4d\u7f6e\u5f00\u59cb\uff0c\u5b57\u8282\u53ef\u4ee5\u552f\u4e00\u89e3\u7801\u6210\u673a\u5668\u6307\u4ee4\u3002\u5982\u53ea\u6709 pushq %rbx \u662f\u4ee5\u5b57\u8282\u503c 53 \u5f00\u5934 \u53cd\u6c47\u7f16\u5668\uff1a\u4ec5\u57fa\u4e8e\u673a\u5668\u4ee3\u7801\u7684\u5b57\u8282\u5e8f\u5217\u786e\u5b9a\u6c47\u7f16\u4ee3\u7801\uff1b\u6307\u4ee4\u547d\u540d\u89c4\u5219\u4e0e GCC \u6709\u4e9b\u7ec6\u5fae\u5dee\u522b\uff0c\u6bd4\u5982 GCC \u7701\u7565\u4e86\u5f88\u591a\u6307\u4ee4\u7ed3\u5c3e\u7684 q\uff0c\u8fd9\u4e9b\u540e\u7f00\u662f \u5927\u5c0f\u6307\u793a\u7b26 \uff0c\u5f88\u591a\u60c5\u51b5\u4e0b\u53ef\u4ee5\u5ffd\u7565 \u5bf9 \u4e00\u7ec4\u76ee\u6807\u6587\u4ef6 \u8fd0\u884c\u94fe\u63a5\u5668\u6240\u505a\u7684\u4e8b\uff1a\u5305\u542b\u4e86\u542f\u52a8\u548c\u7ec8\u6b62\u7a0b\u5e8f\u7684\u4ee3\u7801\uff0c\u548c\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u4ea4\u4e92\u7684\u4ee3\u7801 \u94fe\u63a5\u540e\u7684\u7a0b\u5e8f\u8fdb\u884c\u53cd\u7f16\u8bd1\uff0c\u4f1a\u53d1\u73b0\u5de6\u4fa7\u5217\u51fa\u7684\u5730\u5740\u4e0d\u540c\uff1a\u94fe\u63a5\u5668\u5c06\u5730\u5740\u79fb\u5230\u4e86\u4e0d\u540c\u7684\u5730\u5740\u8303\u56f4\u4e2d\uff1b\u4e14\u94fe\u63a5\u5668\u586b\u5145\u4e86 callq \u6307\u4ee4\u8c03\u7528\u51fd\u6570\u9700\u8981\u4f7f\u7528\u7684\u5730\u5740\uff08\u8fd9\u5c31\u662f\u94fe\u63a5\u5668\u7684\u4efb\u52a1\u4e4b\u4e00\uff1a\u627e\u5230\u5339\u914d\u51fd\u6570\u7684\u53ef\u6267\u884c\u4ee3\u7801\u7684\u4f4d\u7f6e\uff09 nop(hex = 90) \u6307\u4ee4\uff1a\u5bf9\u7a0b\u5e8f\u6ca1\u6709\u5f71\u54cd\uff0c\u53ea\u662f\u4e3a\u4e86\u8ba9\u51fd\u6570\u4ee3\u7801\u53d8\u4e3a 16 \u5b57\u8282\uff0c\u66f4\u597d\u5730\u653e\u7f6e\u4e0b\u4e00\u4e2a\u4ee3\u7801\u5757 \u6c47\u7f16\u4ee3\u7801\u7684\u683c\u5f0f\uff1a . \u5f00\u5934\u7684\u884c\u90fd\u662f\u6c47\u7f16\u5668\u548c \u94fe\u63a5\u5668 \u7684\u4f2a\u6307\u4ee4 \u4e66\u672c\u7684\u8868\u8ff0\u57fa\u4e8e ATT \uff0c\u4e0e GCC\u3001OBJDUMP \u548c\u4e00\u4e9b\u5176\u4ed6\u5de5\u5177\u76f8\u540c Intel \u683c\u5f0f\u7684\u8868\u8ff0\u88ab Microsoft \u7684\u5de5\u5177\u6240\u91c7\u7528 \u7701\u7565\u6307\u793a\u5927\u5c0f\u7684\u540e\u7f00\u5982 q \u7701\u7565\u5bc4\u5b58\u5668\u524d\u7684 % \u63cf\u8ff0\u5185\u5b58\u4f4d\u7f6e\u7684\u65b9\u6cd5\u4e0d\u540c \u5217\u51fa\u64cd\u4f5c\u6570\u7684\u987a\u5e8f\u4e0e ATT \u76f8\u53cd\uff0c\u8fd9\u5728\u4e24\u79cd\u683c\u5f0f\u7684\u8f6c\u6362\u4e2d\u5f15\u8d77\u6781\u5927\u56f0\u60d1 \u5728 C \u4e2d\u5d4c\u5165\u6c47\u7f16\u4ee3\u7801\u7684\u4e24\u79cd\u65b9\u5f0f\uff1a \u7528\u6c47\u7f16\u4ee3\u7801\u7f16\u5199\u6574\u4e2a\u51fd\u6570\uff0c\u5728 \u94fe\u63a5 \u9636\u6bb5\u5408\u5e76 \u5229\u7528 GCC \u76f4\u63a5\u5728 \u7a0b\u5e8f\u4e2d \u5d4c\u5165\u4ee3\u7801\uff08\u5185\u8054\u6c47\u7f16 inline assembly\uff09\uff0c\u4f7f\u7528 asm \u4f2a\u6307\u4ee4\u5728 C \u7a0b\u5e8f\u4e2d\u5305\u542b\u7b80\u77ed\u7684\u6c47\u7f16\u4ee3\u7801\u3002 \u8fd9\u5bfc\u81f4\u4ee3\u7801\u4e0e\u673a\u5668\u76f8\u5173 3.3 \u6570\u636e\u683c\u5f0f \u00b6 \u672f\u8bed\uff1a \u5b57\u8282 byte: 8 \u4f4d \u5b57 word\uff1a16 \u4f4d \u53cc\u5b57 double words\uff1a32 \u4f4d\uff0832 \u4f4d\u88ab\u770b\u4f5c\u957f\u5b57 long word\uff09 \u56db\u5b57 quad words\uff1a64 \u4f4d C \u6570\u636e\u7c7b\u578b Intel \u6570\u636e\u7c7b\u578b \u6c47\u7f16\u4ee3\u7801\u540e\u7f00 \u5927\u5c0f(byte) \u5927\u5c0f(bit) char \u5b57\u8282 b 1 8 short \u5b57 w 2 16 int \u53cc\u5b57 l 4 32 long \u56db\u5b57 q 8 64 \u6307\u9488 \u56db\u5b57 q 8 float \u5355\u7cbe\u5ea6 s 4 double \u53cc\u7cbe\u5ea6 l 8 \u6bd4\u5982\uff0c\u6570\u636e\u4f20\u9001\u6307\u4ee4\u6709\uff1a movb, movw, movl, movq \u6d6e\u70b9\u6570\u4f7f\u7528\u7684\u662f\u4e00\u7ec4 \u5b8c\u5168\u4e0d\u540c\u7684\u6307\u4ee4\u548c\u5bc4\u5b58\u5668 3.4 \u8bbf\u95ee\u4fe1\u606f \u00b6 Summary: x86-64 \u4f53\u7cfb\u7ed3\u6784 \u00b6 \u901a\u7528\u76ee\u7684\u5bc4\u5b58\u5668\uff1a16 \u4e2a\u5b58\u50a8 64 \u4f4d\u503c\uff0c\u7528\u4e8e\u6574\u6570\u6570\u636e\u548c\u6307\u9488\uff0c\u90fd\u4ee5 %r \u5f00\u5934\uff0c\u5b83\u4eec\u7684\u547d\u540d\u662f\u6307\u4ee4\u96c6\u5386\u53f2\u6f14\u5316\u9020\u6210\u7684 %rsp %esp %sp %spl : \u6808\u6307\u9488\u6700\u4e3a\u7279\u522b\uff0c\u6307\u660e\u8fd0\u884c\u65f6\u6808\u7684 \u7ed3\u675f\u4f4d\u7f6e \uff0c\u6709\u4e9b\u7a0b\u5e8f\u660e\u786e\u8bfb\u5199\u8be5\u5bc4\u5b58\u5668 %rax %eax %ax %al : \u8fd4\u56de\u503c\uff0c\u6bd4\u8f83\u5e38\u7528 %rbx %ebx %bx %bl : \u8c03\u7528\u8005\u4fdd\u5b58\u3002c,d \u662f\uff0c\u7b2c 4\u30013 \u4e2a\u53c2\u6570 %rdi %edi %di %dil : \u7b2c\u4e00\u4e2a\u53c2\u6570\u3002\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f s \u6761\u4ef6\u7801\u5bc4\u5b58\u5668\uff1a PF(parity flag) : \u5947\u5076\u6807\u5fd7\u3002\u5f53\u6267\u884c\u7b97\u672f\u6216\u903b\u8f91\u8fd0\u7b97\u65f6\uff0c\u5982\u679c\u5f97\u5230 \u8fd0\u7b97\u7ed3\u679c \u7684\u4f4e 8 \u4f4d\u4e2d\u6709\u5076\u6570\u4e2a 1\uff0c\u8be5\u4f4d\u7f6e 1\uff0c\u5426\u5219\u7f6e 0\u3002\u5728 C \u8bed\u8a00\u4e2d\u8ba1\u7b97\u8be5\u4fe1\u606f\u81f3\u5c11\u9700\u8981 7 \u6b21\u4f4d\u79fb\u3001\u63a9\u7801\u3001\u5f02\u6216\u8fd0\u7b97\u3002 \u4e0d\u540c\u5927\u5c0f\u7ea7\u522b\u7684\u64cd\u4f5c\u53ef\u4ee5\u8bbf\u95ee\u5bc4\u5b58\u5668\u7684\u4e0d\u540c\u90e8\u5206 \u5269\u4e0b\u7684\u5b57\u8282 \u4f1a\u600e\u4e48\u6837\u6709\u4e24\u6761\u89c4\u5219\uff1a1\u30012 \u5b57\u8282\u7684\u6307\u4ee4\u4e0d\u6539\u53d8\uff0c 4 \u5b57\u8282\u6307\u4ee4\u5c06\u9ad8\u4f4d\u5168\u90e8\u7f6e 0 \uff0c\u8fd9\u662f\u4ece IA32 \u5230 x86-64 \u6269\u5c55\u800c\u91c7\u7528\u7684 \u64cd\u4f5c\u6570 \u00b6 \u6570\u636e\u8bfb\u51fa\uff1a\u5e38\u6570\u5f62\u5f0f\u3001\u5bc4\u5b58\u5668\u3001\u5185\u5b58\uff1b\u7ed3\u679c\u5b58\u653e\uff1a\u5bc4\u5b58\u5668\u3001\u5185\u5b58 \u7acb\u5373\u6570 \uff1a\u8868\u793a\u5e38\u6570\u503c\uff1a $0x1F \u4f7f\u7528\u6807\u51c6 C \u8868\u793a\u6cd5\u8868\u793a\u6574\u6570\u3002\u4e0d\u540c\u6307\u4ee4\u5141\u8bb8\u7684\u7acb\u5373\u6570 \u503c\u8303\u56f4\u4e0d\u540c \u5bc4\u5b58\u5668 \uff1a r_a \u8868\u793a\u4efb\u610f\u5bc4\u5b58\u5668\uff0c R[r_a] \u8868\u793a\u5bc4\u5b58\u5668\u4e2d\u7684\u503c \u5185\u5b58\u5f15\u7528 \uff1a \u6839\u636e \u8ba1\u7b97\u51fa\u6765\u7684\u5730\u5740 \u8bbf\u95ee\u67d0\u4e2a\u5185\u5b58\u5730\u5740 M_b[Addr] \uff0c\u8868\u793a\u5bf9\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\u4ece Addr \u5f00\u59cb\u7684 \\(b\\) \u4e2a\u5b57\u8282\u7684\u5f15\u7528\u3002\u5e38\u7701\u53bb\u4e0b\u6807 \\(b\\) \u5185\u5b58\u5f15\u7528 \u603b\u662f\u4ee5\u56db\u5b57\u957f\u5bc4\u5b58\u5668\u7ed9\u51fa \uff0c\u54ea\u6015\u64cd\u4f5c\u6570\u53ea\u662f\u4e00\u4e2a\u5b57\u8282\u3001\u4e00\u4e2a\u5b57\u6216\u53cc\u5b57 \u5bfb\u5740\u6a21\u5f0f \uff1a Imm(r_b, r_i, s) = M[Imm + R[r_b] + R[r_i]*s] \u6bd4\u4f8b\u53d8\u5740\u5bfb\u5740\uff0c\u8fd9\u662f\u5f15\u7528\u6570\u7ec4\u548c\u7ed3\u6784\u5143\u7d20\u65f6\u901a\u7528\u7684\u5f62\u5f0f Imm : \u7acb\u5373\u6570\u504f\u79fb R[r_b] : \u57fa\u5740\u5bc4\u5b58\u5668\uff0864 \u4f4d\uff09 R[r_i] : \u53d8\u5740\u5bc4\u5b58\u5668\uff0864 \u4f4d\uff09 s : \u6bd4\u4f8b\u56e0\u5b50\uff0c\u5fc5\u987b\u662f \\(1,2,4,8\\) \u4f8b\uff1a\u8ba1\u7b97 260(%rax,%rdx,4) \u7684\u503c \u6307\u4ee4 \u00b6 \u5728\u5b66\u4e60\u6307\u4ee4\u65f6\uff0c\u6ce8\u610f\u6bcf\u4e00\u7c7b\u547d\u4ee4\u7684 \u6e90\u548c\u76ee\u7684\u7684\u8981\u6c42 \u662f\u975e\u5e38\u91cd\u8981\u7684 \u8bbf\u95ee\u4fe1\u606f \u00b6 \u6570\u636e\u4f20\u9001 \uff1a\u5b83\u4eec\u7684\u6e90/\u76ee\u7684\u7c7b\u578b\u4e0d\u540c\uff0c\u6216\u6267\u884c\u7684\u8f6c\u6362\u4e0d\u540c\uff0c\u6216\u8005\u6709\u4e00\u4e9b\u5176\u4ed6\u7684\u526f\u4f5c\u7528\u3002\u6211\u4eec\u628a\u76f8\u540c\u64cd\u4f5c\u7684\u4e00\u7cfb\u5217\u6267\u884c\u5212\u4e3a\u4e00\u7c7b\uff0c\u5b83\u4eec\u7684\u64cd\u4f5c\u6570\u5927\u5c0f\u4e0d\u540c MOV S,D \u7c7b \uff1a\u4e0d\u505a\u4efb\u4f55\u53d8\u5316\uff0c\u6570\u636e\u4ece S \u5230 D movb, movw, movl, movq, movabsq S\uff08\u6e90\u64cd\u4f5c\u6570\uff09 \u5e94\u5f53\u6307\u5b9a\u4e00\u4e2a \u7acb\u5373\u6570 \uff0c\u5b58\u50a8\u5728\u5bc4\u5b58\u5668\u6216\u5185\u5b58\u4e2d D\uff08\u76ee\u7684\u64cd\u4f5c\u6570\uff09 \u5e94\u5f53\u6307\u5b9a\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u5bc4\u5b58\u5668\u6216\u8005\u5185\u5b58\u5730\u5740 \u4e24\u4e2a\u64cd\u4f5c\u6570\u4e0d\u80fd\u90fd\u6307\u5411\u5185\u5b58 \uff1a \u5c06\u4e00\u4e2a\u503c\u4ece\u5185\u5b58\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u5185\u5b58\uff0c\u5fc5\u987b\u5148\u8f7d\u5165\u5bc4\u5b58\u5668\uff0c\u518d\u5199\u5165\u76ee\u7684\u4f4d\u7f6e movq %rax, -12(%rbp) \\\\register--memory 8bytes movb (%rdi, %rcx),%al \\\\memory--register 1bytes movabsq : \u5904\u7406 64 \u4f4d \u7acb\u5373\u6570\u6570\u636e \uff0c\u4ec5\u4ee5 \u5bc4\u5b58\u5668 \u4f5c\u4e3a\u76ee\u7684\u3002\u5e38\u89c4 movq \u4ec5\u4ee5\u8868\u793a\u4e3a 32 \u4f4d\u8865\u7801\u6570\u5b57 \u7684\u7acb\u5373\u6570\u4f5c\u4e3a\u6e90\u64cd\u4f5c\u6570\uff0c\u7136\u540e\u7b26\u53f7\u6269\u5c55\u5f97\u5230 64 \u4f4d\u503c\uff08\u4ec0\u4e48\u662f \u7b26\u53f7\u6269\u5c55 \uff1f\uff09 \u4ee5\u4e0b\u4e24\u7c7b\u6570\u636e\u79fb\u52a8\u6307\u4ee4\u5c06\u8f83\u5c0f\u7684\u6e90\u503c\u590d\u5236\u5230\u8f83\u5927\u7684\u76ee\u7684\u65f6\u4f7f\u7528\uff0c\u5b83\u4eec\u4ee5 \u5bc4\u5b58\u5668\u6216\u5185\u5b58\u5730\u5740\u4e3a\u6e90\uff0c \u5bc4\u5b58\u5668\u4f5c\u4e3a\u76ee\u7684 \u3002\u7b2c\u4e00\u4e2a\u540e\u7f00\u6307\u793a\u6e90\u5927\u5c0f\uff0c\u7b2c\u4e8c\u4e2a\u6307\u793a\u76ee\u7684\u5927\u5c0f MOVZ \u96f6\u6269\u5c55\uff08zero-extend\uff09\uff0c\u5269\u4f59\u4f4d\u586b\u5145 0 movzbw, movzbl, movzwl, movzbq, movzwq \u6ca1\u6709 movzlq \u8fd9\u53ef\u4ee5\u901a\u8fc7 movl \u5b9e\u73b0 MOVS \u7b26\u53f7\u6269\u5c55\uff08sign-extend\uff09\uff0c\u6e90\u7684\u6700\u9ad8\u4f4d\u590d\u5236 movsbw, movsbl, movswl, movsbq, movswq, movslq, cltq cltq : \u5c06 %eax \u7b26\u53f7\u6269\u5c55\u5230 %rax \uff0c\u6ca1\u6709\u64cd\u4f5c\u6570\u3002\u8fd9\u7b49\u4ef7\u4e8e movslq %eax,%rax \u6570\u636e\u4f20\u9001\u6307\u4ee4\u7684\u793a\u4f8b long exchange ( long * xp , long y ){ long x = * xp ; * xp = y ; return x ; } exchange: movq (%rdi), %rax movq %rsi, (%rdi) ret \u503c\u5f97\u6ce8\u610f\u7684\u70b9\uff1a \u6307\u9488\u5c31\u662f\u5730\u5740\uff0c\u95f4\u63a5\u5f15\u7528\uff08\u89e3\u5f15\u7528\uff09\u5c31\u662f\u628a\u6307\u9488\u653e\u5728\u5bc4\u5b58\u5668\u4e2d\uff0c\u7136\u540e\u5728\u5185\u5b58\u5f15\u7528\uff08\u95f4\u63a5\u5bfb\u5740\uff09\u65f6\u4f7f\u7528\u8fd9\u4e2a\u5bc4\u5b58\u5668 \u5c40\u90e8\u53d8\u91cf\u901a\u5e38\u4fdd\u5b58\u5728\u5bc4\u5b58\u5668\u4e2d\uff0c\u8bbf\u95ee\u901f\u5ea6\u5feb\u5f97\u591a \u5982\u679c\u4f60\u9700\u8981\u7b26\u53f7/\u96f6\u6269\u5c55\uff08\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\uff09\uff0c\u5219\u5fc5\u987b\u5728\u62f7\u8d1d\u5230 \u5bc4\u5b58\u5668 \u65f6\u4f7f\u7528\u6269\u5c55\u7684\u6570\u636e\u79fb\u52a8\u6307\u4ee4 \u6280\u80fd\uff1aGCC \u4ea7\u751f\u7684\u6c47\u7f16\u4ee3\u7801\u4e0a\u6709\u540e\u7f00\uff0c\u53cd\u7f16\u8bd1\u6ca1\u6709\u3002\u4f60\u9700\u8981\u638c\u63e1\u7684\u6280\u80fd\u662f\uff1a \u901a\u8fc7\u8bc6\u522b\u6e90\u548c\u76ee\u7684\u786e\u5b9a\u76f8\u5e94\u7684\u6307\u4ee4\u540e\u7f00 \u538b\u5165\u548c\u5f39\u51fa\u6808\u6570\u636e \uff1a\u6808 \u5411\u4e0b\uff08\u5c0f\u7684\u65b9\u5411\uff09\u589e\u957f \uff0c\u6808\u9876\u5143\u7d20\u7684\u5730\u5740\u662f\u6240\u6709\u6808\u4e2d\u5143\u7d20\u5730\u5740\u6700\u4f4e\u7684 pushq, popq pushq %rbp \u7684\u884c\u4e3a\u7b49\u4e8e\u4ee5\u4e0b\u4e24\u6761\u6307\u4ee4\uff1a subq $8, %rsp; movq %rbq,(%rsp) \uff0c\u5148\u9012\u51cf\u6808\u6307\u9488\uff0c\u518d\u5c06\u503c\u5b58\u50a8\u5230\u5bf9\u5e94\u4f4d\u7f6e \u3010Question\u3011 movq 8(%rsp),%rdx \u8fdb\u884c\u4e86\u4ec0\u4e48\u64cd\u4f5c\uff1f \u7b97\u672f\u548c\u903b\u8f91\u64cd\u4f5c \u00b6 \u5206\u6210\u56db\u7ec4\uff1a\u52a0\u8f7d\u6709\u6548\u5730\u5740\u3001\u4e00\u5143\u64cd\u4f5c\u3001\u4e8c\u5143\u64cd\u4f5c\u3001\u79fb\u4f4d leaq INC,DEC,NEG,NOT ADD,SUB,IMUL,XOR,OR,AND SAL,SHL,SAR,SHR \u52a0\u8f7d\u6709\u6548\u5730\u5740\uff08load effective address\uff09\uff1a \u6ca1\u6709\u5f15\u7528\u5185\u5b58\uff0c\u4e0d\u662f\u4ece\u6307\u5b9a\u7684\u4f4d\u7f6e\u8bfb\u5165\u6570\u636e \uff0c\u53ea\u662f\u5c06\u6709\u6548\u5730\u5740\u5199\u5165* \u76ee\u7684\u64cd\u4f5c\u6570\uff08\u5fc5\u987b\u662f\u4e00\u4e2a\u5bc4\u5b58\u5668\uff09 leaq 7(%rdx,%rdx,4),%rax leaq \u6709\u4e00\u4e9b\u7075\u6d3b\u7528\u6cd5\uff0c\u8ba1\u7b97\u5668\u5e38\u5e38\u6839\u672c\u4e0d\u7528\u5b83\u6765\u8ba1\u7b97\u5730\u5740\u3002\u5b83\u53ef\u4ee5\u6267\u884c \u52a0\u6cd5\u548c\u6709\u9650\u5f62\u5f0f\u7684\u4e58\u6cd5 \uff0c\u5728\u7f16\u8bd1\u7b80\u5355\u8868\u8fbe\u5f0f\u65f6\u5f88\u6709\u7528\u5904 \u4e00\u5143\u64cd\u4f5c\uff1a\u53ea\u6709\u4e00\u4e2a\u64cd\u4f5c\u6570\uff0c\u65e2\u662f\u6e90\u53c8\u662f\u76ee\u7684\u3002\u53ef\u4ee5\u662f \u5bc4\u5b58\u5668\u6216\u5185\u5b58\u5730\u5740 \u4e8c\u5143\u64cd\u4f5c\uff1a\u7b2c\u4e8c\u4e2a\u64cd\u4f5c\u6570 \u65e2\u662f\u6e90\u53c8\u662f\u76ee\u7684 \uff0c\u6e90\u64cd\u4f5c\u6570\u662f\u7b2c\u4e00\u4e2a\u3002\u7b2c\u4e00\u4e2a\u53ef\u4ee5\u662f \u7acb\u5373\u6570\u3001\u5bc4\u5b58\u5668\u3001\u5185\u5b58\u4f4d\u7f6e \uff0c\u7b2c\u4e8c\u4e2a\u53ef\u4ee5\u662f \u5bc4\u5b58\u5668\u3001\u5185\u5b58\u4f4d\u7f6e \u5f53\u7b2c\u4e8c\u4e2a\u64cd\u4f5c\u6570\u662f\u5185\u5b58\u5730\u5740\u65f6\uff0c\u5904\u7406\u5668\u5fc5\u987b\u5148\u8bfb\u51fa\uff0c\u6267\u884c\u64cd\u4f5c\uff0c\u518d\u5199\u56de \u79fb\u4f4d\u64cd\u4f5c\uff1a\u7ed9\u51fa \u79fb\u4f4d\u91cf\uff08\u53ea\u80fd\u662f\u7acb\u5373\u6570\u6216\u5b58\u653e\u5728\u5355\u5b57\u8282 %cl \u4e2d\uff09 \uff0c\u7b2c\u4e8c\u9879\u662f\u8981\u79fb\u4f4d\u7684\u6570 \u4e00\u4e2a\u5b57\u8282\u53ef\u4ee5\u7f16\u7801\u7684\u79fb\u4f4d\u8303\u56f4\u8fbe\u5230\u4e86 255 \u5bf9 \\(w\\) \u4f4d\u7684\u6570\u636e\u503c\u8fdb\u884c\u64cd\u4f5c\uff0c\u79fb\u4f4d\u91cf\u662f\u7531 %cl \u7684\u4f4e \\(\\log_2 w\\) \u4f4d\u51b3\u5b9a\u7684\uff0c\u9ad8\u4f4d\u88ab\u5ffd\u7565 \u4f8b\uff1a %cl = 0xFF \u65f6\uff0c salb \u79fb\u52a8 \\(7\\) \u4f4d\uff0c salq \u79fb\u52a8 \\(63\\) \u4f4d \u5de6\u79fb\u7684\u4e24\u4e2a\u540d\u5b57\u6548\u679c\u662f\u4e00\u6837\u7684 \u3010\u8ba8\u8bba\u3011 \u4ee5\u4e0a\u5927\u591a\u6570\u6307\u4ee4\u53ef\u7528\u4e8e\u65e0\u7b26\u53f7\u8fd0\u7b97\u548c \u8865\u7801\u8fd0\u7b97 \uff0c\u8fd9\u662f\u8865\u7801\u6210\u4e3a\u5b9e\u73b0\u6709\u7b26\u53f7\u6574\u6570\u8fd0\u7b97\u7684\u6bd4\u8f83\u597d\u7684\u65b9\u6cd5\u7684\u539f\u56e0 \u53ea\u6709 \u53f3\u79fb \u64cd\u4f5c\u9700\u8981\u533a\u5206\u6709\u65e0\u7b26\u53f7","title":"Ch3. \u7a0b\u5e8f\u7684\u673a\u5668\u7ea7\u8868\u793a"},{"location":"books/CSAPP/Chapter3/#ch3","text":"Abstract \u672c\u7ae0\u5b66\u4e60\u6c47\u7f16\u8bed\u8a00\u548c\u673a\u5668\u8bed\u8a00\u3002\u5b66\u4e60\u672c\u7ae0\u540e\uff0c\u4f60\u5e94\u8be5\u638c\u63e1\u7f16\u8bd1\u3001\u53cd\u7f16\u8bd1\u5de5\u5177\u7684\u4f7f\u7528\uff0c\u5e76\u80fd\u591f\u9605\u8bfb\u7b80\u5355\u7684\u6c47\u7f16\u4ee3\u7801\u3002","title":"Ch3. \u7a0b\u5e8f\u7684\u673a\u5668\u7ea7\u8868\u793a"},{"location":"books/CSAPP/Chapter3/#_1","text":"gcc -Og -S test.c -S : \u8c03\u7528 \u7f16\u8bd1\u5668 \uff0c\u751f\u6210 \u6c47\u7f16\u4ee3\u7801 \uff08 .s \u540e\u7f00\uff09\u3002 -c : \u8c03\u7528 \u6c47\u7f16\u5668 \uff0c\u751f\u6210\u672a\u94fe\u63a5\uff08\u6ca1\u586b\u5165\u5168\u5c40\u503c\u7684\u5730\u5740\uff09\u7684\u4e8c\u8fdb\u5236 \u76ee\u6807\u6587\u4ef6\uff08\u673a\u5668\u4ee3\u7801\uff09 \uff08 .o \u6216 .obj \u540e\u7f00\uff09\u3002 -o : \u6307\u5b9a\u4ea7\u751f\u7684 \u53ef\u6267\u884c\u6587\u4ef6\uff08\u673a\u5668\u4ee3\u7801\uff09 \u540d\uff08 .exe \u6216\u65e0\u540e\u7f00\uff09\u3002 -Og : \uff08\u4e0d\u8fdb\u884c\u4f18\u5316\uff09\u751f\u6210\u7b26\u5408\u539f\u59cb C \u4ee3\u7801\u6574\u4f53\u7ed3\u6784\u7684\u673a\u5668\u4ee3\u7801\u3002\u672c\u7ae0\u4f7f\u7528\u8be5\u9009\u9879\u4f5c\u4e3a\u5b66\u4e60\u5de5\u5177\u3002 -O1, -O2 : \u8f83\u9ad8\u7ea7\u522b\u7684\u4f18\u5316 objdump -d test.o -f : display file header information GDB \u8c03\u8bd5\u7a0b\u5e8f\u7684\u5b57\u8282\u4ee3\u7801 \u9996\u5148\u901a\u8fc7\u53cd\u6c47\u7f16\u5668\u786e\u5b9a\u8be5\u8fc7\u7a0b\u7684\u4ee3\u7801\u957f\u5ea6 (gdb) x/14xb multstore","title":"\u672c\u7ae0\u9700\u8981\u7528\u5230\u7684\u547d\u4ee4\u884c\u5de5\u5177"},{"location":"books/CSAPP/Chapter3/#31","text":"Intel \u5904\u7406\u5668\u7cfb\u5217\u79f0\u4e3a x86 \u3002 x86-64 \u662f\u4e00\u79cd \u673a\u5668\u8bed\u8a00 \uff0c\u662f\u76ee\u524d\u7b14\u8bb0\u672c\u7535\u8111\u548c\u53f0\u5f0f\u673a\u6700\u5e38\u89c1\u7684\u3002 \u5b83\u517c\u5bb9\u5b83\u7684 32 \u4f4d\u524d\u8eab\u2014\u2014 IA32 \uff08INtel Architecture 32-bit\uff09\u3002 8086 \u662f\u4e00\u6b3e\u5904\u7406\u5668\u3002\u5b83\u662f\u7b2c\u4e00\u4ee3\u5355\u82af\u7247\u300116 \u4f4d\u5fae\u5904\u7406\u5668\u4e4b\u4e00\u3002 i386 \u662f\u4e00\u6b3e\u5904\u7406\u5668\u3002\u5b83\u5c06\u4f53\u7cfb\u7ed3\u6784\u6269\u5c55\u5230 32 \u4f4d\uff0c\u589e\u52a0\u4e86 \u5e73\u5766\u5bfb\u5740\u6a21\u5f0f \uff0cLinux \u548c Windows \u7cfb\u7edf\u90fd\u4f7f\u7528\u8fd9\u79cd\u6a21\u5f0f\u3002","title":"3.1 \u5386\u53f2\u89c2\u70b9"},{"location":"books/FOCS/","tags":["Ongoing"],"text":"\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08\u7b2c\u56db\u7248\uff09 \u00b6 Foundations Of Computer Science (4 th Edition) \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e Behrouz A. Forouzan 2022 \u672c\u4e66\u7684\u9605\u8bfb\u7b14\u8bb0\u5c06\u5168\u90e8\u91c7\u7528\u82f1\u6587\u3002\u4ec5\u5728\u672c\u6982\u8ff0\u90e8\u5206\u5217\u51fa\u4e2d\u6587\u76ee\u5f55 \u7ae0\u8282\u76ee\u5f55 \u00b6 \u7b2c 1 \u7ae0 \u7eea\u8bba Introduction \u7b2c\u4e00\u90e8\u5206\uff1a\u6570\u636e\u7684\u8868\u793a\u4e0e\u8fd0\u7b97 \u7b2c 2 \u7ae0 \u6570\u5b57\u7cfb\u7edf Number Systems \u7b2c 3 \u7ae0 \u6570\u636e\u5b58\u50a8 \u7b2c 4 \u7ae0 \u6570\u636e\u8fd0\u7b97 \u7b2c\u4e8c\u90e8\u5206\uff1a\u8ba1\u7b97\u673a\u786c\u4ef6 \u7b2c 5 \u7ae0 \u8ba1\u7b97\u673a\u7ec4\u6210 \u7b2c 6 \u7ae0 \u8ba1\u7b97\u673a\u7f51\u7edc\u548c\u56e0\u7279\u7f51 \u7b2c\u4e09\u90e8\u5206\uff1a\u8ba1\u7b97\u673a\u8f6f\u4ef6 \u7b2c 7 \u7ae0 \u64cd\u4f5c\u7cfb\u7edf \u7b2c 8 \u7ae0 \u7b97\u6cd5 \u7b2c 9 \u7ae0 \u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00 Programming Language \u7b2c 10 \u7ae0 \u8f6f\u4ef6\u5de5\u7a0b \u7b2c\u56db\u90e8\u5206\uff1a\u6570\u636e\u7ec4\u7ec7\u4e0e\u62bd\u8c61 \u7b2c 11 \u7ae0 \u6570\u636e\u7ed3\u6784 \u7b2c 12 \u7ae0 \u62bd\u8c61\u6570\u636e\u7c7b\u578b \u7b2c 13 \u7ae0 \u6587\u4ef6\u7ed3\u6784 \u7b2c 14 \u7ae0 \u6570\u636e\u5e93 \u7b2c\u4e94\u90e8\u5206\uff1a\u9ad8\u7ea7\u8bdd\u9898 \u7b2c 15 \u7ae0 \u6570\u636e\u538b\u7f29 \u7b2c 16 \u7ae0 \u5b89\u5168 \u7b2c 17 \u7ae0 \u8ba1\u7b97\u7406\u8bba \u7b2c 18 \u7ae0 \u4eba\u5de5\u667a\u80fd \u7b2c\u516d\u90e8\u5206\uff1a\u793e\u4ea4\u5a92\u4f53\u548c\u793e\u4f1a\u8bdd\u9898 \u7b2c 19 \u7ae0 \u793e\u4ea4\u5a92\u4f53\u5bfc\u8bba \u7b2c 20 \u7ae0 \u793e\u4f1a\u548c\u9053\u5fb7\u95ee\u9898 \u9644\u5f55 \u9644\u5f55 A Unicode \u9644\u5f55 B UML \u9644\u5f55 C \u4f2a\u4ee3\u7801 \u9644\u5f55 D \u7ed3\u6784\u56fe \u9644\u5f55 E \u5e03\u5c14\u4ee3\u6570\u548c\u903b\u8f91\u7535\u8def \u9644\u5f55 F C\u3001C++ \u548c Java \u7a0b\u5e8f\u793a\u4f8b \u9644\u5f55 G \u6570\u5b66\u77e5\u8bc6 \u9644\u5f55 H \u9519\u8bef\u68c0\u6d4b\u548c\u7ea0\u6b63 \u9644\u5f55 I \u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\u6574\u6570\u7684\u52a0\u51cf\u6cd5 \u9644\u5f55 J \u5b9e\u6570\u7684\u52a0\u51cf\u6cd5 Ch1. \u7eea\u8bba \u00b6 \u4ec0\u4e48\u662f\u56fe\u7075\u6a21\u578b\u548c\u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b \u8ba1\u7b97\u673a\u662f\u4e00\u79cd \u901a\u7528 \u7684\u673a\u5668\uff0c\u53ef\u4ee5\u5b8c\u6210 \u5404\u79cd\u4e0d\u540c\u7684\u5de5\u4f5c \u3002 \u56fe\u7075\u57281936\u5e74\u7684\u8bba\u6587\u300a\u8bba\u53ef\u8ba1\u7b97\u6570\u53ca\u5176\u5728\u5224\u5b9a\u4e0a\u7684\u5e94\u7528\u300b\u4e2d\u7ed9\u51fa\u4e86\u56fe\u7075\u673a\u7684\u5b9a\u4e49\u3002 \u300a\u8bba\u53ef\u8ba1\u7b97\u6570\u53ca\u5176\u5728\u5224\u5b9a\u4e0a\u7684\u5e94\u7528\u300b\u7b80\u5355\u7406\u89e3 \u539f\u59cb\u8bba\u6587\uff1aOn Computable Numbers\uff0cwith an Application to the Entscheidungsproblem \u672c\u4e66\u4e3e\u4e86\u56fe\u7075\u673a\u7684\u4e00\u4e2a\u4f8b\u5b50\u2014\u2014\u53ef\u7f16\u7a0b\u6570\u636e\u5904\u7406\u5668\uff1a\u7531\u8f93\u5165\u6570\u636e\u3001\u8f93\u51fa\u6570\u636e\u3001\u7a0b\u5e8f\u7ec4\u6210\u3002 \u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u8f83\u56fe\u7075\u6a21\u578b\u6700\u5927\u7684\u6539\u53d8\uff0c\u662f\u5c06\u7a0b\u5e8f\u5b58\u50a8\u5728\u5b58\u50a8\u5668\u4e2d\u3002 \u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u7531 4 \u4e2a\u5b50\u7cfb\u7edf\u7ec4\u6210\uff1a\u5b58\u50a8\u5668\u3001\u7b97\u672f\u903b\u8f91\u5355\u5143\u3001\u63a7\u5236\u5355\u5143\u3001\u8f93\u5165\u8f93\u51fa\u5355\u5143\u3002 \u6307\u4ee4\u987a\u5e8f\u6267\u884c\u3002 \u73b0\u4ee3\u8ba1\u7b97\u673a\u57fa\u4e8e\u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u3002 \u8ba1\u7b97\u673a\u7684\u5386\u53f2 \u673a\u68b0\u8ba1\u7b97\u5668\uff1a1930 \u5e74\u4ee5\u524d \u7535\u5b50\u8ba1\u7b97\u673a\uff1a1930~1950 \u5e74 \u57fa\u4e8e\u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u7684\u8ba1\u7b97\u673a\uff1a1950 \u5e74\u81f3\u4eca \u7b2c\u4e00\u4ee3\u8ba1\u7b97\u673a\uff1a\u771f\u7a7a\u7ba1 \u7b2c\u4e8c\u4ee3\u8ba1\u7b97\u673a 1959~1965\uff1a\u6676\u4f53\u7ba1 \u7b2c\u4e09\u4ee3\u8ba1\u7b97\u673a 1965~1975\uff1a\u96c6\u6210\u7535\u8def \u7b2c\u56db\u4ee3\u8ba1\u7b97\u673a 1975~1985\uff1a\u5fae\u578b\u8ba1\u7b97\u673a\u3001\u8ba1\u7b97\u673a\u7f51\u7edc \u7b2c\u4e94\u4ee3\u8ba1\u7b97\u673a 1985~\uff1a\u638c\u4e0a\u8ba1\u7b97\u673a\u3001\u53f0\u5f0f\u8ba1\u7b97\u673a\u3001\u7b2c\u4e8c\u4ee3\u5b58\u50a8\u5a92\u4f53\u3001\u591a\u5a92\u4f53\u3001\u865a\u62df\u73b0\u5b9e... \u9644\u5f55 B\uff1aUML \u56fe \u00b6 UML \u662f\u7edf\u4e00\u5efa\u6a21\u8bed\u8a00 Unified Modeling Language\u3002\u5b83\u5305\u62ec\uff1a\u7528\u6237\u89c6\u56fe\u3001\u7ed3\u6784\u89c6\u56fe\u3001\u884c\u4e3a\u89c6\u56fe\u548c\u5b9e\u73b0\u89c6\u56fe\u3002 \u884c\u4e3a\u89c6\u56fe\uff1a \u72b6\u6001\u56fe\uff1a\u4e3b\u8981\u4f7f\u7528\u4e94\u79cd\u7b26\u53f7 Ch.2 \u6570\u5b57\u7cfb\u7edf \u00b6 \u672c\u7ae0\u6982\u8981 \u672c\u7ae0\u4e3b\u8981\u76ee\u7684\u662f \u719f\u6089\u4e8c\u8fdb\u5236\u3001\u516b\u8fdb\u5236\u3001\u5341\u8fdb\u5236\u548c\u5341\u516d\u8fdb\u5236\u7684\u8ba1\u7b97 \u3002\u672c\u4e66\u4e3b\u8981\u4ee5\u7b97\u6cd5\u5f62\u5f0f\u7ed9\u51fa\uff0cCSAPP \u4e2d\u6709\u66f4\u591a\u6570\u5b66\u5c42\u9762\u7684\u8ba8\u8bba\u3002 CSAPP\uff1a\u5efa\u8bae\u4f60\u53cd\u590d\u9605\u8bfb\u6570\u5b66\u539f\u7406\u63cf\u8ff0\u548c\u793a\u4f8b\u4e0e\u8ba8\u8bba\uff0c\u76f4\u5230\u4f60\u5bf9\u8be5\u5c5e\u6027\u7684\u8bf4\u660e\u5185\u5bb9\u53ca\u5176\u91cd\u8981\u6027\u6709\u4e86 \u7262\u56fa\u7684\u76f4\u89c9 \u3002\u5bf9\u4e8e\u66f4\u52a0\u590d\u6742\u7684\u5c5e\u6027\uff0c\u4f60\u5e94\u8be5\u5c1d\u8bd5\u63a8\u5bfc\u3002 \u4f4d\u7f6e\u5316\u6570\u5b57\u7cfb\u7edf\u3001\u975e\u4f4d\u7f6e\u5316\u6570\u5b57\u7cfb\u7edf\uff08\u7f57\u9a6c\u6570\u5b57\u7b49\uff09 \u5176\u4ed6\u8fdb\u5236\u5230\u5341\u8fdb\u5236\u7684\u8f6c\u6362\uff1a\u76f4\u63a5\u8ba1\u7b97 \u5341\u8fdb\u5236\u5230\u5176\u4ed6\u8fdb\u5236\u7684\u8f6c\u6362\uff08\u7528 UML \u56fe\u8868\u793a\uff09 \u6574\u6570\u90e8\u5206\uff1a\u8fde\u9664 \u5c0f\u6570\u90e8\u5206\uff1a\u8fde\u4e58 \u5c06\u4e00\u4e2a \\(n\\) \u4f4d\u5341\u8fdb\u5236\u6570\u8f6c\u6362\u4e3a\u5176\u4ed6\u8fdb\u5236\uff0c\u600e\u4e48\u8ba1\u7b97\u9700\u8981\u7684\u4f4d\u6570\uff1f Ch.3 \u6570\u636e\u50a8\u5b58 \u00b6 \u672c\u7ae0\u6982\u8981 \u7b80\u5355\u4ecb\u7ecd\u4e86\u6570\u5b57\u3001\u6587\u672c\u3001\u97f3\u9891\u3001\u56fe\u50cf\u3001\u89c6\u9891\u662f\u5982\u4f55\u5b58\u50a8\u5728\u8ba1\u7b97\u673a\u4e2d\u7684\u3002\u8fd9\u4e9b\u63cf\u8ff0\u90fd\u662f\u6982\u5ff5\u6027\u7684\uff0c\u6280\u672f\u7ec6\u8282\u9700\u8981\u67e5\u9605\u76f8\u5e94\u6570\u636e\u683c\u5f0f\u7684\u89c4\u8303\u6587\u6863\u3002 \u63cf\u8ff0\u4ee5\u4e0b\u5b58\u50a8\u6574\u6570\u7684\u65b9\u6cd5\uff1a\u5b83\u4eec\u80fd\u5b58\u50a8\u54ea\u4e9b\u6570\u5b57\uff1f\u5b58\u50a8\u3001\u8fd8\u539f\u7684\u6b65\u9aa4\u662f\u600e\u6837\u7684\uff1f\u4e3b\u8981\u5e94\u7528\u5728\u54ea\u91cc\uff1f\u6ea2\u51fa\u60c5\u51b5\u5982\u4f55\uff1f \u65e0\u7b26\u53f7\u8868\u793a\u6cd5 \u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\u8868\u793a\u6cd5\uff08\u539f\u7801\uff09 \u4e8c\u8fdb\u5236\u8865\u7801\u8868\u793a\u6cd5 \u53cd\u7801\u8868\u793a\u6cd5\uff08\u672c\u4e66\u672a\u4ecb\u7ecd\uff09 CSAPP\uff1a\u7406\u89e3\u8865\u7801\u8868\u793a\u7684\u65b9\u6cd5\uff1a\u628a\u6700\u9ad8\u4f4d\u770b\u4f5c\u6743\u91cd\u4e3a \\(-2^{w-1}\\) \u7684\u4f4d \u5c1d\u8bd5\u7ed9\u51fa\u53cd\u7801\u8fd0\u7b97\u7684\u6570\u5b66\u8868\u8fbe\u5f0f\uff0c\u5e76\u7406\u89e3\u53cd\u7801\u7684\u8868\u8fbe\u5f0f\u662f\u5982\u4f55\u6784\u5efa\u7684\uff1f \u6ce8\u610f \u53cd\u7801\u64cd\u4f5c \u548c \u6574\u6570\u7684\u53cd\u7801\u8868\u793a \u3002\u53cd\u7801\u8868\u793a\u7684\u6574\u6570\u4e2d\uff0c\u53ea\u6709\u8d1f\u6570\u624d\u8fdb\u884c\u53cd\u7801\u64cd\u4f5c\u3002 \u5b9e\u6570\u7684\u50a8\u5b58\uff1a\u6d6e\u70b9\u8868\u793a\u6cd5\uff08\u5177\u6709 \u5f88\u5927\u6574\u6570\u90e8\u5206\u6216\u5f88\u5c0f\u5c0f\u6570\u90e8\u5206\u7684\u6570 \uff09\uff1a\u7b26\u53f7\u3001\u4f4d\u79fb\u91cf\u548c\u5b9a\u70b9\u6570 \u89c4\u8303\u5316\uff1a\u5b9a\u70b9\u6570\u5c0f\u6570\u70b9\u5de6\u4fa7\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u6570\u7801\u3002\u4e8c\u8fdb\u5236\u6570\u89c4\u8303\u5316\u540e\uff0c\u5de6\u4fa7\u7684 1 \u9690\u542b\u4e86\u3002 \u5341\u8fdb\u5236\u79f0\u4e3a\u79d1\u5b66\u8ba1\u6570\u6cd5\uff0c\u4e8c\u8fdb\u5236\u79f0\u4e3a\u6d6e\u70b9\u8868\u793a\u6cd5 \u5c3e\u6570\uff1a\u5c0f\u6570\u70b9\u53f3\u8fb9\u7684\u4e8c\u8fdb\u5236\u6570\u5b9a\u4e49\u4e86\u8be5\u6570\u7684\u7cbe\u5ea6\uff0c\u4f5c\u4e3a \u65e0\u7b26\u53f7\u6574\u6570\u5b58\u50a8 \u6307\u6570\uff1a\u6709\u7b26\u53f7\uff0c\u4f7f\u7528 \u4f59\u7801\u7cfb\u7edf \uff1a\u504f\u79fb\u91cf \\((2^{m-1}-1)\\) \u88ab\u52a0\u5230\u6bcf\u4e2a\u6570\u5b57\u4e2d\uff08m \u4e3a\u5185\u5b58\u5355\u5143\u5927\u5c0f\uff09\uff0c\u7edf\u4e00\u79fb\u5230\u975e\u8d1f\u7684\u4e00\u904d\u3002\u5982 4 \u4f4d\u5b58\u50a8\u5355\u5143\u4f7f\u7528\u4f59 7 \u7801\u7cfb\u7edf\u3002\u8fd9\u6837\u505a\u7684\u4f18\u52bf\u662f\u5bf9\u8fd9\u4e9b\u6574\u6570\u8fdb\u884c\u6bd4\u8f83\u6216\u8fd0\u7b97\u65f6\u4e0d\u9700\u8981\u8003\u8651\u7b26\u53f7\u3002 IEEE \u6807\u51c6\uff1a\u5355\u8fdb\u5ea6\u4e3a 1\uff0c8\uff0c23\uff1b\u53cc\u7cbe\u5ea6\u4e3a 1\uff0c11\uff0c52 \u50a8\u5b58\uff1a\u786e\u5b9a\u7b26\u53f7\uff0c\u8f6c\u4e8c\u8fdb\u5236\uff0c\u89c4\u8303\u5316\uff0c\u50a8\u5b58\u6307\u6570\u548c\u5c3e\u6570\uff0c\u8fde\u63a5\u4e09\u4e2a\u90e8\u5206 \u8fd8\u539f\uff1a\u62c6\u5206\u4e3a\u4e09\u4e2a\u90e8\u5206\uff0c\u786e\u5b9a\u7b26\u53f7\uff0c\u89e3\u7801\u4f4d\u79fb\u91cf\uff0c\u53bb\u89c4\u8303\u5316\u5c3e\u6570\uff0c\u8fd8\u539f\u6570\u5b57\uff0c\u8f6c\u5341\u8fdb\u5236\uff0c\u52a0\u4e0a\u7b26\u53f7 \u6d6e\u70b9\u6570\u7684\u4e0a\u6ea2\u548c\u4e0b\u6ea2 \uff1a\u4e3e\u4f8b\u5355\u7cbe\u5ea6\u6d6e\u70b9\u6570\u6700\u5927\u8d1f\u503c\u4e3a \\(-(1-2^{-24})\\times 2^{+128}\\) \uff0c\u5176\u4e2d\uff0c\u5c3e\u6570 23 \u4f4d\u65e0\u7b26\u53f7\u6570\uff0c\u6700\u5927\u7edd\u5bf9\u503c\u4e3a \\(2^{24}-1\\) \uff0c\u6307\u6570 8 \u4f4d\u4f59\u7801\u6570\uff0c\u6700\u5927\u4e3a \\(2^{8-1}=128\\) \u3002\u6700\u5c0f\u8d1f\u503c\u4e3a \\(-(1-2^{-1})\\times 2^{-127}\\) \u96f6\u7684\u7ea6\u5b9a\uff1a\u4e09\u4e2a\u90e8\u5206\u90fd\u8bbe\u7f6e\u4e3a 0 \u4ec0\u4e48\u662f \u622a\u65ad\u9519\u8bef \uff1f \u5b58\u50a8\u6587\u672c \u00b6 \u8865\u5145\u77e5\u8bc6\uff1aASCII \u548c Unicode \u7f16\u7801\u7c7b\u578b \u4f4d\u6570 ASCII 7 \u6269\u5c55 ASCII 8 Unicode 32 UNICODE \u7684\u7f16\u7801\u7ed3\u6784 \u00b6 \u6bcf\u4e2a Unicode \u7f16\u7801\u4ee5\u5341\u516d\u8fdb\u5236\u8868\u793a\u4e3a U-XXXXXXXX \u524d 16 \u4f4d\u5b9a\u4e49\u5e73\u9762 \u540e 16 \u4f4d\u5b9a\u4e49\u5b57\u7b26 ASCII \u5360\u636e Unicode \u4e2d\u524d 128 \u4e2a\u7f16\u7801\uff0c\u5373 U-00000000 ~ U-0000007F ASCII \u8868\u7684\u8bb0\u5fc6 \u5173\u952e\u5b57\u7b26 \u5341\u8fdb\u5236 \u5341\u516d\u8fdb\u5236 \u7a7a\u5b57\u7b26 0 00 \u7a7a\u683c 32 20 0 48 30 9 57 39 A 65 41 Z 90 5A a 97 61 z 122 7A \u5220\u9664 127 7F \u5b58\u50a8\u97f3\u9891 \u00b6 \u6587\u672c\u662f \u6570\u5b57 \u6570\u636e\u7684\u4f8b\u5b50\uff0c\u97f3\u9891\u662f \u6a21\u62df \u6570\u636e\u7684\u4f8b\u5b50\u3002 \u91c7\u6837 \u91c7\u6837\u7387 \u91cf\u5316\uff1a\u622a\u53d6\u4e3a\u6700\u8fd1\u6574\u6570\u503c \u7f16\u7801 \u4f4d\u6df1\u5ea6\uff1a\u6bcf\u6837\u672c\u4f4d\u7684\u4f4d\u6570 \u4f4d\u7387\uff1a\u6bcf\u79d2\u97f3\u9891\u4f4d\u6570\uff08\u4f4d\u7387\uff09=\u6df1\u5ea6 x \u6bcf\u79d2\u6837\u672c\u6570 $ R = B \\times S$ \u58f0\u97f3\u7f16\u7801\u6807\u51c6\uff1aMP3\uff08MPEG Layer3\uff09\uff0cS=44100\uff0cB=16\uff0cR=705600b/s\uff0c\u518d\u53bb\u6389\u4eba\u8033\u65e0\u6cd5\u8bc6\u522b\u7684\u4fe1\u606f\u8fdb\u884c\u538b\u7f29 \u5b58\u50a8\u56fe\u50cf \u00b6 \u5149\u6805\u56fe\u6216\u77e2\u91cf\u56fe \u5149\u6805\u56fe \u00b6 \u91c7\u6837\u79f0\u4e3a \u626b\u63cf \uff0c\u6837\u672c\u79f0\u4e3a\u50cf\u7d20 \u89e3\u6790\u5ea6\uff1a\u626b\u63cf\u7387\uff0c\u6bcf\u82f1\u5bf8\u7684\u65b9\u5757\u8bb0\u5f55\u591a\u5c11\u50cf\u7d20\u3002 \u8272\u5f69\u6df1\u5ea6\uff1a \u771f\u5f69\u8272\uff1a24 \u4f4d\uff0c\u6bcf\u4e2a\u4e09\u539f\u8272 RGB \u8868\u793a\u4e3a 8 \u4f4d\uff0c\u6bcf\u79cd\u8272\u5f69\u90fd\u7531 0~255 \u4e4b\u95f4\u8868\u793a \u7d22\u5f15\u8272\uff1a\u8bb8\u591a\u5e94\u7528\u7a0b\u5e8f\u5e76\u4e0d\u9700\u8981\u5982\u6b64\u5927\u7684\u8272\u5f69\u8303\u56f4\uff0c\u7d22\u5f15\u8272\u4ec5\u4f7f\u7528\u5176\u4e2d\u7684\u4e00\u90e8\u5206\uff0c\u5bf9\u5176\u5efa\u7acb\u7d22\u5f15 \u56fe\u50cf\u7f16\u7801\u6807\u51c6\uff1a JPEG \u4f7f\u7528\u771f\u8272\u5f69\uff0c\u4f46\u538b\u7f29\u56fe\u50cf\u51cf\u5c11\u4f4d\u7684\u6570\u91cf GIF \u4f7f\u7528\u7d22\u5f15\u8272\u6a21\u5f0f \u77e2\u91cf\u56fe \u00b6 \u7531\u5b9a\u4e49\u5982\u4f55\u7ed8\u5236\u5f62\u72b6\u7684\u4e00\u7cfb\u5217\u547d\u4ee4\u6784\u6210\u3002\u8981\u663e\u793a\u56fe\u50cf\u65f6\uff0c\u7cfb\u7edf\u4f9d\u636e\u56fe\u50cf\u7684\u5c3a\u5bf8\u5927\u5c0f\u7528\u76f8\u540c\u7684\u516c\u5f0f\u7ed8\u5236\u56fe\u5f62\u3002 TrueType\uff0cPostScript \u548c CAD\uff08\u8ba1\u7b97\u673a\u8f85\u52a9\u8bbe\u8ba1\uff09\u4e3b\u8981\u4f7f\u7528\u77e2\u91cf\u56fe \u5b58\u50a8\u89c6\u9891 \u00b6 \u89c6\u9891\u662f\u968f\u7a7a\u95f4\uff08\u5355\u4e2a\u56fe\u50cf\uff09\u548c\u65f6\u95f4\uff08\u4e00\u7cfb\u5217\u56fe\u50cf\uff09\u53d8\u5316\u7684\u4fe1\u606f\u8868\u73b0 Ch4. \u6570\u636e\u8fd0\u7b97 \u00b6 \u5173\u952e\u8bcd\uff1a\u7b97\u672f\u8fd0\u7b97\u3001\u79fb\u4f4d\u8fd0\u7b97\u3001\u903b\u8f91\u8fd0\u7b97 \u903b\u8f91\u8fd0\u7b97 \u00b6 \u4f4d\u5c42\u6b21\u548c\u6a21\u5f0f\u5c42\u6b21\u4e0a\u7684\u903b\u8f91\u8fd0\u7b97 \u975e\u3001\u4e0e\u3001\u6216\u548c\u5f02\u6216 \u601d\u8003\uff1a\u5982\u4f55\u7528\u5176\u4ed6\u8fd0\u7b97\u7b26\u6a21\u62df\u5f02\u6216\uff1f\u5f02\u6216\u7684\u7279\u6027 \u4f4d\u6a21\u5f0f\u7684\u56db\u79cd\u5e94\u7528\uff1a\u6c42\u53cd\u3001\u4f7f\u6307\u5b9a\u7684\u4f4d\u590d\u4f4d\uff08\u7f6e 0\uff09\u3001\u5bf9\u6307\u5b9a\u7684\u4f4d\u7f6e\u4f4d\uff08\u7f6e 1\uff09\u3001\u4f7f\u6307\u5b9a\u7684\u4f4d\u53cd\u8f6c \u63a9\u7801 \u79fb\u4f4d\uff08Shift\uff09\u8fd0\u7b97 \u00b6 \u903b\u8f91\u79fb\u4f4d\u8fd0\u7b97 \u4e0d\u5e26\u7b26\u53f7\u4f4d\u7684\u6570\uff1a\u8fd9\u4e9b\u79fb\u4f4d\u8fd0\u7b97\u53ef\u80fd\u6539\u53d8\u6570\u7684\u7b26\u53f7 \u586b 0 \u6216\u5faa\u73af\u79fb\u4f4d\uff08\u65cb\u8f6c\u8fd0\u7b97\uff09 \u7b97\u6570\u79fb\u4f4d\u8fd0\u7b97 \u5047\u5b9a\u4f4d\u6a21\u5f0f\u662f\u4f7f\u7528 \u4e8c\u8fdb\u5236\u8865\u7801 \u5b58\u50a8\u7684\u5e26\u7b26\u53f7\u6574\u6570\u3002 \u7b97\u6570\u53f3\u79fb\u5bf9\u6574\u6570\u9664\u4e8c\uff0c\u7b97\u6570\u5de6\u79fb\u5bf9\u6574\u6570\u4e58\u4e8c\uff0c\u8fd9\u4e9b\u8fd0\u7b97\u672c\u4e0d\u5e94\u8be5\u6539\u53d8\u7b26\u53f7\u4f4d \u7b97\u6570\u53f3\u79fb\uff1a\u4fdd\u7559\u7b26\u53f7\u4f4d\uff0c\u5e76\u590d\u5236\u5165\u53f3\u4fa7\u4f4d\u4e2d\uff0c\u56e0\u6b64\u4fdd\u5b58\u7b26\u53f7 \u7b97\u6570\u5de6\u79fb\uff1a\u4e22\u5f03\u7b26\u53f7\u4f4d\uff0c\u63a5\u53d7\u5de6\u8fb9\u4e3a\u7b26\u53f7\u4f4d\u3002\u5982\u679c\u65b0\u7b26\u53f7\u4f4d\u4e0e\u539f\u5148\u76f8\u540c\uff0c\u8fd0\u7b97 \u6210\u529f \uff0c\u5426\u5219\u53d1\u751f\u6ea2\u51fa \u7b97\u672f\u8fd0\u7b97 \u00b6 \u4e8c\u8fdb\u5236\u8865\u7801\u4e2d\u7684\u52a0\u51cf\u6cd5 \u00b6 \u9047\u5230\u51cf\u6cd5\u65f6\uff0c\u8f6c\u53d8\u4e3a\u52a0\u6cd5\uff0c\u53ea\u9700\u4e3a\u7b2c\u4e8c\u4e2a\u6570\u6c42\u4e8c\u8fdb\u5236\u7684\u8865 \u52a0\u6cd5\u6b63\u5e38 \u6df1\u5165\u7406\u89e3\u539f\u7801\uff0c\u53cd\u7801\uff0c\u8865\u7801\u7684\u539f\u7406 \u00b6 \u82b1\u4e86\u5f88\u957f\u65f6\u95f4\u7406\u89e3\u8865\u7801\u7684\u6784\u9020\u610f\u56fe\u3002\u81ea\u5df1\u7406\u4e86\u4e00\u904d\u903b\u8f91\u5982\u4e0b\uff1a \u8ba1\u7b97\u673a\u53ea\u80fd\u8fdb\u884c\u52a0\u6cd5\uff0c\u4e0d\u80fd\u8fdb\u884c\u51cf\u6cd5 \u7531\u4e8e\u4f4d\u6570\u7684\u9650\u5236\uff0c\u52a0\u6cd5\u76f8\u5f53\u4e8e\u5728\u6a21\u8fd0\u7b97\u4e0b\u8fdb\u884c \u6a21\u8fd0\u7b97\u4e0b\u7684\u52a0\u6cd5\u53ef\u4ee5\u770b\u4f5c\u4e00\u4e2a\u95ed\u73af \u7531\u4e0a\u9762\u4e09\u6761\u8bf4\u660e\uff0c\u6211\u4eec\u7684\u76ee\u6807\u662f\uff1a\u5728\u6a21\u8fd0\u7b97\u7684\u95ed\u73af\u4e2d\u7528\u52a0\u6cd5\u6a21\u62df\u51cf\u6cd5 \u6570\u5b66\u5b9a\u4e49\uff1a \u5bf9\u4e8e\u957f\u5ea6\u4e3a \\(\\omega\\) \u7684\u4f4d\u5411\u91cf\uff0c\u5b83\u7684\u6a21\u4e3a \\(2^{\\omega}\\) \uff0c\u8fd9\u4e00\u4f4d\u5411\u91cf\u5728\u957f\u5ea6 \\(0\\sim 2^{\\omega}-1\\) \u7684\u73af\u5185 \u8981\u7528\u52a0\u6cd5\u6a21\u62df\u51cf\u6cd5 \\(a - b = c\\) \uff0c\u76ee\u7684\u662f\u627e\u5230 \\(d\\) \u4f7f\u5f97 $ (a + d)mod 2^\\omega = c$ \u753b\u51fa\u8fd9\u6837\u4e00\u4e2a\u73af\uff0c\u5f88\u5bb9\u6613\u770b\u51fa\u52a0\u5230 \\(c\\) \u548c\u51cf\u5230 \\(c\\) \u5408\u8d77\u6765\u7ed5\u4e86\u4e00\u4e2a\u5708\uff0c\u56e0\u6b64\uff1a \\(d = 2^\\omega - b\\) \u901a\u8fc7\u8fd9\u4e00\u7b49\u5f0f\u53ef\u4ee5\u5efa\u7acb\u4ece\u8d1f\u6570 \\(-b\\) \u5230 \\(x_d\\) \u7684\u6620\u5c04\uff0c\u8fd9\u4e2a\u6620\u5c04\u628a\u8d1f\u6574\u6570 \\(b\\) \u6620\u5c04\u4e3a \\(d = 2^\\omega - b\\) \u7684\u4f4d\u6a21\u5f0f\uff0c \\(d\\) \u7684\u4f4d\u6a21\u5f0f\u5c31\u662f \\(-b\\) \u7684\u8865\u7801\u8868\u793a \u8fd9\u6837\u7684\u6620\u5c04\u5c31\u662f\u8865\u7801\u64cd\u4f5c\uff1a\u5148\u53d6\u53cd\u7801\u518d+1 \u63a5\u4e0b\u6765\u518d\u5206\u6790\u4ee5\u4e0a\u8fc7\u7a0b\uff0c\u4ee5 0110 - 0010 = 0100 \u5373 6-2=4 \u4e3a\u4f8b \\(x\\) \u662f\u4e00\u4e2a\u8d1f\u6570 \u627e\u5230 \\(d=10000-0010=1110\\) \u3002\u6211\u4eec\u53d1\u73b0\uff1a \\(d\\) \u53ef\u4ee5\u901a\u8fc7\u53d6\u53cd\u7801\u518d+1 \u7684\u627e\u5230 \u3002 \u539f\u7406\uff1a \\( \\({|x|}_\u53cd+|x| = 2^\\omega-1\\) \\) \\(0110 + 1110 = 10100\\) \u53d6\u6a21\u540e\u5373\u4e3a \\(0100\\) \u539f\u7406\uff1a\u8d1f\u6570\u7684\u8865\u7801\u548c\u5b83\u7684\u7edd\u5bf9\u503c\u76f8\u52a0\u7b49\u4e8e\u6a21\uff08\u672c\u8d28\u662f\u95ed\u73af\u5185\u7ed5\u4e00\u5708\u7684\u4e24\u79cd\u65b9\u6cd5\uff09 \\[2^\\omega = x_\u8865 + |x| \\] \u7531\u4ee5\u4e0a\u4e24\u5f0f\uff0c\u6211\u4eec\u5f97\u5230\u4e86\u53cd\u7801\u548c\u8865\u7801\u7684\u5173\u7cfb\uff1a \\(x_\u8865={|x|}_\u53cd+1\\) \u8981\u628a \\(1110\\) \u6620\u5c04\u4e3a \\(-2\\) \uff0c\u5c31\u9700\u8981\u628a\u6700\u5de6\u4fa7\u7684\u6743\u91cd\u8bbe\u7f6e\u4e3a \\(-8\\) \u4e3a\u4ec0\u4e48\u628a\u6700\u5de6\u4fa7\u4f4d\u7684\u6743\u91cd\u89e3\u91ca\u4e3a \\(-8\\) \u53ef\u4ee5\u505a\u5230\u5462\uff1f \u5176\u5b9e\u5c31\u662f\u8fdb\u884c\u4e86 \\(-16\\) \u7684\u64cd\u4f5c\uff0c\u53cd\u5411\u8f6c\u4e86\u4e00\u5708 \u3002 \\(14-16=-2\\) \u9047\u5230\u4e00\u4e2a\u6709\u8da3\u7684\u9898\u76ee\uff1a\u5bf9\u4e8e\u4e00\u4e2a\u8865\u7801\u8868\u793a\u7684\u7cfb\u7edf\uff0c\u8868\u8fbe\u5f0f ~x \u7684\u503c\u662f\u591a\u5c11\uff1f \u5199\u51fa\u4e09\u4e2a\u51fd\u6570\uff08\u6570\u5b57\u5230\u4e8c\u8fdb\u5236\u8865\u7801\uff0c\u53cd\u7801\u64cd\u4f5c\uff0c\u4e8c\u8fdb\u5236\u5230\u6570\u5b57\uff09\uff0c\u5bf9\u5206\u6bb5\u51fd\u6570\u5206\u7c7b\u8ba8\u8bba\uff0c\u5bb9\u6613\u5f97\u5230\uff0c ~x = \\(-1-x\\) \u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\uff08\u539f\u7801\uff09\u8868\u793a\u7684\u52a0\u51cf\u6cd5 \u00b6 \u4e00\u5171\u6709\u56db\u79cd\u4e0d\u540c\u7684\u7b26\u53f7\u7ec4\u5408\uff0c\u9700\u8981\u8003\u8651 8 \u79cd\u4e0d\u540c\u7684\u60c5\u51b5 \u7b2c\u4e00\u6b65\uff0c\u68c0\u67e5\u8fd0\u7b97\uff0c\u7edf\u4e00\u4e3a\u52a0\u6cd5 \u7b2c\u4e8c\u6b65\uff0c\u7528\u5f02\u6216\u68c0\u67e5\u4e24\u6570\u7684\u7b26\u53f7\u4e00\u81f4\u6027 \u7b2c\u4e09\u6b65\uff1a\u82e5\u7b26\u53f7\u76f8\u540c\uff0c\u7edd\u5bf9\u503c\u76f8\u52a0\uff1b\u82e5\u7b26\u53f7\u4e0d\u540c\uff0c\u7edd\u5bf9\u503c\u76f8\u51cf\uff08\u51cf\u6cd5\u539f\u7406\u540c\u4e0a\uff0c\u8f6c\u6362\u4e3a\u8865\u7801\u52a0\u6cd5\uff09\uff0c\u7b26\u53f7\u662f\u7edd\u5bf9\u503c\u8f83\u5927\u7684\u7b26\u53f7 \u6b64\u5904\u9700\u8981\u8003\u8651\u4e0a\u6ea2\uff1a\u5982\u679c \\(A\\geq B\\) \u5219\u6709\u4e0a\u6ea2\uff08\u6a21\u8fd0\u7b97\u540e\u820d\u5f03\uff09 \u5982\u679c \\(A < B\\) \u5219\u65e0\u4e0a\u6ea2\uff0c\u7ed3\u679c\u662f\u4e00\u4e2a\u8d1f\u6570\uff0c\u5e94\u5f53\u53d6\u5176\u4e8c\u8fdb\u5236\u8865\u7801\uff08\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\uff1a\u7edd\u5bf9\u503c\u90e8\u5206\u4f7f\u7528\u4e86\u8865\u7801\u5f0f\u7684\u51cf\u6cd5\u8fd0\u7b97\uff0c\u7ed3\u679c\u4ecd\u7136\u662f\u8865\u7801\u8868\u793a\u3002\u73b0\u5728\u53d6\u8865\u7801\u5c31\u662f\u8f6c\u6362\u4e3a\u65e0\u7b26\u53f7\u6574\u6570\u6a21\u5f0f\uff0c\u7ed3\u5408\u5148\u524d\u786e\u5b9a\u7684\u7b26\u53f7\u4f4d\uff0c\u5c31\u53d8\u56de\u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\u8868\u793a\uff09 \u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5728\u8be5\u52a0\u51cf\u6cd5\u4e2d\uff0c\u7b26\u53f7\u4f4d\u548c\u7edd\u5bf9\u503c\u5206\u5f00\u8ba1\u7b97\u3002\u7edd\u5bf9\u503c\u4e4b\u95f4\u7684\u51cf\u6cd5\u8fd0\u7b97\u4ecd\u7136\u4e0e\u8865\u7801\u76f8\u540c\u3002\u6bd4\u5982\uff1a17-22\uff0c $ 0010001-0010110 = 0010001 + 1101010 = 1111011$\uff0c\u6240\u5f97\u7ed3\u679c\u662f\u8865\u7801\u8868\u793a\uff0c\u9700\u8981\u518d\u8fdb\u884c\u4e00\u6b21\u8865\u7801\u4ee5\u8fd8\u539f\u4e3a\u65e0\u7b26\u53f7\u6574\u6570\u8868\u793a\u3002 \u5b9e\u6570\u7684\u52a0\u51cf\u6cd5 \u00b6 \u5c06\u5b9e\u6570\u7684\u52a0\u51cf\u6cd5\u7b80\u5316\u4e3a \u5c0f\u6570\u70b9\u5bf9\u9f50\u540e\u4ee5\u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\u683c\u5f0f\u5b58\u50a8\u7684\u4e24\u6574\u6570\u7684\u52a0\u6cd5\u548c\u51cf\u6cd5 \u7edf\u4e00\u4e3a\u52a0\u6cd5 \u53bb\u89c4\u8303\u5316 \u4f7f\u6307\u6570\u76f8\u7b49 \u76f8\u52a0\uff0c\u5904\u7406\u4e0a\u6ea2 \u89c4\u8303\u5316 \u56db\u820d\u4e94\u5165\uff0c\u505c\u6b62 Ch.5 \u8ba1\u7b97\u673a\u7ec4\u6210 \u00b6 \u5173\u952e\u8bcd\uff1a\u4e2d\u592e\u5904\u7406\u5355\u5143\uff0c\u4e3b\u5b58\uff0c\u8f93\u5165\u8f93\u51fa\u5b50\u7cfb\u7edf CPU \u00b6 CPU \u7531\u54ea\u4e09\u90e8\u5206\u7ec4\u6210\uff1f\u4ed6\u4eec\u5404\u81ea\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f \u4f60\u80fd\u8bf4\u51fa\u54ea\u4e9b\u79cd\u7c7b\u7684\u5bc4\u5b58\u5668\uff1f\u4ed6\u4eec\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f PC\uff0cIR \u662f\u4ec0\u4e48\uff1f \u4e3b\u5b58 \u00b6 \u5b57\u662f\u4ec0\u4e48\uff1f\u5730\u5740\u662f\u4ec0\u4e48\uff1f \u5730\u5740\u7a7a\u95f4\u662f\u4ec0\u4e48\uff1f64kb\uff0c1b \u5b57\u957f\u7684\u4e3b\u5b58\u6709\u591a\u5c11\u5730\u5740\u7a7a\u95f4\uff1f Note \u5355\u4f4d \u786e\u5207\u7684\u5b57\u8282\u6570 \u8fd1\u4f3c KB \\(2^{10}\\) 1024 \\(10^3\\) megabyte \\(2^{20}\\) 1048576 \\(10^6\\) gigabyte \\(2^{30}\\) 1073741824 \\(10^{9}\\) \u4e00\u4e2a\u6709 N \u5b57\u7684\u4e3b\u5b58\u9700\u8981\u591a\u957f\u7684\u4f4d\u6a21\u5f0f\u6765\u5b58\u50a8\u5730\u5740\uff1f \u7b80\u8ff0 RAM\uff08SRAM\uff0cDRAM\uff09\u548c ROM \u7535\u8111\u7684\u5185\u5b58\u662f\u54ea\u4e00\u79cd\u5b58\u50a8\u5668\uff1f\u5bc4\u5b58\u5668\u5462\uff1f ROM\u3001PROM\u3001EPROM\u3001EEPROM\u3001Flash Memory \u5206\u522b\u662f\u4ec0\u4e48\uff1f \u8865\u5145\uff1a\u903b\u8f91\u7535\u8def\u6807\u8bc6 \u7b80\u8ff0\u975e\u95e8\u3001\u4e0e\u975e\u95e8\u3001\u6216\u975e\u95e8\u7684\u7535\u8def\u5b9e\u73b0\uff1a\u9700\u8981\u7528\u51e0\u4e2a\u7535\u63a7\u5f00\u5173\uff1f \u518d\u6b21\u601d\u8003\uff1a\u5f02\u6216\u5982\u4f55\u4f7f\u7528\u4e0e\u95e8\u6216\u95e8\u6a21\u62df\uff1f \u6211\u7684\u89e3\u51b3\u65b9\u6848\uff1a \\(x XOR y = (x OR y) AND (NOT(xANDy))\\) \u8fd9\u662f\u89c2\u5bdf\u4e0e\u95e8\u6216\u95e8\u771f\u503c\u8868\u540e\uff0c\u601d\u8003\u5982\u4f55\u5bf9\u8fd9\u4e24\u4e2a\u7ed3\u679c\u8fdb\u884c\u8fd0\u7b97\u5f97\u51fa\u7684 \\(xORy=((NOTx)ANDy)OR(xAND(NOTy))\\) \u8fd9\u662f\u601d\u8003\u5f02\u6216\u7684\u7279\u6027\uff1a\u53cd\u8f6c\u5176\u4e2d\u4efb\u610f\u4e00\u4e2a\uff0c\u4e24\u8005\u5c31\u4e00\u6837\uff0c\u53ef\u4ee5\u5229\u7528\u4e0e\u95e8\u5224\u65ad \u8865\u5145\uff1a\u5e03\u5c14\u4ee3\u6570\u90e8\u5206-\u300a\u79bb\u6563\u6570\u5b66\u53ca\u5176\u5e94\u7528\u300b \u5e03\u5c14\u4ee3\u6570\u4e0e\u547d\u9898\u903b\u8f91\u7684\u8f6c\u6362\uff1a\u8865-\u5426\u5b9a\u3001\u5e03\u5c14\u548c-\u6790\u53d6\u3001\u5e03\u5c14\u79ef-\u5408\u53d6 \u5e03\u5c14\u51fd\u6570\uff0c\u5e03\u5c14\u53d8\u5143\uff0c\u51fd\u6570\u7684\u8fd0\u7b97 \u601d\u8003\uff1a\u6709\u591a\u5c11\u4e2a\u4e0d\u540c\u7684 n \u5143\u5e03\u5c14\u51fd\u6570\uff1f \u5438\u6536\u5f8b\uff1a \u00b6 \u300a\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\u300b\u8868\u8ff0\uff1a $ x \\cdot(x^\\prime+y) = x \\cdot y$ \u8bc1\u660e\uff1a\u5206\u914d\u5f8b\u5f97 \\((x \\cdot x^\\prime)+(x\\cdot y)\\) \u5de6\u4fa7\u662f 0\uff0c\u6d88\u53bb \u300a\u79bb\u6563\u6570\u5b66\u53ca\u5176\u5e94\u7528\u300b\u8868\u8ff0\uff1a \\(x+xy=x;x(x+y)=x\\) \u901a\u8fc7\u771f\u503c\u8868\u53ef\u4ee5\u7406\u89e3\uff1a\u5e03\u5c14\u548c\u5f3a\u8c03\u4e86 x \u7684\u4f5c\u7528\uff0c\u5e03\u5c14\u79ef\u524a\u5f31\u4e86 y \u7684\u4f5c\u7528 \u771f\u503c\u8868\u4e0e\u5230\u8868\u8fbe\u5f0f\u7684\u4e92\u5316\u3001\u51fd\u6570\u5316\u7b80 \u00b6 \u548c\u4e4b\u79ef\u6cd5\u4e0e\u79ef\u4e4b\u548c\u6cd5\uff0c\u4e92\u8865\u9879\u5408\u5e76\u539f\u7406\uff0c\u8fd0\u7b97\u5b8c\u5907\u6027\u8bc1\u660e \u5b50\u7cfb\u7edf\u534f\u4f5c \u00b6 \u4e09\u6761\u603b\u7ebf\uff1a\u6570\u636e\u3001\u5730\u5740\u3001\u547d\u4ee4 IO \u8bbe\u5907\u7684\u63a5\u5165\uff1a\u63a7\u5236\u5668","title":"\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08\u7b2c\u56db\u7248\uff09"},{"location":"books/FOCS/#_1","text":"Foundations Of Computer Science (4 th Edition) \u51fa\u7248\u793e \u4f5c\u8005 \u5e74\u4efd \u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e Behrouz A. Forouzan 2022 \u672c\u4e66\u7684\u9605\u8bfb\u7b14\u8bb0\u5c06\u5168\u90e8\u91c7\u7528\u82f1\u6587\u3002\u4ec5\u5728\u672c\u6982\u8ff0\u90e8\u5206\u5217\u51fa\u4e2d\u6587\u76ee\u5f55","title":"\u8ba1\u7b97\u673a\u79d1\u5b66\u5bfc\u8bba\uff08\u7b2c\u56db\u7248\uff09"},{"location":"books/FOCS/#_2","text":"\u7b2c 1 \u7ae0 \u7eea\u8bba Introduction \u7b2c\u4e00\u90e8\u5206\uff1a\u6570\u636e\u7684\u8868\u793a\u4e0e\u8fd0\u7b97 \u7b2c 2 \u7ae0 \u6570\u5b57\u7cfb\u7edf Number Systems \u7b2c 3 \u7ae0 \u6570\u636e\u5b58\u50a8 \u7b2c 4 \u7ae0 \u6570\u636e\u8fd0\u7b97 \u7b2c\u4e8c\u90e8\u5206\uff1a\u8ba1\u7b97\u673a\u786c\u4ef6 \u7b2c 5 \u7ae0 \u8ba1\u7b97\u673a\u7ec4\u6210 \u7b2c 6 \u7ae0 \u8ba1\u7b97\u673a\u7f51\u7edc\u548c\u56e0\u7279\u7f51 \u7b2c\u4e09\u90e8\u5206\uff1a\u8ba1\u7b97\u673a\u8f6f\u4ef6 \u7b2c 7 \u7ae0 \u64cd\u4f5c\u7cfb\u7edf \u7b2c 8 \u7ae0 \u7b97\u6cd5 \u7b2c 9 \u7ae0 \u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00 Programming Language \u7b2c 10 \u7ae0 \u8f6f\u4ef6\u5de5\u7a0b \u7b2c\u56db\u90e8\u5206\uff1a\u6570\u636e\u7ec4\u7ec7\u4e0e\u62bd\u8c61 \u7b2c 11 \u7ae0 \u6570\u636e\u7ed3\u6784 \u7b2c 12 \u7ae0 \u62bd\u8c61\u6570\u636e\u7c7b\u578b \u7b2c 13 \u7ae0 \u6587\u4ef6\u7ed3\u6784 \u7b2c 14 \u7ae0 \u6570\u636e\u5e93 \u7b2c\u4e94\u90e8\u5206\uff1a\u9ad8\u7ea7\u8bdd\u9898 \u7b2c 15 \u7ae0 \u6570\u636e\u538b\u7f29 \u7b2c 16 \u7ae0 \u5b89\u5168 \u7b2c 17 \u7ae0 \u8ba1\u7b97\u7406\u8bba \u7b2c 18 \u7ae0 \u4eba\u5de5\u667a\u80fd \u7b2c\u516d\u90e8\u5206\uff1a\u793e\u4ea4\u5a92\u4f53\u548c\u793e\u4f1a\u8bdd\u9898 \u7b2c 19 \u7ae0 \u793e\u4ea4\u5a92\u4f53\u5bfc\u8bba \u7b2c 20 \u7ae0 \u793e\u4f1a\u548c\u9053\u5fb7\u95ee\u9898 \u9644\u5f55 \u9644\u5f55 A Unicode \u9644\u5f55 B UML \u9644\u5f55 C \u4f2a\u4ee3\u7801 \u9644\u5f55 D \u7ed3\u6784\u56fe \u9644\u5f55 E \u5e03\u5c14\u4ee3\u6570\u548c\u903b\u8f91\u7535\u8def \u9644\u5f55 F C\u3001C++ \u548c Java \u7a0b\u5e8f\u793a\u4f8b \u9644\u5f55 G \u6570\u5b66\u77e5\u8bc6 \u9644\u5f55 H \u9519\u8bef\u68c0\u6d4b\u548c\u7ea0\u6b63 \u9644\u5f55 I \u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\u6574\u6570\u7684\u52a0\u51cf\u6cd5 \u9644\u5f55 J \u5b9e\u6570\u7684\u52a0\u51cf\u6cd5","title":"\u7ae0\u8282\u76ee\u5f55"},{"location":"books/FOCS/#ch1","text":"\u4ec0\u4e48\u662f\u56fe\u7075\u6a21\u578b\u548c\u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b \u8ba1\u7b97\u673a\u662f\u4e00\u79cd \u901a\u7528 \u7684\u673a\u5668\uff0c\u53ef\u4ee5\u5b8c\u6210 \u5404\u79cd\u4e0d\u540c\u7684\u5de5\u4f5c \u3002 \u56fe\u7075\u57281936\u5e74\u7684\u8bba\u6587\u300a\u8bba\u53ef\u8ba1\u7b97\u6570\u53ca\u5176\u5728\u5224\u5b9a\u4e0a\u7684\u5e94\u7528\u300b\u4e2d\u7ed9\u51fa\u4e86\u56fe\u7075\u673a\u7684\u5b9a\u4e49\u3002 \u300a\u8bba\u53ef\u8ba1\u7b97\u6570\u53ca\u5176\u5728\u5224\u5b9a\u4e0a\u7684\u5e94\u7528\u300b\u7b80\u5355\u7406\u89e3 \u539f\u59cb\u8bba\u6587\uff1aOn Computable Numbers\uff0cwith an Application to the Entscheidungsproblem \u672c\u4e66\u4e3e\u4e86\u56fe\u7075\u673a\u7684\u4e00\u4e2a\u4f8b\u5b50\u2014\u2014\u53ef\u7f16\u7a0b\u6570\u636e\u5904\u7406\u5668\uff1a\u7531\u8f93\u5165\u6570\u636e\u3001\u8f93\u51fa\u6570\u636e\u3001\u7a0b\u5e8f\u7ec4\u6210\u3002 \u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u8f83\u56fe\u7075\u6a21\u578b\u6700\u5927\u7684\u6539\u53d8\uff0c\u662f\u5c06\u7a0b\u5e8f\u5b58\u50a8\u5728\u5b58\u50a8\u5668\u4e2d\u3002 \u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u7531 4 \u4e2a\u5b50\u7cfb\u7edf\u7ec4\u6210\uff1a\u5b58\u50a8\u5668\u3001\u7b97\u672f\u903b\u8f91\u5355\u5143\u3001\u63a7\u5236\u5355\u5143\u3001\u8f93\u5165\u8f93\u51fa\u5355\u5143\u3002 \u6307\u4ee4\u987a\u5e8f\u6267\u884c\u3002 \u73b0\u4ee3\u8ba1\u7b97\u673a\u57fa\u4e8e\u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u3002 \u8ba1\u7b97\u673a\u7684\u5386\u53f2 \u673a\u68b0\u8ba1\u7b97\u5668\uff1a1930 \u5e74\u4ee5\u524d \u7535\u5b50\u8ba1\u7b97\u673a\uff1a1930~1950 \u5e74 \u57fa\u4e8e\u51af\u00b7\u8bfa\u4f9d\u66fc\u6a21\u578b\u7684\u8ba1\u7b97\u673a\uff1a1950 \u5e74\u81f3\u4eca \u7b2c\u4e00\u4ee3\u8ba1\u7b97\u673a\uff1a\u771f\u7a7a\u7ba1 \u7b2c\u4e8c\u4ee3\u8ba1\u7b97\u673a 1959~1965\uff1a\u6676\u4f53\u7ba1 \u7b2c\u4e09\u4ee3\u8ba1\u7b97\u673a 1965~1975\uff1a\u96c6\u6210\u7535\u8def \u7b2c\u56db\u4ee3\u8ba1\u7b97\u673a 1975~1985\uff1a\u5fae\u578b\u8ba1\u7b97\u673a\u3001\u8ba1\u7b97\u673a\u7f51\u7edc \u7b2c\u4e94\u4ee3\u8ba1\u7b97\u673a 1985~\uff1a\u638c\u4e0a\u8ba1\u7b97\u673a\u3001\u53f0\u5f0f\u8ba1\u7b97\u673a\u3001\u7b2c\u4e8c\u4ee3\u5b58\u50a8\u5a92\u4f53\u3001\u591a\u5a92\u4f53\u3001\u865a\u62df\u73b0\u5b9e...","title":"Ch1. \u7eea\u8bba"},{"location":"books/FOCS/#buml","text":"UML \u662f\u7edf\u4e00\u5efa\u6a21\u8bed\u8a00 Unified Modeling Language\u3002\u5b83\u5305\u62ec\uff1a\u7528\u6237\u89c6\u56fe\u3001\u7ed3\u6784\u89c6\u56fe\u3001\u884c\u4e3a\u89c6\u56fe\u548c\u5b9e\u73b0\u89c6\u56fe\u3002 \u884c\u4e3a\u89c6\u56fe\uff1a \u72b6\u6001\u56fe\uff1a\u4e3b\u8981\u4f7f\u7528\u4e94\u79cd\u7b26\u53f7","title":"\u9644\u5f55 B\uff1aUML \u56fe"},{"location":"books/FOCS/#ch2","text":"\u672c\u7ae0\u6982\u8981 \u672c\u7ae0\u4e3b\u8981\u76ee\u7684\u662f \u719f\u6089\u4e8c\u8fdb\u5236\u3001\u516b\u8fdb\u5236\u3001\u5341\u8fdb\u5236\u548c\u5341\u516d\u8fdb\u5236\u7684\u8ba1\u7b97 \u3002\u672c\u4e66\u4e3b\u8981\u4ee5\u7b97\u6cd5\u5f62\u5f0f\u7ed9\u51fa\uff0cCSAPP \u4e2d\u6709\u66f4\u591a\u6570\u5b66\u5c42\u9762\u7684\u8ba8\u8bba\u3002 CSAPP\uff1a\u5efa\u8bae\u4f60\u53cd\u590d\u9605\u8bfb\u6570\u5b66\u539f\u7406\u63cf\u8ff0\u548c\u793a\u4f8b\u4e0e\u8ba8\u8bba\uff0c\u76f4\u5230\u4f60\u5bf9\u8be5\u5c5e\u6027\u7684\u8bf4\u660e\u5185\u5bb9\u53ca\u5176\u91cd\u8981\u6027\u6709\u4e86 \u7262\u56fa\u7684\u76f4\u89c9 \u3002\u5bf9\u4e8e\u66f4\u52a0\u590d\u6742\u7684\u5c5e\u6027\uff0c\u4f60\u5e94\u8be5\u5c1d\u8bd5\u63a8\u5bfc\u3002 \u4f4d\u7f6e\u5316\u6570\u5b57\u7cfb\u7edf\u3001\u975e\u4f4d\u7f6e\u5316\u6570\u5b57\u7cfb\u7edf\uff08\u7f57\u9a6c\u6570\u5b57\u7b49\uff09 \u5176\u4ed6\u8fdb\u5236\u5230\u5341\u8fdb\u5236\u7684\u8f6c\u6362\uff1a\u76f4\u63a5\u8ba1\u7b97 \u5341\u8fdb\u5236\u5230\u5176\u4ed6\u8fdb\u5236\u7684\u8f6c\u6362\uff08\u7528 UML \u56fe\u8868\u793a\uff09 \u6574\u6570\u90e8\u5206\uff1a\u8fde\u9664 \u5c0f\u6570\u90e8\u5206\uff1a\u8fde\u4e58 \u5c06\u4e00\u4e2a \\(n\\) \u4f4d\u5341\u8fdb\u5236\u6570\u8f6c\u6362\u4e3a\u5176\u4ed6\u8fdb\u5236\uff0c\u600e\u4e48\u8ba1\u7b97\u9700\u8981\u7684\u4f4d\u6570\uff1f","title":"Ch.2 \u6570\u5b57\u7cfb\u7edf"},{"location":"books/FOCS/#ch3","text":"\u672c\u7ae0\u6982\u8981 \u7b80\u5355\u4ecb\u7ecd\u4e86\u6570\u5b57\u3001\u6587\u672c\u3001\u97f3\u9891\u3001\u56fe\u50cf\u3001\u89c6\u9891\u662f\u5982\u4f55\u5b58\u50a8\u5728\u8ba1\u7b97\u673a\u4e2d\u7684\u3002\u8fd9\u4e9b\u63cf\u8ff0\u90fd\u662f\u6982\u5ff5\u6027\u7684\uff0c\u6280\u672f\u7ec6\u8282\u9700\u8981\u67e5\u9605\u76f8\u5e94\u6570\u636e\u683c\u5f0f\u7684\u89c4\u8303\u6587\u6863\u3002 \u63cf\u8ff0\u4ee5\u4e0b\u5b58\u50a8\u6574\u6570\u7684\u65b9\u6cd5\uff1a\u5b83\u4eec\u80fd\u5b58\u50a8\u54ea\u4e9b\u6570\u5b57\uff1f\u5b58\u50a8\u3001\u8fd8\u539f\u7684\u6b65\u9aa4\u662f\u600e\u6837\u7684\uff1f\u4e3b\u8981\u5e94\u7528\u5728\u54ea\u91cc\uff1f\u6ea2\u51fa\u60c5\u51b5\u5982\u4f55\uff1f \u65e0\u7b26\u53f7\u8868\u793a\u6cd5 \u7b26\u53f7\u52a0\u7edd\u5bf9\u503c\u8868\u793a\u6cd5\uff08\u539f\u7801\uff09 \u4e8c\u8fdb\u5236\u8865\u7801\u8868\u793a\u6cd5 \u53cd\u7801\u8868\u793a\u6cd5\uff08\u672c\u4e66\u672a\u4ecb\u7ecd\uff09 CSAPP\uff1a\u7406\u89e3\u8865\u7801\u8868\u793a\u7684\u65b9\u6cd5\uff1a\u628a\u6700\u9ad8\u4f4d\u770b\u4f5c\u6743\u91cd\u4e3a \\(-2^{w-1}\\) \u7684\u4f4d \u5c1d\u8bd5\u7ed9\u51fa\u53cd\u7801\u8fd0\u7b97\u7684\u6570\u5b66\u8868\u8fbe\u5f0f\uff0c\u5e76\u7406\u89e3\u53cd\u7801\u7684\u8868\u8fbe\u5f0f\u662f\u5982\u4f55\u6784\u5efa\u7684\uff1f \u6ce8\u610f \u53cd\u7801\u64cd\u4f5c \u548c \u6574\u6570\u7684\u53cd\u7801\u8868\u793a \u3002\u53cd\u7801\u8868\u793a\u7684\u6574\u6570\u4e2d\uff0c\u53ea\u6709\u8d1f\u6570\u624d\u8fdb\u884c\u53cd\u7801\u64cd\u4f5c\u3002 \u5b9e\u6570\u7684\u50a8\u5b58\uff1a\u6d6e\u70b9\u8868\u793a\u6cd5\uff08\u5177\u6709 \u5f88\u5927\u6574\u6570\u90e8\u5206\u6216\u5f88\u5c0f\u5c0f\u6570\u90e8\u5206\u7684\u6570 \uff09\uff1a\u7b26\u53f7\u3001\u4f4d\u79fb\u91cf\u548c\u5b9a\u70b9\u6570 \u89c4\u8303\u5316\uff1a\u5b9a\u70b9\u6570\u5c0f\u6570\u70b9\u5de6\u4fa7\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u6570\u7801\u3002\u4e8c\u8fdb\u5236\u6570\u89c4\u8303\u5316\u540e\uff0c\u5de6\u4fa7\u7684 1 \u9690\u542b\u4e86\u3002 \u5341\u8fdb\u5236\u79f0\u4e3a\u79d1\u5b66\u8ba1\u6570\u6cd5\uff0c\u4e8c\u8fdb\u5236\u79f0\u4e3a\u6d6e\u70b9\u8868\u793a\u6cd5 \u5c3e\u6570\uff1a\u5c0f\u6570\u70b9\u53f3\u8fb9\u7684\u4e8c\u8fdb\u5236\u6570\u5b9a\u4e49\u4e86\u8be5\u6570\u7684\u7cbe\u5ea6\uff0c\u4f5c\u4e3a \u65e0\u7b26\u53f7\u6574\u6570\u5b58\u50a8 \u6307\u6570\uff1a\u6709\u7b26\u53f7\uff0c\u4f7f\u7528 \u4f59\u7801\u7cfb\u7edf \uff1a\u504f\u79fb\u91cf \\((2^{m-1}-1)\\) \u88ab\u52a0\u5230\u6bcf\u4e2a\u6570\u5b57\u4e2d\uff08m \u4e3a\u5185\u5b58\u5355\u5143\u5927\u5c0f\uff09\uff0c\u7edf\u4e00\u79fb\u5230\u975e\u8d1f\u7684\u4e00\u904d\u3002\u5982 4 \u4f4d\u5b58\u50a8\u5355\u5143\u4f7f\u7528\u4f59 7 \u7801\u7cfb\u7edf\u3002\u8fd9\u6837\u505a\u7684\u4f18\u52bf\u662f\u5bf9\u8fd9\u4e9b\u6574\u6570\u8fdb\u884c\u6bd4\u8f83\u6216\u8fd0\u7b97\u65f6\u4e0d\u9700\u8981\u8003\u8651\u7b26\u53f7\u3002 IEEE \u6807\u51c6\uff1a\u5355\u8fdb\u5ea6\u4e3a 1\uff0c8\uff0c23\uff1b\u53cc\u7cbe\u5ea6\u4e3a 1\uff0c11\uff0c52 \u50a8\u5b58\uff1a\u786e\u5b9a\u7b26\u53f7\uff0c\u8f6c\u4e8c\u8fdb\u5236\uff0c\u89c4\u8303\u5316\uff0c\u50a8\u5b58\u6307\u6570\u548c\u5c3e\u6570\uff0c\u8fde\u63a5\u4e09\u4e2a\u90e8\u5206 \u8fd8\u539f\uff1a\u62c6\u5206\u4e3a\u4e09\u4e2a\u90e8\u5206\uff0c\u786e\u5b9a\u7b26\u53f7\uff0c\u89e3\u7801\u4f4d\u79fb\u91cf\uff0c\u53bb\u89c4\u8303\u5316\u5c3e\u6570\uff0c\u8fd8\u539f\u6570\u5b57\uff0c\u8f6c\u5341\u8fdb\u5236\uff0c\u52a0\u4e0a\u7b26\u53f7 \u6d6e\u70b9\u6570\u7684\u4e0a\u6ea2\u548c\u4e0b\u6ea2 \uff1a\u4e3e\u4f8b\u5355\u7cbe\u5ea6\u6d6e\u70b9\u6570\u6700\u5927\u8d1f\u503c\u4e3a \\(-(1-2^{-24})\\times 2^{+128}\\) \uff0c\u5176\u4e2d\uff0c\u5c3e\u6570 23 \u4f4d\u65e0\u7b26\u53f7\u6570\uff0c\u6700\u5927\u7edd\u5bf9\u503c\u4e3a \\(2^{24}-1\\) \uff0c\u6307\u6570 8 \u4f4d\u4f59\u7801\u6570\uff0c\u6700\u5927\u4e3a \\(2^{8-1}=128\\) \u3002\u6700\u5c0f\u8d1f\u503c\u4e3a \\(-(1-2^{-1})\\times 2^{-127}\\) \u96f6\u7684\u7ea6\u5b9a\uff1a\u4e09\u4e2a\u90e8\u5206\u90fd\u8bbe\u7f6e\u4e3a 0 \u4ec0\u4e48\u662f \u622a\u65ad\u9519\u8bef \uff1f","title":"Ch.3 \u6570\u636e\u50a8\u5b58"},{"location":"books/FOCS/#ch4","text":"\u5173\u952e\u8bcd\uff1a\u7b97\u672f\u8fd0\u7b97\u3001\u79fb\u4f4d\u8fd0\u7b97\u3001\u903b\u8f91\u8fd0\u7b97","title":"Ch4. \u6570\u636e\u8fd0\u7b97"},{"location":"books/FOCS/#ch5","text":"\u5173\u952e\u8bcd\uff1a\u4e2d\u592e\u5904\u7406\u5355\u5143\uff0c\u4e3b\u5b58\uff0c\u8f93\u5165\u8f93\u51fa\u5b50\u7cfb\u7edf","title":"Ch.5 \u8ba1\u7b97\u673a\u7ec4\u6210"},{"location":"books/FOCS/AppE/","tags":["Ongoing"],"text":"Appendix E: Boolen Algebra and Logic Circuits \u00b6 Boolean Algebra \u00b6 ' NOT . AND + OR Logic Gate \u00b6 A logic gate is an electronic device that normally takes 1 to N inputs and creates one output. Implementation of gates \u00b6 The most common implementation uses only three gates: NOT, NAND, and NOR. Because a NAND gate uses fewer componenets than an AND gate. A transistor, when used in gates, behaves like a switch. Several different technologies are used to implement these transistors, include the most known MOSFET.","title":"Appendix E: Boolen Algebra and Logic Circuits"},{"location":"books/FOCS/AppE/#appendix-e-boolen-algebra-and-logic-circuits","text":"","title":"Appendix E: Boolen Algebra and Logic Circuits"},{"location":"books/FOCS/AppE/#boolean-algebra","text":"' NOT . AND + OR","title":"Boolean Algebra"},{"location":"books/FOCS/AppE/#logic-gate","text":"A logic gate is an electronic device that normally takes 1 to N inputs and creates one output.","title":"Logic Gate"},{"location":"books/FOCS/AppE/#implementation-of-gates","text":"The most common implementation uses only three gates: NOT, NAND, and NOR. Because a NAND gate uses fewer componenets than an AND gate. A transistor, when used in gates, behaves like a switch. Several different technologies are used to implement these transistors, include the most known MOSFET.","title":"Implementation of gates"},{"location":"books/FOCS/Chapter1-4/","tags":["Ongoing"],"text":"Ch. 1-4 Intro, Number, Data and Operation \u00b6 These contents are closely related, so I put them together in one note. Abstract Main Topic are these: Model of computer Outline for this book Storing Data Data Operation Ch1. Introduction \u00b6 Turing Model \u00b6 Turing model is a mathematical and philosophical definition of computation. We only care about the philosophical definition here. He defined these things: Data processor: accepts input data, process the data, and creates output data. Program: a set of instructions that tells the computer what to do with data. Info Turing's thesis can be found here: On Computable Numbers\uff0cwith an Application to the Entscheidungsproblem In the thesis, he presented a mathematical description of the universal Turing machine than can perform all computation. A Chinese explanation can be found here: \u300a\u8bba\u53ef\u8ba1\u7b97\u6570\u53ca\u5176\u5728\u5224\u5b9a\u4e0a\u7684\u5e94\u7528\u300b\u7b80\u5355\u7406\u89e3 Von Neumann Model \u00b6 Today's computers are based on the von Neumann model . The main difference bewtween Turing model and von Neumann model is that while Turing model stores data in its memory, von Neumann model also stores programs in its memory. The von Neumann model consists of four subsystem: Input/Output Arithmetic logic unit (ALU): calculation and logical operations take place Memory Control Unit: controls all other subsystem Main concepts: Programs and data are stored in memory as binary patterns . Sequential execution of instructions. Computer Componenets \u00b6 This section briefly describes the three parts of computer: hardware, software and data . Please refer to the book. History \u00b6 Ignored. Outline of the course \u00b6 As described in the index note . Ch2. Number Systems \u00b6 In this chapter your main task is to understand the binary, hexadecimal and octal systems, and know how to convert number from one system to another. Any base to decimal conversion \u00b6 Simply multiply each digit with its place value in the source system and add the results to get the number. Decimal to any base \u00b6 Integral part and fractional part are handled differently. Integral part Repetitively divide the source to get the quotient and the remainder. The remainder is inserted to the left of the destination. Until quotient is zero. Fractional part Repetitively multiply the source to get the result. The intergral part is inserted to the right of the destination. Until fractional part is zero or destination digits are enough. Number of digits Given a positional number system with base \\(b\\) , find the number of digits of an integer N. Note The answer is \\(\\left \\lceil \\log_b{N} \\right \\rceil\\) . If we are using \\(K\\) digits in base \\(b_1\\) , we need to know the minimum number of digits \\(x\\) we need in the destination system with base \\(b_2\\) . Note The answer is \\(\\left \\lceil K \\times (\\log_{b_2}b_1) \\right \\rceil\\) . Nonpositional number systems \u00b6 Ignored. Ch3. Data Storage \u00b6 Storing Numbers \u00b6 Integers \u00b6 For representations below, you need to know: how to store, retrieve numbers, overflow situation, application. Unsigned representation Sign-and-magnitude representation Two's complement representation Reals \u00b6 We use floating-point representation to represent reals. It consists of three parts: Sign Shifter Fixed-point number Tip You can compare scientific method with floating-point method. Normalization: Decimal: d.xxxxx , d is 1-9 while x is 0-9. Binary: 1.yyyyy , y is 0 or 1. Then extract three pieces of information: Sign Exponent Mantissa (\u5c3e\u6570): the point and bit 1 to the left of the fixed-point section are not stored. The exponent can be positive and negative. We use Excess system to represent: Add a bias to shift positive or negative numbers uniformly to the nonnegative side. The value of this bias is \\(2^{m-1}-1\\) , \\(m\\) is the size of the memory location to store the exponent.","title":"Ch. 1-4 Intro, Number, Data and Operation"},{"location":"books/FOCS/Chapter1-4/#ch-1-4-intro-number-data-and-operation","text":"These contents are closely related, so I put them together in one note. Abstract Main Topic are these: Model of computer Outline for this book Storing Data Data Operation","title":"Ch. 1-4 Intro, Number, Data and Operation"},{"location":"books/FOCS/Chapter1-4/#ch1-introduction","text":"","title":"Ch1. Introduction"},{"location":"books/FOCS/Chapter1-4/#ch2-number-systems","text":"In this chapter your main task is to understand the binary, hexadecimal and octal systems, and know how to convert number from one system to another.","title":"Ch2. Number Systems"},{"location":"books/FOCS/Chapter1-4/#ch3-data-storage","text":"","title":"Ch3. Data Storage"},{"location":"books/FOCS/Chapter9/","tags":["Ongoing"],"text":"Ch9. Programming Language \u00b6 Abstract The aim of this chapter is to compare and contrast different languages. Evolution of programming languages from machine language to high-level languages. Interpreter and compiler. Four computer language paradigms\uff08\u8303\u5f0f\uff09. Understand the procedural paradigm and object-oriented paradigm. 9.1 Evolution \u00b6","title":"Ch9. Programming Language"},{"location":"books/FOCS/Chapter9/#ch9-programming-language","text":"Abstract The aim of this chapter is to compare and contrast different languages. Evolution of programming languages from machine language to high-level languages. Interpreter and compiler. Four computer language paradigms\uff08\u8303\u5f0f\uff09. Understand the procedural paradigm and object-oriented paradigm.","title":"Ch9. Programming Language"},{"location":"books/FOCS/Chapter9/#91-evolution","text":"","title":"9.1 Evolution"},{"location":"courses-outside/","text":"\u6821\u5916\u8bfe\u7a0b \u00b6 \u7b80\u4ecb \u672c\u5206\u533a\u4e3b\u8981\u5b58\u653e\u6821\u5916\u8bfe\u7a0b\u7684\u7b14\u8bb0\uff0c\u4e3b\u8981\u4e3a\u56fd\u5185\u5916\u8457\u540d\u5927\u5b66\u7684\u8ba1\u7b97\u673a\u8bfe\u7a0b\u3002 \u8bfe\u7a0b\u76ee\u5f55 \u00b6 \u5df2\u5b8c\u6210 \u00b6 \u6b63\u5728\u7f16\u8f91 \u00b6 CMU 15-213","title":"\u6821\u5916\u8bfe\u7a0b"},{"location":"courses-outside/#_1","text":"\u7b80\u4ecb \u672c\u5206\u533a\u4e3b\u8981\u5b58\u653e\u6821\u5916\u8bfe\u7a0b\u7684\u7b14\u8bb0\uff0c\u4e3b\u8981\u4e3a\u56fd\u5185\u5916\u8457\u540d\u5927\u5b66\u7684\u8ba1\u7b97\u673a\u8bfe\u7a0b\u3002","title":"\u6821\u5916\u8bfe\u7a0b"},{"location":"courses-outside/#_2","text":"","title":"\u8bfe\u7a0b\u76ee\u5f55"},{"location":"courses-outside/CMU-15-213/","text":"CMU 15-213 \u00b6 Abstract \u8fd9\u662f\u6211\u5b66\u4e60\u300a\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf\u300b\u53ca CMU 15-213 \u8bfe\u7a0b\u7684\u7b14\u8bb0\u3002 \u4e66\u672c\u7f51\u7ad9 \u8bfe\u7a0b\u7f51\u7ad9\uff08Fall 2015\uff09 \u8bfe\u7a0b\u89c6\u9891\uff08Fall 2015\uff09 [\u8bfe\u7a0b\u7f51\u7ad9\uff08\u6700\u65b0\uff09]\uff08http://www.cs.cmu.edu/~213/\uff09 \u8bfe\u7a0b\u4e2d\u6587\u7ffb\u8bd1\u9879\u76ee \u4e66\u7c4d\u82f1\u6587\u7248 \u4e66\u7c4d\u4e2d\u6587\u7248\uff08gitbook\uff09 \u8fdb\u5ea6\u8868 \u00b6 Fall 2015 Schedule \u5168\u8bfe\u7a0b\u6301\u7eed 14 \u5468\uff0c\u6bcf 1-2 \u5468\u5b8c\u6210\u4e00\u4e2a Lab\u3002 2023 \u5e74\u7684\u8bfe\u7a0b\u4e2d\u65b0\u589e\u4e86 L0(cprogramminglab)\u3002 \u65e5\u671f \u5185\u5bb9 03.13 Lecture 01: Course Overview 03.16 Complete C language note for Structure 03.18 Complete C language note for ADT(especially for linked lists) 03.20 Lab 0 due 03.21 Bootcamp 1: Linux, Command Line, Git \u76ee\u5f55 \u00b6 \u8bfe\u7a0b\u7b14\u8bb0 \u00b6 Lecture 01: Course Overview Lecture 02: Bits, Bytes, and Ints; Floating Point \u4e66\u672c\u6458\u8981 \u00b6 \u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf Chapter01. \u8ba1\u7b97\u673a\u7cfb\u7edf\u6f2b\u6e38 Chapter02. \u4fe1\u606f\u7684\u8868\u793a\u548c\u5904\u7406 Chapter03. \u7a0b\u5e8f\u7684\u673a\u5668\u7ea7\u8868\u793a \u5b9e\u9a8c\u8bb0\u5f55 \u00b6 C Programming Lab: Assessing Your C Programming Skills Bootcamp 1: Linux, Command Line, Git","title":"CMU 15-213"},{"location":"courses-outside/CMU-15-213/#cmu-15-213","text":"Abstract \u8fd9\u662f\u6211\u5b66\u4e60\u300a\u6df1\u5165\u7406\u89e3\u8ba1\u7b97\u673a\u7cfb\u7edf\u300b\u53ca CMU 15-213 \u8bfe\u7a0b\u7684\u7b14\u8bb0\u3002 \u4e66\u672c\u7f51\u7ad9 \u8bfe\u7a0b\u7f51\u7ad9\uff08Fall 2015\uff09 \u8bfe\u7a0b\u89c6\u9891\uff08Fall 2015\uff09 [\u8bfe\u7a0b\u7f51\u7ad9\uff08\u6700\u65b0\uff09]\uff08http://www.cs.cmu.edu/~213/\uff09 \u8bfe\u7a0b\u4e2d\u6587\u7ffb\u8bd1\u9879\u76ee \u4e66\u7c4d\u82f1\u6587\u7248 \u4e66\u7c4d\u4e2d\u6587\u7248\uff08gitbook\uff09","title":"CMU 15-213"},{"location":"courses-outside/CMU-15-213/#_1","text":"Fall 2015 Schedule \u5168\u8bfe\u7a0b\u6301\u7eed 14 \u5468\uff0c\u6bcf 1-2 \u5468\u5b8c\u6210\u4e00\u4e2a Lab\u3002 2023 \u5e74\u7684\u8bfe\u7a0b\u4e2d\u65b0\u589e\u4e86 L0(cprogramminglab)\u3002 \u65e5\u671f \u5185\u5bb9 03.13 Lecture 01: Course Overview 03.16 Complete C language note for Structure 03.18 Complete C language note for ADT(especially for linked lists) 03.20 Lab 0 due 03.21 Bootcamp 1: Linux, Command Line, Git","title":"\u8fdb\u5ea6\u8868"},{"location":"courses-outside/CMU-15-213/#_2","text":"","title":"\u76ee\u5f55"},{"location":"courses-outside/CMU-15-213/Lab/BC1/","text":"Bootcamp 1: Linux, Command Line, Git \u00b6 Abstract \u901a\u8fc7\u8fd9\u4e2a\u5c0f Lab\uff0c\u4f60\u80fd\u517b\u6210\u66f4\u597d\u7684\u4f7f\u7528 Linux \u7684\u4e60\u60ef\u3002 \u8bf7\u4e0d\u8981\u5728\u81ea\u5df1\u52a8\u624b\u64cd\u4f5c\u524d\u67e5\u770b\u4ee5\u4e0b\u7b54\u6848\u3002 Lab \u7b54\u6848 Phase 1 ~/start/free_the/university_center Phase 2 rmdir capture_the Phase 3 pineapple Phase 4 cat evil24.txt Phase 5 touch release.txt Phase 6 42 Phase 7 free the university center stones we tried to release them but no one listened","title":"Bootcamp 1: Linux, Command Line, Git"},{"location":"courses-outside/CMU-15-213/Lab/BC1/#bootcamp-1-linux-command-line-git","text":"Abstract \u901a\u8fc7\u8fd9\u4e2a\u5c0f Lab\uff0c\u4f60\u80fd\u517b\u6210\u66f4\u597d\u7684\u4f7f\u7528 Linux \u7684\u4e60\u60ef\u3002 \u8bf7\u4e0d\u8981\u5728\u81ea\u5df1\u52a8\u624b\u64cd\u4f5c\u524d\u67e5\u770b\u4ee5\u4e0b\u7b54\u6848\u3002 Lab \u7b54\u6848 Phase 1 ~/start/free_the/university_center Phase 2 rmdir capture_the Phase 3 pineapple Phase 4 cat evil24.txt Phase 5 touch release.txt Phase 6 42 Phase 7 free the university center stones we tried to release them but no one listened","title":"Bootcamp 1: Linux, Command Line, Git"},{"location":"courses-outside/CMU-15-213/Lab/L0/","text":"Lab0: C Programming Lab \u00b6 \u7b2c\u4e00\u6b21\u5b9e\u9a8c\u7684\u63d0\u9192 \u8bf7\u4ed4\u7ec6\u9605\u8bfb\u5b9e\u9a8c\u624b\u518c\u3002 \u672c\u5b9e\u9a8c\u8981\u6c42\u7528\u94fe\u8868\u5b9e\u73b0\u4e00\u4e2a\u5b57\u7b26\u4e32\u961f\u5217\u3002\u8be5 Lab \u5bf9\u4ee3\u7801\u9c81\u68d2\u6027\u8981\u6c42\u8f83\u9ad8\uff0c\u9700\u8981\u5c3d\u53ef\u80fd\u591a\u5730 \u8003\u8651\u5404\u79cd\u60c5\u51b5 \u3002\u6b64\u5916\uff0c\u5bf9 \u5185\u5b58\u6cc4\u6f0f \u7684\u68c0\u67e5\u4e5f\u5341\u5206\u4e25\u683c\u3002\u5728\u6240\u6709\u8fdb\u884c\u4e86\u8282\u70b9\u589e\u5220\u64cd\u4f5c\u7684\u51fd\u6570\u4e2d\u90fd\u5e94\u5f53\u6ce8\u610f\u3002 \u4ee5\u4e0b\u6d45\u8bb0\u5f55\u81ea\u5df1\u8e29\u8fc7\u7684\u5404\u79cd\u5751\uff1a \u539f\u5730\u53cd\u8f6c\u94fe\u8868 \u00b6 void queue_reverse ( queue_t * q ) { if ( ! q ) return ; /* You need to write the code for this function */ if ( ! q -> head ) return ; if ( q -> n == 1 ) return ; list_ele_t * prev , * next ; prev = q -> tail = q -> head ; next = prev -> next ; while ( next ) { q -> head = next ; next = next -> next ; q -> head -> next = prev ; prev = prev -> next ; //Wrong Code } q -> tail -> next = NULL ; } \u8fd9\u6bb5\u4ee3\u7801\u5728\u94fe\u8868\u957f\u5ea6\u4e3a 3 \u4ee5\u5185\u65f6\u90fd\u80fd\u6b63\u786e\u8fd0\u884c\uff0c\u82e5\u94fe\u8868\u957f\u5ea6\u8d85\u8fc7 3\uff0c\u5219\u53cd\u8f6c\u540e\u94fe\u8868\u7adf\u53ea\u5269\u4e0b\u53cd\u8f6c\u540e\u7684\u5934\u5c3e\u4e24\u4e2a\u5143\u7d20\u3002\u539f\u56e0\u5728\u4e8e\u6807\u6ce8 Wrong Code \u7684\u90a3\u4e00\u884c\uff1a\u53cd\u8f6c\u7b2c\u4e00\u4e2a\u8282\u70b9\u65f6\uff0c\u4e0a\u9762\u7684\u64cd\u4f5c\u5bfc\u81f4\u8282\u70b9\u6307\u5411\u81ea\u8eab\uff08\u8fd9\u4e2a\u95ee\u9898\u5728\u51fd\u6570\u672b\u5c3e\u5904\u7406 tail \u65f6\u624d\u5f97\u5230\u89e3\u51b3\uff09\uff0c\u56e0\u6b64\u6539\u884c\u5e76\u4e0d\u4f1a\u4f7f prev \u8282\u70b9\u5411\u540e\u79fb\u52a8\uff0c\u800c\u662f\u4e00\u76f4\u56fa\u5b9a\u5728 tail \u3002\u5faa\u73af\u8fc7\u540e\uff0c\u94fe\u8868\u4e2d\u5269\u4e0b\u7684\u8282\u70b9\u5168\u90fd\u6307\u5411 tail \uff0c\u7ed3\u679c\u5c31\u662f\u53ea\u5269\u4e24\u4e2a\u4e86\u3002 \u89e3\u51b3\u529e\u6cd5\u662f\u6539\u4e3a prev = q->head \u3002 \u5c0f\u5fc3\u5185\u5b58\u6cc4\u6f0f \u00b6 \u5bb9\u6613\u8e29\u5751\u7684\u60c5\u51b5\uff1a \u5206\u914d\u5185\u5b58\u5931\u8d25\u65f6\u7684\u5904\u7406 \u00b6 \u672c\u9898\u8c03\u7528 malloc() \u7684\u51fd\u6570\u4e3b\u8981\u662f\u63d2\u5165\u8282\u70b9\u51fd\u6570\u3002\u4f46\u662f\u5982\u679c\u4e3a\u8282\u70b9\u7684\u5b57\u7b26\u4e32\u8c03\u7528 malloc() \u5931\u8d25\u65f6\uff0c\u4e0d\u80fd\u76f4\u63a5\u9000\u51fa\u51fd\u6570\uff0c\u9700\u8981\u91ca\u653e\u9884\u5148\u521b\u5efa\u7684\u8282\u70b9 newh \u3002 \u603b\u4e4b\uff1a\u51fd\u6570\u9996\u5148\u8981\u4fdd\u8bc1\u81ea\u5df1\u7684\u5b8c\u5584\u3002 \u5982\u679c\u51fd\u6570\u5931\u8d25\uff0c\u51fd\u6570\u8981\u4fdd\u8bc1\u81ea\u5df1\u9000\u51fa\u65f6\u5185\u5b58\u5b89\u5168\u3002 \u5982\u679c\u51fd\u6570\u6210\u529f\u8fd4\u56de\uff0c\u8c03\u7528\u8005\u5fc5\u987b\u4fdd\u8bc1\u5185\u5b58\u5b89\u5168\u3002 \u5220\u9664\u8282\u70b9\u65f6\u7684\u5904\u7406 \u00b6 bool queue_remove_head ( queue_t * q , char * buf , size_t bufsize ){ if ( ! q ) return false ; if ( ! q -> head ) return false ; if ( buf ) { strncpy ( buf , q -> head -> value , bufsize - 1 ); buf [ bufsize - 1 ] = 0 ; } free ( q -> head -> value ); q -> head = q -> head -> next ; q -> n -- ; return true ; } \u4e0a\u9762\u7684\u8fd9\u4e2a\u51fd\u6570\u6ca1\u6709\u91ca\u653e\u5220\u53bb\u7684\u8282\u70b9\u7684\u5185\u5b58\uff0c\u662f\u5178\u578b\u7684\u5185\u5b58\u6cc4\u9732\u3002 \u5b9e\u9a8c\u89e3\u6790\u548c\u7b54\u6848 \u77e5\u4e4e\uff1aCSAPP:Lab0-C Programming Lab","title":"Lab0: C Programming Lab"},{"location":"courses-outside/CMU-15-213/Lab/L0/#lab0-c-programming-lab","text":"\u7b2c\u4e00\u6b21\u5b9e\u9a8c\u7684\u63d0\u9192 \u8bf7\u4ed4\u7ec6\u9605\u8bfb\u5b9e\u9a8c\u624b\u518c\u3002 \u672c\u5b9e\u9a8c\u8981\u6c42\u7528\u94fe\u8868\u5b9e\u73b0\u4e00\u4e2a\u5b57\u7b26\u4e32\u961f\u5217\u3002\u8be5 Lab \u5bf9\u4ee3\u7801\u9c81\u68d2\u6027\u8981\u6c42\u8f83\u9ad8\uff0c\u9700\u8981\u5c3d\u53ef\u80fd\u591a\u5730 \u8003\u8651\u5404\u79cd\u60c5\u51b5 \u3002\u6b64\u5916\uff0c\u5bf9 \u5185\u5b58\u6cc4\u6f0f \u7684\u68c0\u67e5\u4e5f\u5341\u5206\u4e25\u683c\u3002\u5728\u6240\u6709\u8fdb\u884c\u4e86\u8282\u70b9\u589e\u5220\u64cd\u4f5c\u7684\u51fd\u6570\u4e2d\u90fd\u5e94\u5f53\u6ce8\u610f\u3002 \u4ee5\u4e0b\u6d45\u8bb0\u5f55\u81ea\u5df1\u8e29\u8fc7\u7684\u5404\u79cd\u5751\uff1a","title":"Lab0: C Programming Lab"},{"location":"courses-outside/CMU-15-213/Lab/L0/#_1","text":"void queue_reverse ( queue_t * q ) { if ( ! q ) return ; /* You need to write the code for this function */ if ( ! q -> head ) return ; if ( q -> n == 1 ) return ; list_ele_t * prev , * next ; prev = q -> tail = q -> head ; next = prev -> next ; while ( next ) { q -> head = next ; next = next -> next ; q -> head -> next = prev ; prev = prev -> next ; //Wrong Code } q -> tail -> next = NULL ; } \u8fd9\u6bb5\u4ee3\u7801\u5728\u94fe\u8868\u957f\u5ea6\u4e3a 3 \u4ee5\u5185\u65f6\u90fd\u80fd\u6b63\u786e\u8fd0\u884c\uff0c\u82e5\u94fe\u8868\u957f\u5ea6\u8d85\u8fc7 3\uff0c\u5219\u53cd\u8f6c\u540e\u94fe\u8868\u7adf\u53ea\u5269\u4e0b\u53cd\u8f6c\u540e\u7684\u5934\u5c3e\u4e24\u4e2a\u5143\u7d20\u3002\u539f\u56e0\u5728\u4e8e\u6807\u6ce8 Wrong Code \u7684\u90a3\u4e00\u884c\uff1a\u53cd\u8f6c\u7b2c\u4e00\u4e2a\u8282\u70b9\u65f6\uff0c\u4e0a\u9762\u7684\u64cd\u4f5c\u5bfc\u81f4\u8282\u70b9\u6307\u5411\u81ea\u8eab\uff08\u8fd9\u4e2a\u95ee\u9898\u5728\u51fd\u6570\u672b\u5c3e\u5904\u7406 tail \u65f6\u624d\u5f97\u5230\u89e3\u51b3\uff09\uff0c\u56e0\u6b64\u6539\u884c\u5e76\u4e0d\u4f1a\u4f7f prev \u8282\u70b9\u5411\u540e\u79fb\u52a8\uff0c\u800c\u662f\u4e00\u76f4\u56fa\u5b9a\u5728 tail \u3002\u5faa\u73af\u8fc7\u540e\uff0c\u94fe\u8868\u4e2d\u5269\u4e0b\u7684\u8282\u70b9\u5168\u90fd\u6307\u5411 tail \uff0c\u7ed3\u679c\u5c31\u662f\u53ea\u5269\u4e24\u4e2a\u4e86\u3002 \u89e3\u51b3\u529e\u6cd5\u662f\u6539\u4e3a prev = q->head \u3002","title":"\u539f\u5730\u53cd\u8f6c\u94fe\u8868"},{"location":"courses-outside/CMU-15-213/Lab/L0/#_2","text":"\u5bb9\u6613\u8e29\u5751\u7684\u60c5\u51b5\uff1a","title":"\u5c0f\u5fc3\u5185\u5b58\u6cc4\u6f0f"},{"location":"courses-outside/CMU-15-213/Lecture/Lecture1/","text":"Lecture 01: Course Overview \u00b6 \u672c\u8282\u8bfe\u662f\u8bfe\u7a0b\u6982\u8ff0\uff0c\u6982\u62ec\u5730\u4ecb\u7ecd\u4e86\u8fd9\u95e8\u8bfe\u7684\u5185\u5bb9\uff0c\u5e76\u8bb2\u89e3\u4e86\u5173\u4e8e C \u7684\u5185\u5b58\u7ba1\u7406\u7684\u4e00\u4e9b\u4e1c\u897f\u3002 CSAPP \u7684\u8bfe\u7a0b\u4e3b\u9898\u5c31\u662f\uff1a\u62bd\u8c61\u662f\u597d\u7684\uff0c\u4f46\u4e0d\u8981\u5fd8\u4e86\u73b0\u5b9e\u3002\u672c\u8282\u8bfe\u91cd\u70b9\u8bb2\u89e3\u4e86\u4ee5\u4e0b\u51e0\u4e2a\u73b0\u5b9e\uff1a Ints are not Integers, Floats are not Reals \u8ba1\u7b97\u673a\u7684\u7b97\u6570\u8fd0\u7b97\u4e0e\u6211\u4eec\u60f3\u8c61\u7684\u6709\u5f88\u5927\u4e0d\u540c\u3002 You've Got to Know Assembly \u4f60\u5e94\u5f53\u4e86\u89e3\u4e00\u4e9b\u6c47\u7f16\u8bed\u8a00\u3002 Memory Matters \u5185\u5b58\u7ba1\u7406\u5f88\u91cd\u8981\uff0c\u5b83\u5e38\u5e38\u5bfc\u81f4\u975e\u5e38\u68d8\u624b\u7684 bug\u3002C \u548c C++ \u6ca1\u6709\u63d0\u4f9b\u4efb\u4f55\u5185\u5b58\u4fdd\u62a4\u673a\u5236\u3002 There's more to performance than asymptotic complexity \u5728\uff08\u65f6\u95f4\uff09\u6e10\u8fd1\u590d\u6742\u5ea6\u4e4b\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u4e1c\u897f\u5f71\u54cd\u7740\u6027\u80fd\u3002 Computers do more than execute programs \u9664\u6267\u884c\u7a0b\u5e8f\u5916\uff0c\u8ba1\u7b97\u673a\u8fd8\u505a\u4e86\u5f88\u591a\u4e8b\u60c5\u3002","title":"Lecture 01: Course Overview"},{"location":"courses-outside/CMU-15-213/Lecture/Lecture1/#lecture-01-course-overview","text":"\u672c\u8282\u8bfe\u662f\u8bfe\u7a0b\u6982\u8ff0\uff0c\u6982\u62ec\u5730\u4ecb\u7ecd\u4e86\u8fd9\u95e8\u8bfe\u7684\u5185\u5bb9\uff0c\u5e76\u8bb2\u89e3\u4e86\u5173\u4e8e C \u7684\u5185\u5b58\u7ba1\u7406\u7684\u4e00\u4e9b\u4e1c\u897f\u3002 CSAPP \u7684\u8bfe\u7a0b\u4e3b\u9898\u5c31\u662f\uff1a\u62bd\u8c61\u662f\u597d\u7684\uff0c\u4f46\u4e0d\u8981\u5fd8\u4e86\u73b0\u5b9e\u3002\u672c\u8282\u8bfe\u91cd\u70b9\u8bb2\u89e3\u4e86\u4ee5\u4e0b\u51e0\u4e2a\u73b0\u5b9e\uff1a Ints are not Integers, Floats are not Reals \u8ba1\u7b97\u673a\u7684\u7b97\u6570\u8fd0\u7b97\u4e0e\u6211\u4eec\u60f3\u8c61\u7684\u6709\u5f88\u5927\u4e0d\u540c\u3002 You've Got to Know Assembly \u4f60\u5e94\u5f53\u4e86\u89e3\u4e00\u4e9b\u6c47\u7f16\u8bed\u8a00\u3002 Memory Matters \u5185\u5b58\u7ba1\u7406\u5f88\u91cd\u8981\uff0c\u5b83\u5e38\u5e38\u5bfc\u81f4\u975e\u5e38\u68d8\u624b\u7684 bug\u3002C \u548c C++ \u6ca1\u6709\u63d0\u4f9b\u4efb\u4f55\u5185\u5b58\u4fdd\u62a4\u673a\u5236\u3002 There's more to performance than asymptotic complexity \u5728\uff08\u65f6\u95f4\uff09\u6e10\u8fd1\u590d\u6742\u5ea6\u4e4b\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u4e1c\u897f\u5f71\u54cd\u7740\u6027\u80fd\u3002 Computers do more than execute programs \u9664\u6267\u884c\u7a0b\u5e8f\u5916\uff0c\u8ba1\u7b97\u673a\u8fd8\u505a\u4e86\u5f88\u591a\u4e8b\u60c5\u3002","title":"Lecture 01: Course Overview"},{"location":"courses-outside/CMU-15-213/Lecture/Lecture2/","tags":["Ongoing"],"text":"Lecture 02: Bits, Bytes, and Ints; Floating Point \u00b6 \u628a\u8bb2\u8ba1\u7b97\u673a\u7b97\u6570\u7684\u4e09\u8282\u8bfe\u5408\u5728\u4e00\u4e2a\u7b14\u8bb0\u4e86\u3002 \u7b2c\u4e00\u8282\u8bfe \u00b6 \u4f4d\u3001\u4fe1\u606f\u3001\u8fdb\u5236 \u7b80\u5355\u5e03\u5c14\u4ee3\u6570 C \u4e2d\u7684\u4f4d\u8fd0\u7b97\u3001\u4f4d\u79fb\u8fd0\u7b97 \u4ec5\u7528\u4e8e\u6574\u6570\u7c7b\u578b \u4f4d\u79fb\u91cf <0 \u6216 > \u5b57\u957f\u65f6\u884c\u4e3a\u662f\u672a\u5b9a\u4e49\u7684 \u6574\u6570\u7f16\u7801 \u00b6 \u65e0\u7b26\u53f7\u6570\u548c\u8865\u7801\u6570\u503c\u7684\u8ba1\u7b97 \u8868\u793a\u8303\u56f4 \u7684\u7b80\u5355\u4f7f\u7528 \u7c7b\u578b\u8f6c\u6362 cast cast \u65f6\u4fdd\u6301\u4f4d\u6a21\u5f0f\u4e0d\u53d8\uff0c\u91cd\u65b0\u89e3\u91ca\u3002 \u5199\u51fa T2U \u4e0e U2T \u7684\u51fd\u6570\u8868\u8fbe\u5f0f\u3002 \u5e38\u91cf\u9ed8\u8ba4\u6709\u7b26\u53f7\uff0c U \u540e\u7f00\u65e0\u7b26\u53f7\u3002 \u8868\u8fbe\u5f0f\u6c42\u503c\u65f6\uff0c\u82e5\u6709/\u65e0\u7b26\u53f7\u6570\u6df7\u6742\uff0c\u6709\u7b26\u53f7\u6570\u9690\u5f0f\u8f6c\u6362\u4e3a\u65e0\u7b26\u53f7\u6570\u3002 \u4f4d\u6269\u5c55 extension \u6709\u7b26\u53f7\u6570\u6269\u5c55 \u65e0\u7b26\u53f7\u6570\u6269\u5c55","title":"Lecture 02: Bits, Bytes, and Ints; Floating Point"},{"location":"courses-outside/CMU-15-213/Lecture/Lecture2/#lecture-02-bits-bytes-and-ints-floating-point","text":"\u628a\u8bb2\u8ba1\u7b97\u673a\u7b97\u6570\u7684\u4e09\u8282\u8bfe\u5408\u5728\u4e00\u4e2a\u7b14\u8bb0\u4e86\u3002","title":"Lecture 02: Bits, Bytes, and Ints; Floating Point"},{"location":"courses-outside/CMU-15-213/Lecture/Lecture2/#_1","text":"\u4f4d\u3001\u4fe1\u606f\u3001\u8fdb\u5236 \u7b80\u5355\u5e03\u5c14\u4ee3\u6570 C \u4e2d\u7684\u4f4d\u8fd0\u7b97\u3001\u4f4d\u79fb\u8fd0\u7b97 \u4ec5\u7528\u4e8e\u6574\u6570\u7c7b\u578b \u4f4d\u79fb\u91cf <0 \u6216 > \u5b57\u957f\u65f6\u884c\u4e3a\u662f\u672a\u5b9a\u4e49\u7684","title":"\u7b2c\u4e00\u8282\u8bfe"},{"location":"courses-outside/web.lab/","text":"Web.Lab \u5b66\u4e60\u7b14\u8bb0 \u00b6 \u603b\u8ff0 \u00b6 MIT Web Crush Course \u5927\u81f4\u5305\u62ec\u4e86\u4ee5\u4e0b\u5185\u5bb9\uff08\u6bcf\u5e74\u5185\u5bb9\u90fd\u6709\u6dfb\u52a0\uff0c\u8d8a\u6765\u8d8a\u4e30\u5bcc\u4e86\uff0c\u8fd9\u91cc\u4ee5 2023 \u5e74\u7684\u8bfe\u7a0b\u8868\u4e3a\u4f8b\uff09\uff1a Web \u4e09\u5251\u5ba2\uff1aHTML\u3001CSS\u3001JavaScript Web \u5f00\u53d1\u6846\u67b6\uff1aReact\u3001Node.js \u6570\u636e\u5e93 Chatbook \u9879\u76ee\u5b9e\u8df5 \u9879\u76ee\u90e8\u7f72 \u8fd9\u4e9b\u5185\u5bb9\u57fa\u672c\u6253\u901a\u4e86 Web \u5f00\u53d1\u7684\u524d\u540e\u7aef\uff0c\u662f\u4e00\u95e8\u975e\u5e38\u597d\u7684 Web \u5f00\u53d1\u5165\u95e8\u8bfe\u7a0b\u3002 \u5404\u6a21\u5757\u7b14\u8bb0\u7d22\u5f15 \u00b6","title":"Web.Lab \u5b66\u4e60\u7b14\u8bb0"},{"location":"courses-outside/web.lab/#weblab","text":"","title":"Web.Lab \u5b66\u4e60\u7b14\u8bb0"},{"location":"courses-outside/web.lab/#_1","text":"MIT Web Crush Course \u5927\u81f4\u5305\u62ec\u4e86\u4ee5\u4e0b\u5185\u5bb9\uff08\u6bcf\u5e74\u5185\u5bb9\u90fd\u6709\u6dfb\u52a0\uff0c\u8d8a\u6765\u8d8a\u4e30\u5bcc\u4e86\uff0c\u8fd9\u91cc\u4ee5 2023 \u5e74\u7684\u8bfe\u7a0b\u8868\u4e3a\u4f8b\uff09\uff1a Web \u4e09\u5251\u5ba2\uff1aHTML\u3001CSS\u3001JavaScript Web \u5f00\u53d1\u6846\u67b6\uff1aReact\u3001Node.js \u6570\u636e\u5e93 Chatbook \u9879\u76ee\u5b9e\u8df5 \u9879\u76ee\u90e8\u7f72 \u8fd9\u4e9b\u5185\u5bb9\u57fa\u672c\u6253\u901a\u4e86 Web \u5f00\u53d1\u7684\u524d\u540e\u7aef\uff0c\u662f\u4e00\u95e8\u975e\u5e38\u597d\u7684 Web \u5f00\u53d1\u5165\u95e8\u8bfe\u7a0b\u3002","title":"\u603b\u8ff0"},{"location":"courses-outside/web.lab/#_2","text":"","title":"\u5404\u6a21\u5757\u7b14\u8bb0\u7d22\u5f15"},{"location":"courses-outside/web.lab/HTMLBasic/","tags":["Ongoing"],"text":"HTML \u57fa\u7840 \u00b6 \u5927\u90e8\u5206\u5185\u5bb9\u6765\u81ea\u300aHead First HTML\u300b W3C \u9a8c\u8bc1\u5de5\u5177 \u6982\u5ff5\u6027\u77e5\u8bc6 \u00b6 \u6982\u5ff5 \u00b6 \u5c5e\u6027 \uff1a\u6d4f\u89c8\u5668\u53ea\u8ba4\u8bc6\u6bcf\u4e2a\u5143\u7d20 \u9884\u5b9a\u4e49 \u7684\u4e00\u7ec4\u5c5e\u6027\uff0c\u6211\u4eec\u8bf4\u6d4f\u89c8\u5668\u652f\u6301\u8fd9\u4e2a\u5c5e\u6027\u3002 HTML5 \u652f\u6301\u4e86\u5b9a\u5236\u6570\u636e\u5c5e\u6027\uff0c\u4f60\u53ef\u4ee5\u4e3a\u65b0\u5c5e\u6027\u6784\u9020\u5b9a\u5236\u7684\u5c5e\u6027\u540d\u3002 \u5e03\u5c14\u5c5e\u6027 \uff1a\u6ca1\u6709\u503c\uff0c\u53ea\u6709\u5b58\u4e0d\u5b58\u5728\u3002 \u5143\u7d20 \u5143\u7d20\u7684\u610f\u4e49\u662f\u8ba9\u9875\u9762 \u66f4\u7ed3\u6784\u5316\uff0c\u66f4\u6709\u610f\u4e49 \u3002\u6bd4\u5982\u9762\u5bf9\u89c6\u969c\u4eba\u7fa4\uff0c\u6d4f\u89c8\u5668\u4f1a\u9009\u62e9\u6700\u5408\u9002\u7684\u65b9\u6cd5\u6765\u663e\u793a\u90a3\u4e9b\u5143\u7d20\u3002 \u5757 \uff08block\uff09 \u5143\u7d20\u3001\u5185\u8054 \uff08inline\uff09 \u5143\u7d20\u548c\u7a7a\uff08void\uff09\u5143\u7d20 \u4e0d\u8981\u53ea\u662f\u4e3a\u4e86\u663e\u793a\u6548\u679c\u800c\u4f7f\u7528 HTML \u5143\u7d20\uff0c\u6bd4\u5982 \u4ee3\u7801 \u00b6 \u6d4f\u89c8\u5668\u4f1a\u5ffd\u7565 HTML \u6587\u6863\u4e2d\u7684\u5236\u8868\u7b26\u3001\u56de\u8f66\u548c\u5927\u90e8\u5206\u7a7a\u683c\uff0c\u6839\u636e\u4f60\u7684\u6807\u8bb0\u786e\u5b9a\u5728\u54ea\u91cc\u6362\u884c/\u5206\u6bb5\u3002 \u6ce8\u91ca\u5199\u5728 \u4e4b\u95f4\u3002 \u5b57\u7b26\u5b9e\u4f53 \uff1a\u7528\u4e8e\u8f93\u5165 < \u548c > \u7b49\u7279\u6b8a\u5b57\u7b26 < : > > : < & : & \u67e5\u627e\uff1a W3C , Unicode \u4f7f\u7528\u7f16\u53f7 d \u6807\u51c6 \u00b6 HTML5 \u662f HTML \u7684\u6700\u65b0\u7248\u672c\uff0c\u5b83\u8ba9\u7f16\u5199 HTML \u7684\u5f88\u591a\u505a\u6cd5\u5927\u5927\u7b80\u5316\uff0c\u63d0\u4f9b\u4e00\u4e9b\u65b0\u7684\u529f\u80fd\uff0c\u5e76\u901a\u8fc7 JS API \u63d0\u4f9b\u4e00\u4e9b\u9ad8\u7ea7\u7279\u6027\u3002 HTML \u7684\u53d1\u5c55\u5386\u53f2 HTML \u5df2\u7ecf\u53d1\u5c55\u6210\u4e3a\u4e86\u4e00\u4e2a \u6d3b\u7684\u6807\u51c6 \uff0c\u4e0d\u518d\u4f1a\u6709\u7248\u672c\u53f7\u3002\u73b0\u5728\u53ea\u6709 HTML\u3002 \u5173\u952e\u662f\u5411\u540e\u517c\u5bb9\u6027 \u73b0\u5728\u7684 HTML \u89c4\u8303\u4f1a\u8bb0\u5f55 Web \u5f00\u53d1\u4eba\u5458\u5e38\u72af\u7684\u9519\u8bef\uff0c\u5e76\u5e2e\u52a9\u6d4f\u89c8\u5668\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\u3002 \u8fd9\u662f HTML5 \u7684 doctype\uff0c\u5b83\u544a\u8bc9\u6d4f\u89c8\u5668\uff1a\u8fd9\u4e2a\u9875\u9762\u4f7f\u7528 HTML \u6807\u51c6\u3002 \u8001\u7684 doctype \u4e00\u822c\u957f\u8fd9\u6837 \u6307\u5b9a\u7f16\u7801\u7c7b\u578b\u3002\u8fd9\u4e00\u884c\u5fc5\u987b\u653e\u5728 \u4e2d\u6700\u4e0a\u65b9\u3002 \u4e00\u4e9b\u5143\u7d20\u7684 alt \u5c5e\u6027\u662f \u5fc5\u8981\u7684 \u7f51\u7ad9\u6587\u4ef6\u7ec4\u7ec7 \u00b6 \u4e3a\u4e86\u590d\u7528\uff0c\u56fe\u7247\u4e00\u822c\u653e\u5728\u6839\u76ee\u5f55\u7684 images \u6587\u4ef6\u5939\u4e2d\u3002 \u8def\u5f84\u7edf\u4e00\u4f7f\u7528\uff1a\u659c\u6760 / \uff08\u8bb0\u5fc6\uff1a\u8fd9\u662f\u7528\u53f3\u624b\u5212\u659c\u7ebf\u6700\u81ea\u7136\u7684\u65b9\u5411\uff09 \\ \u662f\u53cd\u659c\u6760\uff0c\u662f Windows \u5e38\u7528\u7684 \u8bbf\u95ee\u7236\u6587\u4ef6\u5939\uff1a ../ \u8def\u5f84\u5f53\u5fc3\u8d85\u8fc7 255 \u4e2a\u5b57\u7b26 \u7f51\u7ad9\u7684 \u6587\u4ef6\u5939\u548c\u6587\u4ef6\u540d\u4e0d\u8981\u6709\u7a7a\u683c \u5a92\u4f53 \u00b6 \u56fe\u50cf \u00b6 JPEG \u9002\u5408\u8fde\u7eed\u8272\u8c03\u56fe\u50cf \u6709\u635f\u683c\u5f0f\uff0c\u7f29\u5c0f\u65f6\u4e22\u5931\u4fe1\u606f \u4e0d\u652f\u6301\u900f\u660e\u5ea6 \u6587\u4ef6\u8f83\u5c0f\uff0c\u9002\u7528\u4e8e Web \u4e0d\u652f\u6301\u52a8\u753b PNG \u9002\u5408\u5355\u8272\u56fe\u50cf\u3001\u7ebf\u6761\u6784\u6210\u56fe\u50cf\uff1alogo\uff0c\u526a\u8d34\u753b\uff0c\u5c0f\u6587\u672c \u6709 PNG-8 PNG-24 PNG-32 \u65e0\u635f\u683c\u5f0f\uff0c\u4f1a\u538b\u7f29\u4f46\u4e0d\u4f1a\u4e22\u6389\u4fe1\u606f \u652f\u6301\u900f\u660e \u6587\u4ef6\u66f4\u5927\u4e00\u4e9b GIF 256 \u8272 \u201c\u65e0\u635f\u201d\u683c\u5f0f \u53ea\u5141\u8bb8\u4e00\u79cd\u989c\u8272\u8bbe\u7f6e\u4e3a\u201c\u900f\u660e\u201d\uff08\u8fd9\u4f1a\u5bfc\u81f4\u952f\u9f7f\u900f\u660e\u533a\uff09 \u652f\u6301\u52a8\u753b \u50cf\u7d20\uff1aCSS \u50cf\u7d20\u662f 1 \u82f1\u5bf8\u7684 1/96\uff0896ppi\uff09 \u4f7f\u7528 \u7f29\u7565\u56fe \u5e76 \u94fe\u63a5\u5230\u539f\u59cb\u56fe\u50cf \u3002 \u6587\u672c\u56fe\u50cf\u8bb0\u5f97 \u67d4\u5316\u6587\u672c\u8fb9\u7f18\uff08\u53cd\u952f\u9f7f\uff09 \uff0c\u589e\u5f3a\u53ef\u8bfb\u6027\u3002 \u89c6\u9891 \u00b6 \u5143\u7d20\u624b\u518c \u00b6 Web \u4e09\u90e8\u66f2\uff1a\u8ba1\u5212\u3001
    \u548c \u6807\u51c6 HTML \u7ed3\u6784 \u00b6 rel href \u00b6