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 <stdlib.h> | |
#include <stdio.h> | |
#define WHEEL_LENGTH 7 | |
#define PRINT_LENGTH | |
#define PRINT_WHEEL | |
void n_primes(int * results, int n){ | |
if(n < 1) | |
return; |
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 <stdint.h> | |
int64_t gcd(int64_t a, int64_t b){ | |
if(!b) | |
return a; | |
return gcd(b, a%b); | |
} |
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
<html> | |
<head> | |
<title>My first Three.js app</title> | |
<style> | |
canvas { width: 100%; height: 100% } | |
html,body { overflow: hidden; margin: 0 } | |
</style> | |
</head> | |
<body> | |
<script src="three.js"></script> |
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/python | |
# Simulation for Neural Network | |
import pygame | |
import pygame.draw | |
import random | |
from pygame.locals import * |
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
# Pseudo code for the sockets | |
# Game | |
def connection(player, socket=zqm.socket(zqm.REQ)): | |
while True: | |
# Send to the NN | |
info = player.get_info() | |
info_p = info.pickle() | |
socket.send(info_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
#!/usr/bin/python | |
#This file represents the simulation as it receives commands from the ANN and executes an action depending on the command. | |
import threading | |
import time | |
import zmq | |
def connection(socket): | |
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
#!/usr/bin/python | |
# This file represents the ANN as it receives inputs from the simulation and does calculations depending on the input. | |
import threading | |
import time | |
import zmq | |
def connection(socket): | |
while True: | |
msg = socket.recv() |
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
/* Thomas Manning | |
* Mon Feb 3 01:23:23 EST 2014 | |
* | |
* About: | |
* This is a project to try to make as fast a prime generator | |
* as possible using parallel programming, the sieve of eratosthenes | |
* and many other optimizations. | |
* | |
* It's kind of big because of the use of a very large static array | |
* for wheel optimization (wheel size of 7). Using a good editor |
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 <stdlib.h> | |
#include <stdio.h> | |
#define WHEEL_LENGTH 3 | |
#define PRINT_LENGTH | |
#define PRINT_WHEEL | |
void n_primes(int * results, int n){ | |
if(n < 1) | |
return; |
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 | |
# Recursive descent wrapper for objects containing objects | |
import functools | |
def recursive_descent(fn): | |
@functools.wraps(fn) | |
def wrapped(self, *args, **kwargs): | |
fn(self, *args, **kwargs) |
OlderNewer