Quantcast
Channel: C++博客-所有随笔
Browsing all 7880 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

遍历Windows目录

不多说,在代码中。   /*** @file directory_walker.h* @brief 遍历目录功能分为遍历函数和动作类,动作类可根据不同用途重写,返回false表示中断遍历。* @author lemene*/ #ifndef DIRECTORY_WALKER_HPP#define DIRECTORY_WALKER_HPP #include <string> class...

View Article


Image may be NSFW.
Clik here to view.

框架搭建

1.整体框架图 2.服务进程说明connsvr: 接入服务器,连接玩家和后端服务器gamesvr: 游戏服务器dbcache: 数据缓存服务dirsvr: 目录服务器versionsvr: 版本服务器authsvr:...

View Article


Image may be NSFW.
Clik here to view.

lua5.1->lua5.0

关键字:  and break do else elseif end false for function if in local nil not or repeat return then true until...

View Article

Image may be NSFW.
Clik here to view.

Effective STL(5)——算法

1.确保目标空间足够大2.了解各种与排序有关的选择  如果需要对vector、string、deque或者数组中的元素执行一次完全排序,那么可以使用sort或者stable_sort。  如果有一个vector、string、deque或者数组,并且只需要对等价性最前面的n个元素进行排序,那么可以使用partial_sort。...

View Article

Image may be NSFW.
Clik here to view.

lua的编码风格很爽啊

这样完全只要关系逻辑了,别的都秒杀,只是代码出错了,多半要用肉眼看,,,再有就是用luabind class的细节,还不了解CTestClass ={ m_TestVal = 0, m_funcTest = nul}function CTestClass:SetValue(v) self.m_TestVal = v;endfunction CTestClass:TestShow()...

View Article


Image may be NSFW.
Clik here to view.

RMQ

     摘要: RMQ        定义:               A[0...n-1]           &nb...  阅读全文英雄哪里出来 2014-06-26 16:35 发表评论

View Article

Image may be NSFW.
Clik here to view.

tcmalloc性能测试对比

使用tcmalloc测试多线程分配对象 #include <boost/thread.hpp>#include <boost/bind.hpp>#include <boost/shared_ptr.hpp>#include <boost/progress.hpp>#include <vector>template <int...

View Article

Image may be NSFW.
Clik here to view.

【转载】一致性 hash 算法( consistent hashing )

转载地址: http://blog.csdn.net/sparkliang/article/details/5279393consistent hashing 算法早在 1997 年就在论文 Consistent hashing and random trees 中被提出,目前在cache 系统中应用越来越广泛;1 基本场景比如你有 N 个 cache 服务器(后面简称 cache...

View Article


Image may be NSFW.
Clik here to view.

获取桌面窗口句柄

HWND FindDesktopIconWnd(){    HWND hWndDesktop = NULL;    HWND hProgMan = ::FindWindow(L"Progman", NULL);    if (hProgMan)    {        HWND hShellDefView = ::FindWindowEx(hProgMan, NULL,...

View Article


Image may be NSFW.
Clik here to view.

一些VA的Snippet片断

下面代码是我常用VA的Snippet的片断,做记录,防止丢失命令函数通用代码Title:Command Common! Shortcut:dwr    TAnswer & stAns = getAnswer();      TRequest & stReq = getRequest();    error_code_t iRet = ERR_OK;    CPlayer *...

View Article

Image may be NSFW.
Clik here to view.

我的开放代码

之前我的代码是放到code.google.com上面的,但是最近老有些问题,前些天又发现发现csdn搞了一个git服务器,于是就把代码迁移到这上面来了。地址如下,有喜欢的朋友,可以看看,这些代码,已经在我的很多项目中使用了,当然,还会有不少问题。下载地址是:https://code.csdn.net/zdhsoft/commonlib/tree/master,git地址是:git@code.csdn...

View Article

Image may be NSFW.
Clik here to view.

cmake vs2012指定v11_

http://www.cmake.org/Bug/view.php?id=13774http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89595d6bhttp://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_VS_PLATFORM_TOOLSETcmake ../...

View Article

Image may be NSFW.
Clik here to view.

php的json_encode不兼容JSON_UNESCAPED_UNICODE的解决方案。

/*** 对变量进行 JSON 编码* @param mixed value 待编码的 value ,除了resource 类型之外,可以为任何数据类型,该函数只能接受 UTF-8 编码的数据* @return string 返回 value 值的 JSON 形式*/function json_encode_ex($value){    if...

View Article


Image may be NSFW.
Clik here to view.

lua常用函数

lua_newtablevoid lua_newtable (lua_State *L);创建一个空 table ,并将之压入堆栈。 它等价于 lua_createtable(L, 0, 0) 。 lua_gettopint lua_gettop (lua_State *L);返回栈顶元素的索引。 因为索引是从 1 开始编号的, 所以这个结果等于堆栈上的元素个数(因此返回 0 表示堆栈为空)。...

View Article

Image may be NSFW.
Clik here to view.

Vc2008配合vmware配置“方便的”远程调试

  everettjf原创,转载请注明出处。 Vc2008用这么多年,最近才发现可以这么配置。总结一下,分享给大家。 网上有很多教程,这里综合各个教程,整理了一份比较完成步骤。 由于开发环境是win7 x64,而目前产品不支持x64,于是为了方便调试,发现了一个一直忽视的vc2008自带的远程调试功能。 注意:这里是指方便的远程调试功能,为了“方便的”调试,需要设置一些windows共享。 环境:...

View Article


Image may be NSFW.
Clik here to view.

The feelings of attending the 31st International Conference on Machine...

Under construction.杰哥 2014-06-27 21:46 发表评论

View Article

Image may be NSFW.
Clik here to view.

大乐透胆拖中奖计算器 2014新规则

下载1CM 2014-06-28 12:12 发表评论

View Article


Image may be NSFW.
Clik here to view.

Asia Hefei Online 2008 解题报告

A. Constellations PKU 3690 http://poj.org/problem?id=3690 题意:给定N*M(N<=1000, M <= 1000)的01矩阵S,再给定T(T <= 100)个P*Q(P <= 50, Q <= 50)的01矩阵,问P*Q的矩阵中有多少个是S的子矩阵。 题解:位压缩 + KMP 由于P <=...

View Article

Image may be NSFW.
Clik here to view.

无名

一直在看校友群,却不知道该说什么.长大了一点也不好,不能像小时候那样说话了多彩人生 2014-06-30 14:17 发表评论

View Article

Image may be NSFW.
Clik here to view.

[cocos2dx笔记005]一个字符串管理配置类

     摘要: 在用vs开发cocos2dx过程中,要显示的中文,要求是UTF-8格式的才能正常显示出来,但VS一般是ANSI格式保存,这样,在代码中写入的中文字符串,运行后,显示的就是乱码。 为了正确显示中文,或支持多语言,我这里定义一个简单的字符串管理类,来满足上述要求。  阅读全文冬瓜 2014-06-30 14:59 发表评论

View Article
Browsing all 7880 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>