Command Flags
| Flag | Options | Description |
|---|---|---|
-codec:a |
libfaac, libfdk_aac, libvorbis | Audio Codec |
-quality |
best, good, realtime | Video Quality |
-b:a |
128k, 192k, 256k, 320k | Audio Bitrate |
-codec:v |
mpeg4, libx264, libvpx-vp9 | Video Codec |
| import numpy as np | |
| import functools as ft | |
| def display_hist(x, num_bins = 8, zeros_as_blank = False): | |
| '''Returns a histogram as a unicode text string, e.g. '▁▂▄█▆▃▁▁' | |
| Inspired by the `precis` function from the Statistical Rethinking R package | |
| by Richard McElreath. This function will calculate a histogram and then | |
| returns a string displaying the histogram in unicode characters. It uses the | |
| LOWER BLOCK group like "2584 ▄ LOWER HALF BLOCK". |
| #!/usr/bin/python | |
| import socket | |
| import sys | |
| if len(sys.argv) != 3: | |
| print("usage: telnet.py IPADDRESS PORT") | |
| exit(-1) | |
| print("Opening connection on %s port %s" % (sys.argv[1], sys.argv[2])) |
Command Flags
| Flag | Options | Description |
|---|---|---|
-codec:a |
libfaac, libfdk_aac, libvorbis | Audio Codec |
-quality |
best, good, realtime | Video Quality |
-b:a |
128k, 192k, 256k, 320k | Audio Bitrate |
-codec:v |
mpeg4, libx264, libvpx-vp9 | Video Codec |
| from itertools import product | |
| import numpy as np | |
| INV_SQRT_3 = 1.0 / np.sqrt(3.0) | |
| ASIN_INV_SQRT_3 = np.arcsin(INV_SQRT_3) | |
| def gaussian_bell(xs, ys, xc=0., yc=0., xsigma=1., ysigma=1.): | |
| """ Compute a 2D Gaussian with asymmetric standard deviations and |
| {0: 'tench, Tinca tinca', | |
| 1: 'goldfish, Carassius auratus', | |
| 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
| 3: 'tiger shark, Galeocerdo cuvieri', | |
| 4: 'hammerhead, hammerhead shark', | |
| 5: 'electric ray, crampfish, numbfish, torpedo', | |
| 6: 'stingray', | |
| 7: 'cock', | |
| 8: 'hen', | |
| 9: 'ostrich, Struthio camelus', |
| 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 |
| /* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon | |
| * http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */ | |
| s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17 | |
| ?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;} |