Search

4/27/2011

華山市場2樓:阜杭豆漿

華山市場2樓:阜杭豆漿

台北.華山市場2樓:阜杭豆漿
地址:台北市忠孝東路一段108號2樓(華山市場二樓)
電話:02-23922175
時間:05:30 ~ 10:30

4/23/2011

David Mandelin's blog » Mozilla JavaScript 2011

David Mandelin's blog » Mozilla JavaScript 2011

The reason for the pauses is that SpiderMonkey uses an old-school stop-the-world mark-and-sweep collector. Briefly, it works like this:

1. Based on some heuristics, the JS engine decides it is time to collect some garbage.
2. The GC finds all the GC roots, which are the immediately accessible objects: JS local variables, the JS global object, JS objects stored on the C++ stack, and a few other things.
3. The GC marks all objects that can be reached from the roots, by following all the pointers stored in the roots, then all the pointers stored in the objects reached from the roots, and so on.
4. The GC sweeps over all allocated objects. If an object is not marked, there is no way for the program to access it, so it can never be used again, and the GC frees it.
The main problem with stop-the-world mark-and-sweep GC is that if there are a lot of live objects, it can take a long time to mark all those objects. “A long time” typically means 100 milliseconds, which is not that long, but is disruptive to animation and is noticeably jerky.

Our first step in fixing GC pauses will be incremental GC. Incremental GC means that instead of stopping the program to mark everything, the GC periodically pauses the program to do a little bit of marking, say 3 milliseconds worth. There is an overhead to starting and stopping a mark phase, so the shorter the pause time, the slower the actual program runs. But we think we can make the pause time unnoticeable without having too much impact on throughput.

Note that the sweep phase can also take a long time, so we’ll need to do some work there also, such as sweeping incrementally or in concurrently on a different thread.

The longer-term goal is to move to generational GC. It’s more complicated than incremental GC, so I won’t go into details now, but the key benefits of generational GC are that (a) it is very fast at collecting short-lived objects (technically, it actually manages to collect them without looking at them or doing anything to them at all), and (b) it helps make creating objects faster.

Bill McCloskey and Chris Leary are working on the new GCs. Gregor Wagner has also been working independently on specific improvements, like doing more sweeping off the main thread.

4/19/2011

差生学什么? - 阮一峰的网络日志

差生学什么? - 阮一峰的网络日志

多种技能的结合。

成为企业家的第一步,就是要让自己变得有价值。任何一个普通的学生,都不可能在某个单独的领域出类拔萃,成为世界级高手。但是,你可以在几个不同的领域都达到不错的水平,这并不是很难。我的艺术才能有限、只掌握一些基本的写作技巧、有一点起码的幽默感和企业管理知识,我把这些才能结合起来,就创造出了《呆伯特》。这个世界上,比我优秀的画家、作家、幽默的人和管理学大师有的是。但是,能够把这些东西结合在一起的人,就非常少。价值就是这样被创造出来的。

别怕失败。

如果你真的在冒风险(很可能你就该这么做),那么90%的时候,你会失败。这里的关键是,不要白白失败,要从失败中获得收获,在将来派上用处。我的第一份工作是银行,结果我失败了;第二份工作是电话公司,也失败了。但是,我从失败中对这些职业有了深切的体验,后来我把它们都画进了《呆伯特》。你应该把失败看做通向成功的一种过程,而不是需要回避的障碍。

克服恐惧。

大学时,我曾经选修演讲课,感觉用处不大,因为它教的是,如何在公众场合掩饰自己的紧张。毕业后,我听了Dale Carnegie的课程,却受到极大启发。它完全不讲演讲技巧,而是训练你享受在公开场合发言的乐趣。当你在人群面前变得放松的时候,就自然而然会讲得好。我在这里不是为它做广告,而是想说人们需要训练的东西,其实是如何用热情取代恐惧和害羞。这是企业家的基本技能。

简洁的写作。

我还上过一个商务写作课程,它其实就教你怎么写简单句,如何不用多余的词。简洁的句子,会让思想更有力。你想要例子,就去看看乔布斯和巴菲特的文章。

培养说服能力。

消费者心理学、销售技巧、市场推广、商务谈判、市场统计、甚至产品设计,都是说服能力的不同表现形式。企业家全都应该掌握。

4/13/2011

Accessible tables

Accessible tables
<table>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Birthday</th>
</tr>
<tr>
<th scope="row">Jackie</th>
<td>5</td>
<td>April 5</td>
</tr>
<tr>
<th scope="row">Beth</th>
<td>8</td>
<td>January 14</td>
</tr>
</table>

via: http://yellowshoe.com.au/standards/
ref: Bring on the tables | 456 Berea Street

TED: Jason Fried 談為什麼上班時工作做不完

TED: Jason Fried 談為什麼上班時工作做不完

* 你可以問問自己或是問別人:「真的想要把一件事情做好時,你要的是什麼?」,回答可能是一個空間(廚房、地下室或走廊)、一個移動的空間(飛機、火車)、或一段時間(很早的清晨、很晚的夜裡、週末),卻不會得到「辦公室」這個答案。
* 工作其實跟睡眠很像,不是在於你在睡覺的時候不能工作(或是兩者反過來),而是在於他們都可以被分成很多個階段,必須漸進,就像從「淺眠」一直到「深層睡眠」。不管是工作或是睡眠,你都需要一段不被打擾的「長時間」來進行,如果睡眠常常被中斷,那睡眠的品質會很差,工作也是如此。
* 辦公室裡有太多中斷工作的因素:上司的「進度如何」問候、會議的舉行等等。
* 多使用非當面的溝通方式(面對面、打電話),改用像是即時通、電子郵件的方式。很多人可能會覺得電子郵件很煩,但是至少你可以一段時間「主動地」不去理會電子郵件、或者是關掉即時通,但是當別人直接來找你的時候,你無法拒絕,此時工作就被中斷。
* 嘗試舉行一次「安靜的星期四」,所有人在這天都不要說話,你會發現完成的工作大增。一開始可以嘗試一個月一次,如果效果好,可以嘗試兩週一次或者更頻繁。