Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
| update(ft, p, v): | |
| for (; p <= N; p += p&(-p)) | |
| ft[p] += v | |
| # Add v to A[a...b] | |
| update(a, b, v): | |
| update(B1, a, v) | |
| update(B1, b + 1, -v) | |
| update(B2, a, v * (a-1)) | |
| update(B2, b + 1, -v * b) |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| # This is a short collection of tools that are useful for managing your | |
| # known_hosts file. In this case, I'm using the '-f' flag to specify the | |
| # global known_hosts file because I'll be adding many deploy users on this | |
| # system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
| # Add entry for host | |
| ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
| # Scan known hosts | |
| ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com |