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 <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | |
int burritos = 0; | |
void *consumer(void *threadid) { | |
int i; | |
for(i=0; i<15; i++) { |
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
function cartas(k, p, filename, repet) | |
completados = [0]; | |
output = fopen(filename, "w"); | |
for i = 1 : repet | |
paso = 1; | |
conteo = 0; | |
while (conteo < k) | |
conteo += bernoulli(p); | |
paso++; | |
endwhile |
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
function caos() | |
L = 0.000037; | |
numgen = 100; | |
first = 2000; | |
thisgen = first; | |
output = fopen("caos.dat", "w"); | |
for i=1 : numgen | |
i; | |
nextgen = L*thisgen*(100000-thisgen); | |
fprintf(output, "%d %d\n", i, nextgen); |
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
set term postscript eps color 30 | |
set key outside Right | |
set size 2, 1.5 | |
set output "caos.eps" | |
set pointsize 2 | |
plot "caos.dat" with lines ls 3 title "" |
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> | |
int main(int argc, char** args) { | |
printf("Hola Mundo!\n"); | |
return 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
.file "fact.c" | |
.section .rodata | |
.LC0: | |
.string "Numero: " | |
.LC1: | |
.string "%d" | |
.LC2: | |
.string "Factorial: %d\n" | |
.text | |
.globl main |
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
.reprueba: | |
.string "El payaso viene por ti\n" | |
.aprueba: | |
.string "Vamos bien\n" | |
.valor: | |
.string "%d" | |
.text | |
.globl main | |
.type main, @function | |
main: |
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
.file "hola.c" | |
.section .rodata | |
.LC0: | |
.string "Hola Mundo!" | |
.text | |
.globl main | |
.type main, @function | |
main: | |
.LFB0: | |
.cfi_startproc |
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> | |
int main(int argc, char** args) { | |
int x; | |
int factorial = 1; | |
printf("Numero: "); | |
scanf("%d", &x); | |
while (x>1) { | |
factorial *= 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
.LC0: #etiquetas | |
.string "Numero: " #cadenas | |
.LC1: | |
.string "%d" | |
.LC2: | |
.string "Factorial: %d\n" | |
.text | |
.globl main | |
.type main, @function | |
main: |
OlderNewer