This file contains hidden or 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 <GL/glfw.h> | |
| #include <math.h> | |
| #if defined(_WIN32) | |
| #include <windows.h> | |
| extern int main(int argc, char* argv[]); |
This file contains hidden or 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
| ### Graphics Variables | |
| from Tkinter import * | |
| WIDTH = 500.0 | |
| HEIGHT = 500.0 | |
| root = Tk() | |
| canvas = Canvas(width=WIDTH, height=HEIGHT, bg="black") | |
| moonshape = 0 |
This file contains hidden or 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 range(start, stop, step) { | |
| if (typeof stop == 'undefined') { | |
| stop = start; | |
| start = 0; | |
| } | |
| if (typeof step == 'undefined') | |
| step = 1; | |
| if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) | |
| return []; |
This file contains hidden or 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
| def rwh_primes(n): | |
| sieve = [True] * n | |
| for i in xrange(3,int(n**0.5)+1,2): | |
| if sieve[i]: | |
| sieve[i*i::2*i]=[False]*((n-i*i-1)/(2*i)+1) | |
| return [2] + [i for i in xrange(3,n,2) if sieve[i]] | |
| n = 10 ** 7 | |
| q = 11 | |
| primes = rwh_primes(n) |
This file contains hidden or 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
| /* | |
| * PNGImage.cpp | |
| * | |
| * Created on: Jul 16, 2012 | |
| * Author: zrbecker | |
| */ | |
| #include "PNGImage.h" | |
| #include <png.h> |
This file contains hidden or 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
| /* | |
| * == Altered == | |
| * assign() is overloaded in c++. Changed assign(n, u) to | |
| * assign_val(n, u); | |
| * | |
| * The insert and erase function use index instead of iterator | |
| * to determine where stuff is inserted/erased | |
| * | |
| * == Not implemented == | |
| * any operator overloading, obviously |
This file contains hidden or 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 max(x, y) ((x) > (y)) ? (x) : (y) | |
| #define C_VECTOR(T) \ | |
| typedef struct _c_vector_##T { \ | |
| size_t capacity; \ | |
| size_t size; \ |
This file contains hidden or 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
| class TapeException(BaseException): | |
| pass | |
| class Machine: | |
| def __init__(self, state, tape, machine, negsize=1): | |
| self.state = state | |
| self.tape = tape | |
| self.machine = machine | |
| self.negsize = negsize |
This file contains hidden or 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> | |
| typedef struct edge_s { | |
| int i; | |
| int j; | |
| } Edge; | |
| typedef struct graph_s { |
This file contains hidden or 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
| def Permute(list): | |
| if len(list) == 0: | |
| return [] | |
| elif len(list) == 1: | |
| return [list] | |
| else: | |
| perms = [] | |
| for n in list: |