会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
阿汤的博客
CnBlogs
Home
New Post
Contact
Admin
Subscription
2022年3月22日
Windows下使用VS2019静态编译Qt6.2.3源码
依赖项 cmake https://cmake.org/download/ 需要3.16版本以上 perl https://strawberryperl.com 下载后安装,保证命令行环境中可用 ninja https://github.com/ninja-build/ninja/releases
Read More
posted @ 2022-03-22 00:41 你好阿汤哥
Views(2433)
Comments(1)
Diggs(1)
2019年1月23日
lua coroutine
Lua中协程都放在表coroutine中。 Lua协程的四个状态 1. 挂起(suspended):一个协程被创建的时候,处于挂起状态,不会自动运行。 2. 运行(running):coroutine.resume()用于启动或者再次启动一个协程,使其变成运行状态。 3. 正常(normal):协程
Read More
posted @ 2019-01-23 17:28 你好阿汤哥
Views(654)
Comments(0)
Diggs(0)
2019年1月21日
lua for循环
在lua种,for语句有两种形式 数值型(numerical) 泛型(generic) 数值型for: 基本语法如下 在循环开始之前,每个表达式(exp1,exp2,exp3)都会执行一遍,循环开始后就不再执行。 输出: var是被for自动声明的局部变量,初始值为exp1,作用范围仅限于for循环
Read More
posted @ 2019-01-21 20:08 你好阿汤哥
Views(9214)
Comments(0)
Diggs(0)
2019年1月19日
leetcode 46. 全排列
题目描述:给定一个没有重复数字的序列,返回其所有可能的全排列。 示例: 思路:递归 假设数据规模为n(这里表示数组的长度) n = 1 :只有自身一种序列 n = 2 :1.第一种序列就是自身 2.两数交换位置,形成第二种序列 n = 3:为了缩小数据规模,可以拆分成1 + 2的情况。即:[1 +
Read More
posted @ 2019-01-19 17:13 你好阿汤哥
Views(223)
Comments(0)
Diggs(0)
2019年1月6日
sprintf、vsprintf、sprintf_s、vsprintf_s、_snprintf、_vsnprintf、snprintf、vsnprintf 函数辨析
看了题目中的几个函数名是不是有点头晕?为了防止以后总在这样的细节里纠缠不清,今天我们就来好好地辨析一下这几个函数的异同。 实验环境: Windows下使用VS2017Linux下使用gcc4.9.4 为了验证函数的安全性我们设计了如下结构 当我们把数据写到Data.buf字段中去的时候,如果发生了内
Read More
posted @ 2019-01-06 19:58 你好阿汤哥
Views(7638)
Comments(0)
Diggs(1)
2018年8月11日
rapidxml的常见读写操作
rapidxml官网地址:http://rapidxml.sourceforge.net/ rapidxml只包含4个hpp头文件,把这四个头文件放到项目中,即可使用rapidxml 生成的示例文件:
Read More
posted @ 2018-08-11 16:28 你好阿汤哥
Views(2400)
Comments(0)
Diggs(0)
2018年7月11日
C++11 可变参数模板构造string列表
#include #include #include #include template typename std::enable_if::value, std::string>::type to_string(const T & val) { return std::to_string(val); } template typename std::enable_if:...
Read More
posted @ 2018-07-11 17:23 你好阿汤哥
Views(1214)
Comments(0)
Diggs(0)
2018年6月25日
Fedora 28 设置yum代理
编辑 vi /etc/dnf/dnf.conf 文件 添加一行代理设置:proxy=http://****:****
Read More
posted @ 2018-06-25 10:52 你好阿汤哥
Views(865)
Comments(0)
Diggs(0)
2018年4月27日
Linux命令计算文件中某一列的平均值
例如每秒执行一次top命令,把结果输出到某个文件中保存,现在需要统计这段时间内某个进程的平均CPU占用率,可使用以下命令 输出结果:
Read More
posted @ 2018-04-27 21:20 你好阿汤哥
Views(5921)
Comments(0)
Diggs(0)
2018年4月14日
从数组中删除奇数元素
输出结果:
Read More
posted @ 2018-04-14 15:03 你好阿汤哥
Views(2516)
Comments(0)
Diggs(0)
下一页
公告