git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
ks.default <- function(rows) seq(2, max(3, rows %/% 4)) | |
many_kmeans <- function(x, ks = ks.default(nrow(x)), ...) { | |
ldply(seq_along(ks), function(i) { | |
cl <- kmeans(x, centers = ks[i], ...) | |
data.frame(obs = seq_len(nrow(x)), i = i, k = ks[i], cluster = cl$cluster) | |
}) | |
} | |
all_hclust <- function(x, ks = ks.default(nrow(x)), point.dist = "euclidean", cluster.dist = "ward") { |
# Simulation study for sample size between/within | |
# got Treat + Sham between subjects | |
# got Time within subjects | |
nPerGroup <- 30 | |
nTime <- 4 | |
muTreat <- c(37, 32, 20, 15) | |
muSham <- c(37, 32, 25, 22) | |
stdevs <- c(12, 10, 8, 6) | |
stdiff <- 9 |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
As configured in my dotfiles.
start new:
tmux
start new with session name:
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True): | |
"""Create a view of `array` which for every point gives the n-dimensional | |
neighbourhood of size window. New dimensions are added at the end of | |
`array` or after the corresponding original dimension. | |
Parameters | |
---------- | |
array : array_like | |
Array to which the rolling window is applied. | |
window : int or tuple |
# .. Memory benchmarks for SciPy's Singular Value Decomposition .. | |
# .. Author: Fabian Pedregosa <[email protected]> | |
import numpy as np | |
from scipy.sparse import linalg as splinalg | |
from scipy import sparse, linalg | |
import pylab as pl | |
from memory_profiler import memory_usage | |
dims = np.arange(500, 1500, 20) |
%-----------------------------------------------------------------------------% | |
% Letter class | |
\documentclass[a4paper, 10pt]{letter} | |
% Name of sender | |
\name{Joe Fox} | |
% Signature of sender | |
\signature{Joe Fox} |
require(ncdf) | |
require(raster) | |
## Input: a netCDF file | |
file.nc <- 'rain.nc' | |
## Output: a GeoTIFF file | |
file.tiff <- 'rain.tiff' | |
## Import netCDF |
ffmpeg -i shame-run.mov -r 24/1 test/output%03d.jpg |
import pyaudio | |
import wave | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 2 | |
RATE = 44100 | |
CHUNK = 1024 | |
RECORD_SECONDS = 5 | |
WAVE_OUTPUT_FILENAME = "file.wav" | |