09 2015 档案

摘要:在系统的代码中,我们有许多单例。从[cegui](http://cegui.org.uk/) 的代码中的找到一个基于模板的类,具体代码改变后如下#ifndef _SINGLETON_H_#define _SINGLETON_H_#include #include template class Si... 阅读全文
posted @ 2015-09-26 20:14 westfly 阅读(836) 评论(0) 推荐(0)
摘要:最近用到了protobuf传输数据,但在protobuf之前还有个协议头。因为是重构,所以需要模拟协议头部。有如下代码string data;char buffer[256];memcpy(buffer, &header, sizeof(header));data.append(buffer);cl... 阅读全文
posted @ 2015-09-23 18:33 westfly 阅读(264) 评论(0) 推荐(0)
摘要:Awk中调用shell命令需求 在awk中,有时候需要调用linux系统中命令,如计算字符串的MD5值,并保存下来。方法参考call a shell command from inside awk and pass some awk variables to the shell command c... 阅读全文
posted @ 2015-09-01 19:44 westfly 阅读(2308) 评论(0) 推荐(0)