问题引入:游戏里面每个Player身上有很多buffs,在每一个tick(最小时间段)都要去检查buff里面的每一个buff是不是过期,产生的效果如何,造成在每个tick里面都去遍历一个长list,明显很不好。 怎么优化? 1.原始模型: buff的状态在每一个tick里面都要更新!可以想象指针每移...
分类:
其他好文 时间:
2014-06-27 15:55:42
阅读次数:
355
function tick_handler () { echo "tick_handler() called" ; } function tick_handler1 () { echo "tick_handler1() called" ; } register_tick_f...
分类:
Web程序 时间:
2014-06-21 07:05:30
阅读次数:
723
组内有个同事,有个奇怪的需求需要matplotlib删除x轴效果图如下:关键代码:from matplotlib import pyplot as pltplt.plot(range(10))plt.tick_params(\ axis='x', # changes appl...
分类:
其他好文 时间:
2014-06-18 08:55:25
阅读次数:
324
一开始思考的时候觉得好难的题目,因为感觉很多情况,不知道从何入手。
想通了就不难了。
可以转化为一个利用速度建立不等式,然后解不等式的问题。
建立速度,路程,时间的模型如下:
/***************************************************************************
* *
* 秒钟的速度s=6°/s,分针...
分类:
其他好文 时间:
2014-06-10 15:20:06
阅读次数:
163
1.首先我们的目的是长期监听时间变化,其实应用程序退出。
通过了解我们知道注册ACTION_TIME_TICK广播接收器可以监听系统事件改变,但是
查看SDK发现ACTION_TIME_TICK广播事件只能动态注册:
Broadcast Action: The current time has changed. Sent every minute. You can not receive t...
分类:
移动开发 时间:
2014-06-05 08:35:13
阅读次数:
285
hash wheel timer是一种算法,netty用来做心跳超时检查,这个算法有几个共有的属性:Ticks per Wheel (一轮的tick数),Tick Duration(一个tick的持续时间)以及 TimeUnit(时间单位)。关于Tick Duration我感觉应该解释为每一次tick时间间隔。
HashedWheelTimer原文英语注释表达了这样一层意思:
...
分类:
其他好文 时间:
2014-05-25 08:51:24
阅读次数:
230
The three hands of the clock are rotating every
second and meeting each other many times everyday. Finally, they get bored of
this and each of them wo...
分类:
其他好文 时间:
2014-05-12 05:20:21
阅读次数:
525
solution1.Tick the primary key 1.right click on
the Id of the entity in dataset schema. 2.Edit Key 3.Tick the Primary Key
分类:
其他好文 时间:
2014-05-07 19:18:56
阅读次数:
362
很多应用都会有一个启动界面。欢迎画面慢慢隐现,然后慢慢消隐。我的方式是使用两个Activity,程序启动时候load第一张Activity,然后由tick触发N秒钟后startActivity另外一张Activity。splash.javapackage
com.yuyidong.second;im...
分类:
移动开发 时间:
2014-04-29 10:22:46
阅读次数:
506