Skip to content

Instantly share code, notes, and snippets.

View rob-p's full-sized avatar
🎯
Focusing

Rob Patro rob-p

🎯
Focusing
View GitHub Profile
@rob-p
rob-p / gist:4e1285ac94456a46e3ce
Last active August 29, 2015 14:21
Updated Quant. Analysis IPython Notebook
{
"metadata": {
"name": "",
"signature": "sha256:a6e570cf0bd55a345c51e9845a0be441853a5108bc5ac8bec032e8c0b89b057d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <thread>
#include <atomic>
#include <iostream>
#include "unistd.h"
#include "fcntl.h"
extern "C" {
#include "kseq.h"
@rob-p
rob-p / WeightedConfigSampler.py
Created December 18, 2012 02:44 — forked from anonymous/WeightedConfigSampler.py
Tabs => spaces (where did tabs come from?)
import networkx as nx
import random
import copy
def isValidPair(G, Gp):
'''
This function checks if the weighted, undirected graphs G and Gp
constitute a valid pair.
G and Gp constitute a valid pair if, for every vertex u in G and Gp,
the multiset of weights for u is the same in both graphs.