By admin, 22 六月, 2017 this 在 JavaScript function() {} 和 () => {} 里的区别 function() { this } 里面的this是一个新的指针,如果我们想访问父亲的指针,需要在调用前var self = this; 然后在函数里用self引用父亲。 () => { this }里面的this是父亲作用域的指针。 https://stackoverflow.com/questions/24900875/whats-the-meaning-of-an-arrow-formed-from-equals-greater-than-in-javas 标签 JavaScript
By admin, 17 六月, 2017 CSS函数calc width: calc(100% - 100px); 参考:https://www.w3schools.com/cssref/func_calc.asp 标签 CSS
By admin, 15 六月, 2017 批量压缩图片 convert -quality 50命令可以把一幅图片的大小降到原来的1/4左右。下面命令可以批量压缩目录里大于100K的图片。 find . -size +100k|xargs -I '{}' convert -quality 50 '{}' '{}'
By admin, 9 六月, 2017 N-Gram数据库 这是Google扫描书本时生成的数据库:http://storage.googleapis.com/books/ngrams/books/datasetsv2.html 1-gram的数据库即单词的频率,例如: circumvallate 1978 313 215 85 circumvallate 1979 183 147 77 The first line tells us that in 1978, the word "circumvallate" (which means "surround with a rampart or other fortification", in case you were wondering) occurred 313 times overall, on 215 distinct pages and in 85 distinct books from our sample. 标签 NLP
最新评论