This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
operations = { | |
"+": lambda x, y: x + y, | |
"-": lambda x, y: x - y, | |
"/": lambda x, y: x / y, | |
"*": lambda x, y: x * y | |
} | |
def calculate(expr): | |
numxChars = "" | |
operation = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import timing | |
import zipfile | |
import os | |
import shlex | |
import subprocess | |
import glob | |
import shutil | |
import MySQLdb | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mount a Gutenberg CD | |
mount -t iso9660 PG2003-08.ISO iso -o loop | |
# flatten the hierarchy of a Gutenberg CD | |
cp $(find iso -name "*.txt") lt/corpus | |
# strip the corpus | |
for i in $(ls corpus); do < corpus/$i ./strip.py > words/$i; done | |
# count some words | |
for i in $(ls words); do < words/$i ./wordcount.py > wc/$i; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from moviepy.editor import concatenate, ImageClip | |
import os | |
import platform | |
import subprocess | |
import random | |
import torch | |
# pip install pytorch-pretrained-biggan | |
from pytorch_pretrained_biggan import (BigGAN, truncated_noise_sample, convert_to_images) | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |