Skip to content

Instantly share code, notes, and snippets.

View pepgonzalez's full-sized avatar

José González pepgonzalez

View GitHub Profile
def hola():
print "Hola"
return
# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw
import sys
import random
from operator import itemgetter
import math
import matplotlib.pyplot as plt
from random import randint
from PIL import Image, ImageDraw
import sys
import random
import math
class Vector:
def __init__(self, imagen):
self.imagen = imagen
self.tx = imagen.size[0]
self.ty = imagen.size[1]
import networkx as nx
import matplotlib.pyplot as plot
from sys import argv
vertices = dict()
#Clase Nodo, estructura de informacion
class Nodo:
def __init__(self, nombre, frecuencia, izquierda, derecha):
self.nombre = nombre
import networkx as nx
import matplotlib.pyplot as plot
from sys import argv
vertices = dict()
#Clase Nodo, estructura de informacion
class Nodo:
def __init__(self, nombre, frecuencia, izquierda, derecha):
self.nombre = nombre
import networkx as nx
import matplotlib.pyplot as plot
from sys import argv
vertices = dict()
#Clase Nodo, estructura de informacion
class Nodo:
def __init__(self, nombre, frecuencia, izquierda, derecha):
self.nombre = nombre
@pepgonzalez
pepgonzalez / Huffman.py
Created April 11, 2013 02:37
Codigo de compresion de datos de huffman
import networkx as nx
import matplotlib.pyplot as plot
from sys import argv
vertices = dict()
#Clase Nodo, estructura de informacion
class Nodo:
def __init__(self, nombre, frecuencia, izquierda, derecha):
self.nombre = nombre
##iniciamos
set ns [new Simulator]
##declaramos el tipo de enrutamiento
$ns rtproto LS
##archivo para la simulación
set nf [open a.nam w]
set nt [open trace.tr w]
def main():
amarillo = (255,255,0)
RADIO = 50
UMBRAL = 2
CIRCUNFERENCIA = (RADIO *2) * math.pi
print "CIRCUNFERENCIA" +str(CIRCUNFERENCIA)
mx = [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]
my = [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]
mg = [[0,1,0],[1,-4,1],[0,1,0]]
imagen = Image.open("cvb2.png")
def main():
amarillo = (255,255,0)
RADIO = 50
UMBRAL = 2
CIRCUNFERENCIA = (RADIO *2) * math.pi
print "CIRCUNFERENCIA" +str(CIRCUNFERENCIA)
mx = [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]
my = [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]
mg = [[0,1,0],[1,-4,1],[0,1,0]]
imagen = Image.open("mc.png")