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 | |
import matplotlib.pyplot as plt | |
# Generate a random graph with 6 communities | |
size1= 150 | |
size2= 150 | |
G = nx.stochastic_block_model([size1, size2], [[0.03,0.001],[0.001,0.02]]) | |
node_colors = [ '#01f2ab'] * size1 + ['#f20148'] * size2 | |
node_outline= [ '#01a675'] * size1 + ['#a60131'] * size2 |
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
graph AFD1 { | |
rankdir=LR; | |
node [color="#1f3656", fontcolor="#1f3656", shape=circle, penwidth=1.5, fontsize=16,nodesep=0.5]; | |
edge [color="#1f3656", fontcolor="#e54a45", penwidth=1.5, fontsize=16, minlen=1]; | |
graph [bgcolor=transparent, splines=true]; | |
center = 1; | |
//node [shape = doublecircle]; qf; |
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 python3 | |
""" This script converts a graph formatted as an edge list | |
to a dot file. | |
""" | |
import argparse | |
parser = argparse.ArgumentParser(description='Converts an edge list file to a respective graphviz dot file.') | |
parser.add_argument('--directed', action='store_true', default=False, |
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
\documentclass[a4paper,11pt]{article} | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} | |
\usepackage{lmodern} | |
\usepackage[brazilian]{babel} | |
\usepackage{microtype} | |
\usepackage[alf]{abntex2cite} % adds abnt alfnumeric citation style | |
\title{Título aqui} |
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
# Generate auxialiary files | |
$recorder = 1; | |
# The output file dir | |
$out_dir = "./build"; | |
$pdf_mode = 2; # Ensure that dvi and ps file are created (POWERDOT) | |
#$pdf_mode = 1; # Ensure that pdflatex is used (USUAL) | |
$view = "pdf"; # |
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 | |
# rsvg-convert is inside librsvg2-bin in ubuntu | |
for SVGFILE in *.svg; | |
do | |
SVGNAME="${SVGFILE%.*}"; | |
rsvg-convert -f eps -o "$SVGNAME.eps" "$SVGFILE" | |
ps2epsi "$SVGNAME.eps" | |
ps2pdf -dCompatibilityLevel=1.4 -dEmbedAllFonts=true -dSubsetFonts=true -dEPSCrop "$SVGNAME.epsi" "$SVGNAME.pdf"; | |
done | |
wait |
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 | |
for GFILE in *.dot; | |
do | |
GNAME="${GFILE%.*}"; | |
GTYPE=$(head -n 1 $GFILE); | |
case "$GTYPE" in | |
*digraph*) dot -Teps $GFILE -o "$GNAME.eps";; | |
*graph*) neato -Teps $GFILE -o "$GNAME.eps";; | |
esac | |
ps2pdf -dCompatibilityLevel=1.4 -dEmbedAllFonts=true -dSubsetFonts=true \ |
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 python3 | |
from itertools import permutations | |
from random import randint | |
def tournamentTime(person_list): | |
""" Computes how much a tournament will last according to the order of | |
persons in 'person_list' | |
Assumes a person is described as a 3-tuple of positive integers (ts, tb, tr) | |
where: |