February 24, 2014



首先,至少有两个人生日相同,表示有多人生日相同也是符合要求的,那我们就采用补的方法,至少有两个人生日相同的概率等于1减去所有人的生日都互异的概率。\(P_1\) 表示所有人生日互异的概率。

February 23, 2014




August 28, 2013


看到一片文章讲的是Javascript的异步回调,然后我想Javascript的callback是不是都是异步的? 找到一篇阮一峰的文章, 里面的一段代码其实有点问题。


June 24, 2011

Android - Managing Multiple BroadcastReceivers

When I was developing the Presently Android client I ran into an interesting problem. If a user is in the main timeline activity and a new message comes in, the active timeline just needs to update with the new message. However, if the user is in another activity stream, (like viewing @ replies or DM’s for example) and a new message comes in to the main stream the application should not only update the main stream but should also show the user a notification so they can be aware that new messages are coming into another activity.

May 24, 2011

How to use the Application object of Android

We know there is an Application class in the Android api and according to the class name it’s used for global settings or running entrance. What does it to do for an application? I will dive into it along with some examples in this blog post.