上一页 1 2 3 4 5 6 7 8 9 ··· 25 下一页
摘要: 这篇文章主要是推荐下http://www.cnblogs.com/skynet/archive/2010/09/05/1818636.html这篇文章从编译器的角度看问题,比较深入。回到题目,为什么不编码返回值 是因为C中有隐式或显示的类型转换,在编译的时候无法确定调用哪一个函数。 阅读全文
posted @ 2014-10-18 12:02 westfly 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 需求:我们的Server服务接收Http请求,经过一系列的异步请求其它Server(对,我们的Server是一个FrontServer)后,生成最终的结果,返回给请求者。在这个过程中,需要我们的Server等待一定时间,如果结果无法得出,也需要给前端返回错误码。这是一个非常常见的需求,我们的方案很朴... 阅读全文
posted @ 2014-10-18 09:26 westfly 阅读(2798) 评论(0) 推荐(0) 编辑
摘要: 去除尾部多余的字符#include #include int main(int argc, const char *argv[]){ std::string str; char buf[16]; for (int i = 0; i < 10; i++) { int len... 阅读全文
posted @ 2014-08-20 10:12 westfly 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 这是一篇介绍bind和function用法的文章,起因是近来读陈硕的文章,提到用bind和function替代继承,于是就熟悉了下bind和function的用法,都是一些网上都有的知识,记录一下,期冀对他人也有用处。注:本文暂时不探索bind和function的实现和开销。1. bind 是什么b... 阅读全文
posted @ 2014-08-17 10:57 westfly 阅读(3829) 评论(0) 推荐(2) 编辑
摘要: 今天开始阅读LevelDB的代码,用source insight建立工程,但其不支持cc后缀的C++文件。找到这篇《source insight看cc文件》解决的根本办法:Options-〉“Document Options”-〉在“File filter” 里边加上*.cc或者 O... 阅读全文
posted @ 2014-08-17 09:09 westfly 阅读(3530) 评论(0) 推荐(1) 编辑
摘要: 公司每个project代码中,都有一个Config类,作为模块启动的配置。其实现如下struct Config { int num; char * file_name; int load_from_file(const char* filename);}int Config::load_from_f... 阅读全文
posted @ 2014-08-16 15:23 westfly 阅读(1554) 评论(0) 推荐(0) 编辑
摘要: 比较#include #include int main(int argc, const char *argv[]){ char xman[] = "xman"; char* xtest = "xmansuper"; printf("%s\t%d\t%d\n", xman, sizeof(xm... 阅读全文
posted @ 2014-07-01 11:20 westfly 阅读(488) 评论(1) 推荐(0) 编辑
摘要: 在平时写代码的过程中,我一个推荐带有n系列的字符串函数,如strcat ->strncatsprintf->snprintf我们有类似的一个函数void dump_kid(std::string* str, uint32_t kid){ char buffer[16]; int len; ... 阅读全文
posted @ 2014-06-27 15:59 westfly 阅读(7725) 评论(1) 推荐(0) 编辑
摘要: python操作execel主要是读写读 通过http://pypi.python.org/pypi/xlrd写 通过http://pypi.python.org/pypi/xlwd下载tar包,解压出来,安装即可,如果没有权限,将xlrd/xlrd拷贝到当前目录下,也可以使用。如下是xlrd的使用... 阅读全文
posted @ 2014-06-18 17:31 westfly 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 概况Hadoop Streaming 是一个工具, 代替编写Java的实现类,而利用可执行程序来完成map-reduce过程。一个最简单的程序$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/hadoop-streaming.jar-input myInputDirs... 阅读全文
posted @ 2014-06-17 11:10 westfly 阅读(1129) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 25 下一页