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
-- Use single inheritance to do fun things with tables | |
mt = {} | |
mt.__index = function (t, k) | |
tbl = {} | |
setmetatable(tbl, mt) | |
return tbl | |
end | |
setmetatable(_G.table, mt) | |
print(m.e.t.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 | |
# Euler method of approximating Diff. Eq.s | |
# Uses eval to reduce f(x,y) -- is this okay? | |
def euler(eq, x, y, h, e): | |
while x < e: | |
eqResult = eval(eq) | |
x = x + h | |
y = y + (h*eqResult) |