C++ mutex std::mutexSince C++ 11 1#include <mutex> 12mutex(const mutex&) = delete; // copy constructormutex& operator=(const mutex&) = delete; // copy operator 最基本的互斥锁。默认 unlock 2024-05-09 cpp #CPP
Prototype Pattern 简化对象的创建过程。 12345678910// prototypeclass Animal{public: Animal() = default; virtual ~Animal() = default; virtual Animal *clone() = 0; virtual void play() = 0;}; 1234567891011121 2023-12-10 design pattern #CPP #DesignPattern
Mediator Pattern 聊天服务器与用户之间的关系,一个用户向另一个用户发送的消息由聊天服务器执行,用户不关注发送细节。 123456789101112131415161718192021222324252627282930313233343536// Mediatorclass User;class Mediator{public: Mediator() = default; virtual ~M 2023-12-09 design pattern #CPP #DesignPattern
Observer Pattern 公众号与订阅者之间的关系,一对多。 123456789101112131415161718192021222324// Observerclass Observer{public: Observer() = default; virtual ~Observer() = default; virtual void update(const char *msg) = 0;& 2023-12-09 design pattern #CPP #DesignPattern
Google Performance Tools 安装1sudo apt install google-perftools libgoogle-perftools-dev 使用#include <gperftools/profiler.h>-lprofiler 123456789#include <gperftools/profiler.h>int fun(){ ProfilerStart("x 2023-12-04 tools #Tool
PlantUML VS Code + PlantUML 环境配置 安装 graphviz 安装 JDK,配置 JAVA 环境,安装好 JDK 后,记得添加环境变量; 在 VS Code 中新建以.plantuml为文件名后缀的文件,语法见官网说明文档。 1sudo apt install graphviz openjdk-11-jdk Reference 使用 Sublime + PlantUML 高效地画图 2023-03-12 tools #Tool
Visual Studio Code 简介https://code.visualstudio.com 安装配置通用下载链接: 12https://vscode.cdn.azure.cn/stable/{ID}/vscode-server-linux-x64.tar.gzhttps://vscode.cdn.azure.cn/stable/{ID}/VSCodeUserSetup-x64-1. 2023-03-12 tools #Tool
tar Overview123tar --help # helptar -xzf aaa.tar.gz # extracttar -czf aaa.tar.gz aaa # compress Reference How to Compress and Extract Files Using the tar Command on Linux 2023-03-01 tools #Tool #Linux
zip Overview1234567sudo apt install zip unzipsudo yum install zip unzipzip aaa bbb # compressunzip aaa.zip # extractunzip xxx.zip -d xxx # 解压文件到指定目录unzip -o xxx.zip -d xxx # 覆盖已存在的文件 Reference How to Zip 2023-03-01 tools #Tool #Linux
lipo 概述12345678# 详情lipo -info XXXXlipo -archs XXXX# 拆分lipo XXXX.framework/XXXX -thin armv7 -output XXXX_armv7lipo XXXX.framework/XXXX -thin arm64 -output XXXX_arm64# 合并lipo -create XXXX_armv7 XXXX_arm64 -o 2022-12-16 macos #Tool #MacOS