Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
javascript:(function(){var l,r="";while(l=prompt(r)){try{r=String(eval(l));}catch(e){r="Error: "+e}}})(); |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Plack::Builder; | |
my $body = join '', <DATA>; | |
my $app = sub { | |
my $self = shift; |
#! /bin/python | |
print "Wadsworth's Constant" | |
theString = raw_input('] ') | |
theStringLength = len(theString) | |
WadsworthsAmount = int(round((0.3) * theStringLength)) | |
firstSpace = theString.find(' ', WadsworthsAmount) | |
if firstSpace == -1: | |
FinalString = theString[WadsworthsAmount:] | |
else: | |
FinalString = theString[firstSpace+1:] |
# compiled by Tom Christiansen | |
v1.0 \0, \0N,\0NN Match octal character up to octal 077. | |
v1.0 \N, \NN, \NNN Match Nth capture group (decimal) if not in charclass and that many seen, else (octal) character up to octal 377. | |
v4.0 \a Match the alert character (ALERT, BEL). | |
v5.0 \A True at the beginning of a string only, not in charclass. | |
v1.0 \b Match the backspace char (BACKSPACE, BS) in charclass only. | |
v1.0 \b True at Unicode word boundary, outside of charclass only. | |
v1.0 \B True when not at Unicode word boundary, not in charclass. | |
v4.0 \cX Match ASCII control character Control-X (\cZ, \c[, \c?, etc). | |
v5.6 \C Match one byte (C char) even in UTF‑8 (dangerous!), not in charclass. |
package yow.webbit.chat; | |
import org.webbitserver.*; | |
import org.webbitserver.handler.StaticFileHandler; | |
import org.webbitserver.handler.logging.LoggingHandler; | |
import org.webbitserver.handler.logging.SimpleLogSink; | |
import org.webbitserver.netty.NettyWebServer; | |
import java.io.IOException; | |
import java.util.HashSet; |
# FOR CENTOS 6 | |
# Andrew Diller Jan 2012 | |
# Get EPEL Repo installed | |
rpm --httpproxy proxy --httpport 3128 --import https://fedoraproject.org/static/0608B895.txt | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm | |
vi /etc/yum.repos.d/epel.repo |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
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 |
#!/usr/bin/env perl | |
# rssfs.pl | |
use strict; | |
use warnings; | |
use Date::Parse; | |
use Fuse; | |
use HTML::FormatText::WithLinks; |