I hereby claim:
- I am gvx on github.
- I am robinwell (https://keybase.io/robinwell) on keybase.
- I have a public key whose fingerprint is 43E3 C73A 188A 844E 39F1 EEBA E429 16EB 3793 DA2D
To claim this, I am signing this object:
function love.graphics.roundrect(mode, x, y, width, height, xround, yround) | |
local points = {} | |
local precision = (xround + yround) * .1 | |
local tI, hP = table.insert, .5*math.pi | |
if xround > width*.5 then xround = width*.5 end | |
if yround > height*.5 then yround = height*.5 end | |
local X1, Y1, X2, Y2 = x + xround, y + yround, x + width - xround, y + height - yround | |
local sin, cos = math.sin, math.cos | |
for i = 0, precision do | |
local a = (i/precision-1)*hP |
class LinkedList: | |
next = None | |
val = None | |
def __init__(self, val): | |
self.val = val | |
def add(self, val): | |
if self.next is None: | |
self.next = LinkedList(val) |
xxxxxxxx | |
x x | |
x xxxx x | |
x x x x | |
x x x x | |
x xxxx x | |
x x | |
xxxxxxxx | |
--- |
return function(name) | |
local class = require(name) | |
local classmt = getmetatable(class) | |
if getmetatable(class) == nil then | |
local props = {unpack(class)} | |
for i = #class, 1, -1 do | |
class[i] = nil | |
end | |
local classmt = {} | |
local instancemt = {__index = class} |
I hereby claim:
To claim this, I am signing this object:
$ py3.3 time_them.py | |
default implementation: | |
2.1573487099958584 | |
my implementation: | |
0.7448599760100478 | |
$ py3.3 time_them_2.py | |
default implementation: | |
0.6372028530022362 | |
my implementation: | |
0.20809232600731775 |
#By Robin Wellner (gvx) | |
#I hereby waive copyright and related or neighboring rights to this work | |
#See the Creative Commons Zero Waiver at <http://creativecommons.org/publicdomain/zero/1.0/> | |
def switch(expression, cases, default=None): | |
try: | |
ret = cases[expression] | |
except KeyError: | |
ret = default | |
if callable(ret): ret = ret() |
#By Robin Wellner (gvx) | |
#I hereby waive copyright and related or neighboring rights to this work | |
#See the Creative Commons Zero Waiver at <http://creativecommons.org/publicdomain/zero/1.0/> | |
class mutable(object): | |
def __init__(self, obj): | |
self._obj = obj | |
def __repr__(self): | |
return 'mutable('+repr(self._obj)+')' | |
def __call__(self, obj=None): |
#By Robin Wellner (gvx) | |
#I hereby waive copyright and related or neighboring rights to this work | |
#See the Creative Commons Zero Waiver at <http://creativecommons.org/publicdomain/zero/1.0/> | |
def rotn(intext, n): | |
outtext = [] | |
for char in intext: | |
if 65 <= ord(char) < (65+26): | |
char = chr(((ord(char) - 65) +n) % 26 + 65) | |
elif 97 <= ord(char) < (97+26): |
PROGRAM:RNDABC | |
:Input D:randInt | |
(1,D)→A:randInt( | |
1,D)→B:randInt(1 | |
,D)→C:Disp "AB", | |
AB,"AC",AC,"BC", | |
BC:Pause :Disp " | |
{A,B,C}",{A,B,C |