Yeah yeah, gist's aren't supposed to have README's. Whatever. In order to run this stuff I'll write a brainfuck interpreter. Run it with >python brainfuck.py file.bf
Enjoy!
import itertools as i | |
import sys | |
def main(): | |
with open("test.pr", 'r') as f: | |
n = int(f.read(1)) |
def main(): | |
cases = int(input()) | |
for case in range(cases): | |
print(deletions(input())) | |
def deletions(s): | |
# Set our first char | |
last = s[0] |
''' Requestester ''' | |
import requests | |
base = 'http://helixtangowebapi.azurewebsites.net' | |
response = requests.get(base+'/api/values') | |
print response.text |
''' Question: N-Ary tree post order traversal | |
Twist: Using only iteration! | |
Rationale: | |
This essentially becomes a Dynamic Programming question. Instead | |
of using Top-Down recursion. We build up our solution from the bottom | |
up using a list and our base case. The base case is if a node has no | |
children. | |
I built a simply NaryTree for testing and a function that takes a node |
''' All Your Base | |
2009 1-C | |
thomas moll 2015 | |
''' | |
import sys | |
filename = 'A-large-practice.in' | |
outfile = 'file.out' |
Yeah yeah, gist's aren't supposed to have README's. Whatever. In order to run this stuff I'll write a brainfuck interpreter. Run it with >python brainfuck.py file.bf
Enjoy!
def check_parenthesis(string): | |
stack = Stack() | |
# We're using a dict which allows us to do some fun things! | |
brackets = {'{':'}', '[':']', '(':')'} | |
for character in string: | |
# Keys being the left-side brackets | |
if character in brackets.keys(): | |
stack.push(character) |
#include "keymap_common.h" | |
/* | |
* SpaceFN | |
* http://geekhack.org/index.php?topic=51069.0 | |
*/ | |
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |
/* Keymap 0: Default Layer | |
* ,-----------------------------------------------------------. | |
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |
import inspect | |
""" Dynamic weighted graphs | |
tmoll 2015 | |
""" | |
class DynamicWeight(object): | |
"""docstring for DynamicWeight""" | |
def __init__(self, weight, weight_func): | |
self.weight_func = weight_func |
Layer 0 | |
,-----------------------------------------------------------. | |
|Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | | |
|-----------------------------------------------------------| | |
|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | |
|-----------------------------------------------------------| | |
|Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | | |
|-----------------------------------------------------------| | |
|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | |
|-----------------------------------------------------------| |