会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
miyanyan
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
下一页
2022年10月17日
python DLL load failed while importing ...
摘要: 这个报错是加载动态库失败,解决它分三步走 检查这个dll是否存在,且是否在搜索目录下(搜索目录一般是 当前目录 + 系统目录 + 程序内通过sys.path.append添加的) 如果dll存在,则检查dll的依赖,这里python并没有告诉我们缺少哪个依赖,有点坑== 可通过Dependencie
阅读全文
posted @ 2022-10-17 13:21 miyanyan
阅读(1008)
评论(0)
推荐(0)
2022年10月13日
c++ dynamic_cast 实现原理
摘要: 算法 参考Itanium C++ ABI 前置知识 vtable、vptr 可以参考c++中虚析构函数如何实现多态的、内存布局如何? RTTI layout 每个vtable都应包含 当前vptr与源对象vptr的偏移量,其地址为 :vptr - 2个字 每个vtable都应包含 继承类的std::
阅读全文
posted @ 2022-10-13 17:49 miyanyan
阅读(1200)
评论(0)
推荐(0)
2022年9月22日
pybind11使用(3) 使用stl容器
摘要: 假设c++侧读到的数据是一个结构体, 定义如下: struct AirwayData { int uavId; int routeId; std::vector<int> longitude; std::vector<int> latitude; std::vector<float> altitud
阅读全文
posted @ 2022-09-22 15:35 miyanyan
阅读(351)
评论(0)
推荐(0)
2022年9月1日
pybind11使用(2) 编写C++类并导出为pyd
摘要: 导出的坑 1.dynamic module does not define module export function 这是由于导出的包名不一致导致的,需要保证 cmake的project名称 project ("haha" LANGUAGES CXX) # <-- haha find_packa
阅读全文
posted @ 2022-09-01 16:36 miyanyan
阅读(969)
评论(0)
推荐(0)
pybind11使用(1) cmake + vcpkg 环境配置以及一些坑
摘要: 看似简单的配置流程 安装 : vcpkg install pybind11 编写 cmake find_package(pybind11 REQUIRED) pybind11_add_module(${PROJECT_NAME} src/main.cpp) 问题随之而来 1.[build] LINK
阅读全文
posted @ 2022-09-01 16:18 miyanyan
阅读(1435)
评论(0)
推荐(0)
2022年8月30日
OpenGL 4.5+ 的 VAO、VBO、IBO写法
摘要: 写法 opengl4.5新增了DSA(direct_state_access), 可以不用glBindBuffer()和glBindVertexArray()直接设置好VAO、VBO、IBO, 只需要draw之前bind即可 新旧函数对比(左侧为新函数) glCreateBuffers = glGe
阅读全文
posted @ 2022-08-30 11:08 miyanyan
阅读(456)
评论(0)
推荐(0)
2022年7月12日
树上问题
摘要: 树的直径 树上任意两节点之间最长的简单路径即为树的「直径」 当以某个节点为根时,从这个节点出发,会得到最长路径d1和次长路径d2,则以该节点为根的最长路径为d1 + d2 // 已知树边关系 : vector<vector<int>> graph(n) int maxLen = 0; functio
阅读全文
posted @ 2022-07-12 15:32 miyanyan
阅读(31)
评论(0)
推荐(0)
2022年6月7日
C++ unordered_map 与 自定义结构体
摘要: 1. unordered_map 的 operator[] 需要自定义结构体有默认构造函数 比如下面程序会报异常 struct Node { int left, right; // [left, right] int value; int lazy; Node(int l, int r) : lef
阅读全文
posted @ 2022-06-07 15:41 miyanyan
阅读(641)
评论(0)
推荐(0)
2022年5月26日
珂朵莉树与动态开点线段树
摘要: LeetCode699. 掉落的方块 珂朵莉树 class ChthollyTree { public: struct ChthollyNode { int left, right; mutable int value; // 可以直接在set里更改 ChthollyNode(int l, int
阅读全文
posted @ 2022-05-26 10:38 miyanyan
阅读(51)
评论(0)
推荐(0)
2022年5月24日
子数组的最小值的贡献
摘要: LeetCode907 非常经典的一道题,思想也很经典,核心点在于预处理出当前点为最小值时的辐射范围 int n = nums.size(); vector<int> left(n, -1); vector<int> right(n, n); // 维护递增栈 stack<int> stackUp;
阅读全文
posted @ 2022-05-24 21:58 miyanyan
阅读(34)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
下一页
公告