该文被密码保护。 阅读全文
posted @ 2019-02-23 11:43 米**饭 阅读(3) 评论(0) 推荐(0) 编辑

2019年2月23日

该文被密码保护。 阅读全文
posted @ 2019-02-23 12:39 米**饭 阅读(2) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-02-23 12:06 米**饭 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 如图: local m_rHight = math.ceil( 1334 / 100 ) / 2 -- 高半径local m_rWide = math.ceil( 750 / 200 ) / 2 -- 宽半径 -- 函数方法实现 function getNewPoints( aX, aY, bX, 阅读全文
posted @ 2019-02-23 11:55 米**饭 阅读(137) 评论(0) 推荐(0) 编辑

2014年6月18日

摘要: 1. map : C++的STL中map是使用树来做查找算法; 时间复杂度:O(log2N)2.hash_map : 使用hash表来排列配对,hash表是使用关键字来计算表位置; 时间复杂度:O(1), 最坏的时间复杂度:O(n)总体来说:hash_map 比 map 查找速度快,而且查找速度... 阅读全文
posted @ 2014-06-18 11:10 米**饭 阅读(915) 评论(0) 推荐(1) 编辑
摘要: 例子链接:http://blog.csdn.net/gamecreating/article/details/7698719结论: unordered_map 查找效率快五倍,插入更快,节省一定内存。如果没有必要排序的话,尽量使用 hash_map(unordered_map 就是 boost 里面... 阅读全文
posted @ 2014-06-18 09:55 米**饭 阅读(2077) 评论(0) 推荐(0) 编辑
摘要: 例子: typedef boost::unordered_map UserOnlineMap; UserOnlineMap userOnlineMap_; std::pair res = userOnlineMap_insert(std::make_pair(xxx, xxx)); if... 阅读全文
posted @ 2014-06-18 09:51 米**饭 阅读(6270) 评论(0) 推荐(0) 编辑

2014年6月17日

摘要: 一.boost::thread的创建 1.线程创建方法一: boost::shared_ptr writeThread_; boost::function0 f = boost::bind(&DBTaskMgr::execute, this); writeThread_ = bo... 阅读全文
posted @ 2014-06-17 20:09 米**饭 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 1.boost锁的概述: boost库中提供了mutex类与lock类,通过组合可以轻易的构建读写锁与互斥锁。2.mutex对象类(主要有两种): 1.boost::mutex(独占互斥类) -->有lock和unlock方法 2.boost::shared_mutex(共享互斥类) -->有... 阅读全文
posted @ 2014-06-17 16:49 米**饭 阅读(663) 评论(0) 推荐(0) 编辑
摘要: #include void sort(int &a, int &b){ if (a>=b) { return; } if (a<b) { int temp = a; a = b; b = temp; }}int main(int arg... 阅读全文
posted @ 2014-06-17 14:35 米**饭 阅读(227) 评论(0) 推荐(0) 编辑

导航