Terminal

Starship brew install starship add eval "$(starship init zsh)" to .zshrc mkdir -p ~/.config && touch ~/.config/starship.toml 默认配置 # 设置配置范例,开启编辑器的自动补全 "$schema" = 'https://starship.rs/config-schema.json' # 在命令之间插入空行 add_newline = false # ~/.config/starship.toml # A minimal left prompt format = """$character""" # move the rest of...

February 10, 2023 · 1 min · 247 words · Lucius Chen

VSCode

Extensions ESLint Markdown All in One Markdown Preview Github MoonScript Language One Dark Pro Prettier - Code formatter Settings { "editor.fontFamily": "'Iosevka', LXGW WenKai Mono, Menlo, Monaco, 'Courier New', monospace", "editor.fontLigatures": true, "editor.fontSize": 14, "security.workspace.trust.untrustedFiles": "open", "editor.bracketPairColorization.enabled": true, "editor.renderWhitespace": "boundary", "workbench.colorCustomizations": { "editorBracketHighlight.foreground1": "#EFBB24", "editorBracketHighlight.foreground2": "#F8C3CD", "editorBracketHighlight.foreground3": "#A5DEE4", "editorBracketHighlight.foreground4": "#8A6BBE", "editorBracketHighlight.foreground5": "#90B44B", "editorBracketHighlight.foreground6": "#FFB11B", "editorBracketHighlight.unexpectedBracket.foreground": "#E83015", "tab.activeBackground": "#724832", "scrollbarSlider.background": "#91AD70", "scrollbarSlider.hoverBackground": "#91AD70", "scrollbarSlider.activeBackground": "#91AD70" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[html]": { "editor....

February 10, 2023 · 1 min · 98 words · Lucius Chen

Latex

语法 效果 \bar{x} \(\bar{x}\) \grave{\eta} \(\grave{\eta}\) \dot{x} \(\dot{x}\) \acute{\eta} \(\acute{\eta}\) \breve{a} \(\breve{a}\) \hat{\alpha} \(\hat{\alpha}\) \check{\alpha} \(\check{\alpha}\) \ddot{y} \(\ddot{y}\) \tilde{\iota} \(\tilde{\iota}\) 语法 效果 \sin\theta \(\sin\!\theta\) \arcsin\frac{L}{r} \(\arcsin\frac{L}{r}\) \sinh g \(\sinh\ g\) \operatorname{sh}j \(\operatorname{sh}j\) \operatorname{argch}l \(\operatorname{argch}l\) k'(x)=\lim_{\Delta x\to 0}\frac{k(x)-k(x-\Delta x)}{\Deltax} \(k’(x)=\lim_{\Delta x\to0}\!\frac{k(x)-k(x-\Delta x)}{\Delta x}\) \max H \(\max\!H\) \sup t \(\sup t\) \lg X \(\lg\!X\) \ker x \(\ker x\) \Pr x \(\Pr x\) \arg x \(\arg x\) \lceil\frac{n+1}{2}\rceil \(\lceil\frac{n+1}{2}\rceil\)...

February 10, 2023 · 1 min · 307 words · Lucius Chen

Callback Hell

重构小程序前端校验接口返参处理 原本代码是通过嵌套回调,控制提示之间的前后依赖关系,形成了回调地狱,需要重构。 主要是用 Map (ES6+) 处理 if (code){} else if (cod...

February 10, 2023 · 6 min · 2683 words · Lucius Chen

Quorum

Quorum 机制,是一种分布式系统中常用的,用来保证数据冗余和最终一致性的投票算法,其主要数学思想来源于鸽巢原理。 基于 Quorum 投票的冗余控制算法 在有冗余数据...

February 10, 2023 · 2 min · 809 words · Lucius Chen

Stub

在开发过程中,stub 很多时候就是针对不可控制的部分进行模拟,例如 Mock。 在分布式中,stub 就是用于转换远程过程调用(RPC)期间客户端...

February 10, 2023 · 1 min · 86 words · Lucius Chen

Remote Procedure Call (RPC)

Remote Procedure Call 是一种=软件通信协议=,程序可以在不了解网络细节的前提下,向位于网络上的另外一台计算机中的本地程序请求服务。PRC 被用来像本地系统一样...

February 10, 2023 · 2 min · 629 words · Lucius Chen

Network Time Protocol (NTP)

Network Time Protocol (NTP) is an internet protocol used to synchronize with computer clock time sources in a network. It belongs to and is one of the oldest parts of the TCP/IP suite. The term NTP applies to both the protocol and the client-server programs that run on computers. Mac 中可以在设置中找到 NTP 服务器的地址,比如下...

February 10, 2023 · 2 min · 513 words · Lucius Chen

The Byzantine generals problem

拜占庭将军问题(Byzantine Generals Problem),是由莱斯利·兰波特在其同名论文中提出的分布式对等网络通信容错问题。 在分布式计算中,不同...

February 10, 2023 · 1 min · 240 words · Lucius Chen

Database

Index MVCC Troubleshoot Issues in MySQL

February 10, 2023 · 1 min · 6 words · Lucius Chen