摘要:
#include <iostream> #include <memory> #include <thread> #include <vector> class Node { public: virtual void show() = 0; virtual bool hasFinished() { r 阅读全文
摘要:
#include <iostream> #include <unistd.h> int main(int argc, char *argv[]) { pid_t pid = fork(); if (pid > 0) { std::cout << "In parent process." << std 阅读全文
摘要:
#include <iostream> #include <thread> int main(int argc, char *argv[]) { std::thread t = std::thread([]() { std::cout << "Hello world!" << std::endl; 阅读全文
摘要:
#include <functional> #include <iostream> #include <unordered_map> void (*fp1)() = []() {}; void (*fp2)() = []() { std::cout << "In fp2" << std::endl; 阅读全文
摘要:
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --after="2023-12-07" --pretty=tformat: --numstat | 阅读全文
摘要:
#include <iostream> template <typename T> auto f1(const T& x) { std::cout << x << std::endl; }; auto f2 = [](const auto& x){ std::cout << x << std::en 阅读全文
摘要:
#include <ctime> #include <iostream> using namespace std; int main(int argc, char** argv) { int N = 500; int A[N][N]; int B[N][N]; double C1[N][N]; do 阅读全文
摘要:
生成本地公钥: ssh-keygen -t rsa -C "your_email_address" cd ~/.ssh cat id_rsa.pub 阅读全文
摘要:
一个如下形式的命令: $ cmd1 args1 | xargs cmd2 args2 相当于把 $ cmd1 args1 返回的结果放到 $ cmd2 args2 之后,作为参数传递给cmd2。 阅读全文
摘要:
创建一个Terminal窗口:Ctrl+Alt+t 窗口最大化:Ctrl+Win+↑ 窗口还原:Ctrl+Win+↓ 创建一个Tab:Ctrl+Shift+t 退出一个Tab:exit 另外一种常见的操作习惯是在Terminal的一个Tab内部,通过Tmux分屏。常见的快捷键如下: 启动tmux:t 阅读全文