- 博客(815)
- 收藏
- 关注
原创 (pbc lua 加入)c++_lua_Python with/without extension性能测试 (10万次SerializeToString & ParseFromString)
A. extension c++: 0.259s lua:6.136s python: 15.874s c++比 lua -->23.6倍 lua比python -->2.58倍B.without extension c++:0.098s 林卓毅 protoc-gen-lua lua:1.788s 云风 p
2012-05-22 20:11:47
7015
原创 gen lua
1.make linux, lua 5.1.4 64位系统编译的时候加上-fPIC, libreadline5-dev的安装,否则编译时找不到文件2.protobuf编译完后,运行python文件夹下的setup.py test & setup.py intall 将库添加入python3.pkg-config的安装4.做link时,看清原文件是否具有了执行权限
2012-05-22 10:29:26
2645
原创 boost.python,在python中调用c++接口注意的问题(python2.5.4)
1.BOOST_PYTHON_MODULE(myClassModule){ class_("myClass") .def("setID", &myClass::setID) .def("getID", &myClass::getID) ; def("printTest", &printTest);} 2.Py_Initialize();/
2012-02-04 21:16:27
2918
原创 ACE_TSS全局变量析构的问题
在调试时ace6.0.6发现,使用到全局的ACE_TSS类时,程序退出时会报错,跟踪了一下发现问题的原因在于析构的顺序问题 1.退出时,先析构的是ACE_Main_Base 2.之后析构的是全局ACE_TSS对象,这时就出在setspecific的时候出错 3.解决方案控制全局对象的构造与析构顺序,让ACE_Main_Base最后才析构,这点貌似不好做到临时的方法是
2012-01-02 11:05:49
2751
原创 MySQL Connector
1.MySQL Connector/ODBC 3.51 driver 还是 5.1 driver, 要对应上不同的mysql版本
2011-12-04 20:53:22
1877
原创 wxwidget onpaint
1. // wxWidgets documentation: Note that In a paint event handler, // the application must *always* create a wxPaintDC object, even // if you do not use it. Otherwise, under MS Windows,
2011-11-05 10:36:16
2170
原创 CEGUI 重载Window与WindowRenderer
<br />namespace CEGUI<br />{<br /> class MapTooltip : public Window<br /> {<br /> public:<br /> static const String WidgetTypeName; //!< Window factory name<br /> MapTooltip(const String& type, const String& name);<br /> ~MapToolt
2011-04-04 11:13:00
2116
原创 wxWidgets+Ogre(2)
<br />2011/2/14 Happy Valentine's Day to the world, leave me alone.<br /> <br />(咦?光标不见了)<br />1.从scriptloader里读取所有*.mesh放到列表里,点一个换一个,点左键则create一个, over.<br />
2011-02-14 21:28:00
2514
原创 myEclipse debug android 'hello world'
<br />1.debug 我的 hello world时,发现看到播放器的debug message<br />
2010-12-25 18:33:00
2207
原创 异或的用法
http://blog.codingnow.com/2008/06/variable_length_array.htmlstructvector {int*data;int size;};voidvector_expand(struct vector *v,int s){int new_size=v->size + s;if((new_size ^ v->size)> v->size){ v->data=(int*)realloc(v->data,sizeof(int)*new_size *2)
2010-12-11 11:39:00
2094
原创 bitset是好东西
<br />#include <bitset><br /> <br />std::bitset<sizeof(int)*8> qq(2010);<br />cout<<qq<<endl; //二进制<br /> <br />string ss = "101";<br />std::bitset<sizeof(int)*8> mm(ss); <br />cout<<mm.to_ulong()<<endl; //手输入二进制
2010-12-11 11:18:00
2185
原创 cegui + directX9
1.一些游戏用的cegui还是非常老的版本,尝试在porting到cegui0.72上,难度真不小2.做了简单的demo,加载TLBB的一些layoutcode:CEGUI::SchemeManager::getSingleton().loadScheme("./schemes/WoWLookSkin.scheme.xml"); //CEGUI::SchemeManager::getSingleton().loadScheme( "./schemes/TaharezLookSkin.scheme" )
2010-11-22 16:46:00
2848
原创 mygui与luaplus的绑定
<br /><br />1.CEGUI里load layout的时候,有关于event的property项,内容一个是event名,另一个是lua脚本里的function name. event事件来后fireEvent,依次调用event里的SlotContainer函数指针容器内的SubscriberSlot,而lua对应的应该是ScriptFunctor模板转换的FunctorCopySlot,ScriptFunctor重载了operator(),operator()调用的就是scriptModul
2010-11-15 17:38:00
3992
1
原创 枚举转string输出
<br />#define MSGDEF(x) if(uMsg == x) {printf("%s",#x);}<br />enum kk<br />{<br /> BT_1,<br /> BT_2,<br /> BT_3<br />};<br />void printf_enum(int uMsg)<br />{<br /> MSGDEF(BT_1);<br /> MSGDEF(BT_2);<br /> MSGDEF(BT_3);<br />}
2010-08-04 15:35:00
2482
原创 上海四金和税的算法
<br />四金的缴费基数的定义: <br /><br />一般四金基数就是当月的工资,不过如果工资很高(比如超过了上年你所在城市社会月平均工资的三倍),那基数就到顶了。而如果工资特别低的话(比如低于上年你所在城市社会月平均工资的百分之六十),那基数也有封底。 <br /><br />四金缴费比例: 个人缴纳部分公司缴纳部分 <br /><br />养老保险金= 基数×8% +基数×22%<br /><br />医疗保险金= 基数×2% +基数×12% <br /><br />失业保险金= 基数×1% +基
2010-07-08 12:46:00
1177
原创 tc 快捷
<br />1.SHIFT+F4 新建文件<br />2.CTRL+R 刷新<br />3.ALT + F5 压缩到对面文件夹<br />4.CTRL + AlT + F5 压缩到本文件夹<br />5.CTRL + D 显示路径栏右边带星的路径<br />6.Alt + Shift + Enter 当前窗格下所有文件夹的占用空间<br />7.Shift + ↓和 Shift + ↑:选择或取消选择文件或文件夹
2010-07-07 11:20:00
689
原创 string list
<br />// STL<br />#include <string><br />#include <list><br />#include <sstream><br />typedefstd::list< std::basic_string<TCHAR> > string_list;
2010-07-03 12:24:00
722
原创 普通函数定义在头文件
1.此函数应该被定义为static防止多次定义的link error2.如果是全局变量, 则加 __declspec(selectany), 防多次定义
2010-05-05 11:54:00
825
1
原创 plan5.1
1.c/c++ compile principle2.linux network server3.windows gui4.effect c++5.lua script
2010-05-01 01:19:00
554
原创 template类中容器成员的访问
1.如何访问template类中容器成员,特别是层次比较深的时候, "::"符比较难做到 solution : typename example:template >class MyContainer{public: T& front() { return _con.front(); } void insert(const T& t) {
2010-04-21 10:29:00
925
原创 Effective C++
Item 1: Prefer const and inline to #define.Item 2: Prefer to .Item 3: Prefer new and delete to malloc and free. Item 4: Prefer C++-style comments. Item 5: Use the same form in correspo
2010-04-05 23:32:00
652
原创 Dream2
1.入学, 饭堂吃早饭, 迟到了, 鱼头煲, 吃的时候,电视放抽血体验的,恶心死了, 去洗餐具,发现人走光了,门也快关了, 走小门, 发现后面有个女青年只穿内衣在跑,原来我跑错员工更衣室了2.踏进教室, 发现老师光脚, 我刚走了两步,发现同学们的眼光不对劲,一直望着我的脚, 原来地板被刷得非常干净直到反光, 我连声说对不起,抄后门进了, 后来才知道班级有个洁癖狂3.我的死党"东神骑士飞升"
2010-04-05 21:53:00
506
原创 Effect STL Items
Item 1. Choose your containers with care.Item 2. Beware the illusion of container-independent code.Item 3. Make copying cheap and correct for objects in containers.Item 4. Call empty instead of
2010-03-31 22:42:00
740
原创 ModifyStyle, ModifyStyleEx
1.wtl 中的CListViewCtrl调用ModifyStyle, ModifyStyleEx, 不起作用, 改成_listCtrl.SetExtendedListViewStyle(_listCtrl.GetExtendedListViewStyle() | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES, 0);参照http://www.cppblo
2010-03-18 17:08:00
3294
原创 study1
1.class _OgreExport NedPoolingPolicy ==>全是静态函数(包C API)2.template class CategorisedAllocPolicy : public NedPoolingPolicy{}; ==>模板给它增加Policy,省去virtual 继承所花费的vtable3.template struct MyTest{
2010-03-16 22:44:00
561
原创 things to do
1.classify the disk to study and entertainment(add disk volume, maybe?)2.cegui exception3.get snippet from company. ---4.get words in kingsoft dict back home
2010-03-08 10:54:00
521
原创 kernel
1. "@ e r r, h r " at watch2. TCHAR* buffer;DWORD error = GetLastError();::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, ( LPTSTR )&buf
2010-02-11 00:55:00
549
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人