Glog使用
This repository contains a C++ implementation of the Google logging module.
Glog源码下载访问Glog官网:https://github.com/google/glog。
Glog动态库调用demo加载动态库demo.c123456789101112131415161718192021222324252627282930313233343536373839404142434445464748typedef int (*FuncType_DtuDrvInit)(void* param);void* LoadDLL(const char* dllname) { void* ret = dlopen(dllname, RTLD_GLOBAL | RTLD_LAZY); const char* error = dlerror(); if (error) { printf("dlopen(%s) error(%s) \r\n", dllname, ...
同步链接GitLab和GitHub仓库
开发过程中将代码克隆在不同的平台上,方便备份与修改。
GitLab仓库备份到Github仓库添加Github个人访问令牌
Gitlab绑定镜像
注释公司的gitlab的host1打开C:\Windows\System32\drivers\etc,注释公司的hosts
C++ 工具API
记录工作实现的Tool API。
处理数据获取整形数字长度Api.cpp1234567891011121314/** * @brief Get a integer place. * @param [in] src_data Input integer. * @return The input integer place. */int Hj212Tool::GetIntLen(int src_data){ int leng = 0; while (src_data) { src_data /= 10; leng++; } return leng;}
转换CRC校验码为stringApi.cpp123456789101112131415161718/** * @brief Transfer ASCII d8e ====> ASCII 0d8e. * @param[out] *crc_string The string crc. */void Hj212Tool: ...
Boost正则、编码转换
正则正则是在字符串中匹配特殊需要字段的表示方法。基本语法参考。
Boost::regex使用Match字段这种方式是为了匹配字符字段是否跟你想要的正则表达式翻译的字段相同。
match.cpp123456789101112131415161718192021222324252627282930313233#include <boost/regex.hpp>#include <iostream>#include <string>using namespace::boost;using namespace::std;void test(void){ regex re("(https?://www.ttufo.com/.+/.+/.+)(_\\d+)(.html?)"); string target("http://www.ttufo.com/ufo/201705/154053_3.html"); // NOTE: cmatch is meaning char *, smatch is string ...
Boost::Steady_timer
Boost::Steady_timerSteady_timer是boost中提供异步的定时器,能在异步的情况下到定时的时间执行对应的操作。
简单的重复异步TimeTask.cpp12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879#include <iostream>#include <boost/asio.hpp>#include <boost/thread.hpp>#include <boost/asio/steady_timer.hpp>using namespace std;// How use boost::asio::steady_timer timing to run task.// Function task.void Print(const boost::system::err ...
C++的Jsoncpp和queue基本使用
记录在使用C++的过程中的一些代码实现。
C++二维数组解析Json对象数组(旧方法)JSON文件example.json123456789101112131415161718{"type":"HJ212-2017","cycle":60,"host":"192.168.101.114","port":5095,"mn":"12345678","st":"12","cn":"34","pw":"56","cp":[{"n":"abc","dt":"4N.0","ds":"LB33","len":1,& ...
海的女儿
我的心中有一个关于自己的爱情和追寻生命的故事框架,我相信一定可以写完这个故事。
简介海的女儿一艘神秘的大船来到一座岛上,从船上下来一个女孩,女孩叫蓝。羽看到蓝的第一眼时就喜欢上了这个女孩,蓝在岛上生活了一年,这一年是羽最开心的时光。蓝很喜欢在夕阳下捡贝壳,每当这个时候陪她捡贝壳的羽是最幸福的。蓝总是在捡贝壳的时候踩羽留在沙滩上的脚印,每当羽看到时总会泛起莫名的感觉,他不知道蓝是无意的还是有意的………有一天那艘神秘的大船回来了,蓝走了,留下羽,羽很痛苦,在哭泣与痛苦中羽不断的挣扎明白了生命明白了自己(海上的独自流浪,鲨鱼的威胁,海豚的协助,狂风暴雨的踩踏,澄澈的星辰),看到曾经在大海面前,自然面前的约定都画作细沙流逝的泡沫。许久后,他结婚生子,有了可爱的孩子和妻子,只是不知为何他忘不掉蓝,黑夜下,他独自坐在海边,看着泛着浪花的大海,抬头仰望着星空,仿佛看到了蓝一样。(曾经的游向大海,游得精疲力尽,最后还是无赖的放弃) ——————————献给在岁月时光里我一直都喜欢的女孩蓝(我的生命)
人物
1.程序员(带着镣 ...
如何在Vscode下搭建scheme学习环境
作为程序员是不应该带有偏见的人,因为我们是创造者,我们吸取好的,摒弃不好的,努力的站在他人的肩膀上,使用咒语展现魔法的魅力和力量,美丽这个世界。
搭建Scheme环境安装Vscode 官方网站https://code.visualstudio.com/,下载对应需要安装的平台的软件,本教程是的平台是Win10。安装Vscode中文插件Chinese (Simplified) Language Pack for Visual Studio Code,安装Scheme语法插件vscode-scheme,设置Vscode自带的颜色主题Ctrl+k Ctrl+t,选择Solarized Dark主题。
安装ChezScheme解释器下载解释器 访问官网https://www.scheme.com/,点击Chez Scheme Github project page,进入官网下载对应的版本,这里下载的是Win10的版本,默认安装路径。
设置环境变量 打开ChezScheme安装的路径C:\Progr ...
Cmake的使用
CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such a ...