思考のかけら

Mensu - 思考のかけら

Mensu's Blog concerning what he has learned during programming

Node.js 事件循环

node.js event loop

The article was initially posted on 2018-05-26. 个人浅薄和粗糙的理解,忽略了大量细节,必有疏漏,仅供参考 Node.js 与 V8、libuv 的协作 libuv 提供事件循环,并提供一些系统调用和 I/O 操作的函数(API)。这些 API 封装了相应的 I/O 操作,并可以通过多路复用等方式避免阻塞。I/O 操作完成后...


Https 握手过程

https handshake process

The article was initially posted on 2018-03-13. 个人浅薄和粗糙的理解,忽略了大量细节,必有疏漏,仅供参考 安全传输数据 不可破解(对称/非对称加密) 完整一致(摘要一致) 来源可靠(证书合法) 证书 作用:证明服务端的公钥是服务端的。 CA:证书机构 PKI:公钥认证体系,包括 CA、吊销列...


LeetCode: 368. Largest Divisible Subset

week 20

The article was initially posted on 2018-01-14. Description Largest Divisible Subset - LeetCode Given a set of distinct positive integers, find the largest subset such that every pair \(...


LeetCode: 309. Best Time to Buy and Sell Stock with Cooldown

week 19

The article was initially posted on 2018-01-11. Description Best Time to Buy and Sell Stock with Cooldown - LeetCode Say you have an array for which the \(i^{th}\) element is the price o...


LeetCode: 714. Best Time to Buy and Sell Stock with Transaction Fee

week 18

The article was initially posted on 2018-01-04. Description Best Time to Buy and Sell Stock with Transaction Fee - LeetCode Your are given an array of integers prices, for which the i-th...