Programmer Spray, on duty

Game, UnrealEngine3

导航

2012年5月20日 #

A Tour of Go Exercise: 69 Equivalent Binary Trees

摘要: 如其广告所言,Go用于写Equivalent Binary Trees确实简便优雅 1 package main 2 3 import "tour/tree" 4 import "fmt" 5 6 // Walk walks the tree t sending all values 7 // from the tree to the channel ch. 8 func Walk(t *tree.Tree, ch chan int){ 9 if t == nil {10 return11 }12 Walk(t.Left, ch)13 ch ... 阅读全文

posted @ 2012-05-20 23:35 Spray 阅读(207) 评论(0) 推荐(0) 编辑

2012年4月29日 #

A Tour of Go Exercise:Maps i 46 : function closure

摘要: Implement afibonaccifunction that returns a function (a closure) that returns successive fibonacci numbers. 1 package main 2 3 import "fmt" 4 5 // fibonacci is a function that returns 6 // a function that returns an int. 7 func fibonacci() func() int { 8 i1 := 0 9 i2 := 110 return func... 阅读全文

posted @ 2012-04-29 00:46 Spray 阅读(355) 评论(0) 推荐(0) 编辑

2012年4月28日 #

A Tour of Go Exercise:Maps i 44

摘要: Go 语言练习 A Tour of GoImplementWordCount. It should return a map of the counts of each “word” in the strings. Thewc.Testfunction runs a test suite against the provided function and prints success or failure.You might findstrings.Fieldshelpful. 1 package main 2 3 import ( 4 "tour/wc" 5 " 阅读全文

posted @ 2012-04-28 23:33 Spray 阅读(247) 评论(0) 推荐(0) 编辑

2012年2月8日 #

do{} while(0)

摘要: cocos2d-x 里面看到比较怪的代码CCScene* HelloWorld::scene(){ CCScene * scene = NULL; do { // 'scene' is an autorelease object scene = CCScene::node(); CC_BREAK_IF(! scene); // 'layer' is an autorelease object HelloWorld *layer = HelloWorld::node(); CC_BREAK_I... 阅读全文

posted @ 2012-02-08 23:16 Spray 阅读(310) 评论(0) 推荐(0) 编辑

2012年2月6日 #

VS2010 中的.vcxproj/.vcxproj.user等

摘要: 一个VS2010的工程中,所有的参数都是保存在.sln/.vcxproj/.vcxproj.user 三个文件中的。今天我试图修改一个debug参数,其中某一个参数读取的是默认值,也就是$(projectdir), 而我需要将它改成$(projectdir)\..\..\这个目录,于是我就动手改。然后保存,奇怪,我本以为会提示我某些文件需要checkout (比如sln或者vcxproj的)结果居然没有。那我改了该怎么上传呢?同事提醒我,有的信息是保存在vcxproj.user中的,这个是本地设定,一般p4上是不管理的。我去查了下, 果然,所有debug的设定,都是被保存在vcxproj.us 阅读全文

posted @ 2012-02-06 16:21 Spray 阅读(7446) 评论(1) 推荐(0) 编辑

2011年11月8日 #

开博,计划书单

摘要: 一直觉得在校内,开心和QQ空间这种地方写技术类的东西比较格格不入(八卦才是王道), 但是总觉得该有个地儿交流些啥心得啊之类的。果然,刚发现有专为程序员量身定做的。先简单列下想读或者重读的书单吧:Programming Pearls 2 /编程珠玑才开始一点点,虽然书比较薄,但是料很足。里面好多题目好纠结,精读的话,估计至少1各月//--------------------------------------------------------------------------------------------------------------Introduction to 3D Game 阅读全文

posted @ 2011-11-08 20:49 Spray 阅读(210) 评论(0) 推荐(0) 编辑