- 博客(54)
- 资源 (362)
- 收藏
- 关注
原创 linux 下C/C++程序常用调试方法(gdb)
不管是在开发或者运行过程中,调试保证程序正常运行最基本的手段,熟悉这些调试方式,方便我们更快的定位程序问题所在,提高开发效率。 一 程序正常运行调试 (1) 直接使用gdb 开发过程中最常用的方式,我们可以在其过程中给程序添加断点,监视等辅助手段,监控其行为是否与我们设计相符,比如: (2) 程序已经运行,通过
2014-12-02 09:13:54
7590
原创 linux下使用性能分析工具nmon
一 简介nmon 工具可以帮助在一个屏幕上显示所有重要的性能优化信息,并动态地对其进行更新。这个高效的工具可以工作于任何哑屏幕、telnet 会话、甚至拨号线路。另外,它并不会消耗大量的 CPU 周期,通常低于百分之二。在更新的计算机上,其 CPU 使用率将低于百分之一。使用哑屏幕,在屏幕上对数据进行显示,并且每隔两秒钟对其进行更新。然而,您可以很容易地将这个时间间隔更改为
2014-12-01 14:10:19
3062
1
原创 install and use odbc at linux
//install unixodbcdownload from 点击打开链接$tar zxvf unixODBC-2.3.0.tar.gz$cd unixODBC-2.3.0$ cmake -G "Unix Makefiles" -DWITH_UNIXODBC=1$make$make install//install mysql-connectordownload from 点击打开链接$tar
2012-08-18 09:01:08
2092
原创 template method
// imple1 use inherit// class forward declareclass record;class primary_key;class genereate_table_algoritem1{public: genereate_table_algoritem1(const std::string& __table) { } virtual
2012-06-10 12:02:52
871
原创 禁用复制赋值的问题
如果在构造函数中用到了 new之类的初始化操作,在析构函数调用了delete.如果没有禁用拷贝构造,复制赋值 那么在进行 A a; A b= a; 操作时,b 进行析构的时候,会把a 申请的内存给析构掉,会造成a 里面的对象已经释放,导致不可预计的结果。 class example{public: example() { base_ptr_ =
2012-06-10 11:07:56
935
原创 simple poll echo server example
// echo_server.cc#include // fcntl#include // exit#include // socket#include // sockaddr_in#include // bzero#include // inet_addr#include // read#include // perr
2011-12-22 19:23:46
898
原创 simple select echo server example
// echo_server.cc#include // fcntl#include // exit#include // select#include // socket#include // sockaddr_in#include // bzero#include // inet_addr#include // errno#inclu
2011-12-22 17:01:49
1065
原创 makefile 生成/使用静态库
// puls.hint my_puls(int x,int y); // puls.ccint my_puls(int x,int y){ return x + y;} // puls_lib_test.cc#include"puls.h"#includeint main(){ int puls_res = my_puls(3,4); printf
2011-12-01 14:22:19
26688
原创 VS2010 编译 STLPORT
下载地址: http://sourceforge.net/projects/stlport/ 下载后解压,假设目录为:D:\STLport,接下来就该编译它了:1.在开始菜单中找到VC 命令行工具,这样可以省去很多事(网上很多教程要做很多热身运动,为啥不让M$代行呢?接下来切换到D:\STLport目录。2.可以运行configure –help看看编译选项,用MSVC编译器编译
2011-11-15 16:31:17
2382
原创 关于压测
2011-10-31 第一天测试,客户端蹦了1000多次。因为之前没有任何的异常处理,最近在游戏主程序入口添加了异常捕获,检测到异常即弹出BUG提交报告,结束客户端进程。此方法导致客户端崩溃次数过多,需要做处理,以后在做开发的时候,每个函数需要做异常捕获,可以参考天龙的代码。服务器第一天还算稳定,基本没有出现崩溃的现象。 2011-11-01 第二次测试,客户端根据收集的信息,更改了崩溃导致的BU
2011-11-03 18:27:32
870
原创 State
class TCPOctetStream;class TCPState;class TCPConnection {public: TCPConnection(); /* */ void ActiveOpen(); void PassiveOpen(); vo
2011-09-07 16:27:28
692
原创 C++ class friend
class A;class B;class A{public: explicit A( int a ); ~A(); friend class B;private: int aa;};A::A( int a ){ aa = a;}A::~A()
2011-09-02 09:18:52
2003
原创 Strategy
typedef float Coord;Coord coords[] = { 1,2,3 };int b[] = { 1,2,2 };#if 0class Compositor {public: void Compose(){}};class Compo
2011-09-01 18:44:08
852
原创 google code svn
http://lee-private-project.googlecode.com/svn/trunk/ only readhttps://lee-private-project.googlecode.com/svn read and write
2011-06-09 18:58:00
605
原创 网游服务器-文摘
网络游戏中玩家在线数据的存取http://blog.youkuaiyun.com/dijinzhou/archive/2010/08/04/5788291.aspx 网络游戏中的定时器设计http://blog.youkuaiyun.com/dijinzhou/archive/2010/08/02/5783224.aspx 另外一个类似的 也是采用滚轮方式设计的一个高效的定时器分析及设计
2011-06-09 17:00:00
802
原创 Some article about BigTable
<br />Google's BigTable 原理 (翻译)<br />http://blog.youkuaiyun.com/accesine960/archive/2006/02/09/595628.aspx<br /> <br />Bigtable探秘 Google分布式数据存储系统<br />http://database.51cto.com/art/201007/209107.htm
2011-03-30 09:59:00
638
原创 Dirty data
<br />#include <WinSock2.h>#pragma comment(lib,"ws2_32.lib")#define PORT 5150#define DATA_BUFSIZE 8192int _tmain(int argc, _TCHAR* argv[]){ TCHAR szSendBuf[BUFSIZ]; TCHAR szRecvBuf[BUFSIZ]; DWORD dwTime = 10000; int iSendBytes = 0; in
2011-03-29 23:06:00
1636
原创 用mysqlslap进行压力测试
lee@ubuntu:~$ mysqlslap --helpmysqlslap Ver 1.0 Distrib 5.1.49, for debian-linux-gnu (x86_64)Copyright (C) 2005 MySQL ABThis software comes with ABSOLUTELY NO WARRANTY. This is free software,
2011-01-22 22:32:00
1343
原创 MYSQL 语法常用
独立新建表CREATE TABLE TT (ID INT, NAME VARCHAR(20));从已知表复制表CREATE TABLE TT AS SELECT * FROM CC;2011-01-07 22:18:00Reference:http://justcoding.javaeye.com/blog/672066Mysql之inner join,left join,right join详解首先借用官方的解释下:inner join(等值
2011-01-08 11:18:00
701
原创 ununtu 常用操作问题以及解决方案!
<br />2011-01-07 21:09:41<br />不能打开某些文件夹,没有权限?<br />终端输入gksu nautilus<br />在打开的窗口找到要改的文件夹,右键-属性-权限,可以任意更改了<br />当然可以用命令行<br /> <br />
2011-01-08 10:16:00
797
原创 Ping and Traceroute
<br />正在看TCP/IP详解1,所以相关都得了解下。<br /> <br />实现代码采摘:<br />http://research.microsoft.com/en-us/um/redmond/projects/invisible/src/games/ping/ping.c.htm<br />http://www.codeproject.com/KB/IP/Ping_and_Traceroute.aspx<br /> 如何使用 TRACERT 解决 Windows 中的 TCP/IP 问题<br
2010-12-21 10:40:00
528
原创 linux download
Index of /pub/linux/kernel/Historic/old-versions<br />http://www.kernel.org/pub/linux/kernel/Historic/old-versions/<br /> <br /> <br />开始阅读 《linux 内核完全注释》<br />10:27:14 2010-12-13
2010-12-13 10:27:00
513
原创 SVN架设经历
<br />服务器下载地址: http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=11150&expandFolder=11150&folderID=8682<br /> <br />结合 http://www.cnblogs.com/andyran/archive/2007/08/31/876802.html<br />这篇文章,但遇到一个问题,老出异常,F:/SVN/conf/svnserve.conf:12: Optio
2010-12-07 11:33:00
419
原创 Singleton
<br />#include <assert.h>template <typename T> class Singleton{protected: static T* ms_Singleton;public: Singleton( void ) { assert( !ms_Singleton ); ms_Singleton = static_cast<T*>(this); } ~Singleton( void ) { assert( m
2010-08-12 11:56:00
580
原创 Player(Loginserver) 分析
//// Player 是指已经通过网络连接进入服务器端程序的客户//////#ifndef __PLAYER_H__#define __PLAYER_H__#include "Type.h"#include "Socket.h"#include "SocketInputStream.h"#include "SocketOutputStream.h"#include "Packet.h"#define MAX_CACHE_SIZE 1024
2010-08-06 11:11:00
1956
原创 SocketInputStream 分析
////文件名称: SocketInputStream.h//功能描述: 消息数据的接收缓存,提供数据的接收和格式化读取功能// ////#ifndef __SOCKETINPUTSTREAM_H__#define __SOCKETINPUTSTREAM_H__#include "BaseType.h"#include "Socket.h"//初始化的接收缓存长度#define DEFAULTSOCKETINPUTBUFFERSIZE 64*
2010-08-05 10:43:00
6781
原创 使用Ogitor自带的场景
配置目录:include + libplugins_debug.cfg# Defines plugins to load# Define plugin folderPluginFolder=.# Define pluginsPlugin=RenderSystem_Direct3D9_dPlugin=RenderSystem_GL_dPlugin=Plugin_ParticleFX_dPlugin=Plugin_CgProgramManager_dPlugin=Plug
2010-08-03 18:41:00
1212
原创 Factory Method
class Product{};//-----------------------------------------------------------------------------//first implementationtypedef int ProductId;const int MINE = 1;const int YOURS = 2;const int THEIRS = 3;class MyProduct : public Product{
2010-07-22 10:44:00
444
原创 D3D绘制按钮
//-----------------------------------------------------------------------------// File: CreateDevice.cpp//// Desc: This is the first tutorial for using Direct3D. In this tutorial, all// we are doing is creating a Direct3D device and using it
2010-07-20 09:36:00
1773
原创 游戏服务器设计--点点滴滴
关于服务器中玩家数据缓存: 服务器在启动的时候会从数据库中导入大量的信息,包括玩家的基本信息,玩家的活动信息,邮件,好友,组队等等。 问题:哪些信息是必须在服务器初始化时导入的? 考虑这个问题的因素:并不是所有的玩家角色活动频繁,有一部分的玩家长时间是不登陆的,全部导入会增加服务器的内存,而且查询服务器数据也会带来效率的影响。 考虑的方案:
2010-07-14 16:30:00
1458
原创 Start Game with OGRE
#include "ExampleApplication.h"#include #include #include class GameListener : public ExampleFrameListener, public OIS::MouseListener, public OIS::KeyListener{public: GameListener(RenderWindow* win, Camera* cam) : ExampleFrameListener(win,
2010-07-12 18:33:00
693
原创 Fifteenth Demo of OGRE
#include "ExampleApplication.h"class TutorialApplication : public ExampleApplication{protected:public: TutorialApplication() { } ~TutorialApplication() { }protected: MeshPtr mGrassMesh; void createGrassMesh() { const float w
2010-07-11 09:32:00
505
原创 Thirteenth Demo of OGRE
#include #include #include #include "ExampleApplication.h"class MouseQueryListener : public ExampleFrameListener, public OIS::MouseListener{public: enum QueryFlags { NINJA_MASK = 1
2010-07-11 08:48:00
569
1
原创 Twelfth Demo of OGRE
#include #include #include #include "ExampleApplication.h"class MouseQueryListener : public ExampleFrameListener, public OIS::MouseListener{public: MouseQueryListener(RenderWindow* win, Camera* cam, SceneManager *sceneManager, CEGUI::Renderer
2010-07-09 17:59:00
479
原创 Eleventh Demo of OGRE
#include "ExampleApplication.h"#include using namespace std;class MoveDemoListener : public ExampleFrameListener{public: MoveDemoListener(RenderWindow* win, Camera* cam, SceneNode *sn, Entity *ent, deque &walk) : ExampleFrameListener(win,
2010-07-09 11:47:00
572
原创 Seventh Demo of OGRE
Fame of CEGUI when used in OGRE//mem probs without this next one#include #include #include #include #include #include #include "OgreCEGUIRenderer.h"#include "OgreCEGUIResourceProvider.h"//regular mem handler#include "ExampleApplicatio
2010-07-08 14:59:00
485
原创 Sixth Demo of OGRE---Buffer Input
<br />#include "ExampleApplication.h"class TutorialFrameListener : public ExampleFrameListener, public OIS::MouseListener, public OIS::KeyListener{public: TutorialFrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr) : ExampleFra
2010-07-07 11:41:00
472
原创 Fifth Demo of OGRE---Listener
#include "ExampleApplication.h"class TutorialFrameListener : public ExampleFrameListener{public: TutorialFrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr) : ExampleFrameListener(win, cam, false, false) { mMouseDown = f
2010-07-06 13:54:00
482
gatling press tools
2014-08-06
C++Primer中文版(第4版).part2.rar--two parts in all
2008-12-24
C++Primer中文版(第4版).part1.rar--two parts in all
2008-12-24
PRENTICE_HALL-CPP_Gui_Programming_With_Qt3.2.pdf
2008-12-19
Beginning_SUSE_Linux_From_Novice_to_Professional.chm
2008-12-17
ADDISON_WESLEY-Moving_to_Linux_Second_Edition.chm
2008-12-16
[2007计算机Bible红版系列图书].Linux.Bible.2007.Edition
2008-12-16
Fedora.6.and.Red.Hat.Enterprise.Linux.Bible.chm
2008-12-15
Linux+Programming+by+Example+-+The+Fundamentals+[Prentice-Hall+2004].pdf
2008-12-15
CHM_Maded_Myself--Bjarne Stroustrup'S papers AND Interviews
2008-12-05
TorqueGameEngineAdvancedSDK-1-7-1.part2.rar TGEA
2008-11-15
Visual C++.Net 2008 (9.0) Precompiled Dependencies
2008-09-14
What_every_programmer_should_know_about_memory.pdf
2008-12-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人