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 <iostream> | |
using namespace std; | |
int main() | |
{ | |
int num, min, max; | |
while(true) |
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 <X11/Xlib.h> | |
#include <X11/Xutil.h> | |
int main() | |
{ | |
Display *dpy = XOpenDisplay(NULL); | |
int w = WidthOfScreen(XDefaultScreenOfDisplay(dpy)); | |
int h = HeightOfScreen(XDefaultScreenOfDisplay(dpy)); | |
int x=0, y=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
Val | |
{ | |
TRIM(min=-20, max=20) | |
ENGINE() | |
ENGINE_TOP() | |
ENGINE_BOTTOM() | |
} | |
Key | |
{ |
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** argv){ | |
return printf("%d\n", (scanf("%d %d %d %d\n%d %d %d %d", &(&argc)[0], &(&argc)[-1], &(&argc)[-2], &(&argc)[-3], &(&argc)[-4], &(&argc)[-5], &(&argc)[-6], &(&argc)[-7]) == 8) ? ((((&argc)[0] += (&argc)[-1] + (&argc)[-2] + (&argc)[-3]) > ((&argc)[-4] += (&argc)[-5] + (&argc)[-6] + (&argc)[-7])) ? (&argc)[0] : (&argc)[-4]) : -1) == 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
import numpy | |
def str2matrix(string): | |
return numpy.matrix(tuple(int(x)*2-1 for x in ''.join('{0:08b}'.format(ord(x)) for x in string))).T | |
def matrix2box(matrix): | |
return matrix * matrix.T - numpy.identity(matrix.shape[0]) | |
def make_neural(*strings): |
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** argv){ | |
char* itr = argv[2]; | |
while(itr = strstr(itr, argv[1])) | |
printf("%d\n", (int)(++itr-argv[2])); | |
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
#!/bin/bash | |
file='count.log' | |
flock ${file} sh -c "expr `cat ${file} 2>/dev/null` + 1 >${file}; echo -e \"Content-Type: text/plain\n`cat ${file}`\"" |
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 random | |
import itertools | |
SIZES = tuple(random.randint(0, 10) for i in range(200)) | |
TARGET = 100 | |
GENOM_NUM = 100 | |
MUTATION_NUM = 10 | |
MAX_LOOP = 100 |
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> | |
void void_func(int v){ | |
} | |
void loop(int i){ | |
printf("hello, world! %d\n", i); | |
((void (*)(int))((long long)loop * (i<9) + (long long)void_func * (i>=9)))(i + 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
#include <stdio.h> | |
#define GENOM_SIZE 64 | |
#define GENOM_NUM 10 | |
#define MUTATION_RATE 5 | |
__device__ unsigned int rand(unsigned int* seeds){ | |
seeds[threadIdx.x] = seeds[threadIdx.x] * 0x97531 + 0x13579; |