会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
BlackSnow
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
16
下一页
2024年11月7日
关于libmodbus下TCP重复连接的问题
摘要: 首先创建一个连接 modbus_t *ctx = modbus_new_tcp("172.17.64.54", 9999); while (modbus_connect(ctx) == -1l) { std::cout << "Error: " << modbus_strerror(errno) <
阅读全文
posted @ 2024-11-07 11:01 BlackSnow
阅读(472)
评论(0)
推荐(0)
2024年10月18日
关于使用template 递归处理 处理任意个bitset<8>拼接
摘要: // 基本情况:没有更多的 bitset 需要拼接 template<typename... Args> std::bitset<8 * sizeof...(Args)> concatenate_bitsets() { return std::bitset<8 * sizeof...(Args)>(
阅读全文
posted @ 2024-10-18 19:28 BlackSnow
阅读(26)
评论(0)
推荐(0)
2024年10月10日
GoogleTest Guide 中文
摘要: 1.简介 GoogleTest是由Google开发的一个C++测试框架,支持Linux、Windows和macOS操作系统,使用Bazel或CMake构建工具。 项目主页:https://github.com/google/googletest 官方文档:https://google.github.
阅读全文
posted @ 2024-10-10 16:51 BlackSnow
阅读(1301)
评论(1)
推荐(1)
2024年9月25日
使用stringstream 以及bitset<8> 实现输出16进制数
摘要: 关于bitset的一些用法 强调std::vector<bool> 会被特化为bitset。 四个字节表示一个bool值回被 用一个bit位取代,因此会导致迭代器失效,所以进行状态压缩时应当考虑使用bitset容器。 bitset可以通过u_char进行初始化 1 u_char tmp = 'a';
阅读全文
posted @ 2024-09-25 16:34 BlackSnow
阅读(144)
评论(0)
推荐(0)
2024年9月19日
Qt Creator 关于#define 的问题
摘要: 编译器版本:Qt 5.15.2 MSVC2019 64bit 当使用此宏时 #define TRY_CATCH_BLOCK(code,returnValueExpr) \ try { \ code; \ }catch (const QException &e) {\ qDebug() << LOG_
阅读全文
posted @ 2024-09-19 11:16 BlackSnow
阅读(119)
评论(0)
推荐(0)
2024年8月31日
QUrl类
摘要: QUrl 类不持支在url中直接添加端口号 需要调用方法成员setPort,对其进行设定 //错误写法 QUrl url(QString("http://root:666666@"+IP+":"+QString::number(port)+"/RPC2")); //正确写法 QUrl url("ht
阅读全文
posted @ 2024-08-31 13:27 BlackSnow
阅读(20)
评论(0)
推荐(0)
2024年8月16日
QFuture与std::future 异步调用样例
摘要: 实现场景: 前端维护一个进度条,后端进行异步调用,查询状态。为防止用户界面被阻塞故采用异步操作调用。 std::future 可以理解为一个轻型Thread std::future 相对于QtConcurrent ,std::future不要求传入函数必须为static声明,这大大提高了灵活性。 参
阅读全文
posted @ 2024-08-16 13:51 BlackSnow
阅读(60)
评论(0)
推荐(0)
2024年8月13日
WSL安装Redis
摘要: 1.安装redis Powershell管理员执行 apt-get install redis 2.修改配置文件 修改配置的文件/etc/redis/redis.conf # 将下面这行注释掉 #bind 127.0.0.1 ::1 # 修改下面的配置为no protected-mode no 3.
阅读全文
posted @ 2024-08-13 16:48 BlackSnow
阅读(272)
评论(0)
推荐(0)
WSL下配置开发环境
摘要: 1.端口转发相关设置: 将Windows下的指定端口转发到WSL的指定端口 netsh interface portproxy add v4tov4 listenport=4000 listenaddress=0.0.0.0 connectport=4000 connectaddress=192.1
阅读全文
posted @ 2024-08-13 16:41 BlackSnow
阅读(78)
评论(0)
推荐(0)
2024年8月5日
10进制数转BCD码
摘要: void StringToBCD(const char* strSource, uint8_t byBCDTarget[8]) { // 初始化BCD数组 memset(byBCDTarget, 0, 8); // 计算输入字符串的长度 size_t length = strlen(strSourc
阅读全文
posted @ 2024-08-05 16:11 BlackSnow
阅读(168)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
16
下一页
公告