-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
402 lines (244 loc) · 41.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
<!DOCTYPE html><html 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>hustwolf's blog</title><meta name="author" content="hustwolf"><meta name="copyright" content="hustwolf"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website">
<meta property="og:title" content="hustwolf's blog">
<meta property="og:url" content="https://hustwolf.github.io/index.html">
<meta property="og:site_name" content="hustwolf's blog">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:author" content="hustwolf">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://hustwolf.github.io/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><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/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: undefined,
translate: undefined,
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
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/dist/fjGallery.min.js',
css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
}
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'hustwolf\'s blog',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-04-30 11:55:43'
}</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><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" 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">42</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">4</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> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</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_name"><a id="site-name" href="/">hustwolf's blog</a></span><div id="menus"><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> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</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"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></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="/java/jmh/" title="jmh"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="jmh"></a></div><div class="recent-post-info"><a class="article-title" href="/java/jmh/" title="jmh">jmh</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 datetime="2022-11-30T16:00:00.000Z" title="发表于 2022-12-01 00:00:00">2022-12-01</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/java/">java</a></span></div><div class="content"></div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/algorithm/med/" title="最短编辑距离"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="最短编辑距离"></a></div><div class="recent-post-info"><a class="article-title" href="/algorithm/med/" 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 datetime="2022-11-29T16:00:00.000Z" title="发表于 2022-11-30 00:00:00">2022-11-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/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数 。
你可以对一个单词进行如下三种操作:
插入一个字符删除一个字符替换一个字符 leetcode Q72
123456789101112131415161718192021222324class Solution { public int minDistance(String word1, String word2) { // 标准dp的问题 int[][] distance = new int[word1.length()+1][word2.length()+1]; for (int i = 0; i < word2.length()+1; i++) { distance[0][i] = i; } for (int i = 0; i < word1.length() + 1; i++) { dist ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/java/order-run/" title="顺序执行"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="顺序执行"></a></div><div class="recent-post-info"><a class="article-title" href="/java/order-run/" 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 datetime="2022-11-27T16:00:00.000Z" title="发表于 2022-11-28 00:00:00">2022-11-28</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/java/">java</a></span></div><div class="content">3个线程顺序输出A、B、C
12</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/bigdata/kafka/" title="kafka"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="kafka"></a></div><div class="recent-post-info"><a class="article-title" href="/bigdata/kafka/" title="kafka">kafka</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 datetime="2022-11-24T08:05:35.000Z" title="发表于 2022-11-24 16:05:35">2022-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/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a></span></div><div class="content">源码解析kafka broker的启动常见类说明
kafka.utils.KafkaScheduler这个类是jdk的ScheduledThreadPoolExecutor简单的封装,用于在后台定时执行任务;
kafka.network.SocketServer这个是所有的 io 操作的出入口;
Acceptor负责接收tcp connection, accept之后给 Processor 监听与执行; Processor 收入请求后,把信息给RequestChannel;这个类其实就是一个通道;KafkaRequestHandler 这个类(线程)会负责从从RequestChannel获取消息,然后进行处理;
ApiRequestHandler 才是真正的逻辑处理部分;
这个接口主要有2个实现类;a、ControllerApis这是kafka controller的核心类
b、KafkaApis 这个是broker的核心逻辑
kafka的协议的核心KafkaApis; 这个message是由json文件定义的;
</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/algorithm/coin-change/" title="零钱兑换"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="零钱兑换"></a></div><div class="recent-post-info"><a class="article-title" href="/algorithm/coin-change/" 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 datetime="2022-11-23T16:00:00.000Z" title="发表于 2022-11-24 00:00:00">2022-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/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">问题给你一个整数数组 coins ,表示不同面额的硬币;以及一个整数 amount ,表示总金额。
计算并返回可以凑成总金额所需的 最少的硬币个数 。如果没有任何一种硬币组合能组成总金额,返回 -1 。
你可以认为每种硬币的数量是无限的。
leetcode 322
解答123456789101112131415161718192021222324252627282930313233class Solution { public int coinChange(int[] coins, int amount) { // 标准的dp int[] nums = new int[amount+1]; nums[0] = 0; for(int i=1; i< amount+1; i++){ nums[i] = -1; } for(int c : coins){ if(c <= amount){ ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/java/forkjoinpool/" title="forkjoinpool"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="forkjoinpool"></a></div><div class="recent-post-info"><a class="article-title" href="/java/forkjoinpool/" title="forkjoinpool">forkjoinpool</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 datetime="2022-11-21T09:26:07.000Z" title="发表于 2022-11-21 17:26:07">2022-11-21</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/java/">java</a></span></div><div class="content">这个东西我感觉相对于
</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/interview/bigdata1/" title="临近点均值法缺失值填充"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="临近点均值法缺失值填充"></a></div><div class="recent-post-info"><a class="article-title" href="/interview/bigdata1/" 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 datetime="2022-11-05T16:00:00.000Z" title="发表于 2022-11-06 00:00:00">2022-11-06</time></span></div><div class="content">题目1:临近点均值法缺失值填充要求用scala编写spark上的处理程序,临近点定义为缺失处的上下n个元素,n<=4。要考虑大数据量情况下,不出现内存溢出。输入:DataFrame(自己造测试数据,行数为2000万以上,列数至少要有2列以上,每一列随机产生一些空数据)输出:经过缺失值填充后的DataFrame
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172import org.apache.spark.sql.SparkSessionimport org.apache.spark.sql.expressions.Windowimport scala.util.Randomimport org.apache.spark.sql.functions._import org.apache.spark.sql.DataFrameimport org.apac ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/interview/maxvote/" title="最大投票数"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="最大投票数"></a></div><div class="recent-post-info"><a class="article-title" href="/interview/maxvote/" 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 datetime="2022-11-05T16:00:00.000Z" title="发表于 2022-11-06 00:00:00">2022-11-06</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/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">a、b两所学校学生共同乘坐同一列高铁出游联欢,共有N节车箱(编号0,1,…,N-1),每节车箱里有a、b学校的学生各若干名,人数按学校表示为数组A、B:A = [A[0],A[1],…,A[N-1]]B = [B[0],B[1],…,B[N-1]]在联欢过程中,学生们需要为某个节目评分,假设a校学生每人都会投1分,b校学生每人都会投-1分,而负责计分的工作人员只会收走连号若干节车箱的评分票,然后进行累加统计后得出最终评分结果。请写一个算法函数,要求返回最大的评分结果值,并且要求时间复杂度为O(N)
123456789101112131415161718192021222324public class MaxVote { public int max(int[] a, int[] b) { if (a == null || a.length < 1) { return 0; } int curSum = a[0] - b[0]; int m ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/bigdata/hive-window-function/" title="hive中的window function详解"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="hive中的window function详解"></a></div><div class="recent-post-info"><a class="article-title" href="/bigdata/hive-window-function/" title="hive中的window function详解">hive中的window function详解</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 datetime="2021-04-02T01:58:31.000Z" title="发表于 2021-04-02 09:58:31">2021-04-02</time></span></div><div class="content">基本概念窗口聚合函数 是指那些在一个window(很多个记录)内进行计算的函数,而这个window的又和current row有很大的关系;
概念
(Partition BY Order BY ROW|RANGE BETWEEN Windowing specification)
window framewinfow frame决定了对于当前row来说,window function应该作用在那个row范围里
range vs rows如果order by 没有windows frame clause, 那么window 为RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
如果order by 与 window clause 都没有那就是
ROW BETWEEN UNBOUNDED PRECEGING AND UNBOUNDED FOLLOWING
When ORDER BY is specified with missing WINDOW clause, the WINDOW specification defaults to RA ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/tools/math-script/" title="数学公式"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="数学公式"></a></div><div class="recent-post-info"><a class="article-title" href="/tools/math-script/" 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 datetime="2020-08-29T08:44:43.000Z" title="发表于 2020-08-29 16:44:43">2020-08-29</time></span></div><div class="content">一直都很苦恼如何输出优雅的数学公式
MathJax可以在浏览器中输出 一个教程
Latex不用说了 教程
</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/cloud/kubernetes/" title="k8s"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="k8s"></a></div><div class="recent-post-info"><a class="article-title" href="/cloud/kubernetes/" title="k8s">k8s</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 datetime="2020-08-03T07:04:52.000Z" title="发表于 2020-08-03 15:04:52">2020-08-03</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/cloud/">cloud</a></span></div><div class="content">resourcesworkloads
Workloads
Deployment
ReplicaSet
StatefulSet
DaemonSet
Job
CronJob
service
resources
service
ingress
ingress controller
storage
</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/ml/common-alg/" title="常见机器学习算法"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="常见机器学习算法"></a></div><div class="recent-post-info"><a class="article-title" href="/ml/common-alg/" 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 datetime="2020-08-03T07:04:52.000Z" title="发表于 2020-08-03 15:04:52">2020-08-03</time></span></div><div class="content">
KNN
用于有监督学习中的分类,算出距离,最近的n个,然后判断?
问题来了1、计算距离时,用到的属性如何编码?2、如何定义距离?3、有没有快速一点的计算方法,这个算法太慢了4、如何评估判断结果?5、有哪些应用场景?
</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/ml/%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/" title="人工神经网络"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="人工神经网络"></a></div><div class="recent-post-info"><a class="article-title" href="/ml/%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/" 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 datetime="2020-08-03T07:04:52.000Z" title="发表于 2020-08-03 15:04:52">2020-08-03</time></span></div><div class="content">
文本生成
文本生成的本质上就是预测下一个单词!
循环神经网络
LSTM
</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/linux/perf/" title="perf教程"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="perf教程"></a></div><div class="recent-post-info"><a class="article-title" href="/linux/perf/" title="perf教程">perf教程</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 datetime="2020-07-26T08:23:49.000Z" title="发表于 2020-07-26 16:23:49">2020-07-26</time></span></div><div class="content"></div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/bigdata/hadoop-history/" title="hadoop历史"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="hadoop历史"></a></div><div class="recent-post-info"><a class="article-title" href="/bigdata/hadoop-history/" title="hadoop历史">hadoop历史</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 datetime="2020-07-25T08:20:13.000Z" title="发表于 2020-07-25 16:20:13">2020-07-25</time></span></div><div class="content">07年,虽然我读大学时hadoop才开始开发,但一直到13年 我上班 hadoop2.0发布,才算真正稳定下来
18年发布了hadoop3.0
hadoop2的改动主要包括 以前的job tracker到 yarnhdfs支持ha
hadoop3的改动呢?
最低支持java8
hdfs支持erasure code
对于编程来说,不要引入runtime dependency; shaded client jars
而spark history呢?14年才成为顶级项目,1.6是16年出来的;2.3是18年出来的
20年才有3.0
==
大数据技术很多都是来自于传统技术,比如 语法解析AST、基于规则的优化CRO、基于代价的优化CBO、列存,都来自传统数据库;shuffle broadcast来自大数据
spark3中一大亮点1、adaptive sql execute痛点a、spark.sql.shuffle.partition, 默认为200,对sql里,这个参数设置了就不变,导致后面都是这个值,不合理b、spark sql的最佳执行计划,比如join的选 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/bigdata/hdfs-namenode/" title="hdfs namenode分析"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="hdfs namenode分析"></a></div><div class="recent-post-info"><a class="article-title" href="/bigdata/hdfs-namenode/" title="hdfs namenode分析">hdfs namenode分析</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 datetime="2020-07-24T09:01:38.000Z" title="发表于 2020-07-24 17:01:38">2020-07-24</time></span></div><div class="content">normal hdfs启动流程
loading fsimage
loading edits
saving heckpoint
safe mode : 各个datanodes report各自的block信息,形成block map,然后退出安全模式
Namenode 存储 Namespace info\block info注意在namenode的fsimage文件中并不存储block对应的datanode信息,这个是在启动过程中各个datanode report过来的
Second Namenode – so called checkpoint node
名字很有疑惑性,其实它根本不是name node替代,它唯一的作用就是帮namenode 合并editlog;然后把合并好的checkpoint给回送回去
因为namenode主要是启动的时候才read checkpoint, merge editlog; checkpoint image;随着时间的增长,系统里的editlog会非常的大,会极大的拖慢系统的启动过程
主要就2个参数
param
default
desc
...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/bigdata/yarn-fairscheduler/" title="yarn公平调度器"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="yarn公平调度器"></a></div><div class="recent-post-info"><a class="article-title" href="/bigdata/yarn-fairscheduler/" title="yarn公平调度器">yarn公平调度器</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 datetime="2020-07-24T08:42:58.000Z" title="发表于 2020-07-24 16:42:58">2020-07-24</time></span></div><div class="content">resource manager分为2部分
调度器 scheduler
应用程序管理器 application manager, ASM
fair scheduler目标 所有的job获得同样份额的资源
1、系统默认按照内存来公平调度2、系统按照queue来组织apps,在queue上公平共享
资源在每个子队列里共享a (b(c, d), e(f, g, h))
这里有5个queue, a.b.c a.b.d a.e.f a.e.g a.e.h他们share是 25 25 16 16 16
在每一个queue里,可以指定单独的调度策略,比如 fifo、fair、capacity
各个queue可以设置最高与最低的限额也可以设置不同的优先级
当一个资源池有资源多余时,可以将多余资源共享给其他pool
根据每个资源池的最小资源保障,将系统中的部分资源分配给各个资源池;
根据资源池的指定优先级将剩余资源按照比例分配给各个资源池;
在各个资源池中,按照作业的优先级或者根据公平策略将资源分配给各个作业;
参数
参数
default
说明
yarn.scheduler ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/linux/core-dump/" title="linux-core-dump"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="linux-core-dump"></a></div><div class="recent-post-info"><a class="article-title" href="/linux/core-dump/" title="linux-core-dump">linux-core-dump</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 datetime="2020-07-22T12:36:43.000Z" title="发表于 2020-07-22 20:36:43">2020-07-22</time></span></div><div class="content">关于 计算机的内存说明 pmap
pmap -x pid输出
Address Kbytes RSS Dirty Mode Mapping0000000000400000 4 4 0 r-x– java0000000000600000 4 4 4 r—- java0000000000601000 4 4 4 rw— java00000000009c0000 1400692 1400496 1400496 rw— [ anon ]00007f2f84000000 38316 38316 38316 rw— [ anon ]00007f2f8656b000 27220 0 0 —– [ anon ]00007f2f94000000 58752 58752 58752 rw— [ anon ]00007f2f97960000 6784 0 0 —– [ ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/linux/process-status/" title="linux-process"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="linux-process"></a></div><div class="recent-post-info"><a class="article-title" href="/linux/process-status/" title="linux-process">linux-process</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 datetime="2020-07-22T12:36:43.000Z" title="发表于 2020-07-22 20:36:43">2020-07-22</time></span></div><div class="content">http://arthurchiao.art/blog/how-does-ltrace-work-zh/
ltrace 用来跟踪进程调用库函数strace 用来跟踪系统调用 or 信号产生
他们都是通过ptrace系统调用实现的
ptrace 系统调用非常强大,可以跟踪系统调用、重写运行中程序的内存、读取运行中程 序的寄存器等等。
strace 和 ltrace 都使用 PTRACE_SYSCALL 跟踪系统调用。两者的大致工作过程类 似:为被跟踪程序触发 SIGTRAP 信号,暂停执行,通知跟踪程序(strace 或 ltrace),然后跟踪程序被“唤醒”,分析被暂停的程序。
ltrace 还会通过 PTRACE_POKETEXT 重写程序内存,以便通过特殊指令中断程序的执行。
VDSO
usage
编写动态分析工具,如gdb,strace
反追踪,一个进程只能被一个进程追踪(注:一个进程能同时追踪多个进程),若此进程已被追踪,其他基于ptrace的追踪器将无法再追踪此进程,更进一步可以实现子母进程双线执行动态解密代码等更高级的反分析技术
代码注入,往其他进程里注入代码。
...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/middleware/mysql/" title="mysql"><img class="post_bg" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="mysql"></a></div><div class="recent-post-info"><a class="article-title" href="/middleware/mysql/" title="mysql">mysql</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 datetime="2020-07-22T12:36:43.000Z" title="发表于 2020-07-22 20:36:43">2020-07-22</time></span></div><div class="content">https://www.dnsstuff.com/how-to-optimize-mysql-database
</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="page-number" href="/page/3/#content-inner">3</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="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">hustwolf</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">42</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">4</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/hustwolf"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">welcome to my Blog</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="/java/jmh/" title="jmh"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="jmh"/></a><div class="content"><a class="title" href="/java/jmh/" title="jmh">jmh</a><time datetime="2022-11-30T16:00:00.000Z" title="发表于 2022-12-01 00:00:00">2022-12-01</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/algorithm/med/" title="最短编辑距离"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="最短编辑距离"/></a><div class="content"><a class="title" href="/algorithm/med/" title="最短编辑距离">最短编辑距离</a><time datetime="2022-11-29T16:00:00.000Z" title="发表于 2022-11-30 00:00:00">2022-11-30</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/java/order-run/" title="顺序执行"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="顺序执行"/></a><div class="content"><a class="title" href="/java/order-run/" title="顺序执行">顺序执行</a><time datetime="2022-11-27T16:00:00.000Z" title="发表于 2022-11-28 00:00:00">2022-11-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/bigdata/kafka/" title="kafka"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="kafka"/></a><div class="content"><a class="title" href="/bigdata/kafka/" title="kafka">kafka</a><time datetime="2022-11-24T08:05:35.000Z" title="发表于 2022-11-24 16:05:35">2022-11-24</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/algorithm/coin-change/" title="零钱兑换"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="零钱兑换"/></a><div class="content"><a class="title" href="/algorithm/coin-change/" title="零钱兑换">零钱兑换</a><time datetime="2022-11-23T16:00:00.000Z" title="发表于 2022-11-24 00:00:00">2022-11-24</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/cloud/"><span class="card-category-list-name">cloud</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/java/"><span class="card-category-list-name">java</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/%E5%A4%A7%E6%95%B0%E6%8D%AE/"><span class="card-category-list-name">大数据</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/%E7%AE%97%E6%B3%95/"><span class="card-category-list-name">算法</span><span class="card-category-list-count">8</span></a></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/algorithm/" style="font-size: 1.5em; color: #99a9bf">algorithm</a> <a href="/tags/cdh/" style="font-size: 1.1em; color: #999">cdh</a> <a href="/tags/concurrent/" style="font-size: 1.1em; color: #999">concurrent</a> <a href="/tags/dp/" style="font-size: 1.1em; color: #999">dp</a> <a href="/tags/dynamic-programming/" style="font-size: 1.1em; color: #999">dynamic-programming</a> <a href="/tags/hive/" style="font-size: 1.23em; color: #999ea6">hive</a> <a href="/tags/java/" style="font-size: 1.37em; color: #99a4b2">java</a> <a href="/tags/jvm/" style="font-size: 1.1em; color: #999">jvm</a> <a href="/tags/kafka/" style="font-size: 1.1em; color: #999">kafka</a> <a href="/tags/kubernetes/" style="font-size: 1.1em; color: #999">kubernetes</a> <a href="/tags/linux/" style="font-size: 1.23em; color: #999ea6">linux</a> <a href="/tags/mysql/" style="font-size: 1.1em; color: #999">mysql</a> <a href="/tags/spark/" style="font-size: 1.37em; color: #99a4b2">spark</a> <a href="/tags/%E5%B9%B6%E5%8F%91/" style="font-size: 1.1em; color: #999">并发</a> <a href="/tags/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" 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/2022/12/"><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/11/"><span class="card-archive-list-date">十一月 2022</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/04/"><span class="card-archive-list-date">四月 2021</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/2020/08/"><span class="card-archive-list-date">八月 2020</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/2020/07/"><span class="card-archive-list-date">七月 2020</span><span class="card-archive-list-count">24</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2020/06/"><span class="card-archive-list-date">六月 2020</span><span class="card-archive-list-count">5</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">42</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</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">本站总访问量 :</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">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-04-30T03:55:42.941Z"><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 hustwolf</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" 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="浅色和深色模式转换"><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><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>