-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
436 lines (397 loc) · 20.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
<!DOCTYPE html>
<html lang="en" dir="auto">
<head>
<meta name="generator" content="Hugo 0.133.1"><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="index, follow">
<title>Lucius | Braindump</title>
<meta name="description" content="">
<meta name="author" content="">
<link rel="canonical" href="https://sheerwill.xyz/">
<link crossorigin="anonymous" href="/assets/css/stylesheet.fc220c15db4aef0318bbf30adc45d33d4d7c88deff3238b23eb255afdc472ca6.css" integrity="sha256-/CIMFdtK7wMYu/MK3EXTPU18iN7/MjiyPrJVr9xHLKY=" rel="preload stylesheet" as="style">
<link rel="icon" href="https://sheerwill.xyz/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="https://sheerwill.xyz/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://sheerwill.xyz/favicon-32x32.png">
<link rel="apple-touch-icon" href="https://sheerwill.xyz/apple-touch-icon.png">
<link rel="mask-icon" href="https://sheerwill.xyz/safari-pinned-tab.svg">
<meta name="theme-color" content="#2e2e33">
<meta name="msapplication-TileColor" content="#2e2e33">
<link rel="alternate" type="application/rss+xml" href="https://sheerwill.xyz/index.xml">
<link rel="alternate" type="application/json" href="https://sheerwill.xyz/index.json">
<link rel="alternate" hreflang="en" href="https://sheerwill.xyz/">
<noscript>
<style>
#theme-toggle,
.top-link {
display: none;
}
</style>
<style>
@media (prefers-color-scheme: dark) {
:root {
--theme: rgb(29, 30, 32);
--entry: rgb(46, 46, 51);
--primary: rgb(218, 218, 219);
--secondary: rgb(155, 156, 157);
--tertiary: rgb(65, 66, 68);
--content: rgb(196, 196, 197);
--code-block-bg: rgb(46, 46, 51);
--code-bg: rgb(55, 56, 62);
--border: rgb(51, 51, 51);
}
.list {
background: var(--theme);
}
.list:not(.dark)::-webkit-scrollbar-track {
background: 0 0;
}
.list:not(.dark)::-webkit-scrollbar-thumb {
border-color: var(--theme);
}
}
</style>
</noscript><style>
#icons {
display: flex;
flex-wrap: wrap;
margin-top: 2em;
}
#icons .item {
width: 80px;
height: 50px;
margin: 10px;
}
#icons .item .name {
font-size: 12px;
user-select: all;
text-align: center;
}
#icons .item .icon {
display: flex;
justify-content: center;
}
#icons .item svg {
width: 30px;
height: 30px;
}
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MEASUREMENT_ID"></script>
<script>
var doNotTrack = false;
if ( false ) {
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
var doNotTrack = (dnt == "1" || dnt == "yes");
}
if (!doNotTrack) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MEASUREMENT_ID');
}
</script>
<meta property="og:title" content="Lucius | Braindump" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://sheerwill.xyz/" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Lucius | Braindump"/>
<meta name="twitter:description" content=""/>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Lucius | Braindump",
"url": "https://sheerwill.xyz/",
"description": "",
"thumbnailUrl": "https://sheerwill.xyz/favicon.ico",
"sameAs": [
"https://twitter.com/Lucius_Chen", "https://www.instagram.com/lucius_chen/", "https://github.com/LuciusChen"
]
}
</script>
</head>
<body class="list" id="top">
<script>
if (localStorage.getItem("pref-theme") === "dark") {
document.body.classList.add('dark');
} else if (localStorage.getItem("pref-theme") === "light") {
document.body.classList.remove('dark')
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
}
</script>
<header class="header">
<nav class="nav">
<div class="logo">
<a href="https://sheerwill.xyz/" accesskey="h" title="Lucius | Braindump (Alt + H)">Lucius | Braindump</a>
<div class="logo-switches">
<button id="theme-toggle" accesskey="t" title="(Alt + T)">
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
<svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</button>
</div>
</div>
<ul id="menu">
<li>
<a href="https://sheerwill.xyz/tags/" title="Tags">
<span>Tags</span>
</a>
</li>
<li>
<a href="https://sheerwill.xyz/archives/" title="Archive">
<span>Archive</span>
</a>
</li>
<li>
<a href="https://sheerwill.xyz/search/" title="Search (Alt + /)" accesskey=/>
<span>Search</span>
</a>
</li>
</ul>
</nav>
</header>
<main class="main">
<article class="first-entry home-info">
<header class="entry-header">
<h1>Hi there 👋🏻</h1>
</header>
<div class="entry-content">
<p>This is my Personal Knowledge Management</p>
<ul>
<li>Technical Debt</li>
<li>Workflow</li>
<li>Efficiency Tools</li>
</ul>
<p>You can filter out the top nodes by tag “top-node” and the backlink at the bottom of the article for a better view.</p>
</div>
<footer class="entry-footer">
<div class="social-icons" >
<a href="https://twitter.com/Lucius_Chen" target="_blank" rel="noopener noreferrer me"
title="Twitter">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path
d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z">
</path>
</svg>
</a>
<a href="https://www.instagram.com/lucius_chen/" target="_blank" rel="noopener noreferrer me"
title="Instagram">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect>
<path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path>
<line x1="17.5" y1="6.5" x2="17.5" y2="6.5"></line>
</svg>
</a>
<a href="https://github.com/LuciusChen" target="_blank" rel="noopener noreferrer me"
title="Github">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22">
</path>
</svg>
</a>
</div>
</footer>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Making a Multipart/Form-Data POST Request in Java
</h2>
</header>
<div class="entry-content">
<p><dependencies> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.4</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.4</version> </dependency> </dependencies> CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost uploadFile = new HttpPost("..."); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.addTextBody("field1", "yes", ContentType.TEXT_PLAIN); // This attaches the file to the POST: File f = new File("[/path/to/upload]"); builder.addBinaryBody( "file", new FileInputStream(f), ContentType.APPLICATION_OCTET_STREAM, f.getName() ); HttpEntity multipart = builder.build(); uploadFile.setEntity(multipart); CloseableHttpResponse response = httpClient.execute(uploadFile); HttpEntity responseEntity = response.getEntity(); 4.0 版本需要按照下面...</p>
</div>
<footer class="entry-footer"><span title='2024-08-27 19:48:28 +0800 CST'>August 27, 2024</span> · 1 min · 231 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Making a Multipart/Form-Data POST Request in Java" href="https://sheerwill.xyz/posts/main/20240826192831-making_a_multipart_form_data_post_request_in_java/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Direct Invocation of YOLOv8 Trained Models in Java
</h2>
</header>
<div class="entry-content">
<p>pom.xml 文件中需要增加一些包。 <repositories> <repository> <id>opencv</id> <url>https://mvnrepository.com/artifact/org.openpnp/opencv</url> </repository> <repository> <id>djl.ai</id> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> </repository> </repositories> <dependencies> <!-- DJL Core API --> <dependency> <groupId>ai.djl</groupId> <artifactId>api</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL PyTorch Engine --> <dependency> <groupId>ai.djl.pytorch</groupId> <artifactId>pytorch-engine</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL PyTorch Model Zoo --> <dependency> <groupId>ai.djl.pytorch</groupId> <artifactId>pytorch-model-zoo</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL Basic Dataset --> <dependency> <groupId>ai.djl</groupId> <artifactId>basicdataset</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL Image Processing --> <dependency>...</p>
</div>
<footer class="entry-footer"><span title='2024-08-27 14:40:54 +0800 CST'>August 27, 2024</span> · 2 min · 628 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Direct Invocation of YOLOv8 Trained Models in Java" href="https://sheerwill.xyz/posts/main/20240826191654-direct_invocation_of_yolov8_trained_models_in_java/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Vector clocks
</h2>
</header>
<div class="entry-content">
<p>给定的 Lamport 时间戳 \(L(a)\) 和 \(L(b)\) 并且 \(L(a) < L(b)\),我们推断不出 \(a \rightarrow b\) 或者 \(a || b\).1 要区分平行的这些事件,需要 vertor clocks: 假定分布式系统中有 \(n\) 个节点,\(N = \langle N_{1},...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:14:03 +0800 CST'>March 8, 2024</span> · 3 min · 1076 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Vector clocks" href="https://sheerwill.xyz/posts/main/20220602235916-vector_clocks/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">FIFO broadcast
</h2>
</header>
<div class="entry-content">
<p>Definition 最弱的广播类型称为先进先出(FIFO)广播。在这个模型中,由同一节点发送的信息按照发送的顺序传递。例如下图中,\(m_{1}\) 必须在 \(m_{3}\) 之...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:13:14 +0800 CST'>March 8, 2024</span> · 2 min · 892 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to FIFO broadcast" href="https://sheerwill.xyz/posts/main/20220616105609-fifo_broadcast/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Total order broadcast
</h2>
</header>
<div class="entry-content">
<p>Definition 总秩序广播(total order broadcast),有时也被称为原子广播(atomic broadcast)。FIFO broadcast 和 Causal broadcast 允许不同的节点以不同...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:11:31 +0800 CST'>March 8, 2024</span> · 2 min · 837 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Total order broadcast" href="https://sheerwill.xyz/posts/main/20220616135058-total_order_broadcast/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Distribution System
</h2>
</header>
<div class="entry-content">
<p>Remote Procedure Call Remote Procedure Call (RPC) 使得调用远程函数就像调用本地函数一样,这样就不需要关心资源的具体问题,实际上 RPC 是将方法调用转换成了网络通信。但是遇到通信失败怎...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:10:28 +0800 CST'>March 8, 2024</span> · 16 min · 7681 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Distribution System" href="https://sheerwill.xyz/posts/main/20220602202933-distribution_system/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Causality and Happen-before relation
</h2>
</header>
<div class="entry-content">
<p>The Happens-before relation An event is something happening at one node (sending or receiving a message, or a local execution step). event \(a\) happens before event \(b\), written \(a \rightarrow b\). 那么在分布式,有三种情况,满足其中一条,则 \(a\) 是发生在 \(b\) 之前: \(a\) 和 \(b\) 发生在相同节...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:06:39 +0800 CST'>March 8, 2024</span> · 2 min · 574 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Causality and Happen-before relation" href="https://sheerwill.xyz/posts/main/20220602202832-causality_and_happen_before_relation/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Causal broadcast
</h2>
</header>
<div class="entry-content">
<p>Definition Causal broadcast 算法有点类似于 FIFO broadcast: 每条被广播的消息附上的不是一个序列号,而是一个整数的向量。这种算法有时被称为向量时钟算法,向量时钟...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:04:06 +0800 CST'>March 8, 2024</span> · 2 min · 980 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Causal broadcast" href="https://sheerwill.xyz/posts/main/20220616132407-causal_broadcast/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Lamport clocks
</h2>
</header>
<div class="entry-content">
<p>Lamport clocks algorithm Lamport clocks in words Figure 1: lamport-example-simple 每个节点都维护一个计数器 \(t\),每一个当前节点事件 \(e\) 发生时,自增 1。 增长后的值设为 \(L(e)\) 发送消息时附带上当前的计数 \(t\) 消息...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 10:02:54 +0800 CST'>March 8, 2024</span> · 2 min · 617 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Lamport clocks" href="https://sheerwill.xyz/posts/main/20220609201658-lamport_clocks/"></a>
</article>
<article class="post-entry">
<header class="entry-header">
<h2 class="entry-hint-parent">Raft consensus algorithm
</h2>
</header>
<div class="entry-content">
<p>Figure 1: node-state-transitions-in-raft 一个节点有三种状态:leader,candidate 和 follower。当一个节点第一次运行,或者崩溃后恢复时,处于 follower 的状态并且等待其...</p>
</div>
<footer class="entry-footer"><span title='2024-03-08 09:59:11 +0800 CST'>March 8, 2024</span> · 6 min · 2897 words · Lucius Chen</footer>
<a class="entry-link" aria-label="post link to Raft consensus algorithm" href="https://sheerwill.xyz/posts/main/20220623152601-raft_consensus_algorithm/"></a>
</article>
<footer class="page-footer">
<nav class="pagination">
<a class="next" href="https://sheerwill.xyz/page/2/">Next »
</a>
</nav>
</footer>
</main>
<footer class="footer">
<span>© 2024 <a href="https://sheerwill.xyz/">Lucius | Braindump</a></span> ·
<span>
Powered by
<a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> &
<a href="https://github.com/adityatelange/hugo-PaperMod/" rel="noopener" target="_blank">PaperMod</a>
</span>
</footer>
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
<path d="M12 6H0l6-6z" />
</svg>
</a>
<script>
let menu = document.getElementById('menu')
if (menu) {
menu.scrollLeft = localStorage.getItem("menu-scroll-position");
menu.onscroll = function () {
localStorage.setItem("menu-scroll-position", menu.scrollLeft);
}
}
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener("click", function (e) {
e.preventDefault();
var id = this.getAttribute("href").substr(1);
if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
behavior: "smooth"
});
} else {
document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView();
}
if (id === "top") {
history.replaceState(null, null, " ");
} else {
history.pushState(null, null, `#${id}`);
}
});
});
</script>
<script>
var mybutton = document.getElementById("top-link");
window.onscroll = function () {
if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
mybutton.style.visibility = "visible";
mybutton.style.opacity = "1";
} else {
mybutton.style.visibility = "hidden";
mybutton.style.opacity = "0";
}
};
</script>
<script>
document.getElementById("theme-toggle").addEventListener("click", () => {
if (document.body.className.includes("dark")) {
document.body.classList.remove('dark');
localStorage.setItem("pref-theme", 'light');
} else {
document.body.classList.add('dark');
localStorage.setItem("pref-theme", 'dark');
}
})
</script>
</body>
</html>