Skip to content

Instantly share code, notes, and snippets.

@ktibb
ktibb / rwetFinal_D.py
Created May 2, 2012 01:54
Phoneme Phenom: breaking top-40 songs into phonemes
import random
songs = ["1.txt", "2.txt", "3.txt", "4.txt", "5.txt", "6.txt", "7.txt", "8.txt", "9.txt", "10.txt", "11.txt", "12.txt", "13.txt", "14.txt", "15.txt", "16.txt", "17.txt", "18.txt", "19.txt", "20.txt", "21.txt"]
dictfile = "cmuDict.txt"
cmu = open(dictfile, "r")
dictlines = cmu.readlines()
cmu.close()
@ktibb
ktibb / UtterClass.pde
Created April 16, 2012 04:59
Dictionary Aloud
class Utter {
String global_txt;
float life=255;
float x;
float y;
float r;
float g;
float b;
//the contructor
@ktibb
ktibb / fizzbuzz.pde
Created April 14, 2012 18:36
FizzBuzz
int i=1;
int z=0;
void setup() {
}
void draw() {
for (i=1; i<=100; i++) {
if (i%3==z && i%5==z) {
println ("fizzbuzz");
@ktibb
ktibb / 1984_D1.py
Created April 11, 2012 02:47
Markov code applied to the text of 1984
import urllib
import BeautifulSoup
import re
from random import choice
#import context_free
import sys
import markov
html = urllib.urlopen('http://www.george-orwell.org/1984/0.html').read()
@ktibb
ktibb / Web_to_Markov.py
Created April 9, 2012 14:57
Not Working: feeding webtext into Markov code
import urllib
import BeautifulSoup
import re
from random import choice
#import context_free
import sys
import markov
html = urllib.urlopen('http://www.george-orwell.org/1984/0.html').read()
@ktibb
ktibb / Prophetic Quatrain
Created March 7, 2012 23:35
RWET Midterm
import urllib
import BeautifulSoup
import re
import nltk
from random import choice
#import context_free
part = dict()
words = list()
final = list()
import urllib
import BeautifulSoup
import re
html = urllib.urlopen('http://www.oprah.com/relationships/What-Kind-of-Woman-Watches-Porn-Researchers-Find-Answers').read()
soup = BeautifulSoup.BeautifulSoup(html)
#texts = soup.findAll(text=True)
texts = soup.find("div", {"class": "arial14"})