笔记
文章平均质量分 53
记录学习过程中的一些小知识。
咲之
空白
展开
-
python-时间戳/格式化时间互转
python-时间戳转格式化时间原创 2022-06-12 12:19:33 · 489 阅读 · 0 评论 -
python-csv文件数据处理
python-csv文件数据处理原创 2022-05-29 22:12:37 · 4268 阅读 · 0 评论 -
python-连接mysql查询数据
python-使用mysql查询数据原创 2022-05-27 00:54:09 · 1308 阅读 · 0 评论 -
python-离线安装protobuf
python-离线安装protobuf原创 2022-05-25 23:39:46 · 773 阅读 · 0 评论 -
python-Template字符串模板的使用
python-字符串模板使用原创 2022-05-25 22:49:21 · 3288 阅读 · 0 评论 -
c++ 计算程序耗时
惊喜存档。https://en.cppreference.com/w/cpp/chrono计算程序耗时时间。#include <iostream>#include <chrono> long fibonacci(unsigned n){ if (n < 2) return n; return fibonacci(n-1) + fibonacci(n-2);} int main(){ auto start = std::..原创 2022-05-24 00:29:37 · 347 阅读 · 0 评论 -
c++ protobuf中repeated类型使用——序列化
c++使用protobuf中的repeated与map类型原创 2022-05-19 23:28:41 · 12004 阅读 · 2 评论 -
C++ 插入排序与选择排序算法
插入排序算法、选择排序算法原创 2022-05-19 21:29:08 · 165 阅读 · 0 评论 -
轨道六根数
轨道六根数原创 2022-05-17 00:59:31 · 2908 阅读 · 0 评论 -
tomcat-设置允许跨域
tomcat-设置允许跨域原创 2022-05-15 10:48:36 · 512 阅读 · 0 评论 -
centos7-启动elasticsearch
centos7启动es原创 2022-05-12 00:22:08 · 1047 阅读 · 0 评论 -
centos7-启动nacos
centos下启动nacos原创 2022-05-11 00:59:35 · 2822 阅读 · 0 评论 -
centos7-启动kafka
centos下启动kafka原创 2022-05-11 00:14:22 · 1346 阅读 · 0 评论 -
centos7-启动tomcat
centos下tomcat安装与启动原创 2022-05-11 00:00:53 · 4128 阅读 · 0 评论 -
centos7-安装redis
centos中安装redis原创 2022-05-10 23:22:02 · 306 阅读 · 0 评论 -
c++ 从文件中读取多行数据
vector<string> GetList(string fileName){ vector<string> lists; string str; ifstream file(fileName + “.dat”); while(!file.eof()) { file >> str; lists.push_back(str); } file.close(); return lists;}原创 2020-07-24 17:47:17 · 884 阅读 · 0 评论 -
c++ 写文本到指定目录(接上篇)
void Log(string filePath, string fileName, string way, string content){ File *fp; if(0 != _access(filePath.c_str(),0)) { CreateDir(filePath); } string fullPath = filePath + “\\” + fileName; fopen_s(&fp, fullPath.c_str(), way.c_str());原创 2020-07-24 17:39:52 · 717 阅读 · 0 评论 -
c++ 创建多级目录
#include <io.h>#include <direct.h>void CreateDir(string filePath){ int m = 0, n; string shortPath; shortPath = filePath.substr(0, 2); filePath = filePath.substr(3, filePath.size()); while(m >= 0) { m = filePath.find(“\\”原创 2020-07-24 17:28:47 · 394 阅读 · 0 评论 -
c++ 设置dos窗口的前景色
设置dos窗口中字体颜色#include “windows.h”void color(short x){ if(x >= 0 && x <=15) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x); else SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY);}...原创 2020-07-24 17:05:14 · 249 阅读 · 0 评论 -
c++ 获取机器时间
用于记录时间string GetCurTime(){ time_t sysTime; tm localTime; time(&sysTime); localtime_s(&localTime,&sysTime); char buf[128]; snprintf(buf,sizeof(buf),”%04d-%02d-%02d_%02d%02d%02d”,localTime.tm_year + 1900,localTime.tm_mon + 1,localT原创 2020-07-24 16:57:06 · 651 阅读 · 0 评论 -
c++ protobuf中repeated类型使用——反序列化
定义proto大致如下:enum gender {unknown = 0;male = 1;female = 2;}message member {string name = 1;int32 age = 2;gender gender = 3;}mesage battle {repeated member team_a = 1;repeated member team_b = 2;string desc = 3;}声明一个battle类型变量,对接收到的数据反序列化后使原创 2020-07-24 16:27:45 · 3079 阅读 · 0 评论 -
c++ protobuffer中枚举使用
在proto中定义了枚举Times,结构大致如下:enum Times {once = 0;always = 1;}message INIT {Times setup = 1;...}在c++中使用枚举类型:INIT initData;initData.ParseFromArray(buf,size);switch(initData.setup()) {case once: break;case always: break;}...原创 2020-07-24 15:28:02 · 1439 阅读 · 2 评论