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
| /****************************************************************************** | |
| * | |
| * 2015 - Ernesto Serrano <[email protected]> | |
| * --------------------------------------------- | |
| * | |
| * Fichero auxiliar para pintar colores en la consola | |
| * | |
| ******************************************************************************/ | |
| #ifndef __Color_h__ |
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
| // Dise帽ar una funci贸n booleana que devuelva true si en una expresi贸n matem谩tica los par茅ntesis, corchetes y llaves est谩n colocados de forma correcta (a cada s铆mbolo abierto le corresponde uno cerrado del mismo tipo) | |
| // Codigo basado en una soluci贸n parecida encontrada en stackoverflow | |
| bool pareados(char abre,char cierra) | |
| { | |
| bool pareado = false; | |
| if(abre == '(' && cierra == ')') | |
| pareado = true; | |
| else if(abre == '{' && cierra == '}') |
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
| // Dise帽ar una funci贸n que dada una lista L devuelva otra lista R conteniendo los elementos repetidos de L. Si no hay elementos repetidos R ser谩 la lista vac铆a. | |
| // L = [5, 2, 7, 2, 5, 1] | |
| // R = [5, 2] | |
| list<int> repetidos(list<int> L) | |
| { | |
| list<int> R; | |
| for (list<int>::iterator it1 = L.begin(); it1!=L.end(); ++it1) | |
| for (list<int>::iterator it2 = L.begin(); it2!=L.end(); ++it2) |
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
| // Dadas 2 colas con elementos repetidos (y ordenados) implementar la funci贸n queue<int> multiinterseccion (queue<int> q1, queue<int> q2) que calcule la multi intersecci贸n de 2 colas que y q2 y devuelva el resultado en otra cola. | |
| // q1=[2,2,3,3] | |
| // q2=[1,2,3,3,4] | |
| // multi intersecci贸n=[2,3,3] | |
| queue<int> multiinterseccion (queue<int> q1, queue<int> q2) | |
| { | |
| queue<int> multi, q2aux; | |
| while(!q1.empty()) |
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
| // Dise帽ar una funci贸n orden int orden(list<int> L) que devuelva 1 si L est谩 ordenada de forma ascendente de principio a fin, 2 si lo est谩 de forma descendente y 0 si no est谩 ordenada de ninguna forma. | |
| int orden(list<int> L) | |
| { | |
| int resultado = 0; | |
| list<int>::iterator it = L.begin(); | |
| int ant = *it; | |
| ++it; |
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
| actions <- c("N", "S", "E", "W") | |
| x <- 1:4 | |
| y <- 1:3 | |
| rewards <- matrix(rep(0, 12), nrow=3) | |
| rewards[2, 2] <- NA | |
| rewards[1, 4] <- 1 | |
| rewards[2, 4] <- -1 |
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
| #comando para UNIX | |
| curl -s --data "[email protected]&pass=TUPASSWORD" https://vpn.ugr.es | perl -n -e '/cgi.*&p=(.{0,12})/ && print "$1\n"' | |
| #comando para MACOSX que adem谩s copia el password en el portapapeles | |
| curl -s --data "[email protected]&pass=TUPASSWORD" https://vpn.ugr.es | perl -n -e '/cgi.*&p=(.{0,12})/ && print $1' | pbcopy | |
| pbpaste | |
| echo |
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
| git clone [email protected]:exolever/exolever.git | |
| git clone [email protected]:exolever/exo-services.git | |
| cd exolever | |
| mkdir service-exo-core | |
| git mv !(service-exo-core) service-exo-core | |
| git commit -a -S -m "Moving exolever into its own subdirectory (service-exo-core)" | |
| cd ../exo-services |
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
| // C贸digo para realizar el sorteo de bolas de una oposici贸n a Profesor de Ense帽anza Secundaria, Especialidad Inform谩tica | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| // Colores ansi para la consola | |
| #define BLACK "\033[0m" | |
| #define RED "\033[31m" | |
| #define GREEN "\033[32m" |
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
| #include <stdio.h> | |
| /* Funci贸n para sumar, acepta dos valores de entrada y devolver谩 el resultado de la operaci贸n */ | |
| int sumar(int, int); | |
| /* Funci贸n para restar, acepta dos valores de entrada y devolver谩 el resultado de la operaci贸n */ | |
| int restar(int, int); | |
| /* Funci贸n para multiplicar, acepta dos valores de entrada y devolver谩 el resultado de la operaci贸n */ | |
| int multiplicar(int, int); |
OlderNewer