随笔分类 - C/C++
摘要:参考链接 https://stackoverflow.com/questions/16699247/what-is-a-cache-friendly-code 只是堆积:缓存不友好与缓存友好代码的典型例子是矩阵乘法的“缓存阻塞”。 朴素矩阵乘法看起来像 如果N很大,例如,如果N * sizeof(e
阅读全文
摘要:#include #include using namespace std; class String { public: String(const char *pdata); String(const String &rhs); String &operator = (const String &rhs); ~String(); private: ...
阅读全文
摘要:1. 安装 qt-opensource-windows-x86-msvc2015_64-5.6.0.exe (根据自己的VS版本来安装) 下载地址 http://download.qt.io/official_releases/qt 2. 点击VS2015 的“扩展和更新” 搜索QT 安装第一个 Q
阅读全文
摘要:注: 工厂模式和策略模式的区别: 工厂模式强调代码隐藏,解耦合, 策略模式强调方法的可替换性。
阅读全文
摘要:1.8位加: *(__m128i*)(dest + i * 16) = _mm_add_epi8(*(__m128i*)(srcA + i * 16), *(__m128i*)(srcB + i * 16)); 16位减法 __m128i _mm_sub_epi16 (__m128i a, __m1
阅读全文
摘要:解决VS2015 不能设置下面的断点**** 断点未能绑定 1. 清理解决方案 , 重新生成解决方案 , 无效!! 2. 选项-- 调试 -- 启用编辑并继续 无效!! 3. 启用 “使用托管兼容模式” + "使用本机兼容模式" 成功!!! 如果上述方法无法解决,可以试试下面这种 链接器 调试 生成
阅读全文
摘要:1. 结构体中有Mat 类型,但是结构体没有写拷贝构造函数,这样拷贝结构体的时候就会出现错误。。2.
阅读全文
摘要:Release 模式 smooth gaussian : 2 cvtColor CV_BGR2Lab : 3 get_psnr : 16 convertTo CV_8U: 6 absdiff: 2 threshold: 0 dilate 20: 3 fill_hole : 3 bitwise_xor
阅读全文
摘要:fork进阶知识 先看一份代码:[cpp] view plain copy/* * fork_test.c * version 2 * Created on: 2010-5-29 * Author: wangth */ #include #include i...
阅读全文
摘要:#include #include "opencv/cv.h" #include "opencv/cxcore.h" #include "opencv/highgui.h" using namespace std; #pragma comment ( lib,"opencv_highgu...
阅读全文
摘要:准备工作: 1. VS2013 的最新更新版或者VS2015 2. QT Creater 5.7 https://www.qt.io/ 3. CMake (cmake-gui) 4. obs 依赖包,下载下来后放在自己的obs主目录下 根据自己的VS版本来下载 VS2013: https://obs
阅读全文
摘要:#include #include #include void fun1(char** s);void fun2(char** s);void fun3(char** s);void fun1(char** s){ char* _s = *s; *s = (char*)malloc(sizeof(c...
阅读全文
摘要:1. core文件生成打开方式: ulimit -c unlimited echo "1" > /proc/sys/kernel/core_uses_pid 看下服务器上是否安装了 gdb,没有的话要装一下 以调试模式打开程序 ./sip_gw -t2 -n 1 之后程序会crashed, 程序目录
阅读全文
摘要:1. error: ‘for’ loop initial declarations are only allowed in C99 mode 这是因为gcc基于c89标准,换成C99标准就可以在for循环内定义i变量了: gcc src.c -std=c99 -o src 2. cpp引用.c文件
阅读全文
摘要:生成可执行文件 g++ mutiprocess.cpp -o test-fpic:产生位置无关码,位置无关码就是可以在进程的任意内存位置执行的目标码,动态链接库必须使用-c : 只生成 .o 文件-o : 生成可执行文件-g : 生成可调试文件 -lworld表示libworld.so动态库文件...
阅读全文