摘要: ``` git bisect start ``` 当前 commit 包含 bug ``` git bisect bad ``` 找到不含 bug 的 commit ``` git bisect good xxx ``` 会自动回滚到中间的 commit 如果还有 bug ``` git bisec 阅读全文
posted @ 2023-07-21 13:59 consolexinhun 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 运行镜像 docker run -it -p 宿主机端口:容器端口 --name=容器名字 镜像id --restart=always 容器打包为镜像 docker commit 容器id 镜像名字 docker commit 57bacd929826 consolexin/ubuntu:2.2 镜 阅读全文
posted @ 2022-07-28 12:50 consolexinhun 阅读(65) 评论(0) 推荐(0) 编辑
摘要: https://launchpad.net/ubuntu/+cdmirrors 南大的下载比较快 阅读全文
posted @ 2022-06-23 11:02 consolexinhun 阅读(29) 评论(0) 推荐(0) 编辑
摘要: apt install open-vm-tools 阅读全文
posted @ 2022-06-23 10:51 consolexinhun 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 中缀转逆波兰 用一个栈装操作符 1、遇到数字就输出 2、遇到操作符,如果栈空直接放入,如果左括号直接放入,如果是右括号,输出并弹出栈顶直到遇到左括号,再把左括号弹出(不用输出), 如果是四则运算符,如果当前比栈顶优先级高,直接放入,否则输出并弹出所有优先级大于等于当前运算符的,再放入当前运算符。 最 阅读全文
posted @ 2022-01-11 09:50 consolexinhun 阅读(35) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; /** * typeid 识别基类指针所指的实际对象,并进行不同的成员函数调用 * */ class B { int x; public: virtual void f() { printf(" B f\n") 阅读全文
posted @ 2021-12-28 13:30 consolexinhun 阅读(46) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; /** * 基类指针操作派生类对象时,只能访问虚函数,新增成员无法访问 * */ class B { int x; public: B(int i) { x = i; } int getx() { return 阅读全文
posted @ 2021-12-27 23:41 consolexinhun 阅读(88) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; /** * dynamic_cast 强制类型转换,派生类对象指针转为基类对象指针 * */ class Base { public: virtual ~Base() { } }; class D :publi 阅读全文
posted @ 2021-12-27 21:56 consolexinhun 阅读(138) 评论(0) 推荐(0) 编辑
摘要: [a, b) 之内的随机整数 (rand() % (b-a)) + a [a, b] 之间的随机整数 (rand() % (b-a+1)) + a 阅读全文
posted @ 2021-11-01 23:51 consolexinhun 阅读(58) 评论(0) 推荐(0) 编辑
摘要: SCP 指定端口 scp -P ${port} xxx.tar.gz ${username}@${server ip}:/home/ubuntu SSH 端口 ssh ubuntu@xxx -p ${port} 阅读全文
posted @ 2021-10-26 21:03 consolexinhun 阅读(99) 评论(0) 推荐(0) 编辑