Skip to content

Instantly share code, notes, and snippets.

View manuel-delverme's full-sized avatar
😀

Manuel manuel-delverme

😀
View GitHub Profile
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)
#!/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
@manuel-delverme
manuel-delverme / GStreamer-1.0 some strings.sh
Created September 22, 2015 18:14 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
#!/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 ! \
@manuel-delverme
manuel-delverme / ex9.c
Last active December 11, 2015 13:54
ex9.c
#include <stdio.h>
#include <stdlib.h>
#define N_ROWS 5
#define N_COLS 5
void main(){
char swamp[N_ROWS][N_COLS] = {
{'*' , '*', '.', '*', '.' },
{'.' , '.', '.', '.', '.' },
{'.' , '.', '*', '.', '*' },
{'.' , '*', '.', '*', '*' },
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 100
struct Names
{
char name[20];
char surname[20];
#!/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"
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
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]
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
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():