常用正则表达式汇总(随时更新)

数字校验 数字 ^[0-9]*$ n位的数字: ^\d{n}$ 至少n位的数字: ^\d{n,}$ m-n位的数字: ^\d{m,n}$ 零和非零开头的数字: ^(0|[1-9][0-9]*)$ 非零开头的最多带两位小数的数字: ^([1-9][0-9]*)+(\.[0-9]{1,2})?$ 带1-2位小数的正数或负数: ^(\-)?\d+(\.\d{1,2})$ 正数、负数、和小数: ^(\-|\+)?\d+(\.\d+)?$ 有两位小数的正实数: ...

MFC笔记

CString转char* CString str = _T("中国"); USES_CONVERSION; char *p = T2A(str.GetBuffer(0)); str.ReleaseBuffer();

Qt实现弹窗设置默认选项倒计时自动选择

Qt自带弹窗没有自动倒计时 我自己写了一个 MessageBox.h #ifndef MESSAGEBOX_H #define MESSAGEBOX_H #include <QObject> #include <QMessageBox> #include <QTimer> class MessageBox : public QObject { Q_OBJECT public: enum eMessageBox { kYes = 0, // 左边的按钮 kNo = 1, // ...

资源 - 电子书 汇总

电子书汇总 c/c++ 注意 以上资源均来自网络 由vanxkr收集整理

[转] (╯#-_-)╯~~颜文字

小伙伴击掌/打招呼 ╭(●`∀´●)╯╰(●’◡’●)╮ (●’◡’●)ノ ヾ(*´▽‘*)ノ 手拉手╭(′▽`)╭(′▽`)╯ 好困呀(揉眼睛 ( ‘-ωก̀ ) 已阅留爪 (ฅ´ω`ฅ) 勾手指可萌啦 ( 。ớ ₃ờ)ھ 开心 ♪(^∀^●)ノシ (●´∀`)♪ 爱你么么哒 ( ˘ ³˘)♥ ( ˘ ³˘) •́ε•̀)ฅ (๑•́ ₃•̀๑٥) (๑ºั ³ ˘๑)♥ (๑ơ ₃ ơ)ﻌﻌﻌ♥ (ㆀ˘・з・˘)ε٩(๑> ₃ <)۶з 爱心眼 ( •́ .̫ •̀ ) ...

最大公约数GCD和最小公倍数LCM

int GetGcd(int a, int b) { int t = 0; while (b) { t = b; b = a % b; a = t; } return a; } int GetLcm(int a, int b){ return a / GetGcd(a, b) * b; // 先除中间值小效率高 }

leetcode 878.Nth Magical Number

class Solution { public: const double kRrmainder = 1000000007; int GetGcd(int a, int b) { int t = 0; while (b) { t = b; b = a % b; a = t; } return a; } int GetLcm(int a, int b){ return a / GetGcd(a, b) * b; } template<class T> T vanxkr_max(const ...

Sqlite3 笔记

建表 不存在则创建 CREATE TABLE IF NOT EXISTS table (...); 主键自增 id INTEGER PRIMARY KEY [AUTOINCREMENT] --AUTOINCREMENT加不加id都会自动增加 按照in语句顺序返回查询结果 SELECT * FROM example WHERE id IN('38','34','39','36','37') ORDER BY INSTR('38,34,39,36,37',id);

sql查询按照in语句的顺序返回结果

sqlite写法 SELECT * FROM example WHERE id IN('4','3','2','1') ORDER BY INSTR('4,3,2,1',id); mysql写法 SELECT * FROM example WHERE id IN(4,3,2,1) ORDER BY INSTR(',4,3,2,1,',CONCAT(',',id,',')); oracle写法 select name from example where id ...

C++单例模式

更新时间: 2019-01-10 13:14:20 更新时间: 2020-05-15 17:58:19 // singleton.h #ifndef SINGLETON_H #define SINGLETON_H #ifdef _MSC_BUILD #pragma execution_character_set("utf-8") // 编译时把程序里的字符串使用 UTF-8 进行处理 #endif #include <iostream> #include <mutex> class ...