{"id":41,"date":"2026-05-09T22:15:58","date_gmt":"2026-05-09T14:15:58","guid":{"rendered":"https:\/\/hi.tionmon.de\/?p=41"},"modified":"2026-05-10T00:17:32","modified_gmt":"2026-05-09T16:17:32","slug":"%e4%bb%a3%e7%a0%81%e9%ab%98%e4%ba%ae%e4%b8%8e%e8%a1%a8%e6%a0%bc","status":"publish","type":"post","link":"https:\/\/hi.tionmon.de\/?p=41","title":{"rendered":"\u4ee3\u7801\u9ad8\u4eae\u4e0e\u8868\u683c"},"content":{"rendered":"<div>\n<h1>\u4ee3\u7801\u9ad8\u4eae\u4e0e\u8868\u683c<\/h1>\n<p>\u5bf9\u4e8e\u6280\u672f\u535a\u5ba2\u6765\u8bf4\uff0c\u4ee3\u7801\u9ad8\u4eae\u548c\u8868\u683c\u662f\u975e\u5e38\u6838\u5fc3\u7684\u529f\u80fd\u3002\u8fd9\u7bc7\u535a\u6587\u5c06\u4e13\u95e8\u6d4b\u8bd5\u8fd9\u4e9b\u5143\u7d20\u7684\u6e32\u67d3\u6548\u679c\u3002<\/p>\n<h2>\u884c\u5185\u4ee3\u7801<\/h2>\n<p>\u5728\u6bb5\u843d\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u63d0\u5230\u8bf8\u5982 <code>Array.prototype.map()<\/code> \u6216 <code>python3 -m venv venv<\/code> \u8fd9\u6837\u7684\u7b80\u77ed\u4ee3\u7801\u7247\u6bb5\u3002\u884c\u5185\u4ee3\u7801\u7684\u80cc\u666f\u8272\u548c\u5b57\u4f53\u5e94\u8be5\u4e0e\u666e\u901a\u6587\u672c\u6709\u6240\u533a\u5206\uff0c\u4e14\u4e0d\u7834\u574f\u884c\u9ad8\u3002<\/p>\n<h2>\u4ee3\u7801\u5757\u4e0e\u8bed\u6cd5\u9ad8\u4eae<\/h2>\n<h3>JavaScript \/ TypeScript<\/h3>\n<div class=\"xun-code-wrapper\">\n<div class=\"xun-code-header\">\n<div class=\"xun-code-header-left\"><span class=\"xun-code-dots\"><span><\/span><span><\/span><span><\/span><\/span><\/div>\n<div class=\"xun-code-header-right\"><span class=\"xun-code-lang\">TypeScript<\/span><button type=\"button\" class=\"xun-code-copy\" title=\"\u590d\u5236\u4ee3\u7801\"><svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\"><\/path><\/svg><\/button><\/div>\n<\/div>\n<pre class=\"xun-code-block line-numbers\" ><code class=\"language-typescript\">interface User {\r\n  id: number;\r\n  name: string;\r\n  email?: string;\r\n}\r\n\r\nfunction greet(user: User): string {\r\n  if (!user.email) {\r\n    console.warn(&#039;User email is missing!&#039;);\r\n  }\r\n  return `Hello, ${user.name}! Your ID is ${user.id}.`;\r\n}\r\n\r\nconst u: User = { id: 1, name: &quot;Alice&quot; };\r\nconsole.log(greet(u));<\/code><\/pre>\n<\/div>\n<h3>Python \u4ee3\u7801<\/h3>\n<div class=\"xun-code-wrapper\">\n<div class=\"xun-code-header\">\n<div class=\"xun-code-header-left\"><span class=\"xun-code-dots\"><span><\/span><span><\/span><span><\/span><\/span><\/div>\n<div class=\"xun-code-header-right\"><span class=\"xun-code-lang\">Python<\/span><button type=\"button\" class=\"xun-code-copy\" title=\"\u590d\u5236\u4ee3\u7801\"><svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\"><\/path><\/svg><\/button><\/div>\n<\/div>\n<pre class=\"xun-code-block line-numbers\" ><code class=\"language-python\">import os\r\nimport sys\r\n\r\ndef fibonacci(n):\r\n    &quot;&quot;&quot;\u751f\u6210\u6590\u6ce2\u90a3\u5951\u6570\u5217&quot;&quot;&quot;\r\n    a, b = 0, 1\r\n    for _ in range(n):\r\n        yield a\r\n        a, b = b, a + b\r\n\r\nif __name__ == &quot;__main__&quot;:\r\n    print(list(fibonacci(10)))<\/code><\/pre>\n<\/div>\n<h3>Bash \/ Shell \u811a\u672c<\/h3>\n<div class=\"xun-code-wrapper\">\n<div class=\"xun-code-header\">\n<div class=\"xun-code-header-left\"><span class=\"xun-code-dots\"><span><\/span><span><\/span><span><\/span><\/span><\/div>\n<div class=\"xun-code-header-right\"><span class=\"xun-code-lang\">Bash\/Shell<\/span><button type=\"button\" class=\"xun-code-copy\" title=\"\u590d\u5236\u4ee3\u7801\"><svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" width=\"16\" height=\"16\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\"><\/path><\/svg><\/button><\/div>\n<\/div>\n<pre class=\"xun-code-block line-numbers\" ><code class=\"language-bash\">#!\/bin\/bash\r\n# \u8fd9\u662f\u4e00\u4e2a bash \u6d4b\u8bd5\u811a\u672c\r\necho &quot;Updating system...&quot;\r\nsudo apt-get update &amp;&amp; sudo apt-get upgrade -y\r\necho &quot;Done!&quot;<\/code><\/pre>\n<\/div>\n<h2>\u6570\u636e\u8868\u683c<\/h2>\n<p>\u6d4b\u8bd5\u8868\u683c\u7684\u8868\u5934\u3001\u6591\u9a6c\u7eb9\uff08\u5982\u679c\u6709\uff09\u3001\u8fb9\u6846\u4ee5\u53ca\u5bf9\u9f50\u65b9\u5f0f\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u9879\u76ee (\u5de6\u5bf9\u9f50)<\/th>\n<th style=\"text-align: center;\">\u63cf\u8ff0 (\u5c45\u4e2d\u5bf9\u9f50)<\/th>\n<th style=\"text-align: right;\">\u4ef7\u683c (\u53f3\u5bf9\u9f50)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">MacBook Pro 14&#8243;<\/td>\n<td style=\"text-align: center;\">M3 Pro, 18GB RAM, 512GB SSD<\/td>\n<td style=\"text-align: right;\">$1,999<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">iPhone 15 Pro<\/td>\n<td style=\"text-align: center;\">256GB, Natural Titanium<\/td>\n<td style=\"text-align: right;\">$1,099<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">AirPods Pro 2<\/td>\n<td style=\"text-align: center;\">USB-C Case<\/td>\n<td style=\"text-align: right;\">$249<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Magic Keyboard<\/td>\n<td style=\"text-align: center;\">For Mac<\/td>\n<td style=\"text-align: right;\">$99<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8868\u683c\u5728\u79fb\u52a8\u7aef\u662f\u5426\u80fd\u591f\u6a2a\u5411\u6eda\u52a8\u4e5f\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u6d4b\u8bd5\u70b9\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee3\u7801\u9ad8\u4eae\u4e0e\u8868\u683c \u5bf9\u4e8e\u6280\u672f\u535a\u5ba2\u6765\u8bf4\uff0c\u4ee3\u7801\u9ad8\u4eae\u548c\u8868\u683c\u662f\u975e\u5e38\u6838\u5fc3\u7684\u529f\u80fd\u3002\u8fd9\u7bc7\u535a\u6587\u5c06\u4e13\u95e8\u6d4b\u8bd5\u8fd9\u4e9b\u5143\u7d20\u7684\u6e32\u67d3\u6548\u679c\u3002 \u884c\u5185<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"special":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-article"],"_links":{"self":[{"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=41"}],"version-history":[{"count":1,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":42,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions\/42"}],"wp:attachment":[{"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=41"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/hi.tionmon.de\/index.php?rest_route=%2Fwp%2Fv2%2Fspecial&post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}