Cocoa

磁盘权限错误导致launchd高CPU占用

本来想安静地在某弹幕网站上看看「入門⭐︎道場ルノ」,结果风扇一直以最高速转,一看活动监视器才发现launched的CPU占用达到了80%以上,还有几个进程的CPU使用也在30%到40%之间。

按直觉先kill掉几个进程试试,先拿opendirectoryd开刀。kill之后果然CPU使用率立刻降下来了。可是过了一会儿之后opendirectoryd又出现了,launchd的CPU占用又飙到80%以上。

Continue reading 磁盘权限错误导致launchd高CPU占用

Here's to the crazy ones

Here's to the crazy ones: the misfits, the rebels, the troublemakers, the round pegs in the square holes, the ones who see things differently. 

They are not fond of rules. They have no respect of status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can't do, is ignore them, because they change things. They push human race forward.

Some may see them as the crazy ones. We see genius,because the people who are crazy enough to think they can change the world ... are the ones who do.

自己实现的dd工具

闲来无聊,想仿照一下dd这个ctl,结果还遇到了malloc的一些问题。

malloc: *** error for object 0x100105438: incorrect checksum for freed object - object was probably modified after being freed.*** set a breakpoint in malloc_error_break to debug

打印出0x100105438的内容,一看,原来是ofdev所在的地址,但是我并没有free掉ofdev啊,而且为什么会checksum错误呢?非常奇怪的现象。

现在的处理办法是 : 在用过ifdev和ofdev之后,把这两个字符串清空,就可以一切正常。

Continue reading 自己实现的dd工具

MIT Algorithms (1)

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)

経験値上昇中☆