Skip to content

Instantly share code, notes, and snippets.

@bcbwilla
bcbwilla / graph.py
Last active August 29, 2015 14:03
Overcast Network (oc.tc) server player count data collector.
import random
import math
import datetime
from pymongo import MongoClient
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.ticker import MultipleLocator
import numpy as np
@bcbwilla
bcbwilla / analysis.ipynb
Last active August 29, 2015 14:05
Fun with Overcast Network Player Count Data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bcbwilla
bcbwilla / backup.sh
Created December 7, 2014 00:21
Super simple minecraft server world backup with zippy bits
#!/bin/bash
# Minecraft Server Backup
stamp=$(date +%d_%m_%Y_%H_%M_%S)
cd $HOME/servers/backups/mcprohost/
mkdir -p $stamp
wget -r -nH -P $stamp ftp://$MCP_USER:$MCP_PASS@$MCP_IP/world*
zip -rm $stamp $stamp
@bcbwilla
bcbwilla / mrl_scraper.py
Last active August 29, 2015 14:15
Scrapes data from mrl.uscb.edu thermoelectric materials datamine.
"""
Scrapes all dimensions of data from http://www.mrl.ucsb.edu:8080/datamine/thermoelectric.jsp.
RE: electrical resistivity
SE: seebeck coefficient
TH: thermal conductivity
AT: average atomic mass
SC: scarcity
HP: HHI (production)
HR: HHI (reserves)
@bcbwilla
bcbwilla / amcsd_scraper.py
Created February 25, 2015 16:01
amcsd scraper
""" Extract the CIF files for each mineral in the
American Minerologist Crystal Structure Database
http://rruff.geo.arizona.edu/AMS/
Puts files in 'amcsd_data' folder.
"""
import requests
import string
import urllib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bcbwilla
bcbwilla / makereport.py
Last active December 15, 2015 08:59
Computes statistics for teams competing in Project Ares Minecraft Tournaments. The data is scraped for each player on each team from their profile page at http://www.oc.tc. The data is processed and a .csv report file is produced. The data scraping is completely dependent on the html structure of the profile and tournament page, so this script w…
'''
Created on Mar 24, 2013
@author: Ben
'''
import pATournamentReport as r
#Example of how to use the classes.
base_url = "https://oc.tc"
@bcbwilla
bcbwilla / euler.nb
Last active December 15, 2015 09:39
Mathematica functions for solving first order differential equations numerically
(* Numerical Schemes *)
(* Regular Euler Method *)
euler[y0_, npoints_, a_, b_, f_] := (
h = (b - a)/(npoints - 1);
y = Table[0, {npoints}];
t = Table[0, {npoints}];
y[[1]] = y0;
t[[1]] = a;
Do[
yn = y[[n]];
@bcbwilla
bcbwilla / qmhw6.nb
Last active December 15, 2015 10:39
Graduate Quantum Mechanics II, HW 6, #4
En[n_, a_, V_] :=
Assuming[a \[Element] Reals &&
a > 0, (1/8)*Integrate[D[n, x]^2/n, {x, -Infinity, Infinity}] +
Integrate[V*n, {x, -Infinity, Infinity}]]
V[x_, k_] := (1/2)*k*x^2
\[Psi][x_, a_] := (1/Sqrt[2*Pi*a])*Exp[-x^2/(2*a)]
Enf = En[\[Psi][x, a]^2, a, V[x, k]]
Solve[D[Enf, a] == 0, a]