离职
辞职申请已经提交上去了。接下来就是工作交接一下,然后进行相关手续办理。
这是我离开校门的第一份工作,去年 7 月到现在,差不多一年的时间。老大刚才说:你走了,我少了一员干将。感动。
这一年来最大的收获就是工作态度,认真,能静下心沉得住气。这让现在的我比刚出校门的那个毛头小子成熟不少,办事稳当不少。
感谢老大这一年对我的信任,能让我有信心去独立项目完成。感谢组里的几个兄弟的支持帮助。
下一步,新的一步,加油!
帝都我来了
跟一个以技术为新的团队做最新潮的东西,多么畅快的事!
@Appwill rocks!
Firefox Tips:Render pages faster
To improve page rendering, enter about:config in the address bar (accept the warning that comes up) and perform the following:
Create a new integer value named content.notify.backoffcount and set the value to 5
Create a value named nglayout.initialpaint.delay and set its value to 0
The first line stops Firefox waiting for the entire page to download before rendering. The second improves speed rendering further by making sure Firefox does not wait for the page layout information to be fully downloaded before displaying the page.
现在的智能机
今天老张拉着我扯了半天的手机,他想换个手机,在各种纠结。纠结于 BB9700 还是 Android 系列,啰嗦两句现在智能机我的看法。
现在手机在用的是 BB8705,06 年的黑莓老机子,没有 Wifi、内存卡、摄像头、GPS,我依然玩的是不亦乐乎,每天都让丫头训我回到家只会玩手机。如果现在再买智能机还会考虑黑莓吗?会,黑莓的多任务是现在智能机做的最好的,全键盘自然不必说,黑莓第二没人敢称第一。倒是黑莓稳定性安全性第一的原则让一些应用程序不是很方便,比如点讯输入法,只能是外挂形式。黑莓是拿来用的手机。
Android 系现在是井喷啊,不过还没有一个完美的机子,我自己的看法:MileStone > Nexus One > HTC Desire > Hero,不过过于山寨的方向键和没有独立数字键让 MS 略感不完美。期待 Droid 2。A 系现在有点混乱,自己跟自己打架。
iPhone 4 是现在我最期待的手机了,iOS 4 合理的多任务加上三四年的良性稳定发展加上丰富的 Apps,机皇。就是价高,攒钱吧。
UnicodeEncodeError: 'ascii' codec can't encode characters
Problems with non-ASCII characters.
import sys
default_encoding = 'utf-8'
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setdefaultencoding(default_encoding)
PHP 中 require() 和 include() 的区别
require() 和 include() 的功能都是包含并运行指定文件。寻找包含文件的顺序先是在当前工作目录的相对的 include_path 下寻找,然后是当前运行脚本所在目录相对的 include_path 下寻找。
两者的不同之处只有如何处理包含、运行文件失败:include() 产生一个警告,而 require() 会导致一个致命的错误。如果想在遇到丢失文件时停止处理页面就用 require()。
Delphi Format function
function Format ( Const Formatting : string; Const Data : array of const ) : string;
Rich formatting of numbers and text into a string.
Const Formatting 参数是一个格式字符串,用于格式化 Const Data 数组里面的值。
Formatting 参数的指令格式以”%”开始,以 Type 结束,Type 表示一个具体的数据类型。中间是用来格式化 Type 类型的指令字符,是可选的。
%[Index:][-][Width][.Precision]Type
Type 的类型包括:
d = Decimal (integer),整型值;
u = Unsigned decimal,无符号整型值,如果它对应的值是负的,则返回时是一个2的32次方减去这个绝对值的数。
Format('this is %u',[-2]);===>this is 4294967294
f = Fixed,浮点数;
e = Scientific,科学记数法表示;
g = General,浮点型,会将值中多余无效的数去掉。
Format('this is %g',[02.200]);===>this is 2.2
n = Number (floating),浮点型,会将值转化为号码的形式(默认只表示到小数后两位)。
Format('this is %n',[4552.2176]);===>this is 4,552.22
m = Money,钱币类型;
p = Pointer,指针类型,返回的值是指针的地址,以十六进制表示;
s = String,对应字符串类型;
x = Hexadecimal,必须是一个整形值,以十六进制的形式返回;
格式化 Type 的指令:
[index:]
指示 Const Data 中参数显示的顺序:
Format('this is %1:d %0:d',[12,13]);===>this is 13 12
Format('%d %d %d %0:d %3:d', [1, 2, 3, 4]);===>1,2,3,1,4
[width]
指定将被格式化的值占的宽度,默认右对齐,[-]
指定向左对齐:
Format('this is %4d',[12]);===>this is __12
(__下划线是不存在的,只是为了显示这里空了两格)
Format('this is %-4d',[12]);===>this is 12__
[.Precision]
指定精度:
Format('this is %.7f',['1.1234]);===>this is 1.1234000
string.translate and string.maketrans
string.translate( s, table[, deletechars])
Delete all characters from s that are in deletechars (if present), and then translate the characters using table, which must be a 256-character string giving the translation for each character value, indexed by its ordinal.
string.maketrans(from, to)
Return a translation table suitable for passing to translate(), that will map each character in from into the character at the same position in to; from and to must have the same length.
string.translate() 可以根据一个映射表将字符串里的字符替换成映射表对应的字符,比如映射表里面设定 a 对应 1,b 对应 2,c 对应 3,那么 'abc'.translate
对应的字符串就是 '123'
.
string.maketrans() 就是用来生成 translate() 所需要的映射表,参数是两个相等的字符串,根据两个字符串对应的字符位置作成一个字符映射表。
Email PLZ,No IM
Email:
- 不打扰人,对双方来说都更为高效;
- 大段文字讨论,不中断;
- 更为方便的文档存储管理。
IM:
正好与之相反。
Vim 多文件查询
多文件查询是指在多个文件内查询同一字段。命令 :vimgrep:
:vim[grep][!] /{pattern}/[g][j] {file}
For example,递归当前目录及子目录,在所有 py 文件中查询 main,\C 区分大小写,\c 不区分大小写。
:vimgrep /\Cmain/ **/*.py
These commands all fill a list with the results of their search. “grep” and “vimgrep” fill the “quickfix list”, which can be opened with :cw or :copen, and is a list shared between ALL windows.via Find in files within Vim