Skip to content

Instantly share code, notes, and snippets.

@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 9, 2017 20:38
Normal Distribution CDF value based on standard deviations
license: mit
border: no
@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 October 19, 2021 21:13
Glycemic Load Per Serving Visualization
license: gpl-3.0
@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 December 13, 2016 20:35
Philadelphia Air Quality Index Days - Multi-Series Path, Point, and Tooltip
license: gpl-3.0
height: 500
@ctufts
ctufts / .block
Last active December 13, 2016 20:24
Path Transitions - Izhikevich Neuron Model
license: gpl-3.0
height: 500
scrolling: no
border: no
@ctufts
ctufts / .block
Last active June 28, 2017 00:58
Interactive Scatterplot with Regression Line
license: gpl-3.0
height: 500
scrolling: no
border: no
@ctufts
ctufts / common_operations.sql
Last active April 26, 2017 19:23
MySQL examples/common operations
------------------------------------------------------------------
-- alter column name
ALTER TABLE `xyz` CHANGE `manufacurerid` `manufacturerid` INT;
------------------------------------------------------------------
-- export database
------------------------------------------------------------------
mysqldump db table > filename.out
------------------------------------------------------------------
-- import database
@ctufts
ctufts / gensim_notes.md
Last active August 8, 2016 18:08
General notes from using gensim on 20 million messages
  • save_as_text : don't use this unless you just want to read the text in the file. Otherwise it will cause issues if you want to go back later and revise/filter the dictionary
  • If you choose to import a dictionary then alter it, the corpus must also be updated as outlined here - Q8
  • You have to limit the number of features in large datasets otherwise the memory consumption is huge
  • This is regardless of weather the corpus is loaded in RAM or serialized
  • Iterations argument - refers to the number of iterations in the EM step