原題:Dynamo: Amazon’s Highly Available Key-value Store
原文: Amazon's Dynamo - All Things Distributed (PDF Version)
This article is translated by @ono_matope. Please contact me if any problem.
原題:Dynamo: Amazon’s Highly Available Key-value Store
原文: Amazon's Dynamo - All Things Distributed (PDF Version)
This article is translated by @ono_matope. Please contact me if any problem.
| ;; 組み込みしたいもの達 | |
| (define true #t) | |
| (define false #f) | |
| (define null '()) | |
| (define (make-table) | |
| (let ((local-table (list '*table*))) | |
| (define (lookup key-1 key-2) | |
| (let ((subtable (assoc key-1 (cdr local-table)))) | |
| (if subtable |
| 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 |
| module Amida | |
| EMPTY = " " | |
| LINE = "---" | |
| def self.amida(member, line_wo_member = 2, fillness=5) | |
| people = ('A'..'Z').take(member) | |
| hit = people.sample | |
| line = member + line_wo_member | |
| atari = rand(people.size) |
| # Start by checking if they fixed it upstream: | |
| brew update | |
| brew upgrade reattach-to-user-namespace | |
| # If it says it's already installed, they haven't fixed it upstream. So do this: | |
| # Edit the recipe: | |
| brew edit reattach-to-user-namespace |
| Lack is a minified Rack just for study. |
| #!/usr/bin/env ruby | |
| require "rubygems" | |
| require "net/http" | |
| require "uri" | |
| require "cgi" | |
| require "json" # gem install json | |
| class SPARQL |
| nnoremap <buffer> <SID>[ghcmod] <Nop> | |
| nmap <buffer> <Leader>h <SID>[ghcmod] | |
| nnoremap <buffer> <silent> <SID>[ghcmod]y :<C-u>call <SID>paste_type_signature()<CR> | |
| function! s:paste_type_signature() | |
| try | |
| let signature = expand('<cword>').' :: '.ghcmod#type()[1] | |
| catch | |
| return | |
| endtry |
| :function! F() | |
| let xs = [2] | |
| let i = 3 | |
| while len(xs) < 100 | |
| if empty(filter(copy(xs), 'i % v:val == 0')) | |
| call add(xs, i) | |
| endif | |
| let i += 1 | |
| endwhile | |
| put =xs |
| #! /usr/bin/env ruby | |
| require "rubygems" | |
| require "rb-skypemac" | |
| require "readline" | |
| include SkypeMac | |
| def get_channels | |
| res = Skype.send_(:command => "SEARCH RECENTCHATS") | |
| res.sub! "CHATS ", "" | |
| channels = res.split(", ") |