Fork me on GitHub

07 2014 档案
linux timing profile
摘要:double getUnixTime(void){ struct timespec tv; if(clock_gettime(CLOCK_REALTIME, &tv) != 0) return 0; return (((double) tv.tv_sec) + (double) (... 阅读全文
posted @ 2014-07-30 21:01 huashiyiqike 阅读(196) 评论(0) 推荐(0)
thoughts
该文被密码保护。
posted @ 2014-07-30 16:06 huashiyiqike 阅读(0) 评论(0) 推荐(0)
boost高质量随机数库 zhuan
摘要:shared_ptr tmp2(new int(10)) ; int * test=tmp2.get(); std::cout die_gen(generator,1, 6)然后就可以不停的读取die_gen, 比如std::cout #include int main(){boost... 阅读全文
posted @ 2014-07-30 15:03 huashiyiqike 阅读(745) 评论(0) 推荐(0)
如何解析超长的protobuf zhuan
摘要:在调用protobuf的ParseFromString(str)方法时,默认情况下,如果str的长度>64MB,会返回失败。这里给出了解释,主要是出于安全因素的考虑。可以通过SetTotalBytesLimit方法去除这个限制:// ::google::protobuf::Message req;:... 阅读全文
posted @ 2014-07-28 21:26 huashiyiqike 阅读(1160) 评论(0) 推荐(0)
debug makefile 及 lint 软件质量软件
摘要:make -dshould give you more than enough information to debug your makefile.Be warned: it will take some time and effort to analyze the output but load... 阅读全文
posted @ 2014-07-28 11:23 huashiyiqike 阅读(613) 评论(0) 推荐(0)
使用blas做矩阵乘法
摘要:#define min(x,y) (((x) #include #include #include #include //extern "C"//{ #include //}using namespace std;int main(){ const enum CBLAS_ORDER Ord... 阅读全文
posted @ 2014-07-27 21:08 huashiyiqike 阅读(13432) 评论(0) 推荐(0)
Eclipse 手动增加linker library
摘要:多个cu文件nvcc -cubin -m64 -lcudadevrt -lcublas_device -gencode arch=compute_35,code=sm_35 -o test.cubin -c test.cu -dlinkYou can also do that in two step... 阅读全文
posted @ 2014-07-26 14:57 huashiyiqike 阅读(415) 评论(0) 推荐(0)
CUDA 例程
摘要:scalar add#include #include #include __global__ void add(int *a, int *b,int *c){c[blockIdx.x]=a[blockIdx.x]+b[blockIdx.x];}int main(void) { // H ha... 阅读全文
posted @ 2014-07-25 22:29 huashiyiqike 阅读(705) 评论(0) 推荐(0)
CUDA编程常见问题 转
摘要:http://blog.csdn.net/yutianzuijin/article/details/8147912分类:编程语言2012-11-05 10:552521人阅读评论(0)收藏举报cudaGPU 最近初试cuda编程,作为一个新手,遇到了各种各样的问题,然后花费了大量时间解决这些匪夷所... 阅读全文
posted @ 2014-07-25 16:24 huashiyiqike 阅读(882) 评论(0) 推荐(0)
test pthread code
摘要:#include #include using namespace std;int sum=0;void * add(void *);pthread_mutex_t mut;int main(){ pthread_t thread[10]; int num; long count... 阅读全文
posted @ 2014-07-25 15:25 huashiyiqike 阅读(185) 评论(0) 推荐(0)
protobuf example make backup
摘要:# See README.txt..PHONY: all cpp java python cleanall: cpp #java pythoncpp: add_person_cpp list_people_cpp temp_cppjava: add_person_java lis... 阅读全文
posted @ 2014-07-24 17:14 huashiyiqike 阅读(495) 评论(0) 推荐(0)
运算符重载
摘要:加法还可用友元函数,两个参数的方式实现。#include #include #include #include using namespace std;class Matrix{public: Matrix(){memset(this->_mat,0,sizeof(this->_mat));}... 阅读全文
posted @ 2014-07-22 17:05 huashiyiqike 阅读(183) 评论(0) 推荐(0)
简单函数template max
摘要:#include #include #include #include using namespace std;templateelemtypea mymax(const vector &a){ return *max_element( a.begin(), a.end() );}te... 阅读全文
posted @ 2014-07-21 20:03 huashiyiqike 阅读(302) 评论(0) 推荐(0)
const static extern
摘要:http://wenku.baidu.com/link?url=saMJ3WpR_Lili2oflaIK-xK7wkQhtP2I-FdEX6I_XjmNxl7m0Z8SYHJtfqyXYkSmok8hkOugcFeO2_CUyNKzsUc8sD-ycpEFIqxOXMoJ1qGconst 可以放在头... 阅读全文
posted @ 2014-07-20 22:25 huashiyiqike 阅读(201) 评论(0) 推荐(0)
python 关闭垃圾回收
摘要:importgc gc.disable() http://blog.csdn.net/aixiaohei/article/details/6446869 阅读全文
posted @ 2014-07-20 20:10 huashiyiqike 阅读(470) 评论(0) 推荐(0)
Easy and cheap cluster building on AWS backup
摘要:https://grapeot.me/easy-and-cheap-cluster-building-on-aws.htmlThu 17 July 2014, byYan Wang|2 CommentsLinuxParallelgithubImageWhy?It often requires a l... 阅读全文
posted @ 2014-07-19 21:54 huashiyiqike 阅读(252) 评论(0) 推荐(0)
numpy ndarray
摘要:>>> aarray([[1, 2], [3, 4]])>>> a.shape(2, 2)>>> barray([2, 3])>>> b.shape(2,)>>> carray([[1], [2]])>>> c.shape(2, 1)>>> darray([[1, 2]])>... 阅读全文
posted @ 2014-07-16 11:35 huashiyiqike 阅读(199) 评论(0) 推荐(0)
Google Protocol Buffers 反序列化 转
摘要:http://www.cnblogs.com/royenhome/archive/2010/10/30/1865256.html 本文作为结束篇,会稍微介绍下怎么反序列化GoogleBuffer数据,并在最后提供本系列文章中所用到的代码整理供下载。 上一篇文章介绍了怎样将数据序列化到了addre... 阅读全文
posted @ 2014-07-11 14:05 huashiyiqike 阅读(2439) 评论(0) 推荐(0)
Linux gcc getcwd()的实现 zhuan
摘要:通过getcwd()可以获取当前工作目录。1 #include 2 3 char *getcwd(char *cwdbuf, size_t size); 阅读全文
posted @ 2014-07-09 17:33 huashiyiqike 阅读(250) 评论(0) 推荐(0)
ProtoBuf 常用序列化/反序列化API 转
摘要:http://blog.csdn.net/sealyao/article/details/69402451、C数组的序列化和反序列化API[cpp]view plaincopy//C数组的序列化和序列化APIboolParseFromArray(constvoid*data,intsize);boo... 阅读全文
posted @ 2014-07-09 15:01 huashiyiqike 阅读(4902) 评论(0) 推荐(0)
CAFFE 调试
摘要:在Make.config 文件里将DEBUG=1的注释去掉,再make。可以用IDE如eclipse来import makefile工程。必要时按照IDE的提示将源文件cpp和对应的bin文件对应。 阅读全文
posted @ 2014-07-09 09:08 huashiyiqike 阅读(2080) 评论(0) 推荐(0)
install the Mondo Rescue utility in Ubuntu 12.04 or 12.10.
摘要:1. Open a terminal window.2. Type in the following commands, then hit Enter after each.wget ftp://ftp.mondorescue.org/ubuntu/`lsb_release -r|awk '{pri... 阅读全文
posted @ 2014-07-08 17:32 huashiyiqike 阅读(660) 评论(0) 推荐(0)
ubuntu下的网速限制软件wondershaper (2011-09-18 00:00:00)转载▼
摘要:上网或下载的时候我们常常希望网速快一点,但有时我们也需要限制网速,在ubuntu系统下,可以使用wondershaper,不仅可以限制下载速度还可以限制上传速度。 安装好之后,需要使用终端取得管理员权限,使用wondershaper [接口] [上传速度 K] [下载速度 ... 阅读全文
posted @ 2014-07-04 14:22 huashiyiqike 阅读(441) 评论(0) 推荐(0)
GCC 命令行详解 -L 指定库的路径 -l 指定需连接的库名 zhuan
摘要:1。gcc包含的c/c++编译器gcc,cc,c++,g++,gcc和cc是一样的,c++和g++是一样的,(没有看太明白前面这半句是什么意思:))一般c程序就用gcc编译,c++程序就用g++编译2。gcc的基本用法gcc test.c这样将编译出一个名为a.out的程序gcc test.c -o... 阅读全文
posted @ 2014-07-04 09:01 huashiyiqike 阅读(737) 评论(0) 推荐(0)