博客地址:http://home.cnblogs.com/u/zengjianrong/
摘要: https://mp.weixin.qq.com/s?__biz=MzAwMDUwNDgxOA==&mid=2652663676&idx=1&sn=b18ab57322594ebb8e7072e635e8bd1c&chksm=810f29e1b678a0f7238e8a71fd88f14c3c71e 阅读全文
posted @ 2019-08-01 02:02 black_man 阅读(907) 评论(0) 推荐(0) 编辑
摘要: 查看库的源安装包 dpkg -S /usr/lib/libz.so 查看安装包的信息 apt-cache show zlib1g-dev 查看安装包的详细信息 dpkg -L zlib1g-dev 阅读全文
posted @ 2024-05-08 19:47 black_man 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #define PRINT_MACRO_HELPER(x) #x #define PRINT_MACRO(x) #x"="PRINT_MACRO_HELPER(x) #pragma message(PRINT_MACRO(VERSION_NUM)) #if (VERSION_NUM < 202309 阅读全文
posted @ 2024-05-07 11:24 black_man 阅读(1) 评论(0) 推荐(0) 编辑
摘要: AttributeError: module ‘collections‘ has no attribute ‘Mapping‘ 将collections替换为collections.abc即可 比如 from collections import Mapping # 替换为 from collect 阅读全文
posted @ 2024-03-07 20:31 black_man 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 最小用例:https://github.com/google/benchmark?tab=readme-ov-file#usage 排除干扰:https://github.com/google/benchmark/blob/main/docs/reducing_variance.md 1. benm 阅读全文
posted @ 2024-03-05 15:37 black_man 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1. 优雅地实现单例模板,见::cereal::detail::StaticObject; 对比apollo的单例:https://zhuanlan.zhihu.com/p/391151328 2. 静态初始化,见CEREAL_CLASS_VERSION; 3. 静态类对象避免重定义,见::cere 阅读全文
posted @ 2023-06-08 10:52 black_man 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 查看安装包版本信息:python3 -m pip freeze 安装:python3 -m pip install xxx 卸载:python3 -m pip uninstall xxx 更新:python3 -m pip install --upgrade pip setuptools wheel 阅读全文
posted @ 2023-05-31 16:14 black_man 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 为了解决优先级反转,通常会给锁配置相关属性。 但,当锁的相关线程们,均配置的是CFS+同个nice时,由于vruntime大小差异导致的优先级反转,是否还能通过锁的配置属性生效? PTHREAD_PRIO_PROTECT + pthread_mutex_setprioceiling 此时应该只能通过 阅读全文
posted @ 2023-05-12 11:43 black_man 阅读(9) 评论(0) 推荐(0) 编辑
摘要: enable_shared_from_this:让类成员函数可获得自身的shared ptr封装,通过shared_from_this/weak_from_this API; 注意:调用shared_from_this的前提是此对象本身就是shared_ptr封装的类型,可通过将构造函数设置为私有、 阅读全文
posted @ 2023-04-04 18:53 black_man 阅读(20) 评论(0) 推荐(0) 编辑
摘要: https://godbolt.org/ 可在线编译执行,选择不同体系架构、不同版本的编译器; 可用于简单的验证编译器问题,比如优化选项带来的变化等。 编译加速:cmake UNITY_BUILD https://zhuanlan.zhihu.com/p/146434531 阅读全文
posted @ 2023-03-29 17:47 black_man 阅读(16) 评论(0) 推荐(0) 编辑
摘要: CMake梳理依赖关系 梳理依赖关系的方法,通常是在cmake命令中追加参数graphviz,如cmake .. --graphviz=../target_deps_graphviz,用来生成每个目标的依赖dot文件,再结合dot命令,如dot -Tpng -o target.png ./targe 阅读全文
posted @ 2022-12-28 16:27 black_man 阅读(52) 评论(0) 推荐(0) 编辑