Skip to content

Instantly share code, notes, and snippets.

@sunxu
sunxu / 250.csv
Created January 13, 2023 14:26 — forked from jinjier/javdb-top250.md
JavDB Top 250 movies code list. [Updated at 2022/09]
1 LAFBD-41
2 SSNI-497
3 IPX-177
4 ABP-984
5 SSIS-465
6 IPX-580
7 IPX-811
8 SMBD-115
9 IPX-534
10 IPX-726
@sunxu
sunxu / aggregator.lua
Last active August 29, 2015 14:20 — forked from kidd/aggregator.lua
local path = ngx.var.request:split(" ")[2] -- path
local t={}
local cjson = require "cjson"
local m = ngx.re.match(path,[=[^/sentence/(.+)]=])
local words = m[1]:split("%%20") -- words in the sentence
for i,k in pairs(words) do
local res_word = ngx.location.capture("/real/".. k )
local value=cjson.new().decode(res_word.body)
table.insert(t, value.sentiment)

Latency numbers every programmer should know

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  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

" neocomplcache
" http://github.com/Shougo/neocomplcache
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_max_list = 100
let g:neocomplcache_max_keyword_width = 50
let g:neocomplcache_max_filename_width = 15
let g:neocomplcache_auto_completion_start_length = 2