Firefox setInterval passes Random number as parameter bug

I was working on a web development project. Until 30 minutes ago, I had discovered something strange with my code. It worked well on IE and Chrome but it created random results on Mozilla Firefox version 3.6.12. So i did some quick alert()s to find out whats went wrong. Surprisingly, I found out that  if you pass a callback function that can accept parameter into setInterval. It will pass random numbers into the callback function when it wasn't suppose to. I tried to start Firefox in safe mode and run the test again. Unfortunately, the bug still exists.

If you're geeky enough to watch the bug live in action just head over the demo page to reproduce the bug.

Update #1: I just tested the code with setTimeout() it seems like setTimeout() is affected as well.
Update #2: I just filed a report at Bugzilla@Mozilla.
Update #3: It was my mistake. :P It isn't a bug but an inconsistency between browsers.

删除

我向来不是喜新厌旧之人。但手机毕竟是人类制造的,经不起日月的摧残(换手机的借口)。打从拥有了第一支手机起,前前后后我已换了好几架 (每一支都仍然能用哦)... 有的被我搁在家里,有的已换了新主人。物换星移,许许多多的事情一直在改变。在最新的手机里联络表也为了庆祝迁入新居而做出了一番整顿。它的脑海里已不再存有一直不舍丢弃的短讯 - 那些不该属于他的回忆。它们都被... 删除了。

Confidence

She said that I'm a confidence person whom I think I'm not. A confidence person must be mentally strong and able to face challenges as well as projecting a strong image to others. A lot of things had happened in my life lately, my blog is just showing a tip of the iceberg. Some, which I had decided to withheld until I find the right time to write about them. I keep telling and convincing myself so that I can get to pass these phases. Saying that "Constants cannot be redefined" is merely another way to say "Whatever Happened, Happened". I always believe that things happen for a reason. We could either face it, change it or ignore it. I made up my mind to really deal with the problems and change my life. I have no idea what the changes will bring. Be it good or bad I believed this is what I need to do. It is a right thing to do... I suppose.

你·我

那天发生了一些事情。是关于你和我。我知道挣扎于事无补。我知道伤心你会笑我傻。搞乱了你的生活秩序是我不对。可是,有些事情你不用去疑惑、质疑。友谊是真,一直都存在着的。短讯传来,你告述需要几天时间整顿思绪。我只想说我需要更长的时间...

星际2加速挖矿 StarCraft II 7% Mineral Boosting

有人发觉了挖矿的AI有问题。会有7%的延迟. 用AI采矿后矿工会停留一段时间才把矿运回基地。但是如果你用手动用Shift预先queue up挖矿(shift + right click on mineral)和运矿(shift + c)的热键, 你就可以略过AI(要一直重复), 手动指挥矿工加多7%的资源。

高呼吧!现在开局不用闲着了.

草稿

一堆存放了很久的草稿
以前草拟的一些部落文章。一部分已经写了很久,有些却有种种的原因与借口一直搁着没完成。绝大部分是开了个头却想不到内容写下去。越写觉得越空洞所以就没写下去了。最近想选一部分以前留下的草稿写下去。就让读者以留言投票吧。








Still Learning MySQL, MSSQL, Oracle?

I had long thought that it was stupid to implement data consistency control at application layer when I first started coding with PHP and MySQL. Now, I notice that I wasn't that stupid at all, given that most relational databases are "optimized" and partitioned to allow intensive I/O and higher scalability... As a result relational databases became more like object databases which was introduced in the 80's.

As the web evolves, web applications becoming more and more demanding... Now web giants like Google, Facebook, Ebay and Digg are starting to drop relational databases and going back for non-relational storage solutions for better cloud computing. They called it as NoSQL.

As Instant as Google

As always, Google has been trying to make the search experiences more pleasant and user friendly since day one of the search engine development. There were numerous small changes being carried out through out the years. Most changes are hardly noticeable to normal users but the impact on performance and time spent per search are improving drastically. 

When we thought Google Suggest (predicts, suggest & auto complete the keywords as you type) is the best thing Google search can provide us, Google had just shown us an instant streamed search results as you type and almost as fast as you can think. Google Instant is new but it looks, behaves, feels so familiar with the old version. The improved user interface is silk, minimalist and smooth. 

Various UI elements on the Google Instant are fairy consistent. They don't get pushed to bottom as the search interface has a fixed width which I usually hate when dealing with dynamic changing interface. Thumbs up to the UI design team. The streamed results are predicting your input very well in most cases. Google claims that it reduces the total time per search by two to five seconds. What else can be as instant as Google?

乐高

