我发现要描述一件事情,用时间、逻辑关系来列举的方法是最快的。我上班时写的大多邮件就是这样的,these are things I want to know… those are the things I need your help… 1st… 2nd… 3rd… 最后再来一句生硬的Thanks——这就完了。
王小波说,他见过的最华丽的小说就是杜拉斯的《情人》。而我觉得他本人的《黄金时代》、《似水流年》和《革命时期的爱情》也相当不错,还有余华的一些小说。
我就不知道如何酝酿这种华丽,所以我还是直来直去一二三四的列举吧。本来加一些图片会好一些,但不好意思,我的手机在途中被偷了。
好了,以上都是废话,开始吧。
(更多…)
I need a string.format function, after googling around for server minutes. I find all existing solutions is like this one in Ray’s blog
for(var i=0;i< arguments.length;i++) {
var re = new RegExp('\\{' + i + '\\}','gm');
str = str.replace(re, arguments[i]);
}
return str;
It’s very short, but there is one problem~
It can’t handle
string.format("{0}", "{0}")
and regexp has poor performance~
So,
let’s do one ourself, and test the highlight.js wp plugin.
(更多…)