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 json, urllib, os, re | |
from collections import Counter,defaultdict | |
import matplotlib.pyplot as plt | |
import numpy | |
from pandas import * | |
import json | |
import networkx as nx | |
import text_utils as tu | |
filename = raw_input("Enter a file name, json: ") |
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
{ | |
"metadata": { | |
"name": "process_tweets" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"metadata": { | |
"name": "Word-Bigram Freq and Co-Occurrence" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
function getPosts(){ | |
query = "moonrise kingdom"; | |
var tumblr = require('tumblr.js'); | |
var client = tumblr.createClient({ consumer_key: '5AePbGS74iGUh2v1vIaLfxOeDAyS2X8sRPpnOPczwtFzGXEvz7' }); | |
initialize data structure | |
client.tagged(query, function (err, data) { | |
//put 1000 image urls into a list | |
}); | |
setInterval(function(){changeImage()},3000); //once posts are gotten, start changing background | |
} |
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
//Piece of Flashcards.java | |
//Final Project, CS 230 Fall '12 | |
//Megan O'Keefe | |
//Last Modified: December 20th, 2012 | |
/*Takes what has been entered in the userEntry JTextField and does a .equalsIgnoreCase() | |
with what is stored in the back of the current card. If it returns true, modifies the | |
correctLabel to "Correct!", otherwise modifies the correctLabel to "Incorrect." | |
Retabulates accuracy and modifies the percentAccuracy label accordingly. |
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
/*nytbookfolio.js | |
by Megan O'Keefe | |
project: BOOKFOLIO | |
began 3/27/13, completed 4/8/13 | |
Summary: nytscript handles the scripting for the main page of Bookfolio. This file | |
accomplishes three main tasks on loading the index.html page: | |
1) Grabs a local json file from the NYT Bestseller API and extracts title, author | |
and ISBN data from the results[] array (20 items) and places them in separate | |
title, author and isbn arrays. |
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
class SearchHandler(webapp2.RequestHandler): | |
def post(self): #not the same post as jquery $.post | |
searchterm = self.request.get("searchterm") | |
modifiedToken = cleanToken(searchterm) | |
user = users.get_current_user() | |
s="" | |
results="" | |
if user: |
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
#Burstiness.py | |
#by Megan O'Keefe | |
import json, os, bisect | |
from sets import Set | |
from datetime import datetime, timedelta | |
from collections import Counter,defaultdict | |
from numpy import * | |
from pandas import * | |
from pandas.tseries.offsets import Hour, Minute |
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
#storymaker.py | |
#by megan o'keefe | |
#created: July 31st, 2015 | |
#last modified: 7/31/2015 | |
#has WordsApi definitions, also working on: wikipedia articles. | |
import json | |
import unirest | |
import wikipedia |
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
//KMeans_Clustering.java | |
//Megan O'Keefe | |
//Completed: 10/25/15 | |
//CS313, Wellesley College (Assignment #5) | |
//USES EXISTING CLUSTERING CLASSES, NOT INCLUDED | |
/* | |
Overview of KMeans algorithm: | |
- randomly assign each Gene to a cluster (Math.random... for range = # desired clusters) | |
- Then until you have no shuffling changes in the iteration... |
OlderNewer