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
This file contains 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
From 59fc7da8ea7be513f452c82a808cbe125ea0dc96 Mon Sep 17 00:00:00 2001 | |
From: Vladimir Pouzanov <[email protected]> | |
Date: Fri, 25 May 2012 14:28:16 +0300 | |
Subject: [PATCH 1/4] Added basic support for gems | |
--- | |
gem.rb | 3 +++ | |
gem/manager.rb | 15 +++++++++++++++ | |
gem/motion_spec.rb | 18 ++++++++++++++++++ | |
gem/specification.rb | 10 ++++++++++ |
This file contains 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
/* | |
* More info at: http://phpjs.org | |
* http://phpjs.org/functions/index | |
* | |
* php.js is copyright 2009 Kevin van Zonneveld. | |
* Dual licensed under the MIT (MIT-LICENSE.txt) | |
* and GPL (GPL-LICENSE.txt) licenses. | |
* | |
* Conversion to Objective-J copyright 2009 Philippe Laval | |
* Licenced under the same MIT, GPL dual licences. |
This file contains 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
# Install RVM and dependencies | |
sudo aptitude install curl git-core | |
sudo bash < <( curl -L http://bit.ly/rvm-install-system-wide ) | |
sudo aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev | |
sudo adduser `whoami` rvm | |
echo 'source /usr/local/lib/rvm' >> ~/.bashrc | |
# Set up users and groups | |
sudo useradd --home /var/www --create-home --groups rvm unicorn && sudo chmod g+w /var/www | |
sudo adduser `whoami` unicorn | |
# |
This file contains 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
> s = 'foo bar baz baz' | |
> reduce(lambda x,y:dict([ (k, (lambda a,b,k:(a[k] + (1 if k in b else 0)))(x,y,k)) for k in x.keys()]+[ (k,1) for k in y.keys() if not k in x ]), map(lambda x: {x:1}, s.split())) | |
{'bar': 1, 'baz': 2, 'foo': 1} |
This file contains 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
// | |
// NSObject+BlockObservation.h | |
// Version 1.0 | |
// | |
// Andy Matuschak | |
// [email protected] | |
// Public domain because I love you. Let me know how you use it. | |
// | |
#import <Cocoa/Cocoa.h> |