Skip to content

Instantly share code, notes, and snippets.

View t-mart's full-sized avatar

Tim Martin t-mart

View GitHub Profile
class Node(object):
def __init__(self, name, lc=None, rc=None):
self.name = name
self.lc = lc
self.rc = rc
self.rn = None
# THE MEAT OF THE PROBLEM
@staticmethod
def link_rn(level_list):
def list_condense(l):
run_start = None
in_run = False
last_item = None
out = ''
while len(l):
item = l.pop(0)
if not in_run:
run_start = item
@t-mart
t-mart / README.md
Last active August 29, 2015 14:07 — forked from mbostock/.block

For continuous data such as time series, a streamgraph can be used in place of stacked bars. This example also demonstrates path transitions to interpolate between different layouts. Streamgraph algorithm, colors, and data generation inspired by Byron and Wattenberg.

.pie_arc {
font-size: 0.75em;
}
.distillery {
font-weight: bold;
}
#svg {
text-align: center;
@t-mart
t-mart / foo.v
Last active August 29, 2015 14:08
module pipeRegister(clk, reset,
stall,
regWrEnIn, memWrEnIn, mulSelIn, aluOutIn, PCIn, instrTypeIn, isBranchTakenIn,
regWrEnOut, memWrEnOut, mulSelOut, aluOutOut, PCOut, instrTypeOut, isBranchTakenOut
);
parameter BIT_WIDTH = 32;
input clk, reset;
input stall;
local function difference(after, before)
return after - before
end
local function hms(seconds)
local hours = floor(seconds / 3600)
local minutes = floor((seconds % 3600) / 60)
local sec = floor(seconds % 60)
return hours, minutes, sec
end
From 49f5b2cb90dba546fc93e045311cf9f1d273050d Mon Sep 17 00:00:00 2001
From: Tim Martin <tim@timmart.in>
Date: Sat, 17 Jan 2015 02:15:01 -0500
Subject: [PATCH] fix coloring on urxvt
---
colors/hybrid.vim | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/colors/hybrid.vim b/colors/hybrid.vim
@t-mart
t-mart / -
Created February 5, 2015 07:26
from operator import mul
from functools import reduce
from itertools import permutations
def factorial(n):
return reduce(mul, range(1,n+1), 1)
def word_index(word):
index = 1
class MeteredSession(requests.Session):
"""
Creates a session where response downloads are shown graphically on the
terminal with `click.progressbar` meters. This session adds a hook to
responses that will attach 2 meter methods, described below.
To use these meter methods on a response obj `resp`, call
* `resp.iter_content_metered(chunk_size, label='\t' + resp.url)`
* `resp.consume_content_metered(chunk_size, label='\t' + resp.url)`
From a9a78aa85012d4ef5bd25ebf74292268a5f90d00 Mon Sep 17 00:00:00 2001
From: Tim Martin <tim.martin@gatech.edu>
Date: Sun, 27 Jun 2010 01:44:24 -0400
Subject: [PATCH] mammoths will not be chosen when mounting in capitals
---
GoGoMount.lua | 21 +++++++++++++++++++++
GoGoMountData.lua | 38 +++++++++++++++++++-------------------
2 files changed, 40 insertions(+), 19 deletions(-)