编译原理
编译原理
阶段
1. 词法分析阶段
2. 语法分析阶段
3. 语义分析阶段
4. 中间代码生成阶段
5. 代码优化阶段
6. 目标代码生成阶段
7. 符号表管理
8. 出错处理
文法和有限自动机
0型文法
1型文法
2型文法
3型文法, 也叫正规式
自动机
FSA: Finite state automaton, 有限状态自动机
DFA: Deterministic Finite Automaton, 确定有限自动机, 但不同于不确定的有限自动机,DFA中不会有从同一状态出发的两条边标志有相同的符号
NFA: Non-deterministic Finite Automaton, 不确定有限自动机
状态为一个有向图
DFA的一个状态是NFA的一...
Node HTTP
Node HTTP
http: 为http协议的库
https: 为https协议的库
http2: 为http2协议的库
添加超时时间
options中:
timeout: 5000
request.on('timeout', () => {})
req.on('socket', function (socket) {
socket.setTimeout(myTimeout);
socket.on('timeout', function() {
req.abort();
});
});
setTimeout(req.abort.bind(req), 3000);
问题
Uncaught Exception: Error: sock...
Electron
Electron
npm install -g npm
npm install -g npm@6
"electronDownload":{
"mirror":"https://npm.taobao.org/mirrors/electron/"
},
源
npm config set registry https://npm.taobao.org/mirrors/node
npm config set disturl https://npm.taobao.org/mirrors/node
npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/
API使用
Webview
...
Regular Expression
Regular Expression
\b 单词边界, 单词就是\w组成的
Flag
i: With this flag the search is case-insensitive: no difference between A and a (see the example below).
g: With this flag the search looks for all matches, without it – only the first match is returned.
m: Multiline mode (covered in the chapter Multiline mode of anchors ^ $, flag “m”).
s: Enables “do...
macOS 查看应用的bundle identifier
macOS 查看应用的bundle identifier
osascript -e ‘id of app “Name of App”’
osascript -e ‘id of app “Microsoft Excel”’
单独设置应用的显示模式
defaults write com.oracle.workbench.MySQLWorkbench NSRequiresAquaSystemAppearance -bool yes
Reference
Easily see any app’s bundle identifier
468 post articles, 59 pages.