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
| unsigned char* bitmap = img -> informacion; //Se solicita el apuntador a los componentes de la imagen. | |
| int word_size = CHAR_SIZE; //Tamaño inicial de palabra | |
| int cant_char = 0; //Cantidad de caracteres extraídos | |
| int bitmap_pos = 0; //Índice del componente actual de la imagen | |
| int extracted_chunks = 0; //Paquetes recuperados por componente | |
| int num_chunks = CHAR_SIZE / n; //Número de paquetes que se pueden extraer de acuerdo al tamaño n solicitado | |
| int offset = CHAR_SIZE % n; //Sobrante sujeto al número de paquetes por n. |
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
| #define NOFIELD 505L // Analog output with no applied field, calibrate this | |
| // Uncomment one of the lines below according to device in use A1301 or A1302 | |
| // This is used to convert the analog voltage reading to milliGauss | |
| #define TOMILLIGAUSS 1953L // For A1301: 2.5mV = 1Gauss, and 1024 analog steps = 5V, so 1 step = 1953mG | |
| // #define TOMILLIGAUSS 3756L // For A1302: 1.3mV = 1Gauss, and 1024 analog steps = 5V, so 1 step = 3756mG | |
| int ticks = 0; | |
| unsigned long time_e; |
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
| // isis1304-111-proyecto2.cpp: define el punto de entrada de la aplicación de consola. | |
| // | |
| // DESARROLLADO POR: | |
| // Camila García, carnet | |
| // Daniel Ordoñez, carnet | |
| // Edgar A. Margffoy, 201412566 | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.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
| // isis1304-111-proyecto2.cpp: define el punto de entrada de la aplicación de consola. | |
| // | |
| // DESARROLLADO POR: | |
| // Camila García, carnet | |
| // Daniel Ordoñez, carnet | |
| // Edgar A. Margffoy, 201412566 | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.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
| package words_server; | |
| //Import required java libraries | |
| import java.io.*; | |
| import java.util.*; | |
| import javax.servlet.ServletConfig; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.annotation.WebServlet; | |
| import javax.servlet.http.HttpServlet; |
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> | |
| #include<stdlib.h> | |
| #include<string.h> | |
| const char* byte_to_binary(int x) | |
| { | |
| static char b[9]; | |
| b[0] = '\0'; | |
| int z; |
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<math.h> | |
| #define G 9.8 // m/s^2 | |
| int analogPin = 0; | |
| void setup() | |
| { | |
| Serial.begin(9600); | |
| } |
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
| import re | |
| KEY_REGEX = '^[,]?["][a-zA-Z_][\w-]*["]$' | |
| VALUE_REGEX = '^["].*["][,]?$' | |
| CURLY_PAIR = ('{', '}') | |
| SQ_PAIR = ('[', ']') | |
| class JSONException(Exception): | |
| def __init__(self, value): |
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
| private static int[][] swap_values(int[][] sq, int times) | |
| { | |
| int[][] temp_sq = (int[][]) sq.clone(); | |
| Random rand = new Random(); | |
| for(int i = 0; i < times; i++) | |
| { | |
| r1 = rand.nextInt(len(sq)); | |
| c1 = rand.nextInt(len(sq)); | |
| r2 = rand.nextInt(len(sq)); | |
| c2 = rand.nextInt(len(sq)); |
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
| def eval_constraints(sq, n): | |
| fitness = 0 | |
| totalRowDiff = 0 | |
| totalColDiff = 0 | |
| rightDiagonal = 0 | |
| leftDiagonal = 0 | |
| for row in range(0, len(sq)): | |
| sum_row = 0 | |
| sum_col = 0 | |
| for col in range(0, len(sq)): |