This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
from collections import defaultdict | |
def get_percolated_cliques(G, k): | |
perc_graph = nx.Graph() | |
cliques = [frozenset(c) for c in nx.find_cliques(G) if len(c) >= k] | |
perc_graph.add_nodes_from(cliques) | |
# First index which nodes are in which cliques | |
membership_dict = defaultdict(list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import networkx as nx | |
from datetime import datetime | |
import sys | |
import csv | |
import os | |
import random | |
import glob | |
from itertools import combinations | |
from collections import defaultdict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# play YUV444 FULL HD file | |
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \ | |
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \ | |
videoconvert ! \ | |
autovideosink | |
# play YUV422 FULL HD file | |
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define N_ROWS 5 | |
#define N_COLS 5 | |
void main(){ | |
char swamp[N_ROWS][N_COLS] = { | |
{'*' , '*', '.', '*', '.' }, | |
{'.' , '.', '.', '.', '.' }, | |
{'.' , '.', '*', '.', '*' }, | |
{'.' , '*', '.', '*', '*' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define N 100 | |
struct Names | |
{ | |
char name[20]; | |
char surname[20]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from pick import pick | |
urls = [ '__'*i for i in range(1000)] | |
names = [ '-_^'*i for i in range(1000)] | |
title = 'scroll down to crash' | |
style, _ = pick(names, title) | |
print "not happening" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.cluster.hierarchy as hcluster | |
from sklearn.manifold import TSNE | |
import collections | |
import random | |
import fireplace.utils | |
from fireplace import cards |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from adjustText import adjust_text | |
import json | |
notes = [] | |
together = [(0, 1.0, 0.4), (25, 1.0127692669427917, 0.41), (50, 1.016404709797609, 0.41), (75, 1.1043426359673716, 0.42), (100, 1.1610446924342996, 0.44), (125, 1.1685687930691457, 0.43), (150, 1.3486407784550272, 0.45), (250, 1.4013999168008104, 0.45)] | |
embed = [(y,y) for (x,y,z) in together] | |
embed += [(y*1.1,y) for (x,y,z) in together] | |
embed += [(y,y*1.1) for (x,y,z) in together] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
import hdbscan as hdbscan | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# import scipy.cluster.hierarchy as hcluster | |
from sklearn.manifold import TSNE | |
from sklearn.decomposition import PCA | |
import sklearn.metrics.pairwise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
from fireplace.utils import random_draft | |
from fireplace import cards | |
from hearthstone.enums import CardClass | |
from hearthstone import cardxml | |
def classify(y, x): | |
for klass_name in ["ROGUE", "MAGE", "WARRIOR", "HUNTER", "PRIEST", "PALADIN", "WARLOCK", "SHAMAN", "DRUID"]: | |
if klass_name.lower() in y.lower(): |
OlderNewer