-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
263 lines (239 loc) · 44.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!DOCTYPE html><html lang="default" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Jiahao Luo - Blockchain, security and Program Language</title><meta name="author" content="Michael(Jiahao) Luo"><meta name="copyright" content="Michael(Jiahao) Luo"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website">
<meta property="og:title" content="Jiahao Luo">
<meta property="og:url" content="https://www.blog-blockchain.xyz/index.html">
<meta property="og:site_name" content="Jiahao Luo">
<meta property="og:locale">
<meta property="og:image" content="https://www.blog-blockchain.xyz/images/site-avator.jpg">
<meta property="article:author" content="Michael(Jiahao) Luo">
<meta property="article:tag" content="blockchain, security, program language, software engineer">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://www.blog-blockchain.xyz/images/site-avator.jpg"><link rel="shortcut icon" href="/images/favicon.png"><link rel="canonical" href="https://www.blog-blockchain.xyz/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//www.google-analytics.com" crossorigin=""/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="manifest" href="/pwa/manifest.json"/><link rel="apple-touch-icon" sizes="180x180" href="/pwa/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/pwa/32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/pwa/16.png"/><link rel="mask-icon" href="/pwa/safari-pinned-tab.svg" color="#5bbad5"/><link rel="stylesheet" href="/css/index.css?v=5.2.2"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>
(() => {
const saveToLocal = {
set: (key, value, ttl) => {
if (!ttl) return
const expiry = Date.now() + ttl * 86400000
localStorage.setItem(key, JSON.stringify({ value, expiry }))
},
get: key => {
const itemStr = localStorage.getItem(key)
if (!itemStr) return undefined
const { value, expiry } = JSON.parse(itemStr)
if (Date.now() > expiry) {
localStorage.removeItem(key)
return undefined
}
return value
}
}
window.btf = {
saveToLocal,
getScript: (url, attr = {}) => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
Object.entries(attr).forEach(([key, val]) => script.setAttribute(key, val))
script.onload = script.onreadystatechange = () => {
if (!script.readyState || /loaded|complete/.test(script.readyState)) resolve()
}
script.onerror = reject
document.head.appendChild(script)
}),
getCSS: (url, id) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onload = link.onreadystatechange = () => {
if (!link.readyState || /loaded|complete/.test(link.readyState)) resolve()
}
link.onerror = reject
document.head.appendChild(link)
}),
addGlobalFn: (key, fn, name = false, parent = window) => {
if (!false && key.startsWith('pjax')) return
const globalFn = parent.globalFn || {}
globalFn[key] = globalFn[key] || {}
globalFn[key][name || Object.keys(globalFn[key]).length] = fn
parent.globalFn = globalFn
}
}
const activateDarkMode = () => {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
const activateLightMode = () => {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
btf.activateDarkMode = activateDarkMode
btf.activateLightMode = activateLightMode
const theme = saveToLocal.get('theme')
theme === 'dark' ? activateDarkMode() : theme === 'light' ? activateLightMode() : null
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
document.documentElement.classList.toggle('hide-aside', asideStatus === 'hide')
}
const detectApple = () => {
if (/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)) {
document.documentElement.classList.add('apple')
}
}
detectApple()
})()
</script><script>var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?372b8854d18acf62880149b1e08e1901";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
btf.addGlobalFn('pjaxComplete', () => {
_hmt.push(['_trackPageview',window.location.pathname])
}, 'baidu_analytics')
</script><script async="async" src="https://www.googletagmanager.com/gtag/js?id=QXcJQjXxTMeUwnWykFW2xw"></script><script>window.dataLayer = window.dataLayer || []
function gtag(){dataLayer.push(arguments)}
gtag('js', new Date())
gtag('config', 'QXcJQjXxTMeUwnWykFW2xw')
btf.addGlobalFn('pjaxComplete', () => {
gtag('config', 'QXcJQjXxTMeUwnWykFW2xw', {'page_path': window.location.pathname})
}, 'google_analytics')
</script><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"No results found for: ${query}","hits_stats":"${hits} articles found"}},
translate: undefined,
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500,"highlightFullpage":false,"highlightMacStyle":true},
copy: {
success: 'Copy Successful',
error: 'Copy Failed',
noSupport: 'Browser Not Supported'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '',
dateSuffix: {
just: 'Just now',
min: 'minutes ago',
hour: 'hours ago',
day: 'days ago',
month: 'months ago'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
infinitegrid: {
js: 'https://cdn.jsdelivr.net/npm/@egjs/[email protected]/dist/infinitegrid.min.js',
buttonText: 'Load More'
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'Jiahao Luo',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
isShuoshuo: false
}</script><meta name="generator" content="Hexo 7.3.0"><link rel="alternate" href="/atom.xml" title="Jiahao Luo" type="application/atom+xml">
</head><body><script>window.paceOptions = {
restartOnPushState: false
}
btf.addGlobalFn('pjaxSend', () => {
Pace.restart()
}, 'pace_restart')
</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/blue/pace-theme-minimal.min.css"/><script src="https://cdn.jsdelivr.net/npm/[email protected]/pace.min.js"></script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img text-center"><img src="/images/site-avator.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data text-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">73</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">16</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">11</div></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archive</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog-info"><a class="nav-site-title" href="/"><span class="site-name">Jiahao Luo</span></a></span><div id="menus"><div id="search-button"><span class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> Search</span></span></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archive</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><span class="site-page"><i class="fas fa-bars fa-fw"></i></span></div></div></nav><h1 class="title-seo">Jiahao Luo</h1></header><main class="layout" id="content-inner"><div class="recent-posts nc" id="recent-posts"><div class="recent-post-items"><div class="recent-post-item"><div class="post_cover left"><a href="/career/academic/" title="科研小总结"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/f52e2456bd75a61f46d60e3768543c7f.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="科研小总结"></a></div><div class="recent-post-info"><a class="article-title" href="/career/academic/" title="科研小总结">科研小总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-21T18:19:25.038Z" title="Updated 2024-11-22 02:19:25">2024-11-22</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/academic/">academic</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/academic/">academic</a></span></div><div class="content"> 计算机科学的科研 会议的等级 国内计算机学会的 CCF 划分是比较权威的,虽然它受到了政治立场的影响,对某些会议的评级可能存在偏差,但总体上还是在合理范围内。CCF将会议分为A、B、C三个等级: A类会议:质量很高,是公认的顶级会议。 B类会议:部分质量很高,但整体略低于A类。 C类会议:质量相对较低,影响力有限。 一般而言,专注于发表A类会议论文,并选择能够发表A类会议的研究课题,是一个很好的科研策略。值得注意的是,国际认可度高的会议和期刊通常都是英文的,其他语言的学术活动在声望和影响力上往往难以相提并论。 除了CCF的分类,还有一个重要的参考是Core Conference Rankings。这个系统汇集了全球多个国家和地区的会议评级标准,为研究人员提供了更全面的参考。它可能包含了如下的标准 SCI(Science Citation Index):主要用于评估期刊影响力。 SCIE(Science Citation Index Expanded):SCI的扩展版本。 ERA(Excellence in Research for...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dev/rss/" title="RSS信息汇聚"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/07780b2a37df07c6fe3a70d3fa78b077.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="RSS信息汇聚"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/rss/" title="RSS信息汇聚">RSS信息汇聚</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-19T16:51:55.971Z" title="Updated 2024-11-20 00:51:55">2024-11-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">阅读软件 我用过 Feedly,它很适合免费的用户,但是我个人不喜欢它的 UI 界面,我更喜欢 inoreader 的界面,因为我需要更大的预览空间。 follow 也不错,布局是类似的,而且是开源的,支持加密货币大赏,我喜欢它的UI还有激励模式。它会激励一些收费的feed出现,刺激RSS生态的发展。但是它目前还在公测中,很多的功能用不了。 https://github.com/RSSNext/follow 我在试用期的时候,被 Inoreader 吸引力,核心在于 它居然和youtube联合,可以用 youtube 的 API 自动就导入了我关注的频道。 AI识别网站生成 feed的能力很强大。我可以关注 bilibili 感兴趣的 UP 主的视频。虽然由于反爬虫机制,可能会爬取失败,但是多尝试几次,一般都能成功。 Inoreader和其他的 RSS 一样,也有移动和网页客户端,网页有插件能很方便的收藏阅读和加入feed。我购买一年,一年大概432人民币,我还能接受。 订阅渠道 RSSHub: https://docs.rsshub.app/zh/...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dev/crypto-practice/" title="安全加密实践-GPG"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/ecd2b676f9bf98a607c67fc697f9ed4e.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="安全加密实践-GPG"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/crypto-practice/" title="安全加密实践-GPG">安全加密实践-GPG</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-18T09:44:36.112Z" title="Updated 2024-11-18 17:44:36">2024-11-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">GPG 是一款强大的开源加密工具,基于公钥密码学原理,为电子通信提供隐私保护和数据验证。它广泛应用于确保信息安全和身份认证。 安装指南 Linux 系统 Debian/Ubuntu: 12sudo apt updatesudo apt install gnupg CentOS/RHEL: 1sudo yum install gnupg Fedora: 1sudo dnf install gnupg Arch Linux: 1sudo pacman -S gnupg macOS 使用 Homebrew 安装: 1brew install gnupg Windows 从 Gpg4win 官方网站 下载安装包 2. 运行安装程序,按提示完成安装 3. 安装后,在命令提示符或 PowerShell 中验证 FreeBSD 通过 pkg 包管理器安装: 1pkg install gnupg 验证安装 在任何平台上,运行以下命令确认安装成功: 1gpg...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dev/backup-practice/" title="传输和备份实践"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/e9427ec31426e24ea92ff3d40382ed08.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="传输和备份实践"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/backup-practice/" title="传输和备份实践">传输和备份实践</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-18T09:44:33.646Z" title="Updated 2024-11-18 17:44:33">2024-11-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">rsync rsync 是一个强大的文件同步和传输工具,适用于类 Unix 系统。Windows 用户可以通过 WSL(Windows Subsystem for Linux)来使用 rsync。以下是详细的安装和使用方法: Ubuntu/Debian: 12sudo apt updatesudo apt install rsync CentOS/Fedora: 1sudo yum install rsync macOS(使用 Homebrew): 1brew install rsync 注意,两台机器都要安装好。 使用方法 1rsync [选项] 源目录/ 目标目录 -a:归档模式,保留所有文件属性 -v:详细输出 -z:压缩传输 -P:显示进度并允许断点续传 –delete:删除目标目录中源目录没有的文件 -h:以人类可读的格式显示文件大小 -e:指定要使用的远程 shell,通常用于指定 SSH 连接参数 本地同步: 1rsync -avzP /path/to/source/...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dev/macbook/" title="macbook体验"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/f0e20c6b389a00ecf1945b34324cfdd1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="macbook体验"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/macbook/" title="macbook体验">macbook体验</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-24T13:17:33.559Z" title="Updated 2024-11-24 21:17:33">2024-11-24</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">为什么我喜欢 MacBook 最近买了一台 MacBook,使用下来感觉很不错。MacBook 铝制一体化机身,既美观又坚固,硬件质量很可以。最主要是非常省心,合上盖子即可快速休眠,打开盖子能立即恢复工作状态,不会出现无法休眠或休眠后无法唤醒的问题,提供流畅、稳定的使用体验。 MacBook 的电池续航能力一直是业界领先,屏幕素质好,高分辨率和准确的色彩,还有应用的UI更加美观。其次是 macOS 基于 Unix,基本能通过命令行管理开发环境和软件安装,对于熟悉的人来说,会比UI更加便捷。MacBook 在众多开源项目使用很普遍,尤其是视频剪辑和写代码,生态还是相当完善的。 我最近购买了一台 MacBook Pro 14 英寸,配备 M4 Pro 处理器、48GB 内存和 512GB 存储,还买了三年的 AC+。选择这么大的内存是为了确保长期使用(3 年以上)时系统仍能流畅运行。考虑到未来软件可能会更加耗费内存,24GB 可能在几年后显得不够用。我之前 32GB 的MBP一般占用在27GB左右。我主要用于编程和文字处理,不会存储大量视频素材或游戏,因此 512GB...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dev/git/" title="GitHub 协作开发指南"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/4c8a976a9e6720e0283852ce24503f1c.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="GitHub 协作开发指南"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/git/" title="GitHub 协作开发指南">GitHub 协作开发指南</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-24T13:17:30.225Z" title="Updated 2024-11-24 21:17:30">2024-11-24</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">开源项目参与流程 在开源项目或团队协作开发中,使用 GitHub 是一个常见的实践。以下是一套从 Fork 项目到提交 Pull Request(PR)的完整流程,帮助你高效管理代码并与团队或社区协作。 1. Fork 项目仓库 进入项目的 GitHub 页面,点击右上角的 Fork 按钮,将该项目仓库复制到自己的 GitHub 账户下。这个 Fork 的副本是你对项目的个人副本,你可以在上面进行改动而不会影响原项目。 2. Clone 项目到本地 在你的 GitHub 账户中找到刚刚 Fork 的仓库,复制仓库的链接。在本地执行以下命令将仓库克隆到你的电脑: 1git clone <your-forked-repo-url> 3. 添加上游仓库 (Upstream) 当你 Fork 了一个仓库后,你的代码会与原项目(官方项目)脱离直接联系。为了能够同步原项目的最新更改,你需要将原项目添加为“上游仓库”。进入克隆的项目文件夹,运行以下命令: 1git remote add upstream <original-repo-url> 然后验证 git...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dev/python-design/" title="(三)Python面向对象设计模式"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/10/b0e9d2ce07312c8cc21c8e0c2fed6f16.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(三)Python面向对象设计模式"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/python-design/" title="(三)Python面向对象设计模式">(三)Python面向对象设计模式</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-18T09:44:53.242Z" title="Updated 2024-11-18 17:44:53">2024-11-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">类和对象 一切都是对象 在 Python 中,“一切皆对象”是一个核心理念。简单来说,Python 中的所有东西都是对象,无论是数值、字符串、函数、类,甚至是模块和代码本身。Python 对象有三个特征:身份、类型和值。 身份:对象在内存中的地址,可以通过 id() 函数查看,例如 id(obj)。 类型:对象的类别,可以通过 type() 函数查看。例如,type(5) 返回 <class 'int'>。 值:对象的实际内容或数据,直接调用变量名即可查看。 1234i = 2print(id(i)) # 输出 i 的存储地址print(type(i)) # 输出 <class 'int'>print(i) # 输出变量 i...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dev/python-package/" title="(二)包的开发"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/10/b0e9d2ce07312c8cc21c8e0c2fed6f16.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(二)包的开发"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/python-package/" title="(二)包的开发">(二)包的开发</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-18T09:45:01.397Z" title="Updated 2024-11-18 17:45:01">2024-11-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">Python 包的开发是一项重要的技能,可以帮助你组织代码、实现代码复用,并且将功能模块分发给其他开发者使用。 包和模块是什么 在 Python 中,一个包(Package)就是一个包含多个模块的目录,其中通过 __init__.py 文件来表明它是一个包。包允许你将代码逻辑分解为多个文件,并且通过模块的方式进行导入和复用。 模块:一个 Python 文件(*.py 文件)就是一个模块。模块可以包含函数、类和变量。 包:包是包含多个模块的文件夹。包使得模块之间可以被组织起来,以便更好的管理。 目录结构示例: 1234my_package/ ├── __init__.py # 包初始化文件 ├── module_a.py # 模块 A ├── module_b.py # 模块 B 在代码中使用包(如果要供外部使用,推荐使用相对路径): 12345# 导入包中的模块from my_package import module_a# 使用模块中的函数module_a.some_function() 一个典型的 python...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dev/docker/" title="docker自动化"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/11/b4ffc055e44ace7f692c8c5a8ab2f703.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="docker自动化"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/docker/" title="docker自动化">docker自动化</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-18T09:44:38.945Z" title="Updated 2024-11-18 17:44:38">2024-11-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">了解背景 Docker 是一种轻量级的容器化技术,主要用于应用程序的环境迁移和一致性。你需要知道下面的基本概念: 了解镜像、容器的基本概念:https://yeasy.gitbook.io/docker_practice/basic_concept 数据卷的基本概念:https://yeasy.gitbook.io/docker_practice/data_management/volume 网络方面,端口映射、docker compose 容器互联:https://yeasy.gitbook.io/docker_practice/network/port_mapping OK,上面三个基本概念,你就足够使用 docker 了,然后我们来了解 docker 最实用的地方: 环境迁移,在不同的机器上保持一致性,一次创建或配置,可以在任意地方正常运行。。 直接在 docker 内利用 linux 环境和路径挂载来开发。 隔离依赖、统一开发环境、快速启动。 利用 Linux 容器作为开发环境:在不同平台(Windows、Mac、Linux)上保持一致的开发环境。 通过...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dev/python-env/" title="(一)Python环境配置指南"><img class="post-bg" src="https://cdn.blog-blockchain.xyz/2024/10/b0e9d2ce07312c8cc21c8e0c2fed6f16.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(一)Python环境配置指南"></a></div><div class="recent-post-info"><a class="article-title" href="/dev/python-env/" title="(一)Python环境配置指南">(一)Python环境配置指南</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="fas fa-history"></i><span class="article-meta-label">Updated</span><time datetime="2024-11-18T09:44:55.564Z" title="Updated 2024-11-18 17:44:55">2024-11-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/developer/">developer</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/developer/">developer</a></span></div><div class="content">管理 Python 版本 推荐使用 https://github.com/pyenv/pyenv 来管理不同版本的 python,但是它不支持 windows,如果你使用 windows,请使用 https://github.com/pyenv-win/pyenv-win 。 如果你需要使用特定版本的 python,先安装它,类似于 1pyenv install 3.9.6 随后在项目的根目录,使用 1pyenv local 3.9.6 它会生成一个配置文件 .python-version ,就会让进入项目根目录,就会自动切换到 3.9.6 的版本。 管理虚拟环境 Poetry 适合现代 Python 项目开发、个人或小型团队开发、需要发布到 PyPI 的项目。 特点: 自动化依赖管理:Poetry 能够自动处理依赖冲突,生成 pyproject.toml 和 poetry.lock 文件,确保依赖一致性。 内置虚拟环境管理:Poetry 会自动为每个项目创建虚拟环境,隔离项目依赖,保证项目间的互不干扰。 简化的发布流程:通过 poetry build 和 poetry...</div></div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">…</span><a class="page-number" href="/page/8/#content-inner">8</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info text-center"><div class="avatar-img"><img src="/images/site-avator.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info-name">Michael(Jiahao) Luo</div><div class="author-info-description"></div><div class="site-data"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">73</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">16</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">11</div></a></div><a id="card-info-btn" target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/LearnerLj"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons"><a class="social-icon" href="https://github.com/learnerLj" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:[email protected]" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="/atom.xml" target="_blank" title="RSS链接"><i class="fa fa-rss"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>Announcement</span></div><div class="announcement_content">从技术到商业,从产品到设计,从生活到未来,我会在这里分享我的所思所想,欢迎关注!</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Posts</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/career/academic/" title="科研小总结"><img src="https://cdn.blog-blockchain.xyz/2024/11/f52e2456bd75a61f46d60e3768543c7f.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="科研小总结"/></a><div class="content"><a class="title" href="/career/academic/" title="科研小总结">科研小总结</a><time datetime="2024-11-21T17:38:21.000Z" title="Created 2024-11-22 01:38:21">2024-11-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dev/rss/" title="RSS信息汇聚"><img src="https://cdn.blog-blockchain.xyz/2024/11/07780b2a37df07c6fe3a70d3fa78b077.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="RSS信息汇聚"/></a><div class="content"><a class="title" href="/dev/rss/" title="RSS信息汇聚">RSS信息汇聚</a><time datetime="2024-11-19T15:43:20.000Z" title="Created 2024-11-19 23:43:20">2024-11-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dev/crypto-practice/" title="安全加密实践-GPG"><img src="https://cdn.blog-blockchain.xyz/2024/11/ecd2b676f9bf98a607c67fc697f9ed4e.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="安全加密实践-GPG"/></a><div class="content"><a class="title" href="/dev/crypto-practice/" title="安全加密实践-GPG">安全加密实践-GPG</a><time datetime="2024-11-18T09:28:20.000Z" title="Created 2024-11-18 17:28:20">2024-11-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dev/backup-practice/" title="传输和备份实践"><img src="https://cdn.blog-blockchain.xyz/2024/11/e9427ec31426e24ea92ff3d40382ed08.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="传输和备份实践"/></a><div class="content"><a class="title" href="/dev/backup-practice/" title="传输和备份实践">传输和备份实践</a><time datetime="2024-11-18T09:26:20.000Z" title="Created 2024-11-18 17:26:20">2024-11-18</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dev/macbook/" title="macbook体验"><img src="https://cdn.blog-blockchain.xyz/2024/11/f0e20c6b389a00ecf1945b34324cfdd1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="macbook体验"/></a><div class="content"><a class="title" href="/dev/macbook/" title="macbook体验">macbook体验</a><time datetime="2024-11-16T17:33:20.000Z" title="Created 2024-11-17 01:33:20">2024-11-17</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>Categories</span>
<a class="card-more-btn" href="/categories/" title="View More">
<i class="fas fa-angle-right"></i></a>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/academic/"><span class="card-category-list-name">academic</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/audit/"><span class="card-category-list-name">audit</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/courses/"><span class="card-category-list-name">courses</span><span class="card-category-list-count">7</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/defi/"><span class="card-category-list-name">defi</span><span class="card-category-list-count">4</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/developer/"><span class="card-category-list-name">developer</span><span class="card-category-list-count">10</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/evm/"><span class="card-category-list-name">evm</span><span class="card-category-list-count">6</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/functional-language/"><span class="card-category-list-name">functional language</span><span class="card-category-list-count">6</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/geth/"><span class="card-category-list-name">geth</span><span class="card-category-list-count">14</span></a></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>Tags</span></div><div class="card-tag-cloud"><a href="/tags/C/" style="font-size: 1.1em; color: #999">C</a> <a href="/tags/Linux/" style="font-size: 1.1em; color: #999">Linux</a> <a href="/tags/assembly/" style="font-size: 1.1em; color: #999">assembly</a> <a href="/tags/academic/" style="font-size: 1.1em; color: #999">academic</a> <a href="/tags/evm/" style="font-size: 1.3em; color: #99a1ac">evm</a> <a href="/tags/information/" style="font-size: 1.1em; color: #999">information</a> <a href="/tags/developer/" style="font-size: 1.37em; color: #99a4b2">developer</a> <a href="/tags/program-language/" style="font-size: 1.37em; color: #99a4b2">program language</a> <a href="/tags/OS/" style="font-size: 1.1em; color: #999">OS</a> <a href="/tags/crypto/" style="font-size: 1.17em; color: #999c9f">crypto</a> <a href="/tags/defi/" style="font-size: 1.23em; color: #999ea6">defi</a> <a href="/tags/geth/" style="font-size: 1.5em; color: #99a9bf">geth</a> <a href="/tags/smart-contract/" style="font-size: 1.43em; color: #99a6b9">smart contract</a> <a href="/tags/Haskell/" style="font-size: 1.3em; color: #99a1ac">Haskell</a> <a href="/tags/audit/" style="font-size: 1.17em; color: #999c9f">audit</a> <a href="/tags/math/" style="font-size: 1.1em; color: #999">math</a></div></div><div class="card-widget card-archives">
<div class="item-headline">
<i class="fas fa-archive"></i>
<span>Archives</span>
<a class="card-more-btn" href="/archives/" title="View More"><i class="fas fa-angle-right"></i></a>
</div>
<ul class="card-archive-list">
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/11/">
<span class="card-archive-list-date">November 2024</span>
<span class="card-archive-list-count">5</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/10/">
<span class="card-archive-list-date">October 2024</span>
<span class="card-archive-list-count">6</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/01/">
<span class="card-archive-list-date">January 2024</span>
<span class="card-archive-list-count">4</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2023/10/">
<span class="card-archive-list-date">October 2023</span>
<span class="card-archive-list-count">1</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2023/09/">
<span class="card-archive-list-date">September 2023</span>
<span class="card-archive-list-count">1</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2023/08/">
<span class="card-archive-list-date">August 2023</span>
<span class="card-archive-list-count">1</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2023/05/">
<span class="card-archive-list-date">May 2023</span>
<span class="card-archive-list-count">3</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2023/02/">
<span class="card-archive-list-date">February 2023</span>
<span class="card-archive-list-count">1</span>
</a>
</li>
</ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>Website Info</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">Article Count :</div><div class="item-count">73</div></div><div class="webinfo-item"><div class="item-name">Total Word Count :</div><div class="item-count">318.9k</div></div><div class="webinfo-item"><div class="item-name">Unique Visitors :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">Page Views :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">Last Update :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-11-24T14:04:34.010Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2024 By Michael(Jiahao) Luo</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Toggle Between Light and Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle Between Single-column and Double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="Settings"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back to Top"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=5.2.2"></script><script src="/js/main.js?v=5.2.2"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/instantpage.min.js" type="module"></script><script>(() => {
const panguFn = () => {
if (typeof pangu === 'object') pangu.autoSpacingPage()
else {
btf.getScript('https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/pangu.min.js')
.then(() => {
pangu.autoSpacingPage()
})
}
}
const panguInit = () => {
if (false){
GLOBAL_CONFIG_SITE.isPost && panguFn()
} else {
panguFn()
}
}
btf.addGlobalFn('pjaxComplete', panguInit, 'pangu')
document.addEventListener('DOMContentLoaded', panguInit)
})()</script><div class="js-pjax"></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="false" data-click="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">Search</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="text-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> Loading Database</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="Search for Posts" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js?v=5.2.2"></script></div></div><script>"use strict";if("serviceWorker"in navigator){navigator.serviceWorker.register("service-worker.js").then((function(reg){reg.onupdatefound=function(){var installingWorker=reg.installing;installingWorker.onstatechange=function(){switch(installingWorker.state){case"installed":if(navigator.serviceWorker.controller){console.log("New or updated content is available.")}else{console.log("Content is now available offline!")}break;case"redundant":console.error("The installing service worker became redundant.");break}}}}))["catch"]((function(e){console.error("Error during service worker registration:",e)}))}</script></body></html>