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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] -s my_service/semaphore -t my-distributed-task |
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
# Isolate execution of set.seed (or anything else) in own env | |
s1 <- .GlobalEnv$.Random.seed | |
draw <- function(){ | |
eval({ | |
set.seed(12) | |
samples = runif(10) | |
}, envir = new.env()) | |
samples |
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 | |
wd=$(mktemp -d) | |
docx_file=$1 | |
if [ -z $docx_file ]; then | |
echo "Usage: inspect_docx.sh []" | |
fi |
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
# remove low variance columns | |
rna_data = rna_data.loc[:, (rna_data.var() > 0.5)] | |
# remove correlated columns | |
vars = rna_data.var() | |
tbd = [] | |
# from each pair of highly correlated columns, remove columns with lower variance | |
for i, j in zip(*np.where(np.corrcoef(rna_data.values.T) > 0.5)): |
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
""" | |
Basic Idea taken from http://stackoverflow.com/a/8111621/6420372 | |
""" | |
import os | |
import socket | |
import subprocess | |
from select import select | |
import time | |
import contextlib |
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 os | |
import socket | |
import subprocess | |
from select import select | |
import time | |
import contextlib | |
import settings | |
try: | |
import winreg |