This file contains hidden or 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
unbind C-b | |
set -g prefix C-Space | |
set -g mode-keys vi | |
# Set XTerm key bindings | |
setw -g xterm-keys on | |
# Set XTerm overrides | |
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@" |
This file contains hidden or 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
import Levenshtein as levenshtein | |
import numpy as np | |
def dist(coord): | |
i, j = coord | |
return levenshtein.distance(strings_list[i], strings_list[j]) | |
coords = np.triu_indices(len(strings_list), 1) | |
zipped_coords = zip(*coords) |
This file contains hidden or 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
#!/bin/bash | |
# Clones a repo into an organized directory structure at your $CODEPATH. | |
# This organization is similar to how "go get" will organize your code into | |
# $GOPATH/<site>/../../<repo> | |
set -e | |
trap "echo ERRORS DETECTED" err |
This file contains hidden or 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
#!/bin/bash | |
# Finds and converts git repositories in or under the working directory to | |
# reference GitHub Enterprise (code.redbrainlabs.com). | |
set -e | |
trap "echo ERRORS DETECTED" ERR | |
IFS="`printf '\n\t'`" |
This file contains hidden or 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
using Images | |
using Match | |
function sample_S(n, iters=1000) | |
S = zeros(Int32, n) | |
for step = 1:iters | |
i = rand(1:n) | |
@match (i,S[i]) begin | |
(1,0),if S[i+1]==0 end => S[i]=1 | |
(1,0),if S[i+1]==1 end => continue |
This file contains hidden or 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.packages('car') | |
df <- read.csv("~/data.csv") | |
plot(df) | |
# Model 1 | |
model1.y <- df$inf | |
model1.X <- df$unem |
This file contains hidden or 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
import xml.etree.ElementTree as ET | |
@shared_task | |
def test_et(): | |
print('test_et') | |
fpath = '<xml-file>' | |
t = ET.parse(fpath) | |
print('--- t', t) |
This file contains hidden or 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
-- Exercise 1 | |
invalidInt :: MaybeInt -> Bool | |
invalidInt (ValidInt _) = False | |
invalidInt InvalidInt = True | |
maybeIntValue :: MaybeInt -> Int | |
maybeIntValue (ValidInt val) = val | |
maybeIntValue InvalidInt = 0 |
This file contains hidden or 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
-- Exercise 1 | |
formableBy :: String -> Hand -> Bool | |
formableBy [] _ = True | |
formableBy [letter] hand = letter `elem` hand | |
formableBy (letter:letters) hand | |
| letter `elem` hand = formableBy letters (delete letter hand) | |
| otherwise = False | |
This file contains hidden or 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
-- Exercise 1 | |
lastDigit :: Integer -> Integer | |
lastDigit x = mod x 10 | |
dropLastDigit :: Integer -> Integer | |
dropLastDigit x = div x 10 | |
-- Exercise 2 |