Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # code accompanying answer: https://stats.stackexchange.com/a/471245/35989 | |
| n <- 22 | |
| x <- 13 | |
| lik <- function(p) dbinom(x, n, p) * 20 | |
| prior <- function(p) dbeta(p, alpha, beta) | |
| post <- function(p) dbeta(p, alpha+x, beta+(n-x)) | |
| op <- par(mfrow=c(1,3), mar=c(3,1,1,1), cex=0.9) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| // ==UserScript== | |
| // @name Redirect Jupyter notebooks from GitHub | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @match github.com/*.ipynb | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; |
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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| if len(os.Args) > 1 && os.Args[1] == "--help" { | |
| args := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
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 signal | |
| from contextlib import contextmanager | |
| from time import sleep | |
| import pytest | |
| @contextmanager | |
| def timeout(time): | |
| """Timeout context manager | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 json | |
| import sys | |
| # Validate if notebook cells were executed in order | |
| if __name__ == '__main__': | |
| if len(sys.argv) > 0: | |
| path = sys.argv[1] | |
| else: |
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
| # See: | |
| # https://people.eecs.berkeley.edu/%7Ejordan/courses/260-spring10/lectures/lecture5.pdf | |
| # https://www.cs.ubc.ca/%7Emurphyk/Papers/bayesGauss.pdf | |
| post <- function(x, mu0, kappa0, alpha0, beta0) { | |
| n <- length(x) | |
| xbar <- mean(x) | |
| sse <- sum((x - xbar)^2) | |
| mu <- ((kappa0 * mu0) + (n * xbar)) / (kappa0 + n) |
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 | |
| function usage { | |
| echo "Usage: $(basename "$0") [OPTION]... FILE" 2>&1 | |
| echo " -i modify the file in place" | |
| echo " -o don't strip the outputs" | |
| echo " -h display this help and exit" | |
| exit 0 | |
| } |