摘要:根据需求的不同 选择不同的策略算法 之前是保存的各种策略类的指针 这里直接使用 function bind 选择对应的算法 代码 // 005.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <functional> #include <ios
阅读全文
摘要:参考http://blog.csdn.net/calmreason/article/details/51029285 定义一系列相同的算法 根据不同需求选择不同的算法策略 使用 bind function 见 设计模式 策略模式2 c++11 代码 // 004.cpp: 定义控制台应用程序的入口点
阅读全文
摘要:参考http://blog.csdn.net/calmreason/article/details/50909321 桥接模式 实现与抽象之间由指针关联 调用sample类 实际是调用sample类保存的实现类的方法 代码: // 003.cpp: 定义控制台应用程序的入口点。 // #includ
阅读全文
摘要:参考http://blog.csdn.net/calmreason/article/details/50903729 所有产品继承同一基本类 由工厂保存基类指针 产生各类产品 代码 // 002.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include
阅读全文
摘要:参考 http://blog.csdn.net/calmreason/article/details/50895191 主要是发布者存储订阅者的指针 发布时依次NOTIFY 发送信息 订阅者在订阅时将自己加入到发布者的容器中 使用C++11 的智能指针 需要注意智能指针的 weak shared的转
阅读全文
摘要:根据 日文胡牌算法资料 JAVA 此篇博文资料 改写的C++ 代码 tbl.h 1 #pragma once 2 #include <map> 3 #include <vector> 4 5 void init1(std::map<int, std::vector<int>>& tbl); 6 vo
阅读全文
摘要:原地址: http://hp.vector.co.jp/authors/VA046927/mjscore/mjalgorism.html
阅读全文
摘要:学习计划清单 放在这里 督促自己执行 近期任务 leetcode stl 源码学习 bttorrent编写 (优先BCODE解析) 分布式存储编写 json 解析(实战 大量测试 稳定和内存泄漏) leveldb 源码学习 muduo 源码学习 python csdn 11111Python编程实战
阅读全文
摘要:// random.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include #include #include #include #include const int MAJIANG_GROUP_LENGTH = 84; const int POST_BLOCK_COUNT = 4; co...
阅读全文
摘要:网络传输 buf 封装 示例代码 使用boost库 asio
阅读全文