a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| import java.io.UnsupportedEncodingException; | |
| import java.security.InvalidAlgorithmParameterException; | |
| import java.security.InvalidKeyException; | |
| import java.security.Key; | |
| import java.security.KeyPair; | |
| import java.security.KeyPairGenerator; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.NoSuchProviderException; | |
| import java.security.PrivateKey; | |
| import java.security.PublicKey; |
| 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 |
| $ python ./cereal.py | |
| Dumping: | |
| json: 16.3266839981 | |
| simplejson: 21.8916499615 | |
| cjson: 5.22964906693 | |
| ujson: 2.02208805084 | |
| cPickle: 18.5925779343 | |
| tnetstrings: 60.592509985 | |
| tnetstring: 2.44516205788 | |
| msgpack: 21.7611129284 |
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
| from datetime import datetime | |
| import redis | |
| import random | |
| import sqlite3 | |
| BROKER_HOST = "localhost" # Maps to redis host. | |
| REDIS_PASSWORD = None | |
| KEY_PREFIX = "speed_" | |
| ALPHABETE = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM" | |
| SQLITE_DB = ":memory:" |
| from datetime import datetime | |
| import redis | |
| import random | |
| import sqlite3 | |
| BROKER_HOST = "localhost" # Maps to redis host. | |
| REDIS_PASSWORD = None | |
| KEY_PREFIX = "speed_" | |
| ALPHABETE = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM" | |
| SQLITE_DB = ":memory:" |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| #!/usr/bin/env python | |
| import sys | |
| import types | |
| import operator | |
| class Runtime: | |
| def __init__(self, env={}, stack=[]): | |
| self.env = { | |
| # Primitive words, not an impressive base but it works |