Bypass sandbox and present an alert in other apps

There is a historic way to present your alert in other apps, which can date back to iOS 5 or even easier.

You can refer to those links.
Can you use CFUserNotification with IOS 5.1
Display CFUserNotificationDisplayAlert on iPhone Lock Screen
There is even a wiki page on iPhoneDevWiki, CFUserNotification.
(Update 1) Here is the official source code from Apple.

Recently, this guy who comes up with a possible way of using this old method to steal Apple ID.

Continue reading Bypass sandbox and present an alert in other apps

按二进制位的基数排序

今天本来想复习一下排序算法,在网上搜索的时候,偶然看到了一篇"珠排序"的论文,这种方法尝试直接以物理方式来思考排序问题。

把需要排序的每一个正整数分别看成一排珠子,比如有三个珠子就代表正整数3,有四个珠子则代表正整数4。

◯◯◯◯    →    正整数4
◯◯◯  → 正整数3

现在把这一系列珠子都向左/右对齐,水平放置,然后把每一都串起来,用论文里的话就是,“就像算盘一样”。

之后把“算盘”立起来,只要做实验的地方有引力,这些珠子也可以自由滑动,那么在立起来之后马上就可以得到排序之后的答案了。

Continue reading 按二进制位的基数排序