#!/bin/sh
-# Copyright (C) 2011-2012 Simon Ruderich
+# Copyright (C) 2011-2013 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-exec python -i -c 'from math import *;
+exec python -i -c '
+
+# Math functions.
+from math import *
def ld(x):
return log(x)/log(2)
def binom(n,k):
return reduce(lambda a,b: a*(n-b)/(b+1),xrange(k),1)
+
+# Time/Date functions.
+import time
+
+# Convert time in seconds since epoch to readable string.
+def stime(seconds):
+ print time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(seconds))
+
+
print "Welcome to the ultimate calculator."'
# vim: ft=python