Skip to content

Instantly share code, notes, and snippets.

@ctufts
ctufts / .block
Last active December 13, 2016 20:35
Philadelphia Air Quality Index Days - Multi-Series Path, Point, and Tooltip
license: gpl-3.0
height: 500
@ctufts
ctufts / claydavis.py
Last active February 24, 2017 14:19
Traveling Politician (Metropolis Hastings) - the Clay Davis Edition
from sys import exit
from scipy import stats
import math
import random
class Engine(object):
def direction(self):
if stats.bernoulli.rvs(0.5, size = 1)[0]:
@ctufts
ctufts / .block
Last active October 19, 2021 21:13
Glycemic Load Per Serving Visualization
license: gpl-3.0
@ctufts
ctufts / .block
Last active September 7, 2018 13:06
Normal Distribution Probability Density Block
license: mit
height: 600
border: no
@ctufts
ctufts / .block
Last active March 9, 2017 20:38
Normal Distribution CDF value based on standard deviations
license: mit
border: no
@ctufts
ctufts / .block
Last active March 17, 2017 21:49
Interval probability of a normal distribution
license: mit
border: no
@ctufts
ctufts / .block
Last active March 24, 2017 20:31
Force Layout - Point-Along-Path - State Diagram Animation
license: gpl-3.0
@ctufts
ctufts / text_transistion.js
Last active April 6, 2017 13:19
function for crossfade transition of text using d3 based on this block: https://bl.ocks.org/mbostock/f7dcecb19c4af317e464
function transition_text(element_id, display_text, t_duration){
// base off of https://bl.ocks.org/mbostock/f7dcecb19c4af317e464
svg.select(element_id)
.transition()
.duration(t_duration)
.on("start", function () {
var t = d3.active(this)
.style("opacity", 0)
.remove();
@ctufts
ctufts / Error_list.md
Created April 12, 2017 18:24
List of different error metrics

List of metrics First Tier:

  • False Positive - Type I
  • False Negative - Type II
  • True Positive
  • True Negative

Second Tier: Primary issues with 2nd tier - not easy to remember and have various names for the same thing: is there a way to prevent this, i.e. create some type of

@ctufts
ctufts / index.html
Last active July 9, 2017 23:23
coin flip example
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />