
c++
8BitCat
爱生活,积极向上,喜欢钻研。
展开
-
c++ 随机分布
uniform_distribution 模板定义了可以产生随机浮点值的分布对象类型,默认是 double 类型。默认构造函数创建的是标准正态分布,因此期望是 0,方差是 1.0:normal_distribution<double> disX(0, 1.0);uniform_real_distribution 类模板定义了一个默认返回 double 型浮点值的连续分布。可以按如下方式生成一个返回值在范围 [0,10) 内的分布对象:uniform_real_distribution原创 2020-12-21 10:05:18 · 575 阅读 · 0 评论 -
txt记录位置 c++,python显示位置
///////////////////////////////////c++ 写/////////////////////////////////////////////////////////////////////////////////////////////std::ofstream lane_postion_log(ROOT_DIR"/build/lane_position_log.txt");//创建文件lane_postion_log <<p.x<<","<原创 2020-12-17 08:56:26 · 205 阅读 · 0 评论 -
常用函数
c++:sprintf(img_file, "%s%s%d.%s", imgs_directory, imgs_filename, k, extension);原创 2020-05-23 09:52:28 · 264 阅读 · 0 评论 -
c++11/14新特性学习
1.__func__ 预定义表示符返回所在函数的名字#include<string>#include<iostream>using namespace std;const char* hello(){return __func__}int main(){ cout<<hello()<<endl;}打印结果:h...原创 2020-02-20 22:42:03 · 205 阅读 · 0 评论 -
gtest测试用例
google tf测试框架代码https://github.com/google/googletest/tree/2fe3bd994b3189899d93f1d5a881e725e046fdc2跑单个测试例./sgm-test --gtest_filter=WinnerTakesAllTest.RandomLeftNormal跑这个模块的所有测试例./sgm-tes...原创 2020-02-18 19:24:13 · 1251 阅读 · 0 评论 -
线程和std::shared_ptr智能指针使用
//定义线程指针std::unique_ptr<std::thread> thread_;//指向定义函数threadCapture_.reset(new std::thread([this]() { func(); }));#功能函数void func(){ while(1) { std::chr...原创 2020-01-09 18:13:44 · 1159 阅读 · 0 评论 -
学习笔记
1 c语言创建文件夹#ifdef _WIN32 _mkdir((options.outputDir).c_str());#elif defined __linux__ || defined __APPLE__ mkdir((options.outputDir).c_str(), 0755);#endif2.pip 安装pytorch1....原创 2019-08-21 20:53:00 · 446 阅读 · 0 评论 -
windows 安装tensorflow2.0
预先装好python然后在命令行输入:gpu版本:需要预先装好:cuda 和cudnn 才能使用。pip install numpy pandas matplotlib sklearn tensorflow-GPU==2.0.0-alpha0 -i https://pypi.doubanio.com/simplecpu 版本:alpha0 :pip inst...原创 2019-08-19 23:18:33 · 621 阅读 · 0 评论 -
windows + cmake + vs2019 编程
1.安装minGW642.安装cmake3.安装vs20194.组建代码文件结构:5.在build 文件下打开git bash,执行一下指令cmake .. -G"Visual Studio 16 2019" tips( vs2017 对应 cmake .. -G"Visual Studio 152017" )cmake 模板:cmake_min...原创 2019-07-25 23:16:50 · 17087 阅读 · 5 评论 -
linux c++ 计时程序 毫秒级
#inlude<iostream>#include<chrono>int main(){ const auto t1 = std::chrono::system_clock::now(); for(int i = 1; i< 100; i++) { } const auto t2 = std::chr...原创 2019-06-18 19:02:26 · 2903 阅读 · 0 评论 -
/usr/bin/ld: 找不到 -lopencv_dep_cudart
cmake -D CUDA_USE_STATIC_CUDA_RUNTIME=OFF .原创 2017-06-01 16:33:42 · 1507 阅读 · 1 评论 -
关于python 和C++使用cv画矩形并填充颜色同时填充文字
python:font = cv2.FONT_HERSHEY_SIMPLEX # 使用默认字体 cv2.rectangle(im, (10, 10), (110, 110), (0, 0, 255), thickness=2) # cv2.floodFill() cv2.rectangle(im, (11原创 2017-06-16 15:24:54 · 3305 阅读 · 0 评论 -
运行cudasift
cudasift原创 2017-05-26 16:09:19 · 1524 阅读 · 0 评论 -
ubuntu下动态链接库的编译和使用实例
以下实例的环境是amd64 + ubuntu10.10 +g++ 4.4.5测试成功,在其他配置的机器上可能有一点区别。 动态库的使用方式中有两种,第一种是类似于静态库的使用,另一种我称之为真正的动态加载动态库,主要是因为这种方式在程序运行的过程中加载链接库,使用之后在卸载链接库。 先介绍第一种。 在目录/home/owner/test/下创建我们的实验程序:原创 2017-04-25 09:50:24 · 3070 阅读 · 0 评论 -
c++ 解析xml文件
解析的xml文件 15 207 106 489 381 0.99566 15 546 57 912 395 0.984854 15 898 103 1223 382 0.958104 15 2 61 381 38原创 2017-04-25 08:49:22 · 2353 阅读 · 0 评论 -
linux命令整理
linux转载 2017-05-23 08:09:14 · 242 阅读 · 0 评论