This file contains 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
for (var i = 0; i<=100; i++) { | |
if (i % 3 == 0 && i % 5 == 0) { | |
console.log("cracklepop"); | |
} | |
else if (i % 5 == 0) { | |
console.log("pop"); | |
} | |
else if (i % 3 == 0) { | |
console.log("crackle"); | |
} |
This file contains 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 the csv module which we'll need to read and write our csv's | |
import csv | |
#import the shutil module which we use to create a copy of our original csv | |
import shutil | |
#import the Nominatim module from geopy, a bit more on this in the text below | |
from geopy.geocoders import Nominatim | |
geolocator = Nominatim() |
This file contains 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 functions from my module shapeshift | |
from shapeshift import sawToothLeft, sawToothRight, diamondChain, hourGlass, checkerBoard | |
#create the different shapes using my module | |
diamondChain(3, 6) | |
sawToothLeft(3,8) | |
sawToothRight(3,8) | |
hourGlass(10, 6) |
This file contains 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
#Module for shapeshift functions | |
import sys | |
import random | |
words_by_len = dict() #create an empty dictionary to store words by their length | |
#Create a dictionary where the key is the # of characters in the word and the value is a list of words | |
for line in sys.stdin: #load each line from standard in |
This file contains 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
#IT SEES by Rebecca Lieberman | |
#Final Project for Reading and Writing Electronic Text @ ITP, taught by Allison Parrish | |
#Spring 2015 | |
#Code sources -- | |
#Bing Search API Python Wrapper https://github.com/xthepoet/pyBingSearchAPI | |
#Script that fetches image descriptions from Toronto Deep Learning https://github.com/cmyr/INTERESTING_JPG | |
#STEPS TO RUN THIS CODE: | |
#1. create a virtual environment in your project directory |
This file contains 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
#DRONE SWEETIE: a Twitter bot that tweets descriptions of images of drones | |
#Code sources -- | |
#Bing Search API Python Wrapper https://github.com/xthepoet/pyBingSearchAPI | |
#Script that fetches image descriptions from Toronto Deep Learning https://github.com/cmyr/INTERESTING_JPG | |
#STEPS TO RUN THIS CODE: | |
#1. create a virtual environment in your project directory | |
#2. install textblob, requests and beautiful soup to your virtual env | |
#3. run dronesweetie.py with a sys.argv input from the command line | |
#4. make sure the following two modules are in your project directory (+download them with the following links): |
This file contains 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
#RWET Assignment 3: Wordnik API Poems | |
#Rebecca Lieberman | |
#ITP Spring 2015 | |
import sys | |
import urllib | |
import json | |
word = sys.argv[1] |
This file contains 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
#SHAPESHIFT: A Poetic Form by Rebecca Lieberman | |
#Reading and Writing Electronic Text Midterm Project | |
#Made at ITP, Spring 2015 | |
import sys | |
import random | |
words_by_len = dict() #create an empty dictionary to store words by their length |
This file contains 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 random | |
airstrike_list = list() #make an empty list for the words in airstrike | |
all_words = list () #make an empty list called all_words | |
meat = open('meat.txt').read() #load meat into a string | |
for item in meat.split(): #load the words in meat into the list | |
all_words.append(item) | |
for line in open('airstrike.txt'): #for each line in airstrike.txt |
This file contains 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 random | |
all_words = list () #make an empty list called all_words | |
meat = open('meat.txt').read() #load meat and air strike into strings | |
airstrike = open('airstrike.txt').read() | |
for item in meat.split(): #load meat into the list | |
all_words.append(item) | |
NewerOlder