- install trash on your Mac
brew install trash
- alias rm and del, edit your ~/.bashrc or ~/.zshrc
alias rm="echo Use 'del', or the full path i.e. '/bin/rm'"
alias del="trash"
brew install trash
alias rm="echo Use 'del', or the full path i.e. '/bin/rm'"
alias del="trash"
var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT;"; | |
var direct = 'DIRECT;'; | |
var domains = [ | |
'twitter.com', | |
'google.com', | |
'google.com.hk', | |
't.co', | |
'twimg.com', | |
'github.com', |
#对non-lock queue的简单分析#
今天看到 @梁斌penny 在打擂:http://coderpk.com
内容如下:
游戏规则: 比赛由pennyliang,就是本人梁斌同志坐庄,我提交baseline代码(可执行程序),和部分代码,方便统一游戏规则。 10亿数据(每个数据看作一个同志),1个队列,10个线程push,10个线程pop,走完一遍,考察总耗时,耗时最短的获胜。我的代码在我自己机器10亿数据排队进出,耗时1分28秒,内存峰值256MB(CPU16核,真8核那种,Intel(R) Xeon(R) CPU E5540 @ 2.53GHz)
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns | |
Disk seek 10,000,000 ns |