会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Good artists copy, great artists steal
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
11
下一页
2026年2月5日
【vim】批量替换
摘要: visual模式选中,输入:,s/旧文本/新文本/g 批量替换
阅读全文
posted @ 2026-02-05 01:36 仰望星河Leon
阅读(6)
评论(0)
推荐(0)
2026年1月20日
【C++】通过宏在类中添加属性
摘要: #define ADDATTRIBUTE(type, fieldName, attrName)\ protected:\ type fieldName##_;\ public:\ void Set##attrName(type fieldName){ fieldName##_ = fieldName
阅读全文
posted @ 2026-01-20 00:04 仰望星河Leon
阅读(7)
评论(0)
推荐(0)
2026年1月19日
【raylib】绘制button
摘要: #include<iostream> #include<raylib.h> #include "Control/Button.hpp" int main() { //加载资源 Image img = LoadImage("./res/BingWallpaper.jpg"); InitAudioDev
阅读全文
posted @ 2026-01-19 16:56 仰望星河Leon
阅读(15)
评论(0)
推荐(0)
2026年1月18日
【qt】qt事件分发与处理机制
摘要: 14. qt事件处理机制 (0)事件分发处理流程 ┌─────────────────────────────────────────────────────────────┐ │ 事件产生 │ │ 1. 系统事件 (鼠标、键盘等) │ │ 2. 定时器事件 │ │ 3. 网络/IO事件 │ │ 4
阅读全文
posted @ 2026-01-18 00:15 仰望星河Leon
阅读(12)
评论(0)
推荐(0)
2025年12月3日
合并多段数据一次性writev
摘要: 如果有多段数据buffer需要发送,多个buffer拷贝到一个buffer,然后一次性发送,会存在数据拷贝的开销。比如: vector<char> buffer; buffer.insert(buffer.end(),buf1.begin(),buf1.end()); //buf1拷贝到buffer
阅读全文
posted @ 2025-12-03 15:32 仰望星河Leon
阅读(13)
评论(0)
推荐(0)
2025年10月19日
【C++】基于asio的异步https server
摘要: //跨平台异步http server #define _WIN32_WINNT 0x0A00 #include <iostream> #include <vector> #include <string> #include <ctime> //std::tm,std::strftime #inclu
阅读全文
posted @ 2025-10-19 03:09 仰望星河Leon
阅读(91)
评论(0)
推荐(0)
2025年9月7日
【git】git bisect排查出错提交
摘要: //排错(假设提交记录A和记录B之间有错误,记录A正确,记录B错误,但不知道是哪个提交出问题) git bisect bad B git bisect good A 重新编译、运行下看看正确与否。如果正确,输入:git bisect good 继续重新编译、运行下看看正确与否。若正确,输入:git
阅读全文
posted @ 2025-09-07 17:00 仰望星河Leon
阅读(36)
评论(0)
推荐(0)
2025年9月6日
【C++】字节对齐—alignof/alignas和#pragma pack(n)
摘要: 0. 为什么要字节对齐 (1)是什么? 每个变量(结构体的成员)都有“摆放要求”:“我必须放在 编号是 N 的倍数 的货架格子上。”。N 就是它的 对齐值 alignof(T)。 //字节自然对齐时 //int x 对齐到 4,放在 4~7: [ 第0排 ] [ 第1排 ] 0 1 2 3 | 4
阅读全文
posted @ 2025-09-06 12:14 仰望星河Leon
阅读(134)
评论(0)
推荐(0)
2025年8月30日
【C++】编译期if
摘要: 1. 背景 template<typename T> void foo(T t) { if (std::is_same_v<T,int>) { std::cout << "int\n"; } else if(std::is_same_v<T,double>) { std::cout <<"doubl
阅读全文
posted @ 2025-08-30 11:53 仰望星河Leon
阅读(23)
评论(0)
推荐(0)
2025年8月20日
【C++】profiler工具
摘要: 1. core+gdb 程序生产环境运行时若崩溃生成core文件,事后分析原因,查看core文件。对程序运行几乎无影响。 2. 内存调试工具valgrind 在开发环境下测试分析程序时,使用valgrind。严重拖慢程序运行。 https://zhuanlan.zhihu.com/p/1510181
阅读全文
posted @ 2025-08-20 15:40 仰望星河Leon
阅读(114)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
11
下一页
公告