- 博客(16)
- 收藏
- 关注
原创 [C++][Demo]Thai substr
文章目录Demo CodeDemo ResultSummary Demo Code #include <iostream> #include <stdio.h> #include <string.h> #include <stdint.h> using namespace std; bool is_thai_main_utf8(const char* src) { uint8_t ch_1 = static_cast<uint8_t>(sr
2021-01-27 11:37:35
348
原创 [C++][Test]中文字符及提取指定数量字符
文章目录Test CodeTest ResultSummary Test Code #include <iostream> #include <tchar.h> /* _tprintf */ #define TEST 3 #if TEST == 1 #pragma execution_character_set("GBK") int main() { unsigned char buff[] = "壹贰叁肆伍陆柒捌玖十百千万"; printf("%s\n", buff
2020-07-31 18:10:50
445
原创 [C++][Demo]当前时间
文章目录Demo CodeDemo ResultSummary Demo Code #include <stdint.h> #define UTIL_TIME_WAY 1 typedef uint16_t Type_Year; typedef uint8_t Type_Month; typedef uint8_t Type_Day; typedef uint8_t Type_Hour; typedef uint8_t Type_Minute; typedef uint8_t Ty
2020-05-29 10:36:07
294
原创 [C++][Test]vector拷贝及函数参数传递中拷贝问题
文章目录Test CodeTest ResultSummary Test Code #include <iostream> #include <vector> class Element { public: Element() { std::cout << "Element constructor" << std::endl; } ~Element() { std::cout << "Ele
2020-05-26 17:10:46
446
原创 [C++][Demo]使用sort进行排序
文章目录Demo CodeDemo ResultSummary Demo Code #include <vector> #include <algorithm> #include <iostream> using namespace std; struct Data{ int a; int b; char c[10]; Data(){ a = ...
2020-04-15 17:49:54
187
原创 [C++][Demo]unique_ptr进行内存的转移(附内存检测)
文章目录Demo CodeDemo ResultSummary Demo Code #include "stdlib.h" #include <crtdbg.h> #include <stdint.h> #include <iostream> #include <memory> using namespace std; static int32_...
2020-04-15 17:23:25
478
原创 [C][Test]double float -> int转换
文章目录Test CodeTest Resultdoublefloatfloat + fSummary Test Code #ifndef _C_TEST_H_ #define _C_TEST_H_ #if 0 #define TEST_TYPE double #else #define TEST_TYPE float #endif void test1(void){ TEST_TYPE d...
2020-04-14 18:36:30
144
原创 [Python][Demo]Html文件备份
文章目录Demo CodeDemo ResultSummary Demo Code import urllib.request import re from bs4 import BeautifulSoup def getHtml(url): request = urllib.request.Request(url) response = urllib.request.urlop...
2020-04-08 17:25:11
206
原创 [Knowledge Tree]
Knowledge TreeSmart WorkDesign patternC knowledegC plus plus knowledegC plus plus demoUseful learning website Smart Work Plantuml VsCode Sequence Diagram Snippets Setting. Design pattern [C++][Demo]桥接...
2020-04-08 14:36:42
390
原创 [C][Test]返回临时变量指针的函数
文章目录Test CodeTest ResultSummaryRefactorTips Test Code char* getString(void){ char str[] = "123456"; printf("Str in getString addr:[%x] str[%c]\n", str, str[1]); return str; } char* getString_sec...
2020-04-08 10:46:09
567
原创 [C][Test]函数数组及其sizeof
文章目录Test CodeTest ResultSummary Test Code #include <stdio.h> void funca(void){ printf("%s\n", __FUNCTION__); } void funcb(void){ printf("%s\n", __FUNCTION__); } void funcc(void){ printf("%...
2020-04-03 11:36:02
224
原创 [C++][Demo]桥接模式
文章目录Demo CodeDemo ResultSummary Demo Code #if 0 class Color{ public: string m_name; }; class Black : public Color{ public: Black(){ m_name = "Black"; } }; class White : public Color{ public: W...
2020-04-02 17:19:37
140
原创 [C++][Test]函数名 数组名 &
1 Windows 1 shift + Tab 左移tab 2 Microsoft Visual Studio 1 ctrl + K + F 自动调整格式 2 F12 查找跳转 3 shift + Tab键 删除光标右侧一个Tab空格 4 ctrl + K + C 注释 5 ctrl + K + U 取消注释 ...
2020-04-02 14:39:35
575
原创 [C++][Demo]Date类及移位操作符重载
文章目录Sample代码演示结果思考整理 Sample代码 class Date{ public: class Year{ public: Year(){ y = 1900; } uint16_t y; bool isLeapYear(){ return ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)...
2020-04-02 14:37:32
255
原创 [C++][Demo]适配器模式
文章目录Demo CodeDemo ResultSummary Demo Code #include "stdint.h" #include <iostream> using namespace std; #include "util.h" class ReadShm_LibA{ public: uint8_t read(string _name){ cout <<...
2020-04-02 14:37:12
163
原创 Plantuml VsCode Sequence Diagram Snippets Setting
关于使用Plantuml + VsCode进行时序图绘制,可以使用VsCode Snippet功能,如下是本人编写的部分设置: { // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add...
2020-03-26 10:18:58
1133
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