-
mmap的两篇文章
http://blog.csdn.net/streetlight8023/article/details/42168403 http://0xffffff.org/2017/05/01/41-linux-io/ mmap和磁盘读写的两篇文章, 不过还是没明白为啥堆外内存小的时候, ES使用mmap index storage会有大量磁盘读写
-
mail中的Content-Transfer-Encoding定义和用法
python发送邮件时出现乱码, 搜索了一下可以通过更改Content-Transfer-Encoding定义解决.
msg = MIMEText(None, "plain") msg.replace_header('content-transfer-encoding', 'quoted-printable') msg.set_payload(content, 'utf-8')
https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit
https://www.w3.org/Protocols/rfc1341/5_Content-Transfer-Encoding.html
-
vm
-
可是
可是, 我看到微信有消息, 还是希望是你的.
-
在身边
看到这张照片好开心, 有种”一直在身边”的感觉.
-
差不多先生
我不会计较和攀比谁和工资高, 谁先把女孩约出来, 我是差不多先生. 但是我愿意去思考这背后的原因, 否则真的连差不多先生都做不了.
-
安心
不管生活和工作多么的烦心, 想到有个可以说话的人在身边, 就会觉得很开心, 内心顿时平静下来.
-
golang http note
没看懂这是啥, 先继续往下看.
TrailerPrefix is a magic prefix for ResponseWriter.Header map keys that, if present, signals that the map entry is actually for the response trailers, and not the response headers. The prefix is stripped after the ServeHTTP call finishes and the values are sent in the trailers.
This mechanism is intended only for trailers that are not known prior to the headers being written. If the set of trailers is fixed or known before the header is written, the normal Go trailers mechanism is preferred:
https://golang.org/pkg/net/http/#ResponseWriter https://golang.org/pkg/net/http/#example_ResponseWriter_trailers const TrailerPrefix = “Trailer:”
MDN web docs里面的解释 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
-
情绪
我还是抑制住, 不想让你觉得被打扰.
可是我有点事情就想告诉你, 看到微信有消息就多少希望是你的.
-
ReplaceAll in go
go文档的https://golang.org/pkg/regexp/#Regexp.ReplaceAll里面说:
func (*Regexp) ReplaceAll func (re *Regexp) ReplaceAll(src, repl []byte) []byte ReplaceAll returns a copy of src, replacing matches of the Regexp with the replacement text repl. Inside repl, $ signs are interpreted as in Expand, so for instance $1 represents the text of the first submatch.
p, _ = regexp.Compile("(a+)") b = p.ReplaceAll([]byte("baabaaa"), []byte(`$1`)) glog.Infof("%s\n", b) b = p.ReplaceAll([]byte("baabaaa"), []byte("xyz")) glog.Infof("%s\n", b)
结果如下:
baabaaa bxyzbxyz
Split也和我想像的不一样
s := regexp.MustCompile("a*").Split("abaabaccadaaae", 5) // s: ["", "b", "b", "c", "cadaaae"]