This file contains 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
from functools import total_ordering | |
def _apply(v, k): | |
if callable(k): | |
return k(v) | |
else: | |
return v[k] | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
library(reshape2) | |
library(multcomp) | |
n <- 10 | |
ctrl <- rnorm(n, 0, 0.5) | |
a <- rnorm(n, 0.1, 0.5) | |
b <- rnorm(n, 2, 0.5) | |
df <- melt(data.frame(ctrl = ctrl, a = a, b=b)) | |
names(df) <- c("cat", "val") |
This file contains 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
data { | |
int<lower=0> N; | |
} | |
transformed data { | |
int<lower=0> n; | |
n = N / 2; | |
} | |
parameters { |
This file contains 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
#include <stdio.h> | |
double sum(const double *x, double s, size_t n) | |
{ | |
if (n == 0) | |
{ | |
return s; | |
} | |
return sum(x + 1, s + *x, n - 1); |
This file contains 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
{ | |
"editor.formatOnSave": false, | |
"eslint.enable": true, | |
"eslint.run": "onType", | |
"eslint.autoFixOnSave": true, | |
"prettier.eslintIntegration": true, | |
"editor.detectIndentation": false, | |
"eslint.validate": [ | |
"javascript", | |
"javascriptreact", |
This file contains 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
#include <algorithm> | |
#include <functional> | |
#include <numeric> | |
#include <vector> | |
#include <array> | |
template <typename T> | |
using CMPFUNC = std::function<bool(T, T)>; | |
template <typename T> |
This file contains 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
BasedOnStyle: Webkit | |
AlignOperands: true | |
AlignAfterOpenBracket: Align | |
AllowShortIfStatementsOnASingleLine: true | |
AllowShortLoopsOnASingleLine: true | |
AllowShortFunctionsOnASingleLine: Empty | |
ConstructorInitializerAllOnOneLineOrOnePerLine: true | |
BreakConstructorInitializersBeforeComma: true |
This file contains 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
set tabstop=4 | |
set autoindent | |
set expandtab | |
set shiftwidth=4 |
This file contains 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 numpy as np | |
def padding(xs, z=0, max_len=None, dtype=np.int32): | |
if max_len is None: | |
max_len = max(len(x) for x in xs) | |
n_samples = len(xs) | |
results = np.empty((n_samples, max_len), dtype=dtype) | |
results[:, :] = z | |
for i, x in enumerate(xs): |