- Send Escape if you tap Caps Lock alone.
- Send Control if you press Caps Lock with another key.
For both Vim and Emacs world.
" Plug configuration | |
call plug#begin() | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'luochen1990/rainbow' | |
Plug 'flazz/vim-colorschemes' | |
call plug#end() | |
" configure rainbow brackets globally | |
let g:rainbow_active = 1 |
g_LastCtrlKeyDownTime := 0 | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := false | |
*CapsLock:: | |
if (g_ControlRepeatDetected) | |
{ | |
return | |
} |
g_LastCtrlKeyDownTime := 0 | |
g_AbortSendEsc := false | |
g_ControlRepeatDetected := false | |
*CapsLock:: | |
if (g_ControlRepeatDetected) | |
{ | |
return | |
} |
import tensorflow as tf | |
from tensorflow.keras import layers | |
from tensorflow.keras.layers.experimental.preprocessing import StringLookup | |
import logging as log | |
import numpy as np | |
import sys | |
log.basicConfig( | |
level=log.DEBUG, | |
stream=sys.stdout, |
#! /usr/bin/env python | |
import math | |
import statistics | |
def binomial_required_sample_size(p1, p2, min_diff=5e-4, include_continuity_correct=True, two_sided=True): | |
"""derived from: https://www.itl.nist.gov/div898/handbook/prc/section2/prc242.htm""" | |
z_alpha = 1.95 | |
if two_sided: | |
z_alpha = 2.24 | |
z_beta = 0.89 |
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 |
# install virtualenv: If its all fucked up. uinstall it, then install it again. OSX is bullshit | |
pip install virtualenv | |
# use virtualenv. args are optional | |
virtualenv --python=python3 ./venv | |
# activate that shit dawg | |
source ./venv/bin/activate | |
# normally changes your prompt. If not, what kinda bullshit shell you using |
#! /usr/bin/env python | |
import requests | |
import argparse | |
import hashlib | |
import json | |
import time | |
import sys | |
import os | |
parser = argparse.ArgumentParser() |