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> | |
#include <time.h> | |
void numeros(int random[20]); | |
int menu(); | |
void todos(int random[20]); | |
void pares(int random[20]); | |
void impares(int random[20]); | |
void maxmin(int random[20]); |
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
//Standard stuff | |
#include <stdio.h> | |
// rand(),srand() | |
#include <stdlib.h> | |
//time() | |
#include <time.h> | |
/* | |
References: | |
http://stackoverflow.com/questions/822323/how-to-generate-a-random-number-in-c |
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
$ python difhel.py 997 258 | |
Alice generated: 531, using 258 ^ 91 mod 997 | |
Bob generated: 550, using 258 ^ 46 mod 997 | |
Alice's key: 550 ^ 91 mod 997 = 682 | |
Bob's key: 531 ^ 46 mod 997 = 682 | |
Eve's key using bob's private number: 682 | |
Eve's key using alice's private number: 682 |
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
#Descifrado del mensaje | |
def D(c,key): | |
#Alfabeto para descifrar,se utilizo la ref(2) | |
alf = ascii_lowercase | |
alf += ' .' | |
deStr = '' | |
for partC in c: | |
for car in range(len(partC)): | |
deStr += alf[int(partC[car]) - int(key[c.index(partC)][car])] | |
return deStr |
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
public class Client{ | |
/*Class which will represent the client who wants to send a package*/ | |
private float budget; | |
private int xValue,yValue; | |
public void setClient(float budget,int xValue,int yValue){ | |
this.budget = budget; | |
this.xValue = xValue; | |
this.yValue = yValue; |
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
i = 0 | |
j = 0 | |
suma = 0 | |
suma2 = 0 | |
grados = [] | |
while(i<33): | |
while(j<33): | |
suma += mat[i][j] | |
suma2 += mat[i][j] | |
j = j + 1 |
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
public void setOnOff(int environmentTemp){ | |
System.out.println("SETONOFF"); | |
if(environmentTemp <= 20){ | |
this.onOff = false; | |
} | |
if(environmentTemp > 20 && environmentTemp < 25){ | |
this.onOff = true; | |
/*Set the speed to slow*/ | |
this.speed = false; |
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
import math | |
from random import randint | |
from aspirante import aspirante | |
class mejorAspirante: | |
def __ini__(self): | |
## self.aspirantes = aspirantes | |
## self.centroides = centroides |
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
#Training! | |
#For the training,the image of the digit is displayed and it is expected that the user press on his keyboard the digit is shown on screen | |
def training(contoursObj): | |
#Empty array for the labels | |
samples = np.empty((0,100)) | |
#Empty array for the corresponding value | |
valueDigit = [] | |
#Loop over all the images,in this case we have 9 images per digit,so in total we have 90 images(we included 0 as a digit) | |
for num_image in range(1,91): | |
#Get the image and find the contours of the number(rectangle) |
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
import numpy as np | |
import cv2 | |
#Training! | |
def training(contoursObj): | |
samples = np.empty((0,100)) | |
#Empty array for the corresponding value | |
valueDigit = [] | |
#Loop over all the images,in this case we have 9 images per digit,so in total we have 90 images(we included 0 as a digit) |
NewerOlder