This file contains 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 python | |
# -*- coding: utf-8 -*- | |
# Overxfl0w13 - 2015 | |
from random import randint | |
# El objetivo es generar el super individuo # | |
super_single = 0b101010101 | |
# Usaremos como función de evaluación el propio número, tendrá mayor valor cuanto mayor sea el número y por tanto más cerca del super individuo esté # | |
def genetic_algorithm(): |
This file contains 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
(* Practica 2 Autómatas celulares *) | |
(* Ovexfl0w13 *) | |
(* Ejercicio AC unidimensional *) | |
SimulacionACDimensional[configInicial_List, enteroRegla_Integer, | |
t_Integer] := | |
Module[{reglaWolfram, configuraciones, d, i, configActual}, | |
reglaWolfram = GenerarReglaWolfram[enteroRegla]; | |
configActual = configInicial; | |
configuraciones = {ArrayPlot[{configActual}]}; |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
class NodeList: | |
def __init__(self,data,skip): | |
self.data = data | |
self.skip = skip | |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
class NodeTrie: | |
def __init__(self,data): | |
self.data = data | |
self.pointers = [None for i in xrange(97,123)] | |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
# Author: Overxfl0w13 # | |
"""You can define more kernel functions to test its performance whenever it respect the following condition: | |
http://latex.codecogs.com/gif.latex?\forall i\in K(x,y)\rightarrow i\geq 0 | |
Some examples: http://gyazo.com/3b1d3ae355c2638f5ac4d98c82c31d12 (Theme 4: representation based on kernels.) Perception (PER), DSIC-UPV) | |
""" | |
# Kernel test -> hamming distance # |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
def get_gaps_list(posting_lists): return [posting_lists[0]]+[posting_lists[i]-posting_lists[i-1] for i in xrange(1,len(posting_lists))] | |
def vb_encode_number(number): | |
bytex = [] | |
while True: | |
bytex.insert(0,number%128); |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
# Logarithmic merge, dynamic indexing # | |
def create_indexes(n_indexes,n): return [[0 for x in xrange(n**i)] for i in xrange(1,n_indexes+1)] | |
def merge_add_token(indexes,z,token,n,filled): | |
z.append(token) | |
if len(z)==n: |
This file contains 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
// Author: Overxfl0w13 // | |
BEGGIN begin | |
END end | |
DIGIT [0-9] | |
LETTER [a-zA-Z] | |
BLANK [ \t] | |
LINE \n | |
SCOMMENT ("//"({LETTER}|{BLANK})*) | |
MCOMMENT ("/**"({LETTER}|{BLANK}|{LINE})*"**/") | |
EOS ";" |
This file contains 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
// Author: Overxfl0w13 // | |
%token BEGGIN END PLUS MINUS MULT DIV PRINT EOS LP RP INTEGER FLOAT VARIABLE | |
%left GT LT EQ | |
%left '+' '-' | |
%left '*' '/' | |
%{ | |
#include <stdio.h> | |
int yylex(void); | |
void yyerror(char *); |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
# Author: Overxfl0w13 # | |
# One step memory indexation -> SPIMI algorithm # | |
from string import ascii_uppercase,ascii_lowercase,digits | |
from random import choice | |
try: from cPickle import HIGHEST_PROTOCOL,dump,load | |
except: from pickle import HIGHEST_PROTOCOL,dump,load | |
from sys import argv |
OlderNewer