This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Memcached::MultiPartRailsCache | |
| MAX_KEY_LENGTH = 255 # Actually overshooting what the client will let you send through | |
| # but this means our chunk sizes will just a few bytes of headroom | |
| # as we split | |
| PART_SIZE = 1.megabyte - MAX_KEY_LENGTH | |
| def initialize(rails_cache) | |
| @rails_cache = rails_cache | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A simple preforking echo server in C. | |
| * | |
| * Building: | |
| * | |
| * $ gcc -Wall -o echo echo.c | |
| * | |
| * Usage: | |
| * | |
| * $ ./echo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Simple preforking echo server in Python. | |
| Python port of http://tomayko.com/writings/unicorn-is-unix. | |
| """ | |
| import os | |
| import sys | |
| import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Measurement | |
| attr_accessor :count, :sum, :sum_squares, :min, :max | |
| def initialize | |
| @count, @sum, @sum_squares, @min, @max = 0, 0, 0, nil, nil | |
| end | |
| def record n | |
| @count += 1 | |
| @sum += n |