noblog 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cmds/generate.js +3 -3
- package/dist/cmds/generate.js.map +1 -1
- package/dist/index.js +24 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/nomd/nomd.d.ts.map +1 -1
- package/dist/lib/nomd/nomd.js +16 -1
- package/dist/lib/nomd/nomd.js.map +1 -1
- package/dist/lib/notion/client.d.ts +1 -0
- package/dist/lib/notion/client.d.ts.map +1 -1
- package/dist/lib/notion/client.js +16 -0
- package/dist/lib/notion/client.js.map +1 -1
- package/package.json +44 -28
- package/output/00097769-2aac-4b6f-8f37-d9b658d46b2e +0 -435
- package/output/1707063b-7c0a-4572-9526-f7db2f7bbc49 +0 -162
- package/output/1ed588e1-2604-4e33-9685-722b03f66374 +0 -89
- package/output/2b1c0d09-40f7-4151-a053-11391f775ece +0 -33
- package/output/336b6a5a-f383-4d6c-8fe5-54c9a918c4c0 +0 -264
- package/output/37b77a0a-e233-405a-93f5-a60a808eee35 +0 -72
- package/output/3ac660cb-9503-4e88-8939-5aee30c98351 +0 -24
- package/output/5bc1b19a-8350-48b3-aa19-8073561ad45b +0 -109
- package/output/765976b5-7790-497b-8634-4be1d4770e16 +0 -111
- package/output/90f2cb44-90ab-40b7-a736-02bfb83a314c +0 -1167
- package/output/99a7b0c5-f9de-403c-95ec-eba3d700a195 +0 -49
- package/output/c844b66d-0bf3-4f89-bbe1-5974f2de454b +0 -193
- package/output/cd6299f7-54bb-4160-8735-16e629422a57 +0 -193
- package/output/d462cfca-0a39-4b65-8430-4eae35edbb76 +0 -27
- package/output/daafaad2-2570-43da-8e9e-f95a1b29ca17 +0 -12
- package/output/e45ef6bf-6c30-4fb2-9efc-a1984e5dc530 +0 -84
- package/output/sub/05009ca9-cb39-4356-8f24-c0db39cb4661 +0 -64
- package/output/sub/0b903359-2337-4ad9-adef-e77b69142581 +0 -328
- package/output/sub/18f0fae1-b7ca-40ea-b725-4e69404429dc +0 -109
- package/output/sub/232ae8ce-5ec3-4737-a18e-077774b84b1e +0 -940
- package/output/sub/34f4d4af-812e-4e56-a6dd-deb96e7f605c +0 -3
- package/output/sub/44331753-a264-40a4-b86f-eafd676b3da0 +0 -509
- package/output/sub/4bac355b-24f0-49e7-a317-e4f1cad63c79 +0 -65
- package/output/sub/4d6663a2-e93a-402e-89f8-a47cccc0c8cf +0 -76
- package/output/sub/5771c956-25bf-4714-bc2e-65959c9156d9 +0 -52
- package/output/sub/6ff91a18-494e-4ffc-a33b-b9fd2c36f43f +0 -42
- package/output/sub/81e4a2b0-05e2-4013-bd41-14b144979d91 +0 -0
- package/output/sub/99ef1497-0b94-490f-b9a0-f54b0e64194d +0 -6
- package/output/sub/9a33b8cc-101a-4f6a-9852-115595cd166b +0 -172
- package/output/sub/9c060d29-39a2-432b-b06b-b0bd91989a52 +0 -1159
- package/output/sub/a45b383c-d894-4480-8322-9c5d028722e3 +0 -9
- package/output/sub/b875bfe4-3c1e-4a8f-a56c-27a48ab874ca +0 -438
- package/output/sub/b8cbb8f9-f702-4a43-943c-02a6e39683d5 +0 -222
- package/output/sub/e339a686-bbb1-41d9-b6b5-18111e72a68c +0 -1392
- package/output/sub/e7931a8e-45ca-444a-8d6f-e6fed9415c26 +0 -110
- package/output/sub/e859552b-c597-49ed-9ede-fab320fafd87 +0 -150
- package/output/sub/f4237e72-fdce-44a4-b62c-659dce24b1ee +0 -107
- package/output/sub/ff7ea97c-55ac-471c-902f-b7a7bd101ee6 +0 -0
- package/src/cmds/generate.ts +0 -53
- package/src/index.ts +0 -22
- package/src/lib/nomd/cvter.ts +0 -143
- package/src/lib/nomd/nomd.ts +0 -88
- package/src/lib/nosm/default.ts +0 -0
- package/src/lib/nosm/nosm.ts +0 -3
- package/src/lib/notion/client.ts +0 -59
- package/src/lib/notion/object.ts +0 -176
- package/src/lib/notion/request.ts +0 -42
- package/tsconfig.json +0 -35
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
一直想讨论这个问题,包括在今年(23年)秋招时,也有很多面试官问了对人工智能的看法,我是个不喜欢说假话的人,在面试的时候也是会直截地说出人工智能现在泡沫太多的看法,或许也因为这个被一些公司打了tag(笑)。
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
首先,在基于深度学习的人工智能在2016年前后兴起后,大批大批的资金遍涌入了这个赛道。是啊,一个几乎什么方向都能应用,paper发得飞起的领域,怎么会没有前途呢,或许大多数人都是这么想的吧。但是事实上,但凡把人工智能作为主要战略方向的公司(除了龙头的服务提供商,如OPENAI),都在慢慢走向衰落,这一点对于国内公司来说尤其灵验。反过来说,微软在2000年初发展云平台而非人工智能是一个例子;谷歌晚了一点,好在体量大,还是做出了google cloud;这几年的百度式微也多少证明了这一点,近期的阿里宣布要以人工智能为主要发展方向,对此我只能尊重祝福。
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
首先,目前的深度学习严重依赖于计算硬件,这是中国的超级短板。而且在我看来,深度学习本质上是一种基于向量的搜索引擎,一切的一切都是以数据为灵魂的,算法是一个重要的点,但是妄图通过算法来对抗数据是几乎不可能的,近期流行的大模型rank也间接说明了,在模型参数量丰富到足以表示所有的语料前,参数越多,效果越好是毋庸置疑的。深度学习模型作为一种向量搜索引擎,也就自然的引出了最重要的一个功能——知识检索。请允许我戛然而止一下,先讨论下一个约束人工智能的方向,并在其中描述知识检索的联系。
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
市场,这往往是资本首先考虑的因素,是否具有足够的经济效益,是否能够吹牛逼,创造信心神话。而我对于此进行了简单的归纳:只有生产者需要知识检索,消费者不需要知识检索。这貌似是一句废话,因为消费者越多,盘子越大,生产者也会越多,对应的,知识检索的需求也会膨胀。但是反过来呢?如果市场不再有增量呢,你是否需要花费如此之高的成本去养着一批期望值极低的所谓算法工程师。有些人可能会说,万一我不赶上这个风口,市场都被友商吃掉了呢?那你需要的是trade-off,你需要想一想你手头上的现金流,以及投入的这些人力和算力是不是真的能够覆盖这个风险。对于大多数上市公司来说,几乎所有的决策都是为了缓解资本焦虑。甚至你抬头看一看你身边的人,除了媒体编辑和工程师(电类工程师),深度学习真的对大多数人有帮助吗?绝大多数人对于人工智能的态度就是“确实很厉害,但是我好像不怎么用”。甚至支付宝删掉一半的无聊功能,打开软件时间减少半秒对社会的帮助都会更大吧。对于大多数软件来说,嵌入模型和助手之类的功能除了向上级邀功,没有任何效益可言,因为用户真的不care。
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
放眼深度学习这个领域,但凡你看看最近的会议和期刊,空怕都会得出一个结论,“学术就是一个草台班子”,99%的深度学习相关论文,事实意义上都是小圈子的自娱自乐,从发布起到人类文明结束为止都不会对生产力发展产生任何正面的作用(可能会对财富的再分配起到作用)。包括很多人工智能方向的入局者,可以去社交媒体和论坛上看一下,很难想象作为计算机的从业者,会搞不清楚Pycharm,解释器和anaconda的关系,当然这也只是冰山一角,所谓的面试也是没有多少选拔价值,因为有时甚至这些面试官也是走运入职的。试想一下,transformer是18年提出的,LLM初露头角是在21年,而且在相关的工程领域至今没有一个很好的通用工程方案,而如今(甚至早在对应的18年,22年)相关的算法专家/领域大牛已经遍地跑了,这是在是有些滑稽。因为这实在是矛盾的,如果技术方向重要,那么那些专家就不可能是专家,因为他们先前就没在研究或研究不出这些技巧;如果技术方向不重要,那么面试为何偏向学术吹水,只追热门,忽略模式识别和数学的基本功?对于大多数的所谓“专家”,一个优秀的工程师恐怕要不了一个月就能拆穿他们微调的把戏了。
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
插个题外话,如果我是算法方面的面试官,我会筛选几篇近期的会议论文,让候选者进行反向传播的求导,并要求在不与其他人进行沟通的情况下,查阅任意资料,在短时间内截取模型中的一个module进行输入模拟和输出打印。这是最重要的,何恺明也会有发不出论文的一天,但是每天都会有人引用他的方法和模型。现在绝大多数的算法已然成为了靠ppt和画大饼抢饭的岗位。但是,我并不是说尖端的人才也是这样的,只是说大多数算法工程师的招聘标准完全是按照顶学术热门方向来的,对于企业来说,这只会招聘到一群高不成低不就的吸血鬼。严格来说,大多数算法工程师不是工程师。(从此也可以看出Brendan Eich 说的是对的,从0到1的程序员和被高级语言呵护长大的程序员是不一样的,前些年混入了一大批只会python的算法工程师)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
这些观点也不仅仅是我个人的暴论,Yoshua Bengio、朱松纯和 Filip Piekniewski 等人也对现如今基于深度学习的人工智能有着类似的观点。中国目前处于一个阶段,那便是投资找不到方向,投资人心急如焚,看着资产被破败的预期和通胀不断稀释;企业也找不到投资方向——互联网规模见顶,生产力进步停滞,投资不知道该如何反哺生产,只能抢夺存量,像无头苍蝇一样到处撒网,渴望创造奇迹。做蛋糕的时代已经过去了,甚至已经分完了,字节跳动的成功也是一次成功的存量市场抢夺。所以投资人看到了希望,开始投资 kwai、lazada、shein 之类的产品,国家和地方也开始入场,投资各种实验室。这些公司能不能成功,我不知道,但是大多数的从业人员应该已经意识到,他们日常做的其实只有follow和东拼西凑。绝大部分的算法是一个草台班子,遮遮掩掩不是他们有多厉害,而是怕被人看到不过如此。
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
总结一下,我不看好的主要原因,实际上就是以下几点:市场有限,多数人的使用频率极低;技术本身起催化剂作用,可以降本增效,如果不能促进生产力的进步,宏观上只会减少工作岗位(公务员群体尤甚,甚至会抗拒这样的产品入场);数据驱动,从业人员鱼龙混杂,ppt 主要赚吆喝,复杂性成为指标;投资具有泡沫性,同质化严重,缺少持续变现能力,资本会在一定的经济周期后踩踏离场。深度学习是一项很重要的技术,在娱乐应用方面尤其适配,但是绝对不需要这么多的关注,这项技术可以在很多场景减少开销,但本质上是工程大于算法的,而这其中的算法又只需要万里挑一的天才。中国的互联网神话是网民数量和网民素质的神话,在世界经济濒临债务危机的前夕,面临已经停滞的生产力发展、生产力解放和生产关系变化,寄希望于深度学习来进行科技革命的人一定会付出惨痛的代价。如果有AGI,那一定不是深度学习。
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
希望我说的都是屁话。
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
2023.10.19
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# 马后炮
|
|
33
|
-
|
|
34
|
-
<details>
|
|
35
|
-
<summary>[Gen AI: too much spend, too little benefit?](https://www.goldmansachs.com/intelligence/pages/gen-ai-too-much-spend-too-little-benefit.html) (高盛) 2024.06.27</summary>
|
|
36
|
-
|
|
37
|
-
</details>
|
|
38
|
-
|
|
39
|
-
<details>
|
|
40
|
-
<summary>大型科技公司需要 6000 亿美元的年利润才能证明人工智能硬件支出的合理性 (红杉资本)2024.07.06</summary>
|
|
41
|
-
|
|
42
|
-
[https://www.techspot.com/news/103699-big-tech-needs-generate-600-billion-annual-revenue.html](https://www.techspot.com/news/103699-big-tech-needs-generate-600-billion-annual-revenue.html)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</details>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Introduction
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
拜占庭将军问题是指,当一群**将军**(计算机)打算**攻打拜占庭王国的城堡**(达成一致)时,约定**进攻策略**(一致内容)的问题。这个问题的前提是,**攻下城堡或撤退**(达成一致)所需要的**将军**(节点)数量是小于等于将军中**忠诚将军**(忠诚节点)的数量的。
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
拜占庭将军问题实际上是一个分布式系统的一致性问题。解决的核心问题是对叛徒节点的tolerance。
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Magical $\frac{1}{3}$
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
这里介绍一些便于理解的思路
|
|
15
|
-
|
|
16
|
-
- 假定节点总数是$n$,作恶节点数为$m$,那么剩下的正确节点数为 $n - m$,意味着只要收到 $n - m$ 个消息且 $n - m > m$ 就能做出决定,但是这 $n - m$ 个消息有可能有 $m$ 个是由作恶节点冒充的(或因网络延迟导致f个恶意节点的消息先被收到),那么正确的消息就是 $n - m - m$ 个,为了多数一致,正确消息必须占多数,也就是 $n - m - m > m$ ,所以N最少是 $3m + 1$ 个。
|
|
17
|
-
- [拜占庭容错算法BFT的33%](https://zhuanlan.zhihu.com/p/44198965)
|
|
18
|
-
|
|
19
|
-
# Complexity
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
为何oral massage algorithm的复杂度是$O(N^{m+1})$?
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## 算法
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
从论文出发来分析一下:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
A commanding general must send an order to his $n - 1$ lieutenant generals such that:
|
|
32
|
-
|
|
33
|
-
- **IC1:** All loyal lieutenants obey the same order.
|
|
34
|
-
- **IC2:** If the commanding general is loyal, then every loyal lieutenant obeys the order he sends.
|
|
35
|
-
|
|
36
|
-
这是两个重要的 interactive consistency conditions,满足这些,就认为保持了一致性。
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
先扔出论文中的几个assumption:
|
|
40
|
-
|
|
41
|
-
- A1. Every message that is sent is delivered correctly.
|
|
42
|
-
|
|
43
|
-
不考虑丢包
|
|
44
|
-
|
|
45
|
-
- A2. The receiver of a message knows who sent it.
|
|
46
|
-
|
|
47
|
-
信息来源已知
|
|
48
|
-
|
|
49
|
-
- A3. The absence of a message can be detected.
|
|
50
|
-
|
|
51
|
-
可以感知哪个将军没有进行决策
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
A1 和 A2 可以防止叛徒干扰另外两名将军之间的通信,因为根据 A1,不能干扰将军发送的消息,而根据 A2,不能通过引入虚假消息来混淆将军的通信。 A3 防止叛徒试图通过不发送消息来阻止决策。这些假设的实现在论文中的section 6得到阐述。
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
提出算法的定义:
|
|
58
|
-
|
|
59
|
-
- $OM(m)$: oral massage algorithm when the number of malicious node is $m$.
|
|
60
|
-
- $v_i$: lieutenants $i$ "obtaining a value" as its command.
|
|
61
|
-
- $majority(v_1, ..., v_{n-1})$: for each lieutenant, its value $v_i$ should equal to the majority of the $(v_1, ..., v_{n-1})$ received from other lieutenants.
|
|
62
|
-
|
|
63
|
-
在正式开始推导之前,再提出两个限制:
|
|
64
|
-
|
|
65
|
-
1. choose the majority value among the $v_i$ if it exists, otherwise the default value $RETREAT$;
|
|
66
|
-
2. The median of the $v_i$, assuming that they come from an ordered set.
|
|
67
|
-
|
|
68
|
-
符合majority多于一半的原则
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
**对于 Algorithm** $ OM(0)$:
|
|
72
|
-
|
|
73
|
-
1. The commander sends his value to every lieutenant.
|
|
74
|
-
2. Each lieutenant uses the value he receives from the commander, or uses the value RETREAT if he receives no value.
|
|
75
|
-
|
|
76
|
-
**对于 Algorithm** $OM(m) , m > 0$:
|
|
77
|
-
|
|
78
|
-
1. The commander sends his value to every lieutenant.
|
|
79
|
-
2. For each $i$, let $v_i$ be the value Lieutenant $i$ receives from the commander, or else be $RETREAT$ if he receives no value. Lieutenant $i$ acts as the commander in Algorithm $OM(m - 1)$ to send the value $v_i$ to each of the $n - 2$ other lieutenants.
|
|
80
|
-
3. For each $i$, and each $j \ne i$, let $v_j$ be the value Lieutenant $i$ received from Lieutenant $j$ in **step (2)** (using Algorithm $OM(m - 1)$), or else $RETREAT$ if he received no such value. Lieutenant $i$ uses the value $majority (v_1,...,v_{n-1} )$.
|
|
81
|
-
|
|
82
|
-
论文认为这个算法可以解决拜占庭问题
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
## 证明
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
实际上就是证明算法满足互相一致性条件。
|
|
89
|
-
|
|
90
|
-
<details>
|
|
91
|
-
<summary>**LEMMA 1.** For any $m$ and $k$, Algorithm $OM(m)$ satisfies **IC2** if there are more than $2k + m$ generals and at most $k$ traitors.</summary>
|
|
92
|
-
|
|
93
|
-
如果有多于 $2k+m$ 个将军而且将军中叛徒的数量不多于 $k$ 个,那么算法满足**IC2**。
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
当 $m=0$ 时,此时 commander 一定是忠诚的,显然成立。
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
在引理中,我们有 $n > 2k + m$,所以有 $n - 1 > 2k + (m - 1)$ 。假设 m-1 时成立,当为 m 时,通过归纳法应当也成立。
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
由于叛徒最多有 $k$ 个,且 $n - 1 > 2k + (m - 1) \geq 2k$,因此 $n - 1$ 名副官中的大多数是忠诚的。 因此,对于 $n-1$ 个中的大多数lieutenant $i$,每个忠诚的 lieutenant 都有$v_i = v$,因此他在step 3中获得$majority (v_1,...,v_{n-1})=v$ ,证明**IC2**。
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</details>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
**重头戏来了**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
**THEOREM 1.** For any $m$, Algorithm $OM(m)$ satisfies conditions **IC1** and **IC2** if there are more than $3m$ generals and at most $m$ traitors.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
依然使用归纳法证明:
|
|
115
|
-
|
|
116
|
-
- 如果没有叛徒,容易得到 $OM(0)$ 满足 **IC1** and **IC2**。假设定理对于 $OM ( m - 1)$ 成立,归纳证明 $O M ( m ), m > 0$ 的情况 。
|
|
117
|
-
- 先考虑 commander 忠诚时的情况,使用 **lemma1** 并使 $k=m$,当 commander 是忠诚的时,**IC1**实际上就自然被满足了。
|
|
118
|
-
- 考虑 commander 是叛徒的情况,此时,在 $n-1$ 个 lieutenant 中至多有 $m-1$ 个 lieutenant 是叛徒,且 $n-1>3m-1$ ,说明 lieutenant 的数量多于 $3m-1$ 。同时, $3m-1>3(m-1)$,正好符合定理在 $m-1$ 时的情况(假设正确)。也就是说,对于 $n-1$ 的情况,当新的 commander 是叛徒时,可以保证忠诚的 lieutenant 做出了一致的决策;当新的 commander 是忠诚时,可以保证忠诚的 lieutenant 听从忠诚的 commander(做出了一致的决策)。发现了吗,所有忠诚者的决策向量应当是一致的,所以可以推断得到,所有忠诚者的最终决策 $v$ 都是一样的。回到 m 的情况,此时竟然自然地满足了 **IC1**。
|
|
119
|
-
|
|
120
|
-
至此,定理得证。
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
# Full step for $OM(2),~n=7$
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
$OM(2)$ step 1
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-

|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
$OM(1)$ step 1,这里进入第一层迭代,以第一个忠诚节点为例
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-

|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
$OM(1)$ step 2
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-

|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
$OM(1)$ step 3
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-

|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
以此类推还有五次 $OM(1)$ 需要完成,对于忠诚节点为 commander 的情况来说,都是一样的,这里再过一遍叛徒是 commander 的情况
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
$OM(1)$ step 1,这里进入第一层迭代,以叛徒为例,这里 $a,b,c,d,e$ 只是一个代数,它们可以等于任何一个决策。
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-

|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
$OM(1)$ step 2
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-

|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
$OM(1)$ step 3,就算有着叛徒,我们发现此时,所有节点的决策向量也是一样的。此时可能没有一个决策占了多数,所以我们姑且让没有达成一致时的默认决策为 $D$ 。
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-

|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
OK,回到主线,$OM(2)$ step2
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-

|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
整理向量,得到最后的 $OM(2)$ step 3
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-

|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
可以朴素地认为,算法的核心就是为了使忠诚节点的最终结果一致。
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
# Full step for $OM(2),~n=6$
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
[https://pages.cs.wisc.edu/~zuyu/files/om_algo.pdf](https://pages.cs.wisc.edu/~zuyu/files/om_algo.pdf)
|
|
193
|
-
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Abbrivation && Concept
|
|
3
|
-
|
|
4
|
-
- **ABI:** <u>Application Binary Interface</u> ([what is ABI?](https://stackoverflow.com/questions/2171177/what-is-an-application-binary-interface-abi))
|
|
5
|
-
- **AVX:** <u>Advanced Vector Extensions</u> (instruction set)
|
|
6
|
-
- **ISA:** <u>Instruction Set Architecture</u>
|
|
7
|
-
- **PLT:** <u>Procedure Linkage Table</u>
|
|
8
|
-
- **CPE:** <u>Clock cycles Per Element</u>
|
|
9
|
-
- **ATT:** An Assembly Syntax
|
|
10
|
-
- **misc:** [Miscellaneous files](https://learn.microsoft.com/en-us/visualstudio/ide/reference/miscellaneous-files?view=vs-2022#:~:text=In%20this%20article&text=Files%20you%20want%20to%20work,a%20solution%20under%20source%20control.)
|
|
11
|
-
|
|
12
|
-
# CSAPP
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[link_preview](https://github.com/humbornjo/csapp)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# GDB
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[Cheatsheet](https://cs.brown.edu/courses/cs033/docs/guides/gdb.pdf)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# Reverie
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## OS
|
|
28
|
-
|
|
29
|
-
<details>
|
|
30
|
-
<summary>[What is the difference between MOV and LEA?](https://stackoverflow.com/questions/1699748/what-is-the-difference-between-mov-and-lea)</summary>
|
|
31
|
-
|
|
32
|
-
</details>
|
|
33
|
-
|
|
34
|
-
<details>
|
|
35
|
-
<summary>[Is performance of less/greater better than less/greater or equal](https://stackoverflow.com/questions/27016781/is-performance-of-less-greater-than-than-better-than-less-greater-than-or-equ)</summary>
|
|
36
|
-
|
|
37
|
-
</details>
|
|
38
|
-
|
|
39
|
-
<details>
|
|
40
|
-
<summary>[What is a memory fence?](https://stackoverflow.com/questions/286629/what-is-a-memory-fence)</summary>
|
|
41
|
-
|
|
42
|
-
</details>
|
|
43
|
-
|
|
44
|
-
<details>
|
|
45
|
-
<summary>[Disassembly and Binary Analysis Fundamentals](https://hexterisk.github.io/blog/posts/2020/04/02/disassembly-and-binary-analysis-fundamentals/)</summary>
|
|
46
|
-
|
|
47
|
-
</details>
|
|
48
|
-
|
|
49
|
-
<details>
|
|
50
|
-
<summary>[How does multithreading utilizes multiple cores?](https://stackoverflow.com/questions/63589801/how-does-multithreading-utilizes-multiple-cores)</summary>
|
|
51
|
-
|
|
52
|
-
</details>
|
|
53
|
-
|
|
54
|
-
<details>
|
|
55
|
-
<summary>[Why mmap() is faster than sequential IO?](https://stackoverflow.com/questions/9817233/why-mmap-is-faster-than-sequential-io)</summary>
|
|
56
|
-
|
|
57
|
-
</details>
|
|
58
|
-
|
|
59
|
-
<details>
|
|
60
|
-
<summary>[What does reaping children imply?](https://stackoverflow.com/questions/58885831/what-does-reaping-children-imply)</summary>
|
|
61
|
-
|
|
62
|
-
</details>
|
|
63
|
-
|
|
64
|
-
<details>
|
|
65
|
-
<summary>Overhead over switch between process and thread</summary>
|
|
66
|
-
|
|
67
|
-
[**Thread context switch Vs. process context switch**](https://stackoverflow.com/questions/5440128/thread-context-switch-vs-process-context-switch)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
[**Why is it less overhead to switch between threads belonging to the same process than to switch between threads belonging to different processes?**](https://www.quora.com/Why-is-it-less-overhead-to-switch-between-threads-belonging-to-the-same-process-than-to-switch-between-threads-belonging-to-different-processes)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
</details>
|
|
74
|
-
|
|
75
|
-
<details>
|
|
76
|
-
<summary>[Definition of "synchronization primitive"](https://stackoverflow.com/questions/8017507/definition-of-synchronization-primitive)</summary>
|
|
77
|
-
|
|
78
|
-
</details>
|
|
79
|
-
|
|
80
|
-
<details>
|
|
81
|
-
<summary>[What is the first process a typical Linux kernel starts?](https://stackoverflow.com/questions/21612801/what-is-the-first-process-a-typical-linux-kernel-starts)</summary>
|
|
82
|
-
|
|
83
|
-
</details>
|
|
84
|
-
|
|
85
|
-
<details>
|
|
86
|
-
<summary>All about MMU</summary>
|
|
87
|
-
|
|
88
|
-
[**Why does the OS need a page table if the MMU already has one?**](https://stackoverflow.com/questions/58995151/why-does-the-os-need-a-page-table-if-the-mmu-already-has-one)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
[**Why doesn't the MMU require a gargantuan amount of memory?**](https://www.reddit.com/r/osdev/comments/qu4zea/why_doesnt_the_mmu_require_a_gargantuan_amount_of/)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
[**What is the difference between TLB and MMU in OS?**](https://www.quora.com/What-is-the-difference-between-TLB-and-MMU-in-OS)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</details>
|
|
98
|
-
|
|
99
|
-
<details>
|
|
100
|
-
<summary>What does swap do to Page Table Entries</summary>
|
|
101
|
-
|
|
102
|
-
[https://stackoverflow.com/questions/16581490/how-does-kernel-know-which-pages-in-the-virtual-address-space-correspond-to-a-s](https://stackoverflow.com/questions/16581490/how-does-kernel-know-which-pages-in-the-virtual-address-space-correspond-to-a-s)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</details>
|
|
106
|
-
|
|
107
|
-
<details>
|
|
108
|
-
<summary>[Conservative garbage collector](https://stackoverflow.com/questions/7629446/conservative-garbage-collector)</summary>
|
|
109
|
-
|
|
110
|
-
</details>
|
|
111
|
-
|
|
112
|
-
<details>
|
|
113
|
-
<summary>[Unix system file tables](https://stackoverflow.com/questions/14189944/unix-system-file-tables)</summary>
|
|
114
|
-
|
|
115
|
-
</details>
|
|
116
|
-
|
|
117
|
-
<details>
|
|
118
|
-
<summary>Which one to use: static variable or heap allocated variable?</summary>
|
|
119
|
-
|
|
120
|
-
[Memory allocation areas in C++ (Stack vs heap vs Static)](https://stackoverflow.com/questions/14172505/memory-allocation-areas-in-c-stack-vs-heap-vs-static)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
</details>
|
|
124
|
-
|
|
125
|
-
<details>
|
|
126
|
-
<summary>Thread local memory is not thread stack</summary>
|
|
127
|
-
|
|
128
|
-
[What is thread local storage? Why we need it?](https://stackoverflow.com/questions/35692188/what-is-thread-local-storage-why-we-need-it)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
</details>
|
|
132
|
-
|
|
133
|
-
<details>
|
|
134
|
-
<summary>How to implement semaphore?</summary>
|
|
135
|
-
|
|
136
|
-
[Implementation of a semaphore in C](https://stackoverflow.com/questions/54898512/implementation-of-a-semaphore-in-c)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
[C & low-level semaphore implementation](https://stackoverflow.com/questions/36094115/c-low-level-semaphore-implementation)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
[https://gist.github.com/mepcotterell/6f0a779befe388ab822764255e3776ae](https://gist.github.com/mepcotterell/6f0a779befe388ab822764255e3776ae)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
</details>
|
|
146
|
-
|
|
147
|
-
<details>
|
|
148
|
-
<summary>[Why is malloc() considered a library call and not a system call?](https://stackoverflow.com/questions/71413587/why-is-malloc-considered-a-library-call-and-not-a-system-call)</summary>
|
|
149
|
-
|
|
150
|
-
</details>
|
|
151
|
-
|
|
152
|
-
<details>
|
|
153
|
-
<summary>`gprof` under the hood</summary>
|
|
154
|
-
|
|
155
|
-
[https://docs-archive.freebsd.org/44doc/psd/18.gprof/paper.pdf](https://docs-archive.freebsd.org/44doc/psd/18.gprof/paper.pdf)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
[http://gnu.cs.utah.edu/Manuals/gprof-2.9.1/html_mono/gprof.html#SEC25](http://gnu.cs.utah.edu/Manuals/gprof-2.9.1/html_mono/gprof.html#SEC25)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
[How exactly does gprof work?](https://stackoverflow.com/questions/4981121/how-exactly-does-gprof-work)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
[Is it possible to read another thread's program counter?](https://stackoverflow.com/questions/30088710/is-it-possible-to-read-another-threads-program-counter)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
[Can we read and fault-inject another thread's program counter?](https://stackoverflow.com/questions/38018713/can-we-read-and-fault-inject-another-threads-program-counter)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
</details>
|
|
171
|
-
|
|
172
|
-
<details>
|
|
173
|
-
<summary>[threads and LWP in Linux](https://stackoverflow.com/questions/28476456/threads-and-lwp-in-linux)</summary>
|
|
174
|
-
|
|
175
|
-
</details>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
## Net
|
|
179
|
-
|
|
180
|
-
1. [Output of "ip route show"](https://serverfault.com/questions/838853/what-does-the-command-ip-route-show)
|
|
181
|
-
|
|
182
|
-
## Misc
|
|
183
|
-
|
|
184
|
-
- [https://en.wikipedia.org/wiki/Hexspeak](https://en.wikipedia.org/wiki/Hexspeak)
|
|
185
|
-
- [How to write a "dummy" (do nothing) line in C](https://stackoverflow.com/questions/22264284/how-to-write-a-dummy-do-nothing-line-in-c)
|
|
186
|
-
- [Bash : Taking a wildcard as argument of a shell script](https://stackoverflow.com/questions/60357123/bash-taking-a-wildcard-as-argument-of-a-shell-script-and-being-able-to-expand)
|
|
187
|
-
- [Notes on structured concurrency, or: Go statement considered harmful](https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/#id1)
|
|
188
|
-
- [Golang runtime/internal/syscall.Syscall6 consuming large amount of CPU](https://stackoverflow.com/questions/78614811/golang-runtime-internal-syscall-syscall6-consuming-large-amount-of-cpu)
|
|
189
|
-
- [Stupid clangd](https://clangd.llvm.org/config#files)
|
|
190
|
-
- [Exceptions: Yes or No?](https://www.reddit.com/r/cpp/comments/vr771l/exceptions_yes_or_no/)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# 🎧 Zart
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
zart is a music player written in tauri which help you download, organize, and stay sync with your music. It dont need any platform account, all you need to stay sync is to provide a cloud database access.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[Zart: AI powered music app](ff7ea97c-55ac-471c-902f-b7a7bd101ee6.md)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# 🐱 Lulu
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
lulu is my personal exploration on clash project. ☉A☉
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# 🐝 Abee
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
abee is a telegram robot which help you achieve as much “simple earn” as possible, it now support binance.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[link_preview](https://github.com/humbornjo/abee)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# Why Rust
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
pls read ch1 of “Programming Rust”
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Programming Rust
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## ch2
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
try read ch2 of “Programming Rust”, you can skip if it’s too hard for you now.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## ch[3:]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
follow _REPL_, I love jupyter lab [https://github.com/humbornjo/rusting](https://github.com/humbornjo/rusting)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# Rust Wandering
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Before the beginning, please google “auto trait”. And understand “str and &str”.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## My Note
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[str &str and more](e7931a8e-45ca-444a-8d6f-e6fed9415c26.md)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[Rust iterator, deref, ref from top to bottom](4d6663a2-e93a-402e-89f8-a47cccc0c8cf.md)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[slice and &slice](5771c956-25bf-4714-bc2e-65959c9156d9.md)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
[Tiny blog for Arc](05009ca9-cb39-4356-8f24-c0db39cb4661.md)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
[Do u really understand Option?](81e4a2b0-05e2-4013-bd41-14b144979d91.md)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[Understand Send & Sync in practice](a45b383c-d894-4480-8322-9c5d028722e3.md)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## Newbie
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
**Follow this guy** [**youtube@jonhoo**](https://www.youtube.com/@jonhoo)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
**Debug with backtrace:** [**Rust Backtrace on windows?**](https://stackoverflow.com/questions/59131262/rust-backtrace-on-windows) **+** [**How to pass RUST_BACKTRACE=1**](https://stackoverflow.com/questions/54055139/how-to-pass-rust-backtrace-1-when-running-a-rust-binary-installed-in-debian)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
[**Understanding Send and Sync**](https://stackoverflow.com/questions/59428096/understanding-the-send-trait)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
[**Is there any way to explicitly write the type of a closure?**](https://stackoverflow.com/questions/29191170/is-there-any-way-to-explicitly-write-the-type-of-a-closure)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[**How Clone differ from Copy?**](https://stackoverflow.com/questions/31012923/what-is-the-difference-between-copy-and-clone) **⭐**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
[**How Copy and Clone traits are implemented under the hood in rust**](https://www.reddit.com/r/rust/comments/uc8npp/how_copy_and_clone_traits_are_implemented_under/)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
[**Rust Module System**](https://www.sheshbabu.com/posts/rust-module-system/)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
[**Pin and Unpin**](https://www.sobyte.net/post/2022-07/rust-pin-unpin/)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## Best Practice
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
[Replace every to_owned(), into(), to_string() with Cow<str>, and more.](https://doc.rust-lang.org/std/borrow/enum.Cow.html)
|
|
84
|
-
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
We all know that Arc is a thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
But have you ever think about what will happen if Arc is only applied in one thread. Can it be mutable? Does the Mutex still needed?
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Suppose got a scene like:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```rust
|
|
12
|
-
// try manipulate the val in Arc without the aid of Mutex
|
|
13
|
-
use std::sync::{Arc, Mutex};
|
|
14
|
-
|
|
15
|
-
fn main() {
|
|
16
|
-
use std::thread;
|
|
17
|
-
|
|
18
|
-
let mut five = Arc::new("okk".to_string());
|
|
19
|
-
five.push_str("!");
|
|
20
|
-
|
|
21
|
-
for _ in 0..10 {
|
|
22
|
-
let tfive = five.clone();
|
|
23
|
-
|
|
24
|
-
thread::spawn(move || {
|
|
25
|
-
println!("{tfive:?}");
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
# Error
|
|
30
|
-
--> src/main.rs:6:9
|
|
31
|
-
|
|
|
32
|
-
6 | let mut five = Arc::new("okk".to_string());
|
|
33
|
-
| ----^^^^
|
|
34
|
-
| |
|
|
35
|
-
| help: remove this `mut`
|
|
36
|
-
|
|
|
37
|
-
= note: `#[warn(unused_mut)]` on by default
|
|
38
|
-
|
|
39
|
-
error[E0596]: cannot borrow data in an `Arc` as mutable
|
|
40
|
-
--> src/main.rs:7:5
|
|
41
|
-
|
|
|
42
|
-
7 | five.push_str("!");
|
|
43
|
-
| ^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
|
|
44
|
-
|
|
|
45
|
-
= help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Arc<String>`
|
|
46
|
-
|
|
47
|
-
For more information about this error, try `rustc --explain E0596`.
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
According to the hint from compiler, the key is trait `DerefMut`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-

|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Yyyyyyyyyyes, Arc only implements `Deref` rather than `DerefMut`[.](http://derefmut.so/) So only the method that called by `&self` can be adjusted. That’s why Mutex has to be wrapped outside the target value to complete the chain-style dereference: **`Arc`** `-Deref→` **`Mutex`** `-DerefMut→` **`value`**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-

|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|