Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tmarthal
tmarthal / brush.js
Created September 27, 2013 00:30 — forked from enjalot/brush.js
if(!d3.chart) d3.chart = {};
d3.chart.brush = function() {
var g;
var data;
var width = 600;
var height = 30;
var dispatch = d3.dispatch(chart, "filter");
function chart(container) {
@tmarthal
tmarthal / Linear Dependent VAR
Last active December 21, 2015 09:49
Auto-Correlation of statsmodels VAR process with linear dependent timeseries.
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@tmarthal
tmarthal / gist:5286991
Last active December 15, 2015 16:09
Python time list filtering
import datetime
base = datetime.datetime.today()
dateList = [ base - datetime.timedelta(minutes=2*x) for x in range(0,48) ]
hour_ago = base - datetime.timedelta(hours=1)
# get the number of dates from less than an hour ago
len(filter(lambda x: x > hour_ago, dateList))
@tmarthal
tmarthal / gist:5248035
Created March 26, 2013 18:48
PowerSet Calculation in java
import java.util.HashSet;
import java.util.Set;
public class PowerSet {
private Set<Set<Object>> powerSet;
private void setCombinations(Set<Object> set) {