- 博客(11)
- 资源 (4)
- 收藏
- 关注
原创 single ioservice multiple thread Model
#include "boost/asio.hpp"#include "boost/date_time/posix_time/posix_time.hpp"#include "boost/function.hpp"#include "boost/bind.hpp"#include "boost/shared_ptr.hpp"#include "boost/thread.hpp"
2014-04-29 10:00:19
782
原创 boost asio的一个异步调用小测例
#include "boost/asio.hpp"#include "boost/date_time/posix_time/posix_time.hpp"#include using namespace std;using namespace boost::asio;class iosTEST{public:iosTEST(io_service &i
2014-04-20 16:56:02
925
3
原创 c++中读取文本文件单行数据的正确做法
网络上大部分读取文本文件中单行数据的做法如下,ifstream inFile;//(sFileName.c_str(),std::ios::in);inFile.open(sFileName.c_str(),ios::in|ios::binary);if (inFile.fail()){fprintf(stderr,"file %s open error!\n",sFileNa
2013-12-28 19:50:04
3046
原创 使用boost库编写跨平台遍历文件夹下的所有文件
#include "boost/filesystem.hpp"#include bool getFiles( std::string path,std::vector &vFiles ){using namespace boost::filesystem;typedef recursive_directory_iterator rd_iterator;rd_ite
2013-12-03 13:04:22
4842
原创 使用boost线程的一个简单的例子
//需要使用-lboost_thread链接thread库#include "boost/thread/mutex.hpp"#include "boost/thread/thread.hpp"#include "boost/thread/lock_guard.hpp"#include using namespace std;using namespace boost;c
2013-10-05 21:22:22
727
原创 boost中circular_buffer存储字符串的使用示例
#include using namespace boost;#define CIRCUALR_BUFFER_SIZE 1024*1024*1 //2MBint main(){ boost::circular_buffer cb(5); cb.push_back('a'); cb.push_back('b'); char ch[20] = {0}; st
2013-09-09 13:06:22
1521
转载 vs2005-vs2010中编译log4cxx-0.10.0的详细方法
在vs2010中编译log4cxx-0.10.0详细方法(从下载、编译、解决错误详细介绍【看到一片比较有用的工具类文章,本人实践,vs2005同样适用,这里转载了,仅作分享,原文参考:http://blog.sina.com.cn/s/blog_a459dcf501013tbn.html 邵明博客】 本文一共包含了17个步骤,
2013-08-24 17:36:38
941
原创 使用boost的xxx_list_of函数为静态容器map和vector等赋初值
#include #include ///for map_list_of#include using namespace std;using namespace boost::assign;static std::map aMap = boost::assign::map_list_of("aaa",1)("bbb",2)("ccc",3);int main(){
2013-08-10 16:48:13
2251
原创 使用Matlab绘制图像的rgb颜色空间和Lab颜色空间分量图和分量直方图
%author sagittariusboy All right reserved 2013年7月28日 14:58:11org = imread('laaa.jpg');%org = imread('tbbb7.jpg');%org = imread('ccc.jpg');r = org(:,:,1);g = org(:,:,2);b = org(:,:,3);fig
2013-07-28 14:59:08
17846
1
原创 opencv中cvSmooth的操作
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc_c.h"///for cvSmooth#include #include using namespace cv; /** @function mai
2013-05-05 21:12:02
930
原创 GB2312转UTF8示例程序
#include #include #include bool GB2312ToUTF8(const char *pGb2312,std::string &strUtf8){ //GB2312 to unicode int nUniCodeLen = MultiByteToWideChar(CP_ACP,0,pGb2312,-1,NULL,0); wc
2013-04-28 14:13:12
839
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人