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
void process_file(ImageData *image, ImageData *kernel) { | |
const u_int32_t window_center_x = kernel->width / 2; | |
const u_int32_t window_center_y = kernel->height / 2; | |
const u_int32_t window_center_max_x = image->width - (kernel->width / 2); | |
const u_int32_t window_center_max_y = image->height - (kernel->height / 2); | |
u_int32_t kernel_bytes_per_pixel = kernel->rowbytes / kernel->width; |
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 "common.h" | |
BEGIN | |
CLEAR | |
/* Must come before they are used. */ | |
.equ CODE_SEG, 8 | |
.equ DATA_SEG, gdt_data - gdt_start | |
/* Tell the processor where our Global Descriptor Table is in memory. */ |
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
# Install utils | |
apt install bridge-utils radvd | |
# Create config files | |
tee -a /etc/radvd.conf <<EOF | |
interface vpeer-router { | |
AdvSendAdvert on; | |
MinRtrAdvInterval 3; | |
MaxRtrAdvInterval 10; | |
prefix 2001::/64 { |
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 -*- | |
# En una grilla de 20x20 tenemos desde (0,0) hasta (20,20) es decir 20² combinaciones. | |
# lo que significa que para abarcar todas las posiciones tenemos que hacer 2 bucles anidados | |
# unit testing : | |
# 1*1 : 2 | |
# 2*2 : 6 | |
# 3*3 : 20 | |
# 4*4 : 70 | |
# (x,y) |
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
/* If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
Find the sum of all the multiples of 3 or 5 below 1000. */ | |
public class Problema_EULER_1{ | |
public static void main (String[] args) { | |
int sum_3 = 0, | |
sum_5 = 0; | |
for (int x =1; x<=1000; x++) { |
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 Problema_OMA_3 { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
/* | |
a) ¿Cuántos números formados exclusivamente por los dígitos 3 y 7, y divisibles por 3 y por 7, son menores a 100000? | |
b) ¿Cuántos números formados exclusivamente por los dígitos 3 y 7, y divisibles por 3 y por 7, son menores a 100000000?*/ |
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 Problema_OMA_6 { | |
public static void main(String[] args) { | |
for (int x = 100000000 ; x<=999999999; x++) { | |
if (es_primo(x)) { | |
String X = Integer.toString(x); | |
String abc = X.substring(0,3); | |
String jkl = X.substring(3,6); |
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 Problema_OMA_4 { | |
public static void main(String[] args) { | |
/*¿Cuál es el mayor de los números racionales P / Q, tales que P y Q son números primos positivos, | |
P < Q y Q < 26662?*/ | |
double mayor_P_sobre_Q = 0; | |
double current_P_Q = 0; | |
for (long q = 24000; q < 26662; q++) { | |
for(long p = 23999; p<q; p++) { |
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 funciones { | |
public static void main (String args[]) { | |
long start = System.currentTimeMillis(); | |
fibonacci(); | |
long elapsedTimeMillis = System.currentTimeMillis()-start; | |
float elapsedTimeSec = elapsedTimeMillis/1000F; | |
System.out.println(elapsedTimeSec); |
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 java.util.Scanner; | |
public class principal { | |
public static void main(String args[]) { | |
Scanner input = new Scanner(System.in); | |
int maximo = input.nextInt(); |
NewerOlder