Lego乐高砖块是我小时候最喜欢的玩具之一。大概在我两三岁时(虽然乐高有指定年龄但当时有妈妈看着),已经开始玩乐高。经过妈妈细心的引导下两岁的我已经能依照图表拼出较简单的乐高模型。妈妈也断断续续的买了好几盒小型(比较便宜)的乐高组合。开始时我还需要依赖图表才能把模型组装起来。

伏笔

那天,我旧地重游了。买了你喜欢的调味豆奶,喝着,一边走一边寻觅着过去的迹影。回味着与你一起喝过的芋味珍奶。脚板隔着鞋底隐约地感受着一起走过的冰冷大理石。感觉你隔着空气的体温。回忆着当天的点点滴滴,那套电影、那只小熊、那顿午餐。 这些事情,大概你都忘了吧?忆起了两年前在送你生日卡片上埋下以诗词写的伏笔。可是,我又能怎么样呢?

Megablue的数独(Sudoku)程式

Sudoku by megablue v0.2 screen capture
数独,一个玩法简单却具有非常挑战性的数字游戏。前一阵子UCPRO编程论坛的版主出了一道题来挑战坛友。可惜最终只有我写出了一个完整的数独程式。既然没有挑战者那活动就这样作废了。

旧版本(v0.1)是一个纯文字界面界面的单线程程式。前天我把程式用图像界面重写了(v0.2),以及改良了演算法.

更新: 刚刚W.Jiun给了一些建议。我也觉得界面太小了,所以在界面上做了一些调整。如果下载了v0.2觉得界面太小的话可以试试v0.2a. 除了界面以外基本上是一样的。



Path


From now on, I must further the journey alone. There are some paths that are meant to be walked by yourself where no one could accompany you. No one will be there for you when you fall. I just hope that I wouldn't fall... at least not too hard. Determination is crucial; I must keep myself reminded.

雀儿云端闹
猎人不知晓
候时看天照
我说等待老

预览新部落


一直很想编写自己的部落软件却因为惰性而一直擱着。所幸的是最近有一股写作心劲那一股小小的冲动。几天前我翻出了旧有的设计重新整理了一下稍微修改了不足之处。草图设计好后就开始用下班的时间埋头编写。 既然是编写自己的部落对我而言一定对自我有要求。我一直希望有一个非一般有着自我的个性的部落 - 在技术,网页的设计,以及文中上。这篇文字我会尽量控制自己的科技瘾不触及技术上的讨论或轻轻带过。稍微认识我的人都知道,说不到两句我就一定会扯上科技的话题,果真是极客的第一名。唓,又离题了。转跳后可看我画的草图。



Wii Wheel 正邪之战之败了两个

今天去了Endah Parade, 本来不打算买东西... 走入了Carrefour 看到了传说中Carrefour出品的Wii Accessories.

为了让大家可以见证传说,二话不说我就拿出了用了高级Carl Zeiss镜头但拍照很烂的Nokia Express Music 5800手机.


吱咔









吱咔











还好拍出来的照片很看得清。

脑海中突然出现一把低沉听起来有点邪恶的声音游说叫我败Sport Packs.....毕竟28 in 1 这句话的确有点吸引力。
本来想下手了败Sport Packs了.... 可是在下手前的一刹那,另一把声音清脆善良的声音在紧急关头把我叫醒了..
看看下觉得没必要反正想要的只是Wii Wheel...所以就不败了也逃过了被品质低劣但价格便宜的圈套。

虽然暂时摆脱了那把低沉的声音一直脑海中回旋....“败呀败呀,败了玩马车就会很厉害哦!”。
为了不让他击败我...我就加快了脚步逃出了Carrefour。“哈哈这次我胜利了!” 心里是这么想着.可是我却没有察觉到,双脚已经在我卸下防心那一段空档被那邪恶的声音控制了。
走着走着... 当我回过神来,已经在一家电玩专卖店前了。 连那把清脆善良的声音也开始劝我别做无谓的抗拒了。
既然如此,我只好依从免得自己难受。近入了店内,为免那坏东西再次影响我。我就即刻冲到摆放着官方版Wii Wheel的摆设柜前。向店员询问了价钱就要了两个。付钱时共给了120大元!T_T 我又输了再次彻底的战败了!

驾着残旧的笨蛋回到家,Wii remote接上Wii Wheel, 把马车放入了游戏机内。
游戏就开始了,果然不错过弯飘移都比以前顺畅多了。
重点是那方向盘握得非常有质感也没这么容易累了。那把已经沉默一段时间的声音又出现了“嘿嘿,听老子的话总没错吧?玩得很爽是吗?”。
我带怒意大声的反驳“你住口,那是我自己的决定与你无关!”
那声音嘻嘻的笑着...笑声渐小...
邪不能胜正...真的吗我心里质疑着...