ruby一行定义md5、md5file函数

require 'digest/md5'; def md5(str); Digest::MD5.hexdigest(str); end; def md5file(str); Digest::MD5.hexdigest(File.open(str).read); end 在pry中用的时候很方便
Ruby | 2016-10-31 01:18 | 阅读 2382 次 | 评论 0 条

切记,python使用pickle.dumps的时候一定先把unicode给encode('utf-8')成str

pickle.dumps(unicode_draft) #不建议 pickle.dumps(unicode_draft.encode('utf-8')) #建议 直接pickle.dumps(unicode_draft)的时候,保存的是这种形式: V<ul>\u5982\u4f55\u89e3\u6790 pickle.dumps(utf8_str_draft)的时候,保存的是这种形式: S'\xe5\xad\x99\xe9\x91\xa' 一个V,一个S,S后面跟的是单引号包裹的字符串。 -------------------------...
Python | 2016-10-30 03:21 | 阅读 10276 次 | 评论 0 条

php-fpm.conf最佳体验参数

目前感觉手感最好的 pm = dynamic ; The number of child processes to be created when pm is set to 'static' and the ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. ; This value sets the limit on the number of simultaneous requests that will be ; served. Equivalent...
PHP开发 | 2016-10-29 19:21 | 阅读 2488 次 | 评论 0 条
浏览2800824次
文章归档