摘要: DescriptionBackground The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is two squares in one direction and one square perpendicular to this. The world of a knight is the chessboard h 阅读全文
posted @ 2012-03-13 20:54 zsounder 阅读(295) 评论(0) 推荐(1) 编辑
摘要: link to original: http://www.learn-cocos2d.com/2011/08/comparison-lua-scripting-corona-sdk-wax-kobold2d/comment-page-1/#comment-232193This Kobold2D FAQ article explains the difference between Corona SDK and iPhone Wax library, and evaluates the existing and future options for Lua scripting in Kobold 阅读全文
posted @ 2012-03-13 16:21 zsounder 阅读(519) 评论(0) 推荐(1) 编辑
摘要: A*寻路初探 GameDev.net作者: Patrick Lester 译者:Panic 2005年3月18日译者序:很久以前就知道了A*算法,但是从未认真读过相关的文章,也没有看过代码,只是脑子里有个模糊的概念。这次决定从头开始,研究一下这个被人推崇备至的简单方法,作为学习人工智能的开始。 这篇文章非常知名,国内应该有不少人翻译过它,我没有查找,觉得翻译本身也是对自身英文水平的锻炼。经过努力,终于完成了文档,也明白的A*算法的原理。毫无疑问,作者用形象的描述,简洁诙谐的语言由浅入深的讲述了这一神奇的算法,相信每个读过的人都会对此有所认识(如果没有,那就是偶的翻译太差了--b)。 现在是20 阅读全文
posted @ 2012-03-09 17:07 zsounder 阅读(439) 评论(0) 推荐(1) 编辑
摘要: 这是德问技术社区的一个问题,测试了一下,使用typeid等方法都无法正确区分二者,不讨论二者是不是有必要进行区分;下面给出一个方案吧,其实就是利用了Traits,模板的匹配规则。 1: template<typename T> class _ischararray_; 2: 3: template<typename T, int N> 4: class _ischararray_<T[N]> { public: static bool _ischararray(){return true;}}; 5: 6: template<typename T... 阅读全文
posted @ 2012-03-09 11:00 zsounder 阅读(1032) 评论(0) 推荐(4) 编辑
摘要: 一篇介绍C++ Traits的文章:An introduction to C++ Traits,分享一下,后面会针对Traits做一点总结。It is not uncommon to see different pieces of code that have basically the same structure, but contain variation in the details. Ideally we would be able to reuse the structure, and factor out the variations. In 'C' this m 阅读全文
posted @ 2012-03-09 10:45 zsounder 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 几年前整理的,最近有人问起,先放在这里,改天整理一下,前端时间忙,该开始整理一下笔记里的东西了,以后定时更新博客咯。源码下载单继承模式下,虚继承 1: #ifndef OM_SINGLE_VIRTUAL_INHERITANCE_H_ 2: #define OM_SINGLE_VIRTUAL_INHERITANCE_H_ 3: // 单继承模式下,虚拟继承 4: // 若子类没有新定义virtual函数 此时子类的布局是 : 5: // 低地址 -> 高地址 6: // vbptr,子类的元素, 虚基类的元素. 7: // 在虚基类派生出来的... 阅读全文
posted @ 2012-03-01 00:53 zsounder 阅读(697) 评论(2) 推荐(2) 编辑
摘要: Event-Driven Programming: Introduction, Tutorial, Historyhttp://Tutorial_EventDrivenProgramming.sourceforge.netStephen Ferg (steve@ferg.org)Version 0.2 – 2006-02-08This work is licensed under a Creative Commons Attribution Licensehttp://creativecommons.org/licenses/by/2.5/The Creative Commons Attrib 阅读全文
posted @ 2011-10-27 21:56 zsounder 阅读(3349) 评论(0) 推荐(0) 编辑
摘要: 1 Interface(接口约定) Interface理解为接口概念,于JAVA\C#中的接口有所不同的是Obj-C中的接口应该理解为一种非正式协议,Obj-C中的Interface只是表明应该会处理其中声明的消息(方法),但是不是必须处理。 表明Sample Interface中,约定了应该会处理HelloWorld消息,但是Sample.m中我们可以不去实现对HelloWorld的处理,这样编译器会给出警告但是编译可以通过,但是在程序中向Sample发送该消息会引发异常。2 Protocol(正式协议) Protocol(正式协议)看上去更正规一些,语义上更强烈一些:要求采用该协议的类,. 阅读全文
posted @ 2011-10-27 21:33 zsounder 阅读(1434) 评论(0) 推荐(1) 编辑
摘要: GNUstep 首先,目前windows下没有Objective-C的IDE存在,ObjectiveEClipse是一款可选择的插件,搭配Eclipse3.5+CDT6.0,但是已经停止更新。GNUstep是提供类似Cocoa(苹果OS的开发框架)的API和工具,目前支持GNU/Linux and GNU/HURD, Solaris, NetBSD, OpenBSD, FreeBSD, Darwin和Windows,免费使用。这个项目使Objective C能在多数流行平台上开发和运行。 在Windows下搭建Objective C开发环境,需要到GNUstep官方网站上下载,四个软件包:.. 阅读全文
posted @ 2011-10-27 21:18 zsounder 阅读(4554) 评论(1) 推荐(1) 编辑
摘要: 概述 : 非内核对象临界区非常适合于序列化对一个进程中的数据的访问,因为它们的速度很快。但我们或许想要使一些应用程序与计算机中发生的其它特殊事件或者其它进程中执行的操作取得同步。这时临界区无能为力。就需要使用内核对象来同步。 可以使用下列内核对象可用来同步线程: 1. 进程,Processes 2. 线程,Threads 3. 文件,Files 4. 控制台输入,Console input 5. 文件变化通知,File change notifications 6. 互斥量,Mutexes 7. 信号量,Semaphores 8. 事件(自动重设事件和手动重设事件),Events 9. 可等. 阅读全文
posted @ 2011-06-21 15:15 zsounder 阅读(517) 评论(0) 推荐(0) 编辑