Skip to content

Instantly share code, notes, and snippets.

Avatar

Hubert Kario tomato42

View GitHub Profile
View ks-test large samples.R
# number of subjects in each condition
n <- 10000
# number of replications of the study in order to check the Type I error rate
nsamp <- 10000
ps <- replicate(nsamp, {
#population mean = 0, sd = 1 for both samples, therefore, no real effect
y1 <- rnorm(n, 0, 1)
y2 <- rnorm(n, 0, 1)
tt <- ks.test(y1, y2)
@tomato42
tomato42 / idid
Last active Apr 11, 2018
Quick logging and reporting of performed tasks from this and last week
View idid
#!/bin/bash
MYDIR=~/.local/share/idid
mkdir -p "$MYDIR"
echo $(date -u --iso-8601=seconds) $@ >> "$MYDIR"/log
View groups-ann.py
from __future__ import print_function
import sys
import getopt
import math
g = None
m = None
argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "m:")
@tomato42
tomato42 / groups.py
Created Nov 19, 2016
Calculate size of groups in modular exponentiation
View groups.py
from __future__ import print_function
import sys
import getopt
import math
g = None
m = None
argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "m:")
@tomato42
tomato42 / powmod.py
Created Nov 19, 2016
Modular exponentiation
View powmod.py
from __future__ import print_function
import sys
import getopt
import math
g = None
e = None
m = None
argv = sys.argv[1:]
@tomato42
tomato42 / xfs-bloat.c
Created Mar 9, 2015
Utility to fill up XFS file system without writing data to disk
View xfs-bloat.c
/*
* xfs-bloat.c
*
* Create a file that allocates a large amount of space on an XFS file system.
*
* Compilation:
* gcc -Wall xfs-bloat.c -o xfs-bloat
*/
#include <xfs/xfs.h>