
C/C++
mikeyNa
这个作者很懒,什么都没留下…
展开
-
c++中将命令行中的输出到字符流
std::string GetStdoutFromCommand(std::string cmd){ std::string data; FILE *stream; const int max_buffer=256; char buffer[max_buffer]; cmd.append(" 2>&1"); stream = popen(cmd.c_str(), "r"); if(stream) { whil.原创 2020-05-08 18:39:29 · 463 阅读 · 0 评论 -
WIN10 + Tensorflow1.12 + Cmake编译 + Bazel编译
文章转自:https://www.wandouip.com/t5i38311/几篇值得参考的博文:[1]https://blog.youkuaiyun.com/robothn/article/details/86157724[2]https://blog.youkuaiyun.com/yz2zcx/article/details/83106669[3]https://blog.csdn....转载 2019-10-14 16:41:58 · 1258 阅读 · 1 评论 -
Tensorflow C++接口内存泄漏 使用tcmalloc方法
ubuntu 16.04上使用TCMalloc1.sudo apt-get install google-perftools2.在CMakeList.txt中连接动态库target_link_libraries(smartkit4-svs /usr/lib/libtcmaloc.so.4)参考网址:https://github.com/tensorflow/tensorf...原创 2019-08-12 18:45:45 · 861 阅读 · 0 评论 -
C++图片等比例缩放到固定大小
int minHW = min(img.rows, img.cols); float ratio = max(_input_height, _input_width) / (float)minHW; int newH = max(_input_height, (int)(img.rows * ratio)); int ne...原创 2019-07-24 16:09:38 · 3625 阅读 · 0 评论 -
获取可执行文件exe的路径,可以解决获得uwp沙盒的路径的问题
参考的这个路径,https://stackoverflow.com/questions/41413534/get-app-path-for-fopen-in-uwp?tdsourcetag=s_pcqq_aiomsg#include "pch.h"#include <windows.h>#include <string>extern "C" IMAGE_D...原创 2019-04-04 16:14:00 · 833 阅读 · 1 评论 -
wstring与string相互转换
尝试过,这种方式非常好用,保存备用源地址:https://www.cnblogs.com/SunboyL/archive/2013/03/31/stringandwstring.html#include <string>#include <locale.h> // 需包含locale、string头文件、使用setlocale函数。std::wstring ...转载 2019-04-04 16:00:08 · 4229 阅读 · 0 评论 -
windows文件监控 监控文件夹下文件的变化 ReadDirectoryChangesW的使用( C++ )
搜索了很多的网站,下面这个链接对我的帮最大,而且还有附带源码,自己记录一下,顺带分享给大家。https://qualapps.blogspot.com/2010/05/understanding-readdirectorychangesw.html ...原创 2018-11-08 17:22:16 · 2219 阅读 · 0 评论 -
How to convert CStringW to char*? 将CStringW转换为char*
参考网址:https://social.msdn.microsoft.com/Forums/vstudio/en-US/0c72040e-cff0-419f-99fe-dac1074054d5/how-to-convert-cstringw-to-char?forum=vcgeneral我找到的答案:简单一点的方式(亲测可行):CStringW OrigStr = _T("Som...转载 2018-11-08 17:15:45 · 833 阅读 · 0 评论 -
C/C++ 获取文件夹下指定扩展名的文件列表
#include <iostream>#include <vector>#include <string>#include <dirent.h>using namespace std;void SplitString(const std::string& s, std::vector<std::string>&am...原创 2018-08-01 12:18:43 · 1545 阅读 · 0 评论