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
package karelmovil; | |
import java.util.LinkedList; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
public class KLexer { | |
public final char ESTADO_ESPACIO = ' '; | |
public final char ESTADO_PALABRA = 'a'; | |
public final char ESTADO_COMENTARIO = '#'; | |
public final char ESTADO_NUMERO = '0'; |
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
#include<stdio.h> | |
#include<stdlib.h> | |
int main(){ | |
// "i & j" son variables unicamente utlizadas para el control de ciclos | |
// "r" es una variable usada para ver a donde se moverán las pelotas [un numero Random, de ahi la 'r'] | |
// "n_pelotas & n_niveles" son el # de pelotas que van a caer en la MaqdGalton y los niveles de la misma, respectivamente. | |
// "alfiler" hace referencia al lugar en donde van a pegar las pelotas en la MaqdGalton | |
// "lim_izq" es el ultimo alfiler de la parte izq de la MaqdGalton utilizada para reducir los contadores |
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
#include<unistd.h> | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<sys/types> | |
#include<sys/wait> | |
int main(){ | |
pid_t proceso; | |
for(i=0; i<4; i++){ | |
proceso = fork(); |
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
#include<unistd.h> | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<sys/types> | |
#include<sys/wait> | |
/* | |
getpid() <- idDeProcesoActual | |
getppid() <- idDeProcesoPadre | |
*/ |
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
#include<unistd.h> | |
#include<stdio.h> | |
/* | |
Fork: Crea procesos | |
WIFEXITED: Comprueba que el valor recibido sea ! 0 | |
WEXITSTATUS: Evalua los 8 bits menos significativos del | |
codigo de retorno del hijo para identificar su edo de | |
finalizacion | |
P (wait y sale de tabla de procesos), H acaba con exit. |
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
/* | |
struct sockaddr_ll { | |
unsigned short sll_family; /* Always AF_PACKET */ | |
//unsigned short sll_protocol; /* Physical layer protocol */ | |
//int sll_ifindex; /* Interface number */ | |
//unsigned short sll_hatype; /* ARP hardware type */ | |
//unsigned char sll_pkttype; /* Packet type */ | |
//unsigned char sll_halen; /* Length of address */ | |
//unsigned char sll_addr[8]; /* Physical layer address */ | |
//}; */ |
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
/* | |
Por Alma & Ricardo :3 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <pthread.h> | |
typedef struct h{ | |
int ID; |
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
#include<bits/stdc++.h> | |
using namespace std; | |
struct casilla{ | |
int probabilidad; | |
bool gente; | |
int hp_gente; | |
}; | |
casilla mapa[20][21]; |
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
#include<bits/stdc++.h> | |
using namespace std; | |
map<char,int> Letras; | |
map<char,int>::iterator it; | |
int fact(int n){ | |
return (n == 1 || n == 0) ? 1 : fact(n - 1) * 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
#include <arpa/inet.h> #include <linux/if_packet.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <net/if.h> #include <netinet/ether.h> #include <my_global.h> #include <mysql.h> int indice; unsigned char trama[1514],tramaResp[1514]; // Declara Trama unsigned char MACDestino[] = {0xff,0xff,0xff,0xff,0xff,0xff}; // Broadcast unsigned char MACOrigen[6],IPOrigen[4]; unsigned char etherType[] = {0x08,0x06}; // Define ARP unsigned char arpData[] = {0x00,0x01,0x08,0x00,0x06,0x04,0x00,0x01}; unsigned char arpTarget[] = {0x00,0x00,0x00,0x00,0x00,0x00}; unsigned char arpTargetIP[] = {0xc0,0xa8,0x00,0x61}; unsigned char respIP[4],respMAC[6]; void enviarTrama(int ds, unsigned char * trama){ struct sockaddr_ll interfaz; //Reseteamos la struct memset(&interfaz,0,sizeof(interfaz)); interfaz.sll_family = AF_PACKET; interfaz.sll_protocol = htons(ETH_P_ALL); interfaz.sll_ifindex = indice; if (sendto(ds, trama, 60,0, (struct sockaddr *) &interfaz, sizeof(inter |
OlderNewer