See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| /* | |
| * vm.c - Simple X86 interpreter | |
| * | |
| * Copyright (c) 2013, Jeremie Miserez <jeremie@miserez.org> | |
| */ | |
| /* | |
| * Highlights/Features not specified in assignment | |
| * =============================================== | |
| * - Memory simulation of all 4GB with paging |
| #A golfed python 'accent'. Fully backwards compatible with python. | |
| #NOT SUITED FOR DAY-TO-DAY PROGRAMMING! | |
| #If you DO use it for a production (non-challenge/codegolf) program, I'm not | |
| #responsible for anything bad that happens to you, your computer, | |
| #your spare time, your code maintainability, any kittens that god might kill, | |
| #or the tears of blood you will weep. | |
| import sys | |
| from math import * |
| hItuE25058127 | |
| 6uGdS64633551 | |
| iZ8Yg129410073 | |
| mn9Ni177063744 | |
| tvUy62899300 | |
| LlcJs181693848 | |
| rRNp274174151 | |
| UsiSz5027013 | |
| DH4Yd88472413 | |
| eEIN376415610 |
To run the Java version:
Download: https://dl.dropboxusercontent.com/u/18074905/blc-bench-final.jar
Run it from the command line:
time java -jar blc-bench-final.jar
To run the Clojure version:
| stack = [] | |
| compileStacks = [] | |
| words = {} | |
| builtins = {} | |
| lambdaType = type(lambda x: x) #cannot compare against the function type directly for some reason | |
| def prn(o): | |
| print(o) | |
| def clr(l): |
| #!/usr/bin/env ruby | |
| class MRISC | |
| def run(code) | |
| tokens = code.gsub(/(\*.*?\*)|[^a-z0-9,-;@\._]/,'').split(';') | |
| @vars,stack,i = {:_pc=>-1,:_oc=>0},[],0 | |
| tokens.map!{|t| t.chars.first=='@' ? (@vars[t.to_sym]=i-1;nil) : (i+=1;t.split(',').map{|e|numeric?(e) ? e.to_i : e.to_sym})}.compact! | |
| while @vars[:_pc] < tokens.size-1 | |
| @vars[:_pc] += 1 | |
| @vars[:_oc] += 1 |
| # nanoshorten - a very tiny URL shortener Web application written in Bottle and sqlite | |
| # copyright (c) 2012 darkf | |
| # licensed under the WTFPL (WTF Public License) | |
| # see http://sam.zoy.org/wtfpl/ for details | |
| from bottle import get, request, run | |
| import sqlite3, random, string | |
| con = sqlite3.connect('short.db') | |
| c = con.cursor() |
| import os | |
| import sys | |
| import random | |
| import time | |
| import string | |
| import Queue | |
| import threading | |
| from urllib2 import Request, urlopen, URLError, HTTPError | |
| CHARS = string.letters + string.digits |