摘要: 首先在当前文件夹下安装pybind11。 然后编写以下3个文件: 1、CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(example LANGUAGES CXX) add_subdirectory(pybind11) pybind 阅读全文
posted @ 2024-05-07 17:17 南乡水 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 首先编写4个文件: 1、CMakeLists.txt内容: cmake_minimum_required(VERSION 3.15) project(Demo) include_directories(${PROJECT_BINARY_DIR}/headers) aux_source_directo 阅读全文
posted @ 2024-05-07 14:20 南乡水 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <memory> #include <thread> #include <vector> class Node { public: virtual void show() = 0; virtual bool hasFinished() { r 阅读全文
posted @ 2024-03-21 14:41 南乡水 阅读(5) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <unistd.h> int main(int argc, char *argv[]) { pid_t pid = fork(); if (pid > 0) { std::cout << "In parent process." << std 阅读全文
posted @ 2024-02-26 16:16 南乡水 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <thread> int main(int argc, char *argv[]) { std::thread t = std::thread([]() { std::cout << "Hello world!" << std::endl; 阅读全文
posted @ 2024-02-26 16:00 南乡水 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include <functional> #include <iostream> #include <unordered_map> void (*fp1)() = []() {}; void (*fp2)() = []() { std::cout << "In fp2" << std::endl; 阅读全文
posted @ 2023-11-29 11:48 南乡水 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 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 | 阅读全文
posted @ 2023-10-25 16:12 南乡水 阅读(31) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2023-05-10 14:06 南乡水 阅读(11) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2023-04-06 11:09 南乡水 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 生成本地公钥: ssh-keygen -t rsa -C "your_email_address" cd ~/.ssh cat id_rsa.pub 阅读全文
posted @ 2022-07-28 15:23 南乡水 阅读(60) 评论(0) 推荐(0) 编辑