Skip to content

Instantly share code, notes, and snippets.

View yuchsiao's full-sized avatar

Yo Hsiao yuchsiao

View GitHub Profile
@sixtenbe
sixtenbe / analytic_wfm.py
Last active May 27, 2024 01:24 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active July 8, 2024 00:56
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@skratchdot
skratchdot / gh-pages.sh
Last active December 1, 2022 16:26
Initialize gh-pages branch
# create gh-pages branch
git checkout --orphan gh-pages
git rm -rf .
touch README.md
git add README.md
git commit -m 'initial gh-pages commit'
git push origin gh-pages
# add gh-pages as submodule
git checkout master
@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active April 3, 2024 07:29
OpenCV Video Writer on Mac OS X
@kylebgorman
kylebgorman / mcnemar.py
Last active February 11, 2020 18:46
Compute McNemar's test (two two-sided variants) in Python
import scipy.stats
def mcnemar_p(n1: int, n2: int) -> float:
"""Computes McNemar's test.
Args:
n1: the number of "wins" for the first condition.
n2: the number of "wins" for the second condition.
@vmonaco
vmonaco / runs_test.py
Last active February 1, 2024 04:32
Multivariate Wald-Wolfowitz test to compare the distributions of two samples
"""
Multivariate Wald-Wolfowitz test for two samples in separate CSV files.
See:
Friedman, Jerome H., and Lawrence C. Rafsky.
"Multivariate generalizations of the Wald-Wolfowitz and Smirnov two-sample tests."
The Annals of Statistics (1979): 697-717.
Given multivariate sample X of length m and sample Y of length n, test the null hypothesis: