Skip to content

Instantly share code, notes, and snippets.

View emulbreh's full-sized avatar

Johannes Dollinger emulbreh

View GitHub Profile
### Keybase proof
I hereby claim:
* I am emulbreh on github.
* I am emulbreh (https://keybase.io/emulbreh) on keybase.
* I have a public key ASCOMlAGGEUChBcqzgGr7pm8Cq4ivqItmhmcLVNYBxSwfQo
To claim this, I am signing this object:
class Worker(object):
def __init__(self, tasks):
self.enabled = True
self.tasks = set(tasks)
def is_active(self):
return self.enabled and self.tasks
def run(self):
if self.enabled:
@emulbreh
emulbreh / tm.py
Created April 30, 2011 19:03
A Turing Machine Simulator Written in Django Template Language
import sys, os, re
from django import template
from django.template import loader
TURING_MACHINE = """
{% if not current_state %}
{% with INITIAL_STATE as current_state %}
{% with INITIAL_HEAD|default:0|add:1 as pos %}
{% with "@"|add:TAPE as tape %}
{% with "TURING_MACHINE" as tm_tpl %}