- 博客(680)
- 资源 (1)
- 收藏
- 关注
原创 dlopen failure: undefined symbol
今天遇到一个因为没有定义的符号导致 dlopen失败的问题。没有依赖lib1.so, 这或许是问题的原因。在 lib2.so里找不到 foo的定义。再执行 test,就没有刚才的那个问题了。foo 确实是 "U"
2024-09-26 23:47:29 221
原创 Make breakpoint pending on future shared library load
在使用GDB设置断点的时候,有时候会 GDBh 会提示 "Make breakpoint pending on future shared library load".一种情形是设置使用dlopen打开的动态库里的断点。下面通过一个例子说明。
2024-09-25 00:14:53 212
转载 LeetCode: 10. Regular Expression Matching
Given an input string and a pattern , implement regular expression matching with support for and where:The matching should cover the entire input string (not partial).Example 1:Input: s = "aa", p = "a"Output: falseExplanation: "a" does not match the
2024-09-22 10:12:32 54 1
原创 编译 python 3.12
因为系统预装的openssl 版本低,下载了一个新版本的openssl,然后在 configure 选项里指向安装的地址.。
2024-05-01 18:12:51 431
原创 正则表达式的资源
https://www.regular-expressions.info/index.htmlhttps://regex101.com/
2023-12-16 10:30:16 586
转载 Structured binding declaration (since C++17)
【代码】Structured binding declaration (since C++17)
2023-11-10 03:00:36 484
转载 How to enable/disable wayland on Ubuntu 22.04 Desktop
【代码】How to enable/disable wayland on Ubuntu 22.04 Desktop。
2023-10-28 00:04:01 469
原创 C++里的优先级队列
它是一个模板类:默认情况下是 max heap, 默认的比较函数是 std::less<T>.如果需要 min heap,或者是处理自定义的数据类型,需要提供定制的 比较函数。priority_queue 的实现使用了 std::make_heap, std::push_heap, std::pop_heap.
2023-07-31 00:14:35 205
转载 Find Matching Text and Replace the Next Line
Find Matching Text and Replace the Next Line
2023-04-05 23:03:56 161
转载 How to find Which Process Is Killing mysqld With SIGKILL or SIGTERM on Linux
linux signal
2022-08-24 08:42:18 288
转载 删除优先级队列的第k个元素
假定是最小堆。伪代码: 1, Delete a node from the array (this creates a "hole" and the tree is no longer "complete") 2. Replace the deletion node with the "fartest right node" on the lowest level of the Binary Tree (This step
2022-04-23 22:08:49 285
原创 Linux下怎么检查网线是否接上了
1. $ cat /sys/class/net/enp0s25/carrier11表示接上,0表示没接上。下面的命令表示网线状态是 UP还是DOWN:$ cat /sys/class/net/enp0s25/operstate upDown的话可以用命令 UP起来:ip link set dev eth1 up2.使用 ethtool$ ethtool enp0s25 | grep Link\ dCannot get wake-on-lan settings
2022-02-23 22:53:31 8444 2
转载 Opening a port on Linux
Before we learn about opening a port on Linux, let’s understand what network ports are. A port is a communication endpoint. Within an operating system, a port allows the data packets specific processes or network services.Typically, ports identify a spec
2022-02-23 22:30:59 363
原创 DJB Hash
unsigned long long hash( char *str){ unsigned long long hash = 5832; char c; while( (c = *str++) != '\0') { hash = (hash << 5) + hash + c; } return hash;}
2022-02-12 14:18:55 652
翻译 2D Transformations
1. 平移(translation)点 (x,y)平移到 (x',y'),经过的距离为 (tx, ty). 则x' = x + txy' = y + ty或者P' = P + T其中,2. 旋转(以坐标原点为中心喜转动角度 , 逆时针 大于0,顺时针 小于0假设点(x,y)绕原点逆时针转动 到(x',y'). 那么三角函数展开,最后可以得出:3. 绕任一点()旋转:3.1 平移点()到原点 T()3.2 旋转R(...
2022-01-13 08:32:40 500
原创 关于SIGBUS 信号
最近遇到一个程序因为收到 SIGBUS死机的问题。刚开始不清楚是哪个模块导致的,用 address sanitizer 也查不出来。后来想了一下,可以用gdb来执行程序,当收到了 BUS 消息的时候, gdb会自动在出问题的代码行停下来。下面是一个例子。// C program to demonstrate Bus Error#include <stdlib.h>#include <signal.h>#include <pthread.h>#incl
2022-01-09 23:46:42 4336
转载 Memory Layout of C++ Object in Different Scenarios
n this article, we will see the memory layout of different C++ Object. And how different storage & access specifiers affect this memory footprint. I am not going to discuss compiler augmented code, name mangling & working of any C++ mechanism relat
2021-10-21 22:19:59 176
原创 (C++)upcast的时候一定要用 dynamic_cast 吗?
如果是多继承,并且 upcast到不同的接口的时候,需要用dynamic_cast比如,下面的代码,第37行一定要用 dynamic_cast,因为它是从一个 基类接口转到另外一个基类借口。 1 class A 2 { 3 public: 4 virtual bool IsA(void) = 0; 5 protected: 6 int t_a; 7 }; 8 9 class B 10 { 11
2021-10-18 23:05:50 214
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人