user_id: Int
mode: Int
day: date
full_games: Int
import OpenGL.GL as GL | |
import OpenGL.GL.shaders | |
import ctypes | |
import pygame | |
import numpy | |
vertex_shader = """ | |
#version 330 | |
in vec4 position; |
event_handlers = {} | |
def registerEventHandler(event_name, handler): | |
if not event_name in event_handlers.keys(): | |
event_handlers[event_name] = [] | |
event_handlers[event_name].append(handler) | |
class eventHandler(object): | |
'''Decorator which registers a function as an event handler.''' | |
def __init__(self, name): |
import time | |
import random | |
from noise_function import smerp | |
start_time = time.time() | |
for x in xrange(1000*1000): | |
smerp(random.uniform(0, 1), random.uniform(0, 0.5), random.uniform(0.51, 1)) |
def count(digitgen): | |
"Takes an iterator which yields the digits of a number system and counts using it." | |
def subcount(digitgen, places): | |
if places == 1: | |
for d in digitgen(): | |
yield d | |
else: | |
for d in digitgen(): | |
for ld in subcount(digitgen, places - 1): |
""" | |
An extremely simple synchonous signal/slot handler system. | |
""" | |
class Signal(object): | |
def __init__(self): | |
self.slots = [] | |
def connect(self, slot): | |
if not slot in self.slots: |