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 java.lang.reflect.Method; | |
import java.lang.reflect.Field; | |
public class FooTest { | |
static class Foo { | |
private int hehe = 0; | |
private void doSomething() { | |
System.out.println("Foo!"); | |
} |
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 java.lang.reflect.Method; | |
import java.lang.reflect.Field; | |
public class FooTest { | |
static class Foo { | |
private int hehe = 0; | |
private void doSomething() { | |
System.out.println("Foo!"); | |
} |
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
from __future__ import division | |
from math import pi | |
def grader(target): | |
return lambda (p1, q1), (p2, q2): cmp(abs(target - p1 / q1), abs(target - p2 / q2)) | |
def gcd(a, b): | |
# euclid's algorithm | |
while a != b: | |
if b < a: |
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
from __future__ import division | |
from visual import * | |
from math import * | |
PROTON_CHARGE = 100 | |
MU_ZERO = 1.256e-6 | |
VEL = vector(.01, 0, 0) # m/s | |
SCALE = 20 | |
observation_points = [vector(x * .01 - .1, .01 * cos(pi/4 * t), .01 * sin(pi/4 * t)) for x in range(20) for t in range(8)] |
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 | |
import sys | |
from collections import deque | |
SINGLE, SHIFT_LEFT_SEQ, SHIFT_RIGHT_SEQ, INC_SEQ, DEC_SEQ = range(5) | |
SHIFT_RIGHT = ord('>') # increment the data pointer | |
SHIFT_LEFT = ord('<') # decrement the data pointer | |
INC = ord('+') # increment the current byte |
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
# linalg.py - vector and matrix handling | |
# | |
# Copyright 2011 Jonathan D. Page. All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without modification, are | |
# permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this list of | |
# conditions and the following disclaimer. | |
# |
NewerOlder