Skip to content

Instantly share code, notes, and snippets.

View ejherran's full-sized avatar

Edison Javier Herran Cortes ejherran

View GitHub Profile
@ejherran
ejherran / comp.py
Last active May 17, 2017 02:59
Didáctico - Compresión de datos.
# -*- coding: utf-8 -*-
import sys
import pickle
class Nodo:
def __init__(self): # Nodo principal
self.peso = -1 # Peso del simbolo
@ejherran
ejherran / sintac.py
Last active May 17, 2017 02:21
Didáctico - Análisis sintáctico.
# -*- coding: utf-8 -*-
import math
import sys
class Node(): # Nodo principal
def __init__(self, value):
self.value = value # Contenio del nodo
@ejherran
ejherran / avl.py
Last active April 6, 2017 16:23
Arbol AVL con dibujado por consola. Soporta: Agregar, eliminar y editar.
import sys
import math
class Node:
def __init__(self, value):
self.value = value # Carga del node
self.pl = 0 # Profundidad izquierda
@ejherran
ejherran / a2.py
Created March 18, 2017 21:49
Árbol binario por dirección
import math
class Nodo:
valor = None
p = None
l = None
r = None
def __init__(self, valor):
@ejherran
ejherran / a1.py
Created March 18, 2017 21:47
Árbol binario simple - complitud
class Nodo:
valor = None
l = None
r = None
def __init__(self, valor):
self.valor = valor
@ejherran
ejherran / FDragon.java
Created February 8, 2017 05:03
Fractal: Curva Del Dragón - JAVA
/*
*
* Fractal: Curva Del Dragon
* Javier Herran ([email protected])
* UPC - 2017
*
*/
import javax.swing.JFrame;
import javax.swing.JPanel;
@ejherran
ejherran / PI_G3.py
Last active February 4, 2017 05:07
Simulación del valor de PI por medio del método montecarlo - Con TK
# -*- coding: utf-8 -*-
#
# Simulación del valor de PI por el método montecarlo
# Javier Herran ([email protected])
# UPC - 2017
#
#
import random
from tkinter import Tk, Frame, Canvas, BOTH, W, Text, END, NORMAL, DISABLED
@ejherran
ejherran / qrzip.py
Created June 14, 2016 18:18
Generar multiples códigos QR en formato PDF, comprimir el contenido en un fichero ZIP y descargarlo en modo web con DJango - Python 3
# -*- coding: utf-8 -*-
# Python 3.5
# Django 1.9.7
from reportlab.pdfgen import canvas
from reportlab.graphics.shapes import Drawing
from reportlab.graphics.barcode.qr import QrCodeWidget
from reportlab.graphics import renderPDF
from io import BytesIO, StringIO
from zipfile import ZipFile, ZIP_DEFLATED
@ejherran
ejherran / go.py
Last active May 30, 2016 19:16
Go Test
import subprocess as sp
def genMat(r, c, v):
mat = []
row = [v]*c
for i in range(r):
mat.append(row[:])
return mat
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class Test(QtWidgets.QWidget):
def __init__(self):
super(Test, self).__init__()
self.setObjectName("self")
self.resize(400, 41)