上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 官网下载安装,我这里用的x64版。拷贝个sublime_text.exe副本到sublime_text_copy.exe,并用Sublime打开。 把3032前的3342改为3242保存。然后填入注册码,并注册: —–BEGIN LICENSE—– hiwanz Unlimited User License EA7E-26838 5B320641... 阅读全文
posted @ 2013-05-30 14:09 紫红的泪 阅读(934) 评论(0) 推荐(0) 编辑
摘要: JSON doesn't require you to do that, it allows you to do that. It also allows you to use "\u0061" for "A", but it's not required. Allowing \/ helps when embedding JSON in a <script> tag, which doesn't... 阅读全文
posted @ 2013-02-28 17:10 紫红的泪 阅读(11002) 评论(0) 推荐(0) 编辑
摘要: Unity3D中C#实现协程需要注意一下几点: # An iterator member's signature cannot contain any out or ref parameters. # An iterator cannot contain a return statement . # An iterator may not contain any unsafe ... 阅读全文
posted @ 2013-02-07 20:53 紫红的泪 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 游戏中经常需要玩家与环境互动,比如开门动作、射击动作等。常用的互动方式有三种,碰撞检测、光线投射和碰撞检测触发器。以开门这个简单动作为例, 碰撞检测(Collision detection) 当玩家与门的碰撞体发生物理碰撞时触发开门动画。若门的碰撞体与门一样大,这会导致玩家贴着门时门才会打开,感觉门是被撞开的。若门的碰撞体比门大,使得玩家与看不见的碰撞体发生物理碰撞,... 阅读全文
posted @ 2013-01-30 16:04 紫红的泪 阅读(1576) 评论(0) 推荐(0) 编辑
摘要: 在C#和Python中都有GC,但是它们的实现完全不同。C#用的是传统的垃圾回收机制,主要是寻找能够从根集达到的对象,把这些对象标记为活的,然后清理其余对象;Python由于支持扩展模块(C/C++等),他的根集很难找全,因此Python使用引用计数机制来做垃圾回收。引用计数就存在循环引用的问题,参见How Python GC deal with reference-cycles? ... 阅读全文
posted @ 2013-01-28 14:20 紫红的泪 阅读(443) 评论(0) 推荐(0) 编辑
摘要: Python的super()在多继承下的方法推导顺序(MRO, Method Resolution Order)涉及到C3线性化算法(C3 linearization wiki)。其中关键是, children precede their parents and the order of appearance in __bases__ is respected. 例子, ... 阅读全文
posted @ 2013-01-17 15:54 紫红的泪 阅读(467) 评论(0) 推荐(0) 编辑
摘要: >>> def a():... print "a executed"... return []... >>> >>> def b(x=a()):... x.append(5)... print x... a executed>>> b()[5]>>> b()[5, 5]Actually, this is not a design flaw, a... 阅读全文
posted @ 2013-01-07 16:59 紫红的泪 阅读(1033) 评论(0) 推荐(0) 编辑
摘要: The supplemental garbage collection facility, however, is enabled by default and should be able to free that structure, if none of its components are reachable from the outside anymore and they do not... 阅读全文
posted @ 2013-01-06 16:46 紫红的泪 阅读(891) 评论(0) 推荐(0) 编辑
摘要: 像if…else…这种没必要细说,Python中比C/C++多出来的有while…else…/for…else…/try…else…。while…else…/for…else…工作顺序为:在循环中使用时,else语句只在循环完成后执行,也就是说,break语句也会跳过else代码块,只要循环是正常结束,而不是通过break,else语句就会执行。try…else…功能和循环中的else语句没有多大区别:在try范围内没有检测到异常的时候,执行else子句。 阅读全文
posted @ 2012-12-24 14:12 紫红的泪 阅读(1913) 评论(1) 推荐(0) 编辑
摘要: 在stackoverflow上看到的一篇,刚好解答了我的疑惑:http://stackoverflow.com/questions/68630/are-tuples-more-efficient-than-lists-in-python The "dis" module disassembles the byte code for a function and is usefu... 阅读全文
posted @ 2012-12-24 12:49 紫红的泪 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 学习了下C#的排序,Array.Sort需要使用IComparer接口的比较函数。性能高,但是有时候需要写法简单不需要效率时,可以用LINQ: // To order a sequence by the values of the elements themselves, // specify the identity function (x => x) v.Ord... 阅读全文
posted @ 2012-12-18 16:13 紫红的泪 阅读(767) 评论(0) 推荐(0) 编辑
摘要: 《Learn Python The Hard Way》中文版,基本可以当手册看:http://lpthw-cn.ducktypist.com/en/latest/index.html# 《A Byte of Python》中文版,之前看过英文版,感觉光看不练没啥用:http://linux.chinaitlab.com/manual/python_chinese/ 《Think Pyth... 阅读全文
posted @ 2012-11-29 15:17 紫红的泪 阅读(628) 评论(0) 推荐(0) 编辑
摘要: 最近有个这样的需求,就是在不能获取dll源码情况下来检测该dll的内存泄漏。并且该dll是release下的版本,链接了release版的CRT。由于不能获取源码,就不能重新编译,比较好的解决方案就是hook api。寻思这事儿肯定有人干过,搜了一下在code project上真有。收藏一下: http://www.codeproject.com/Articles/150463/Le... 阅读全文
posted @ 2012-11-29 15:12 紫红的泪 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 看到一篇lock-free数据结构的文章,写的不错,最原始的出处是IBM Developer Works,这里转载的看着更顺眼些:http://gamebabyrocksun.blog.163.com/blog/static/57153463201291654858247/ 阅读全文
posted @ 2012-11-28 17:28 紫红的泪 阅读(1308) 评论(0) 推荐(0) 编辑
摘要: 主要用在Managed C++做Native C++ Wrapper时, void foo(Bar^% x); => void foo(ref Bar x); using namespace System::Runtime::InteropServices; void foo([Out] Bar^% x); => void foo(out Bar x); 阅读全文
posted @ 2012-11-22 16:03 紫红的泪 阅读(1231) 评论(0) 推荐(0) 编辑
摘要: 看MongoDB源码,发现里面有用这种诡异智能指针的,以前没见过,学习了。原文地址 阅读全文
posted @ 2012-11-19 16:06 紫红的泪 阅读(1067) 评论(0) 推荐(0) 编辑
摘要: 主要是要注意两种析构语义上的不同:http://www.cnblogs.com/flier/archive/2004/07/08/22333.html 阅读全文
posted @ 2012-11-08 13:34 紫红的泪 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 所谓Stemming,可以称为词根化,这里有个overview。在英语这样的拉丁语系里面,单词有多种变形。比如加上-ed、-ing、-ly等等。在分词的时候,如果能够把这些变形单词的词根找出了,对搜索结果是很有帮助的。Stemming算法有很多了,三大主流算法是Porter stemming algorithm、Lovins stemming algorithm、Lancaster (... 阅读全文
posted @ 2012-11-06 11:51 紫红的泪 阅读(811) 评论(0) 推荐(0) 编辑
摘要: 当这两个头文件顺序颠倒时,编译会出现许多莫名其妙的错误,错误如下: 1>…\include\ws2def.h(91) : warning C4005: 'AF_IPX' : macro redefinition 1>…\include\winsock.h(460) : see previous definition of 'AF_IPX' … [原因分析] 主要原因... 阅读全文
posted @ 2012-11-05 15:18 紫红的泪 阅读(6267) 评论(0) 推荐(0) 编辑
摘要: 一直以来都是在Win32环境下Build和使用boost,但现在基本上每天都在64位Win7下工作,所以很有必要把这几天的经验总结下来。和32位环境不同,x64环境下编译得先从开始菜单启动Visual Studio的Visual Studio 2008 x64 Win64 Command Prompt进入命令提示符,而不是随便打开任意一个命令行窗口就行。然后转到boost根文件夹,运行... 阅读全文
posted @ 2012-11-05 11:04 紫红的泪 阅读(16627) 评论(3) 推荐(3) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页