1) f(n) = O(g(n))
It means there are consts C > 0, n > 0 such that 0 <= f(n) <= c * g(n) for sufficiently large n.
f(n) = Ω(g(n))
It means there are consts C > 0, n > 0 such that 0 <= c * g(n) <= f(n) for sufficiently large n.
O notation, less than or equal to.
Ω notation, greater than or equal to.
Θ notation, less than or equal to AND greate than or equal to.
2) Macro convention
A set in a formula represnts on anonymous function in that set.
3) big O is upper bounds
O notation, less than or equal to.
Continue reading MIT Algorithms (1)
Monthly Archives: November 2014
使用LLDB+debugserver调试程序 via USB
最近因为越狱开发,需要用LLDB+debugserver调试iOS上的系统程序,可惜没有Wi-Fi环境,但想到之前写过一篇SSH over USB的blog,于是考虑到通过USB来实现这个需求也是没问题的。
String theory and M theory (1)
1) BeV和GeV的区别: 以前用billion来表示10亿, 现在用giga
2) π介子, 质量几乎为0, 角动量也几乎为0
3) ρ介子, 起始角动量为1;
4) Chew-Frautschi图上的连线叫雷琪轨迹(Regge trajectpries). 它的纵坐标是L(角动量), 横坐标是m²(质量的平方)
Continue reading String theory and M theory (1)
通过PHP获得iTunes Store的封面图 (2)
几个月前写的通过PHP获得iTunes Store的封面图因为最近iTunes Store调整的原因不能用了,不过还好改动不算太大,代码只需要改一小部分就可以了。
Continue reading 通过PHP获得iTunes Store的封面图 (2)自动生成简单Java程序的UML图
最近Java实验课老是要求画出UML图,各种麻烦。。。
于是就写了这样一个东西,传入一个(或多个)Java源代码的path,然后得到该源代码的UML图,不过只能是一些写得比较简单的Java源代码,在复杂的情况下可能会出现错误的解析。得到的文件是一个(或多个)与Java源代码文件同名的HTML文档。
本来想用php的GD库,不过Mac下的GD库编译安装太麻烦了,于是就放弃了。果然还是直接在网页上截图吧,至少比自己去画方便一些了w
Continue reading 自动生成简单Java程序的UML图使用dd备份磁盘数据
忘了带Time Machine那块磁盘,于是只能用最基础的方法来完整备份数据了。
需要root权限,在终端执行:
dd if=/dev/disk0s2 of=PATH_TO_SAVE.dmg bs=819200
ssh免密码登录
最近用SSH的地方变多了,每次去想/复制密码也挺麻烦的,特别是对于我这样的懒人。虽然早就知道可以免密码登录,不过也是因为太懒,一直没去弄:p
ASS字幕时间调整
最近得了「弹幕依赖症」,看视频时没有弹幕总觉得哪里不对劲,之前写过拿弹幕文件的东西,再配合转换XML弹幕为ASS,本来基本就完事的,不过这一次,因为分Part了,两个XML都是从Part的00:00.00开始计时的,而在网上下载的原始视频是完整的,于是就需要调整第二个ASS文件的时间。