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 / 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 / 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 / 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 / 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 / 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 / naval.py
Created August 26, 2017 04:51
Astucia naval, con arreglos. Concepto
import random as rnd
class Naval():
def __init__(self):
self.tabM = Naval.createBoard(8, 8, "·") # Tableros
self.tabJ = Naval.createBoard(8, 8, "·")
self.barM = [] # Barcos
@ejherran
ejherran / echo_server.py
Created October 12, 2017 04:08
Get Echo Server
import cherrypy
import json
class HelloWorld(object):
@cherrypy.expose
def index(self, data):
size = len(data)
@ejherran
ejherran / client.c
Created October 12, 2017 04:09
Arduino Ethernet Test Web Client
#include <EtherCard.h>
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; // Mac de la tarjeta ether... Debe ser unico en la red local
const static uint8_t ip[] = {10,14,0,56}; // Ip de la tarjeta
const static uint8_t gw[] = {10,14,0,1}; // Ip de la puerta de enlace
const static uint8_t mask[] = {255,255,255,0}; // Mascara de la tarjea
const static uint8_t dns[] = {10,14,0,1}; // Ip del servidor DNS, si existe
const static uint8_t hisip[] = {10,14,0,104}; // Ip de la aplicacion remota
const static int hisport = 8080; // Puerto de la aplicacion remota
TARGETS: # Targets of the process
KIC 8197761: # Target Star
FILE: "./KIC8197761.csv" # Lightcurve source file
#############
### STAR INFO
#############
STAR:
MASS: 1.384
# MASS_LOWER_ERROR: 0.27
TARGETS:
KIC 4570326:
FILE: "./KIC4570326.csv"
##############
### STAR INFO
##############
STAR:
MASS: 1.620
MASS_LOWER_ERROR: 0.2210000705719
MASS_UPPER_ERROR: 0.061999921798706