Cpp
cpp: Prototype Pattern
// Gold.h : 此文件包含 "Gold" 类。原型模式 Prototype Pattern C++ 14 // 2023年5月1日 涂聚文 Geovin Du Visual Studio 2022 edit. #pragma once #ifndef GOLD_H #define GOLD_ ......
cpp: Abstract Factory Pattern
// Gold.h : 此文件包含 "Gold" 类。Abstract Factory Pattern C++ 14 // 2023年4月30日 涂聚文 Geovin Du Visual Studio 2022 edit. #pragma once #ifndef GOLD_H #define GO ......
cpp multi thread std::lock_guard,mutex
#include <atomic> #include <chrono> #include <cmath> #include <condition_variable> #include <ctime> #include <fstream> #include <functional> #include ......
cpp multi thread sync via std::atomic<bool>
#include <atomic> #include <chrono> #include <cmath> #include <condition_variable> #include <ctime> #include <fstream> #include <functional> #include ......
cpp: Simple Factory Pattern
// Monster.h : 此文件包含 "Monster" 类。Abstract Factory Pattern C++ 14 // 2023年4月29日 涂聚文 Geovin Du Visual Studio 2022 edit. #pragma once #ifndef MONSTER_H # ......
cpp: Template Mothod Pattern
文章来源《C++新经典设计模式》 王健伟编著 清华大学出版社 // TemplateMethonPattern.h : 此文件包含 "TemplateMethonPattern" 类。Template Mothod Pattern C++ 14 // 2023年4月29日 涂聚文 Geovin Du ......
cpp future,get,sleep_for,third variable
#include <chrono> #include <condition_variable> #include <ctime> #include <fstream> #include <future> #include <iomanip> #include <iostream> #include ......
ReadAlignChunk_processChunks.cpp:204:processChunks EXITING because of FATAL ERROR in input reads: wrong read ID line format
001、 star报错 002、解决方法 fastq文件为压缩格式,运行时需添加该参数: --readFilesCommand zcat ......
【CPP】自定义排序--针对智能指针
代码块 #include <iostream> #include <memory> #include <vector> #include <algorithm> using namespace std; class Base { public: virtual void Print() { std: ......
pta__【CPP0025】以点类Point及平面图形类Plane为基础设计圆类Circle
#include <iostream>using namespace std;//点类Pointclass Point{private: double x; double y;public: Point(double xv=0,double yv=0);/*构造函数*/ Point(const Po ......
Cpp学习
C++学习 数组 方便存放同类型的元素 一维数组 一维数组数组名代表数组的首地址 一维数组名可以计算出数组在内存空间所占内存大小 二维数组 二维数组名代表二维数组的首地址,也可以查看某行的首地址 二维数组可以计算出数组在内存空间所占内存大小,也可以计算出某行所占内存大小 指针 作用:保存地址 指针的 ......
4/25 cpp模板
template<class T> class myarr { int capacity; int size; T* arr; public: myarr(int a) { arr = new T[a]; size = 0; capacity = a; } myarr(myarr<T>& a) { ......
cpp: 因控制台65001,936 中文输入问题
// ConsoleTextFileDemoApp.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 //geovindu,Geovin Du 涂聚文 #define _UNICODE #define _CRT_SECURE_NO_WARNINGS #include <ios ......
Tars-Cpp 协程实现分析
作者:vivo 互联网服务器团队- Ye Feng 本文介绍了协程的概念,并讨论了 Tars Cpp 协程的实现原理和源码分析。 一、前言 Tars 是 Linux 基金会的开源项目(https://github.com/TarsCloud),它是基于名字服务使用 Tars 协议的高性能 RPC 开 ......
cpp: read and write utf-8 text file
/*****************************************************************//** * \file geovindu.h * \brief 业务操作方法 * * \author geovindu,Geovin Du * \date 2023- ......
cpp: pointer
/*****************************************************************//** * \file geovindu.h * \brief 业务操作方法 * * \author geovindu,Geovin Du * \date 2023- ......
cpp: Ten Sort Algotrthms
// TenSortAlgorithms.h : 此文件包含 "TenSortAlgotrthms" 类。十个常用排序算法 C++ 11 // 2023年4月5日 涂聚文 Geovin Du edit. #ifndef TENSORTALGORITHMS_H #define TENSORTALGOR ......
cpp test for and while loop time cost respectively while std::chrono::high_resolution_clock
#include <chrono> #include <condition_variable> #include <ctime> #include <fstream> #include <future> #include <iomanip> #include <iostream> #include ......
cpp std::this_thread::sleep_for(std::chrono::seconds(sleep_seconds)) for thread execution duration
#include <chrono> #include <condition_variable> #include <ctime> #include <fstream> #include <future> #include <iomanip> #include <iostream> #include ......
cpp condition_variable wait_until unique_mutex time_out
#include <chrono> #include <condition_variable> #include <ctime> #include <fstream> #include <future> #include <iomanip> #include <iostream> #include ......
神必 cpp 语法合集
反向遍历 std::map 的时候删除迭代器 2023.4.19 decltype(mp)::iterator p = ++mp.erase(++it.base()); it = std::make_reverse_iterator(p); demo #include <bits/stdc++.h> ......
cpp常用积累——eigen、csv读取
1.matrixXd 与 vector<double> 的互转 vector<double> 转 matrixXd Eigen::MatrixXd Vec_xx = Eigen::Map<Eigen::MatrixXd>(new_x.data(), new_x.size(),1); vector<d ......
cpp:Double Dimensional Array using vector 2
// StudentArry.h : 此文件包含 "StudentArry" 类。学生数组成绩显示方法 C++ 14 // 2023年4月9日 涂聚文 Geovin Du edit. //(1)vec1.size() 就是”二维数组”的行数 //(2)vec1[0].size() 就是”二维数组”的 ......
cpp:Double Dimensional Array using vector
// StudentArry.cpp : //练习案例:学生数组成绩显示方法 StudentArry //案例描述:学生数组成绩显示方法 #include "StudentArry.h" #include <iostream> #include <string> #include <vector> ......
cpp: vector
// NarcissisticInfo.h : //练习案例:水仙花数 100 - 1000 NarcissisticNumber //案例描述:水仙花数是指一个 3 位数,它的每个位上的数字的 3次幂之和等于它本身 //例如:1 ^ 3 + 5 ^ 3 + 3 ^ 3 = 153 //请利用do. ......
cpp: read csv file
// CSVfilemanagement.h : //练习案例:CSV 文件读写 // // 2023年4月5日 涂聚文 Geovin Du edit. // https://www.digitalocean.com/community/tutorials/getline-in-c-plus-plu ......
cpp: Narcissistic in C++11
// NarcissisticList.h : //练习案例:水仙花数 100 - 1000 NarcissisticList //案例描述:水仙花数是指一个 3 位数,它的每个位上的数字的 3次幂之和等于它本身 //例如:1 ^ 3 + 5 ^ 3 + 3 ^ 3 = 153 //请利用do... ......
cpp: 九九乘法表显示
// CardinalDirection.h : //练习案例:九九乘法表位置 CardinalDirection //案例描述:九九乘法表位置 // //2023年4月5日 涂聚文 Geovin Du edit. // #pragma once #ifndef CARDINALDIRECTION_ ......