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
| <script type="text/javascript"> | |
| shuffle = function(o){ //v1.0 | |
| for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); | |
| return o; | |
| }; | |
| document.onkeyup = KeyCheck; | |
| var input = new Array(); |
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
| fname <- 'a1.txt' | |
| ds <- read.csv(fname,col.names = c('Date','Time','File','TimeElapsed','SongTime'),header=FALSE,stringsAsFactors=FALSE) | |
| ds$Date <- as.Date(ds$Date) | |
| ds$Name <- fname | |
| timelist <- strsplit(ds$Time,split=':') | |
| for (i in 1:length(timelist)) { | |
| hr <- timelist[[i]][[1]] | |
| mn <- timelist[[i]][[2]] |
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 twitter | |
| import json | |
| import pickle | |
| import time | |
| import random | |
| import sys | |
| import csv | |
| import twitter__login | |
| # log in, and collect statuses containing a keyword |
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
| # This is an exploration of topic modeling | |
| # First, let's load up this pile of things. | |
| Sys.setenv(NOAWT=TRUE) | |
| # This is a workaround for Macs | |
| library(tm) | |
| library(Snowball) |
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
| # Run the topics script first to load everything up. | |
| npi[npidtm$fd>0,c('NPI_Description','aotitle',"plocstatename","ploccityname")] | |
| outp <- textvec[grep('FD',textvec)] | |
| grep('FIRE',outp) | |
| outp[grep('FIRE',outp,invert=TRUE)] | |
| npidtm$labelhospital <- 0 | |
| hospinds <- grep("HOSPITAL",textvec) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 1.
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
| time seconds | |
| 1365781233.31362 0.815643072128296 | |
| 1365781253.95795 0.829960107803345 | |
| 1365781332.08635 0.819650888442993 | |
| 1365781371.6965 0.817964792251587 | |
| 1365781407.32883 1.21638607978821 |
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
| Introduction to R | |
| ======================================================== | |
| This file is online! | |
| http://rpubs.com/alexplanation/dst4l | |
| https://gist.github.com/alexstorer/5460479 |
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
| def handler(signum, frame): | |
| raise Exception('Last Resort!') | |
| signal.signal(signal.SIGALRM, handler) | |
| def tryOpenParse(thisurl): | |
| global parser | |
| #print "trying to parse " + thisurl | |
| print "trying to parse..." | |
| loaded = False |
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
| VARSTOCASES | |
| /MAKE stimulus1 from Task_1#1_stimulus Task_1#2_stimulus Task_1#3_stimulus Task_1#4_stimulus Task_1#5_stimulus Task_1#6_stimulus Task_1#7_stimulus Task_1#8_stimulus Task_1#9_stimulus Task_1#10_stimulus Task_1#11_stimulus Task_1#12_stimulus Task_1#13_stimulus Task_1#14_stimulus Task_1#15_stimulus Task_1#16_stimulus Task_1#17_stimulus Task_1#18_stimulus Task_1#19_stimulus Task_1#20_stimulus | |
| /MAKE latency1 from Task_1#1_latency Task_1#2_latency Task_1#3_latency Task_1#4_latency Task_1#5_latency Task_1#6_latency Task_1#7_latency Task_1#8_latency Task_1#9_latency Task_1#10_latency Task_1#11_latency Task_1#12_latency Task_1#13_latency Task_1#14_latency Task_1#15_latency Task_1#16_latency Task_1#17_latency Task_1#18_latency Task_1#19_latency Task_1#20_latency | |
| /MAKE CORRECT_latency1 from Task_1#1_CORRECT_latency Task_1#2_CORRECT_latency Task_1#3_CORRECT_latency Task_1#4_CORRECT_latency Task_1#5_CORRECT_latency Task_1#6_CORRECT_latency Task_1#7_CORRECT_latency Task_1#8_CORRECT_latency Task_1#9_CORRECT_late |
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/env python | |
| from subprocess import call | |
| import datetime | |
| import os | |
| import xlrd | |
| import csv | |
| def csv_from_excel(): |