Skip to content

Instantly share code, notes, and snippets.

Austin Schwartz austinschwartz

Block or report user

Report or block austinschwartz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@austinschwartz
austinschwartz / Jeopardy.ipynb
Created Apr 3, 2018
Jeopardy Python Notebook
View Jeopardy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@austinschwartz
austinschwartz / recursive_descent_parser.py
Created Feb 18, 2018
Python Recursive Descent Parser Example
View recursive_descent_parser.py
#!/usr/bin/env python3
import re
from enum import Enum
from collections import namedtuple
"""
Simple Expression Grammar
exprterm {(+ | -) term}
View link-local.rb
View parens.py
def parens(n, l = 0, r = 0, curr = ""):
if len(curr) == n:
print(curr)
if l < n // 2:
parens(n, l + 1, r, curr + '(')
if r < l:
parens(n, l, r + 1, curr + ')')
View jeopardy_slopegraph.r
library(scales)
library(ggplot2)
library(ggthemes)
library("devtools")
library("slopegraph")
CSV_Text = '"","jaro","dice","levNorm"
"a shot",0.8888888888888888,1,0.6666666666666667
"keanu (reeves)",0.8714285714285714,0.5333333333333333,0.3571428571428571
"the woodwork",0.8425925925925926,0.8,0.5833333333333333
View wavingCubes.py
# Rewriting this this in python:
# https://gist.github.com/beesandbombs/2abe9464e2f43e75807879036a1962ca
import math
recording = False
result = None
N = 16
ia = math.atan(math.sqrt(.5))
View randomwalk.tex
% Modified from https://tex.stackexchange.com/a/249320
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\pgfmathsetseed{\number\pdfrandomseed}
\begin{document}
\begin{tikzpicture}
@austinschwartz
austinschwartz / multiply.s
Created Aug 10, 2017
64-bit tail-recursive multiply w/ two return registers
View multiply.s
.section .data
.section .text
@ throughout the program
@ r4 stores m
@ r5 stores n
@ r6 stores the 32-bit LSB of acc (lower 32 bits)
@ r7 stores the 32-bit MSB of acc (higher 32 bits)
@ int multiply(int m, int n, int acc) {
@austinschwartz
austinschwartz / test_in.c
Created Mar 1, 2017
CS352 Lab3 Test Case 1
View test_in.c
long main(){for(Y=qG[SkBfdSGWx[((FJAmdCw*'u'))]];-636762;UUqxgV=("RLjcdJQyO")){asEHwREpg(tfUwAvibIFe);if(PXqBIEew(Jb,pAt,Lg,jux,okMy,US,hLe,N)){if(-885414.5125210375){while(436485){for(KzuTWYRUrN=(wPL[LKE["UOrmyhvw"]]*(NENNnyXP[(-760952.4360878994||(+'i'))]&&'f'));'k';yMSIlDLMeg=(-*(+"RFs"))){}}{}}}while("jkvqgqXeU"){loUXakm(W,Iqe,I);}}{}for(qRX=I;((("LQgsOETC">24260.031260388205)||yx[nHaqh(j,IU,lMjBa,oRs)])||(('h'/"RDNdGLsN")/'g'));RuuwkW=mvXD(sTTaY,iO,TC,U)){while(("IbQMnAfRN"-(-29940.42566039192))){LnRb(zHb,qO);}}for(O=-966957.704638198;'j';axRBI=292999.3623444184){bMWOc(SlICzzk,RUMI,TRFUytt);for(gA=tTtCGpLLIq;413429;zbJJC=nVCKLs){for(XzRLyYv=-666092;ulzY;HM=ymvV){ReVKv(F,tv);PhpNW(huSnY);}AYrmt(Hgzc,Wj,iJYfAc,eXnZAWc);pHogU(Kq,rKP,il);BYz(JXUO,wlrRY,L);}IPPmKtMUwA(QsZ,wy,p);FNsFHmlSC(OS,uQ);mI(LdQ,sOuim,Pg);cqu(b);cgFi(mnwOD,Qw,xlUGe,Ol,b);Eyo(Yo,VTP,UPM);for(ssIwnksyBq=K(M,TSVH);-999647;Ixu='x'){EAryCRRL(WF,M);{EM(fz,jBeXzEj,BoqkhYt,xwXH);}EWQUIjF(Ml);}vFFYhN(nr);}for(jgGqC=(+-*"Fssxgjnw");PyREQDa;rQlRsd
@austinschwartz
austinschwartz / brackets.py
Created Mar 1, 2017
Generates balanced brackets of size n
View brackets.py
# http://dl.acm.org/citation.cfm?id=357091
import random, sys
class Generator:
def __init__(self):
self.r = 0
self.k = 0
def open(self):
print("{", end = '')
You can’t perform that action at this time.