Hello world!
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
var binnify = function(arr) { | |
var output = []; | |
var bin_string = (arr) => (arr.length == 1) ? `${arr[0]}` : `${arr[0]}-${arr[arr.length - 1]}`; | |
var bin_start = 0; | |
for (var i = 1; i < arr.length; i++) { | |
if (arr[i] != arr[i - 1] + 1) { | |
output.push(bin_string(arr.slice(bin_start, i))); | |
bin_start = i; | |
} | |
} |
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
$.each(mejs.players, function(i, p) { | |
p.media.onended = function() { | |
mejs.players[(i == mejs.players.length - 1 ? 0 : i + 1)].play() | |
} | |
}); |
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 os, csv, urllib2, re, mechanize | |
from BeautifulSoup import BeautifulSoup | |
# initialize variables | |
rows = []; | |
INPUT_FILE = 'combined.csv' | |
OUTPUT_FILE = 'new.csv' | |
# get all clinical trial ids, store rows for later | |
if os.path.isfile(INPUT_FILE): |