Skip to content

Instantly share code, notes, and snippets.

@myxoh
myxoh / Q16.R
Created April 4, 2017 16:13
Q16
periods=48
Delta=0.01
n=periods/Delta
theta=matrix(1,1,n+1)
v=matrix(1,1,n+1)
x=matrix(1,1,n+1)
Z1<-t(rnorm(n))*Delta
Z2<-t(rnorm(n))*Delta
Z3<-t(rnorm(n))*Delta
theta[,1]=0.1
module Fouriest
def to_base(x)
raise ArgumentError, "the base must be a positive > 1 number" if x < 2 || x != (x.to_i)
num = self
new_string = ""
loop do
new_string += (num % x).represent_number
num = num / x
break if num == 0
end
import evdev
from evdev import KeyEvent, InputDevice
class KeyListener:
pressed_keys = [False] * 256
UP = evdev.ecodes.KEY_UP
DOWN = evdev.ecodes.KEY_DOWN
LEFT = evdev.ecodes.KEY_LEFT
RIGHT = evdev.ecodes.KEY_RIGHT
SPACE = evdev.ecodes.KEY_SPACE