Skip to content

Instantly share code, notes, and snippets.

View taylortao's full-sized avatar

Tingting Tao taylortao

View GitHub Profile
@taylortao
taylortao / cache
Last active July 18, 2016 10:07
Cache
ALU(Arithmetic logic unit) -> L1 cache -> L2 cache -> memory -> disk -> network/cloud
Time = calculate time + data move time(that's why we need cache)
cache replacement strategy: LRU least recently used
locality principle
copy and prefetch
latency numbers: http://people.eecs.berkeley.edu/~rcs/research/interactive_latency.html
@taylortao
taylortao / system design
Created July 16, 2016 08:59
system design
What is it?
the process of defining archiecture, components, modules, interfaces and data for a system to satisfy specified requirement.
1. scenario
register/log in, play file, recommendation
2.necessary
user:
daily active user
concurrency user
@taylortao
taylortao / my plan
Last active July 12, 2016 04:37
My plan
At first:
You cannot connect dots looking forward, but you can connect dots looking backward. By Steve jobs
compound interest is the most powerful weapon in the universe.
Freedom, Fitness, Family.
Always know your priority queue.
@taylortao
taylortao / 正则高尔夫
Created July 12, 2016 03:47
正则高尔夫
非常有意思的一组正则小游戏,http://regex.alf.nu/
积分规则:匹配左边(一个10分),不匹配右边的(错误一个扣10分),式子长度越短越好,1个字符扣1分。
中间有被难到的题目参考了Gist: https://gist.github.com/Davidebyzero/9221685
我看懂了的,顺便也记录一下我的理解。
Regex: short of regular expression.
Warmup
foo,哈哈,送分题
Anchors
You are deducted one point per character you use, and ten if you match something you shouldn’t.
我写的是ick$,后来发现还有k$,太坏了。。。考察点是:start/end of string anchors.