I hereby claim:
- I am trishume on github.
- I am thume (https://keybase.io/thume) on keybase.
- I have a public key whose fingerprint is FF73 AF0E EB29 A514 0316 3DFE BE54 21FC B054 2047
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
-- Idris Proof for Commutativity of Addition + Lemmas | |
-- By Tristan Hume | |
-- Citations: | |
-- https://github.com/idris-lang/Idris-dev/wiki/Manual (learning proof techniques) | |
-- http://rosettacode.org/wiki/Proof#Idris (Example proofs with Peano numbers) | |
module Plus | |
-- Enable totality checker. Proofs are only correct if functions | |
-- always terminate with a result for all inputs. |
S.log("-- Starting config --"); | |
S.cfga({ | |
defaultToCurrentScreen : true, | |
nudgePercentOf : "screenSize", | |
resizePercentOf : "screenSize", | |
// "keyboardLayout" : "dvorak", | |
"secondsBetweenRepeat" : 0.1, | |
"checkDefaultsOnLoad" : true, | |
"focusCheckWidthMax" : 3000, | |
"windowHintsShowIcons" : true, |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
import math | |
import string | |
import sys | |
import matplotlib.pyplot as plt | |
from PIL import Image | |
import random | |
from bisect import bisect_left, bisect, insort |
# Econ Elasticity Program - By Tristan Hume | |
# | |
# When this program is run with the Ruby language interpreter | |
# it shows a prompt where calculations can be run. | |
# Some examples: | |
# >> cross_elasticity(8, 12, 6000, 8000) | |
# => 0.714 | |
# >> set_demand2(22,11) | |
# Setting demand with slope -2.0 and y-int 22 | |
# >> data |
require 'liquid' | |
require 'readline' | |
require 'colorize' | |
$state = {'test' => 5, 'wat' => "yup"} | |
def eval_liquid(str) | |
temp = Liquid::Template.parse(str) | |
temp.render($state) | |
end |
## keybindings | |
unbind % | |
unbind , | |
unbind . | |
unbind n | |
unbind p | |
unbind [ | |
unbind '"' | |
unbind l | |
unbind & |
-- Ruby Solution | |
gets.to_i.times{puts (0..gets.to_i-1).map{|i|(-1)**i/(2*i+1).to_f}.inject(:+)} | |
-- Umpteen Haskell solutions, semicolons replace newlines for length comparison | |
-- Crashes on second test case but really short | |
l=readLn>>=(\n->print.sum$[(-1)**i/(2*i+1)|i<-[0..n-1]])>>l;main=getLine>>l | |
-- Working ones | |
l n=show.sum$[(-1)**i/(2*i+1)|i<-[0..n-1]];main=interact$unlines.(map$l.read).tail.lines |
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
robot.clone(); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |