Skip to content

Instantly share code, notes, and snippets.

@christian-mann
christian-mann / cerb.py
Created May 12, 2020 08:00
Cerberus Ghost Skip Success Calculator
# ghost skip consistency calculator
import random
import sys
if 'bludgeon' in sys.argv:
max_hit = 53
accuracy = 0.8168
speed = 4 # ticks
elif 'blowpipe' in sys.argv:
max_hit = 31
// ==UserScript==
// @name Show Invasions on Group Page TTR
// @namespace https://github.com/christian-mann
// @version 1.1
// @description Show invading cogs on the groups page of https://toonhq.org/groups so that it's easier to find a group for the cog you're looking for
// @author Christian Mann (aka Lucky Penny)
// @match https://toonhq.org/groups/
// @grant GM.xmlHttpRequest
// ==/UserScript==
@christian-mann
christian-mann / thing.py
Created February 7, 2020 17:51
Collatz-like thing (Python 3)
import sys
import math
def factors(n):
while n % 2 == 0:
yield 2
n //= 2
for i in range(3, int(math.sqrt(n))+1, 2):
while n % i == 0:
yield i
@christian-mann
christian-mann / lambda.c
Created July 17, 2015 03:08
Lambdas in C
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef C_LAMBDA
#define C_LAMBDA
typedef struct {
void *addr;
@christian-mann
christian-mann / gist:5873613
Created June 27, 2013 02:55
One-line Techno
echo "main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6));}" | gcc -x c - && ./a.out | aplay
@christian-mann
christian-mann / foo.css
Created November 2, 2012 05:08
Foo.css
* {
font-weight: bold;
}
@christian-mann
christian-mann / hw9.tex
Created April 18, 2012 06:57
Statistics Homework 9 Questions University of Tulsa
\documentclass{exam}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{paralist}
\title{Statistics Homework 9}
\author{Christian Mann}
@christian-mann
christian-mann / hw7.tex
Created April 1, 2012 02:25
Statistics Homework 7, University of Tulsa
\documentclass{exam}
\usepackage{listings}
\begin{document}
\title{Homework Set 7}
\author{}
\date{}
\maketitle
\begin{questions}
@christian-mann
christian-mann / hw3.txt
Created February 3, 2012 17:29
Statistics hw3
3-86: The number of people arriving for treatment at an emergency room can be modeled by a Poisson process with a rate parameter of five per hour.
a) What is the probability that exactly four arrivals occur during a particular hour?
b) What is the probability that at least four people arrive during a particular hour?
c) How many people do you expect to arrive during a 45-min period?
3-90: Let $X$ have a Poisson distribution with parameter $\mu$. Show that $E(X) = \mu$ directly from the definition of expected value. [\emph{Hint:} The first term in the sum equals 0, and then $x$ can be canceled. Now factor out $\mu$ and show that what is left sums to 1.
4-4: Let $X$ denote the vibratory stress (psi) on a wind turbine blade at a particular wind speed in a wind tunnel. The article "Blade Fatigue Life Assessment with Application to VAWTS" (\emph{J. of Solar Energy Engr.}, 1982: 107-111) proposes the Rayleigh distribution, with pdf
\[ f(x; \theta) = \left\{ \begin{matrix} \frac{x}{\theta^2} \cdot e^{-x^2/(2\