-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
460 lines (363 loc) · 46.9 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<!DOCTYPE html><html class="hide-aside" lang="zh-CN" 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, maximum-scale=1.0, user-scalable=no"><title>narutozxp - Dr.z</title><meta name="keywords" content="student"><meta name="author" content="narutozxp"><meta name="copyright" content="narutozxp"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="任何的努力皆不会白费">
<meta property="og:type" content="website">
<meta property="og:title" content="narutozxp">
<meta property="og:url" content="https://www.narutozxp.top/index.html">
<meta property="og:site_name" content="narutozxp">
<meta property="og:description" content="任何的努力皆不会白费">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://www.narutozxp.top/img/myself.jpg">
<meta property="article:author" content="narutozxp">
<meta property="article:tag" content="student">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://www.narutozxp.top/img/myself.jpg"><link rel="shortcut icon" href="/img/myself.jpg"><link rel="canonical" href="https://www.narutozxp.top/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Great%20Vibes" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容:${query}"}},
translate: undefined,
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '',
date_suffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
source: {
justifiedGallery: {
js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
}
},
isPhotoFigcaption: true,
islazyload: false,
isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'narutozxp',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-11-11 13:15:49'
}</script><noscript><style type="text/css">
#nav {
opacity: 1
}
.justified-gallery img {
opacity: 1
}
#recent-posts time,
#post-meta time {
display: inline !important
}
</style></noscript><script>(win=>{
win.saveToLocal = {
set: function setWithExpiry(key, value, ttl) {
if (ttl === 0) return
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = url => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
document.head.appendChild(script)
})
win.activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><link rel="stylesheet" href="/css/custom.css"> <link rel="stylesheet" href="/css/font.css"> <script src="https://wavedrom.com/wavedrom.min.js" type="text/javascript"></script> <script src="https://wavedrom.com/skins/default.js" type="text/javascript"></script> <script src="https://wavedrom.com/skins/dark.js" type="text/javascript"></script> <script src="https://wavedrom.com/skins/narrow.js" type="text/javascript"></script> <script src="https://wavedrom.com/skins/lowkey.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/style.css" /><!-- hexo injector head_end start --><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/assets/font-awesome-animation.min.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/tag_plugins.css" media="defer" onload="this.media='all'"><script src="https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/assets/carousel-touch.js"></script><!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/myself.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">16</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">15</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 链接</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('/img/00.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">narutozxp</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 链接</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">narutozxp</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/narutozxp" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:[email protected]" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2024/09/12/TLS%E6%8F%A1%E6%89%8B%E8%BF%87%E7%A8%8B/" title="TLS握手流程"><img class="post_bg" src="/img/13.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="TLS握手流程"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/09/12/TLS%E6%8F%A1%E6%89%8B%E8%BF%87%E7%A8%8B/" title="TLS握手流程">TLS握手流程</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-09-12T16:07:02.000Z" title="发表于 2024-09-12 16:07:02">2024-09-12</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-09-12T09:47:37.000Z" title="更新于 2024-09-12 09:47:37">2024-09-12</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/CS/">CS</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/TLS/">TLS</a></span></div><div class="content">TLS握手过程
HTTP 由于是明文传输,所谓的明文,就是说客户端与服务端通信的信息都是肉眼可见的,随意使用一个抓包工具都可以截获通信的内容。
所以安全上存在以下三个风险:
窃听风险,比如通信链路上可以获取通信内容,用户号容易没。
篡改风险,比如强制植入垃圾广告,视觉污染,用户眼容易瞎。
冒充风险,比如冒充淘宝网站,用户钱容易没。
HTTPS 在 HTTP 与 TCP 层之间加入了 TLS 协议,来解决上述的风险。
TLS 协议是如何解决 HTTP 的风险的呢?
信息加密:HTTP 交互信息是被加密的,第三方就无法被窃取。
校验机制:校验信息传输过程中是否有被第三方篡改过,如果被篡改过,则会有警告提示。
身份证书:证明淘宝是真的淘宝网。
上图简要概述来 TLS 的握手过程,其中每一个「框」都是一个记录(record),记录是 TLS 收发数据的基本单位,类似于 TCP 里的 segment。多个记录可以组合成一个 TCP 包发送,所以通常经过「四个消息」就可以完成 TLS 握手,也就是需要 2个 RTT 的时延,然后就可以在安全的通信环境里发送 HTTP 报文,实现 HTT ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/07/31/CRC%E6%A0%A1%E9%AA%8C%E8%AF%A6%E8%A7%A3/" title="CRC校验详解"><img class="post_bg" src="/img/17.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="CRC校验详解"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/07/31/CRC%E6%A0%A1%E9%AA%8C%E8%AF%A6%E8%A7%A3/" title="CRC校验详解">CRC校验详解</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-07-31T15:51:02.000Z" title="发表于 2024-07-31 15:51:02">2024-07-31</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-08-27T11:39:19.000Z" title="更新于 2024-08-27 11:39:19">2024-08-27</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/CRC/">CRC</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/CRC/">CRC</a></span></div><div class="content">摘要
本文首先阐述了错误检测的目的以及纠错复杂度,然后以此引出了CRC背后的基础思想。为了能够充分理解CRC运算所基于的运算系统,本文还介绍了抽象代数中的相关概念(多项式环、素域、扩域)。然后描述了如何选取CRC的多项式。有了这些基本概念之后,本文介绍了三种CRC的实现,对于同一个CRC算法,其中SIMPLE于TABLE ALGORITHM所使用的寄存器初值是一样的,只是后者更高效一点,而DIRECT TABLE ALGORITHM则更高效,而且寄存器初值也与前两种不一样(通常CRC算法所说的初值就是指的这个算法的寄存器初值),因此需要进行初值转换。在此之后还介绍了一些决定CRC算法的其他参数,并且以此定义一个名为Rocksoft™的参数化模型,用以精确描述CRC算法。最后本文还包含了CRC算法的C实现。
本文很大程度上参考了A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS,在其中加入了一些自己的理解。因此非常感谢Ross N. Williams.大佬
错误检测的目的
发射机产生的数据,在经过带有噪声的信道之后,会被噪声所污染,从而导 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/07/29/WaveDrom/" title="WaveDrom教程"><img class="post_bg" src="/img/27.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="WaveDrom教程"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/07/29/WaveDrom/" title="WaveDrom教程">WaveDrom教程</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-07-29T15:51:02.000Z" title="发表于 2024-07-29 15:51:02">2024-07-29</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-07-30T06:35:57.000Z" title="更新于 2024-07-30 06:35:57">2024-07-30</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/Plot/">Plot</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/Plot/WaveDrom/">WaveDrom</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/WaveDrom/">WaveDrom</a></span></div><div class="content">WaveDrom 可以根据特定指令生成时序 / 波形图(SVG/PNG),并且也可以在浏览器中运行。同时也提供了在线编辑器和教程、教程 2。
信号(signal)
名称(name)和波形(wave)
绘制信号时,需要向 WaveDrom 传递键为 signal,值为 WaveLanes 的数组,WaveLane 一般至少需要包含两个属性:名称(name)和波形(wave),例如(在官方在线编辑器中打开):
1{ "signal" : [{ "name": "clk", "wave": "P..........." }] }
{ "signal" : [{ "name": "clk", "wave": "P..........." }] }
波形的名称将显示在波形左侧,波形由一个字符串指定,每个字符都代表了一个周期的波形,每个字符代表的意义如下:
符号
含义
样例
渲染结果
.
与上一周期状态相同
{ signal ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/05/14/%E8%AE%A1%E7%AE%97%E6%9C%BA%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA/" title="计算机数值表示"><img class="post_bg" src="/img/28.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机数值表示"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/05/14/%E8%AE%A1%E7%AE%97%E6%9C%BA%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA/" title="计算机数值表示">计算机数值表示</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-05-14T17:51:02.000Z" title="发表于 2024-05-14 17:51:02">2024-05-14</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-05-17T06:39:17.000Z" title="更新于 2024-05-17 06:39:17">2024-05-17</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/math/">math</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/categories/CS/">CS</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/%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA/">数值表示</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/%E6%95%B0%E5%80%BC%E8%AE%A1%E7%AE%97/">数值计算</a></span></div><div class="content">计算机数值表示
符号定义
Symbol
Type
Meaning
Defineition
\(B2T_w\)
函数
Binary to two's complement
\(\vec{x} = [x_{w-1},x_{w-2},\cdots,x_0];\;B2T_w(\vec{x})=-x_{w-1}2^{w-1}+\sum\limits_{i=0}^{w-2}x_i2^i\)
\(B2U_w\)
函数
Binary to unsigned
\(\vec{x} = [x_{w-1},x_{w-2},\cdots,x_0];\;B2U_w(\vec{x})=\sum\limits_{i=0}^{w-1}x_i2^i\)
\(U2B_w\)
函数
Unsigned to binary
\(B2U_w\)的反函数
\(U2T_w\)
函数
Unsigned to two's complement
\[0\leq u\leq UMax_w;U2T_w(u)=B2T_w(U2B_w(u))=\begin{cases}u, u\leq TMax_w \\ u- ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/05/10/The-Art-of-Command-Line/" title="The Art of Command Line"><img class="post_bg" src="/img/12.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="The Art of Command Line"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/05/10/The-Art-of-Command-Line/" title="The Art of Command Line">The Art of Command Line</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-05-10T16:18:19.000Z" title="发表于 2024-05-10 16:18:19">2024-05-10</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-05-17T05:15:29.000Z" title="更新于 2024-05-17 05:15:29">2024-05-17</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/CS/">CS</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/bash/">bash</a></span></div><div class="content">命令行的艺术
前言
基础
日常使用
文件及数据处理
系统调试
单行脚本
冷门但有用
仅限 OS X 系统
仅限 Windows 系统
更多资源
免责声明
熟练使用命令行是一种常常被忽视,或被认为难以掌握的技能,但实际上,它会提高你作为工程师的灵活性以及生产力。本文是一份我在 Linux 上工作时,发现的一些命令行使用技巧的摘要。有些技巧非常基础,而另一些则相当复杂,甚至晦涩难懂。这篇文章并不长,但当你能够熟练掌握这里列出的所有技巧时,你就学会了很多关于命令行的东西了。
这篇文章是许多作者和译者共同的成果。这里的部分内容首次出现于 Quora,但已经迁移到了 GitHub,并由众多高手做出了许多改进。如果你在本文中发现了错误或者存在可以改善的地方,请贡献你的一份力量。
前言
涵盖范围:
这篇文章不仅能帮助刚接触命令行的新手,而且对具有经验的人也大有裨益。本文致力于做到覆盖面广(涉及所有重要的内容),具体(给出具体的最常用的例子),以及简洁(避免冗余的内容,或是可以在其他地方轻松查到的细枝末节)。在特定应用场景下,本文的内容属于基本功或者能帮助您节约大量的时间。
本文主要为 Linu ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/11/28/c-plus-plus-summary/" title="c plus plus summary"><img class="post_bg" src="/img/7.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="c plus plus summary"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/11/28/c-plus-plus-summary/" title="c plus plus summary">c plus plus summary</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-11-28T21:50:40.000Z" title="发表于 2022-11-28 21:50:40">2022-11-28</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-08-22T04:49:39.000Z" title="更新于 2024-08-22 04:49:39">2024-08-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/CS/">CS</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/c/">c++</a></span></div><div class="content">C++基础入门
C++初识
第一个C++程序
编写一个C++程序总共分为4个步骤
创建项目
创建文件
编写代码
运行程序
创建项目
Visual Studio是我们用来编写C++程序的主要工具,我们先将它打开
创建文件
右键源文件,选择添加->新建项
给C++文件起个名称,然后点击添加即可。
编写代码
1234567891011#include<iostream>using namespace std;int main() { cout << "Hello world" << endl; system("pause"); return 0;}
运行程序
注释
作用:在代码中加一些说明和解释,方便自己或其他程序员程序员阅读代码
两种格式
单行注释:// 描述信息
通常放在一行代码的上方,或者一条语句的末尾,==对该行代码说明==
多行注释: /* 描述信息 */
通常放在一段代码的上方,==对该段代码做整体说明==
提示:编译器在编译代码时,会忽略注释的内 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/07/22/PyTorch-Abstract/" title="PyTorch Abstract"><img class="post_bg" src="/img/13.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="PyTorch Abstract"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/07/22/PyTorch-Abstract/" title="PyTorch Abstract">PyTorch Abstract</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-07-22T19:59:24.000Z" title="发表于 2022-07-22 19:59:24">2022-07-22</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-07-22T12:02:22.000Z" title="更新于 2022-07-22 12:02:22">2022-07-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/ML/">ML</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/PyTorch/">PyTorch</a></span></div><div class="content">简单的PyTorch教程,来自官网教程60分钟PyTorch教程、通过例子学PyTorch和迁移学习教程。
目录
60分钟PyTorch教程
什么是PyTorch?
Tensor
Operation
Tensor的变换
Tensor与Numpy的互相转换
CUDA Tensor
Autograd: 自动求导
从自动求导看Tensor
梯度
PyTorch神经网络简介
定义网络
测试网络
损失函数
计算梯度
更新参数
训练一个分类器
如何进行数据处理
训练的步骤
数据处理
定义卷积网络
在测试数据集上进行测试
GPU上训练
通过例子学PyTorch
使用Numpy实现三层神经网络
使用Tensor来实现三层神经网络
实现autograd来实现三层神经网络
使用自定义的ReLU函数
和Tensorflow的对比
使用nn模块来实现三层神经网络
使用optim包
自定义nn模块
流程控制和参数共享
迁移学习示例
加载数据
可视化图片
训练模型
可视化预测结果的函数
fine-tuning所有参数
fine-tuning最后一层参数
60分钟PyTorch教程
...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/07/13/Static-Timing-Analysis-for-Nanometer-Designs-A-Practical-Approach-v1/" title="Static Timing Analysis for Nanometer Designs:A Practical Approach(v1)"><img class="post_bg" src="/img/27.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Static Timing Analysis for Nanometer Designs:A Practical Approach(v1)"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/07/13/Static-Timing-Analysis-for-Nanometer-Designs-A-Practical-Approach-v1/" title="Static Timing Analysis for Nanometer Designs:A Practical Approach(v1)">Static Timing Analysis for Nanometer Designs:A Practical Approach(v1)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-07-13T10:00:21.000Z" title="发表于 2022-07-13 10:00:21">2022-07-13</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-09-23T08:43:14.000Z" title="更新于 2022-09-23 08:43:14">2022-09-23</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/IC/">IC</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/STA/">STA</a></span></div><div class="content">绪论
众所周知,静态时序分析是IC工程师必备知识点,也是秋招中笔试面试的高频考点。
网上不乏优秀视频课,如V3学院尤老师、小梅哥、IC创新学院邸志雄老师的课。
《Static Timing Analysis for Nanometer Designs:A Practical Approach》,可堪称静态时序分析的“圣经”吧!
由于网上找不到此书的翻译,因此笔者决定开坑进行对“圣经”的翻译~!希望可以在加深对静态时序分析的学习同时,完成这一本书的翻译方便大家以后更好地从中学习吧。
本章节概述了纳米级(nanometer)设计下的静态时序仿真过程
本章节解决了如下问题:
什么是静态时序分析(static timing analysis)?
噪声(noise)与串扰(crosstalk)会带来什么影响 ?
如何使用静态时序分析?
在整个设计流程中的哪个阶段会应用静态时序分析?
纳米级设计
在半导体器件中,常使用金属互连线来连接电路中的不同部分,从而实现设计。随着工艺技术的发展,这些互连线逐渐开始影响设计的性能。对于深亚微米或者纳米级别的工艺技术,互连线间的耦合效应会带来噪声与串 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/07/13/Static-Timing-Analysis-for-Nanometer-Designs-A-Practical-Approach-v2/" title="Static Timing Analysis for Nanometer Designs:A Practical Approach(v2)"><img class="post_bg" src="/img/10.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Static Timing Analysis for Nanometer Designs:A Practical Approach(v2)"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/07/13/Static-Timing-Analysis-for-Nanometer-Designs-A-Practical-Approach-v2/" title="Static Timing Analysis for Nanometer Designs:A Practical Approach(v2)">Static Timing Analysis for Nanometer Designs:A Practical Approach(v2)</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-07-13T10:00:21.000Z" title="发表于 2022-07-13 10:00:21">2022-07-13</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-05-31T16:07:30.000Z" title="更新于 2023-05-31 16:07:30">2023-05-31</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/IC/">IC</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/STA/">STA</a></span></div><div class="content">
绪论
众所周知,静态时序分析是IC工程师必备知识点,也是秋招中笔试面试的高频考点。
网上不乏优秀视频课,如V3学院尤老师、小梅哥、IC创新学院邸志雄老师的课。
《Static Timing Analysis for Nanometer Designs:A Practical Approach》,可堪称静态时序分析的“圣经”吧!
由于网上找不到此书的翻译,因此笔者决定开坑进行对“圣经”的翻译~!希望可以在加深对静态时序分析的学习同时,完成这一本书的翻译方便大家以后更好地从中学习吧。
本章节概述了纳米级(nanometer)设计下的静态时序仿真过程
本章节解决了如下问题:
什么是静态时序分析(static timing analysis)?
噪声(noise)与串扰(crosstalk)会带来什么影响 ?
如何使用静态时序分析?
在整个设计流程中的哪个阶段会应用静态时序分析?
纳米设计
在半导体器件中,金属互连走线通常用于在电路的各个部分之间建立连接以实现设计。众所周知,随着工艺技术的缩小,这些互连走线会影响设计的性能。对于深亚微米或纳米工艺技术,互连中的耦合会引起噪声和 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/07/05/ML-Theory-Summary/" title="ML Theory Summary"><img class="post_bg" src="/img/29.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="ML Theory Summary"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/07/05/ML-Theory-Summary/" title="ML Theory Summary">ML Theory Summary</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-07-05T09:43:53.000Z" title="发表于 2022-07-05 09:43:53">2022-07-05</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-06-27T04:10:52.000Z" title="更新于 2023-06-27 04:10:52">2023-06-27</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/ML/">ML</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/ML-Theory/">ML Theory</a></span></div><div class="content">Introduction
对概率的诠释有两大学派,一种是频率派另一种是贝叶斯派。后面我们对观测集采用下面记号:
\[
X_{N\times p}=(x_{1},x_{2},\cdots,x_{N})^{T},x_{i}=(x_{i1},x_{i2},\cdots,x_{ip})^{T}
\]
这个记号表示有 \(N\) 个样本,每个样本都是 \(p\) 维向量。其中每个观测都是由 \(p(x|\theta)\) 生成的。
频率派的观点
\(p(x|\theta)\)中的 \(\theta\) 是一个常量。对于 \(N\) 个观测来说观测集的概率为 \(p(X|\theta)\mathop{=}\limits _{iid}\prod\limits _{i=1}^{N}p(x_{i}|\theta))\) 。为了求 \(\theta\) 的大小,我们采用最大对数似然MLE的方法:
\[
\theta_{MLE}=\mathop{argmax}\limits _{\theta}\log p(X|\theta)\mathop{=}\limits _{iid}\mathop{argmax}\li ...</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><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"><div class="is-center"><div class="avatar-img"><img src="/img/myself.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">narutozxp</div><div class="author-info__description">任何的努力皆不会白费</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">16</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">15</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">9</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/narutozxp" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:[email protected]" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2024/09/12/TLS%E6%8F%A1%E6%89%8B%E8%BF%87%E7%A8%8B/" title="TLS握手流程"><img src="/img/13.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="TLS握手流程"/></a><div class="content"><a class="title" href="/2024/09/12/TLS%E6%8F%A1%E6%89%8B%E8%BF%87%E7%A8%8B/" title="TLS握手流程">TLS握手流程</a><time datetime="2024-09-12T16:07:02.000Z" title="发表于 2024-09-12 16:07:02">2024-09-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/07/31/CRC%E6%A0%A1%E9%AA%8C%E8%AF%A6%E8%A7%A3/" title="CRC校验详解"><img src="/img/17.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="CRC校验详解"/></a><div class="content"><a class="title" href="/2024/07/31/CRC%E6%A0%A1%E9%AA%8C%E8%AF%A6%E8%A7%A3/" title="CRC校验详解">CRC校验详解</a><time datetime="2024-07-31T15:51:02.000Z" title="发表于 2024-07-31 15:51:02">2024-07-31</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/07/29/WaveDrom/" title="WaveDrom教程"><img src="/img/27.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="WaveDrom教程"/></a><div class="content"><a class="title" href="/2024/07/29/WaveDrom/" title="WaveDrom教程">WaveDrom教程</a><time datetime="2024-07-29T15:51:02.000Z" title="发表于 2024-07-29 15:51:02">2024-07-29</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
<a class="card-more-btn" href="/categories/" title="查看更多">
<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/CAD/"><span class="card-category-list-name">CAD</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/CRC/"><span class="card-category-list-name">CRC</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/CS/"><span class="card-category-list-name">CS</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/IC/"><span class="card-category-list-name">IC</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/ML/"><span class="card-category-list-name">ML</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/OTHERS/"><span class="card-category-list-name">OTHERS</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/Plot/"><span class="card-category-list-name">Plot</span><span class="card-category-list-count">1</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Plot/WaveDrom/"><span class="card-category-list-name">WaveDrom</span><span class="card-category-list-count">1</span></a></li></ul></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/CRC/" style="font-size: 1.1em; color: #999">CRC</a> <a href="/tags/ML-Theory/" style="font-size: 1.1em; color: #999">ML Theory</a> <a href="/tags/OPENFPGA/" style="font-size: 1.1em; color: #999">OPENFPGA</a> <a href="/tags/Poem/" style="font-size: 1.1em; color: #999">Poem</a> <a href="/tags/PyTorch/" style="font-size: 1.1em; color: #999">PyTorch</a> <a href="/tags/STA/" style="font-size: 1.5em; color: #99a9bf">STA</a> <a href="/tags/TLS/" style="font-size: 1.1em; color: #999">TLS</a> <a href="/tags/VTR/" style="font-size: 1.5em; color: #99a9bf">VTR</a> <a href="/tags/WaveDrom/" style="font-size: 1.1em; color: #999">WaveDrom</a> <a href="/tags/bash/" style="font-size: 1.1em; color: #999">bash</a> <a href="/tags/c/" style="font-size: 1.1em; color: #999">c++</a> <a href="/tags/%E6%8A%BD%E8%B1%A1%E4%BB%A3%E6%95%B0/" style="font-size: 1.1em; color: #999">抽象代数</a> <a href="/tags/%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA/" style="font-size: 1.1em; color: #999">数值表示</a> <a href="/tags/%E6%95%B0%E5%80%BC%E8%AE%A1%E7%AE%97/" style="font-size: 1.1em; color: #999">数值计算</a> <a href="/tags/%E6%B5%8B%E8%AF%95/" style="font-size: 1.1em; color: #999">测试</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</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/2024/07/"><span class="card-archive-list-date">七月 2024</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/05/"><span class="card-archive-list-date">五月 2024</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/11/"><span class="card-archive-list-date">十一月 2022</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/2022/07/"><span class="card-archive-list-date">七月 2022</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/2022/06/"><span class="card-archive-list-date">六月 2022</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/2022/05/"><span class="card-archive-list-date">五月 2022</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/2022/01/"><span class="card-archive-list-date">一月 2022</span><span class="card-archive-list-count">1</span></a></li></ul></div></div></div></main><footer id="footer"><div id="footer-wrap"></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
endLoading: () => {
document.body.style.overflow = 'auto';
document.getElementById('loading-box').classList.add("loaded")
},
initLoading: () => {
document.body.style.overflow = '';
document.getElementById('loading-box').classList.remove("loaded")
}
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function subtitleType () {
if (true) {
window.typed = new Typed("#subtitle", {
strings: ["未来可期、莫要放弃","当我们失去的时候,才知道自己曾经拥有","理想的路总是为有信心的人预备着","爱的力量大到可以使人忘记一切,却又小到连一粒嫉妒的沙石也不能容纳","上天不会无缘无故做出莫名其妙的决定,它让你放弃和等待,是为了给你最好的","醉了就去山顶吹吹风,困了就靠在你的肩头"],
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50
})
} else {
document.getElementById("subtitle").innerHTML = '未来可期、莫要放弃'
}
}
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
}
} else {
subtitleType()
}</script><script>(() => {
const $mermaidWrap = document.querySelectorAll('#article-container .mermaid-wrap')
if ($mermaidWrap.length) {
window.runMermaid = () => {
window.loadMermaid = true
const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'
Array.from($mermaidWrap).forEach((item, index) => {
const mermaidSrc = item.firstElementChild
const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
const mermaidID = 'mermaid-' + index
const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
mermaid.mermaidAPI.render(mermaidID, mermaidDefinition, (svgCode) => {
mermaidSrc.insertAdjacentHTML('afterend', svgCode)
})
})
}
const loadMermaid = () => {
window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
}
window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
}
})()</script><script type="text/javascript" id="maid-script" src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script><script>if (window.mermaid) {
var options = JSON.parse(document.getElementById('maid-script').getAttribute('mermaidoptioins'));
mermaid.initialize(options);
}</script></div><script src="https://cdn.jsdelivr.net/gh/narutozxp/[email protected]/autoload.js"></script><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/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><!-- hexo injector body_end start --><script async src="//at.alicdn.com/t/font_2032782_8d5kxvn09md.js"></script><!-- hexo injector body_end end --></body></html>