Make sure ffmpeg is up-to-date:
brew update
brew upgrade ffmpeg
Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.
| #!/usr/bin/python | |
| import mechanize | |
| import lxml.html | |
| BASE_URL = "http://www2.durhamcountync.gov/sheriff/ips/default.aspx" | |
| def parse_names(root): | |
| # finds the names and prints | |
| names = root.xpath("//a[@class='rvsnavy-bold']") |
| license: MIT | |
| border: no | |
| height: 800 |
| license: gpl-3.0 |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <title></title> | |
| <script type='text/javascript' src="http://d3js.org/d3.v2.js"></script> | |
| <script type='text/javascript' src="slopegraph.js"></script> | |
| <style type='text/css'> | |
| line.slope-line{ | |
| stroke:green |
| license: gpl-3.0 |
Make sure ffmpeg is up-to-date:
brew update
brew upgrade ffmpeg
Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.
| var multiCrowbar = (function() { | |
| /* | |
| * SVG Export | |
| * converts html labels to svg text nodes | |
| * will produce incorrect results when used with multi-line html texts | |
| * | |
| * Author: Gregor Aisch | |
| * based on https://github.com/NYTimes/svg-crowbar/blob/gh-pages/svg-crowbar-2.js | |
| */ |
| import xlrd | |
| import csv | |
| import sys | |
| def csv_from_excel(fn): | |
| wb = xlrd.open_workbook(fn) | |
| sh = wb.sheet_by_index(0) | |
| your_csv_file = open(fn.replace('xls', 'csv'), 'wb') | |
| wr = csv.writer(your_csv_file, quoting=csv.QUOTE_ALL) | |
| for rownum in xrange(sh.nrows): |
| live_state born_state 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000 2012 | |
| Florida Alabama 0.0477 0.0484 0.0541 0.0508 0.0555 0.0554 0.0458 0.0344 0.0259 0.0197 0.0145 0.0102 | |
| Florida Alaska 0.0000 0.0000 0.0000 0.0000 0.0001 0.0000 0.0002 0.0004 0.0005 0.0005 0.0005 0.0008 | |
| Florida Arizona 0.0000 0.0000 0.0000 0.0001 0.0004 0.0003 0.0004 0.0007 0.0008 0.0011 0.0014 0.0015 | |
| Florida Arkansas 0.0007 0.0009 0.0021 0.0035 0.0024 0.0040 0.0040 0.0043 0.0032 0.0030 0.0025 0.0022 | |
| Florida California 0.0003 0.0003 0.0009 0.0006 0.0017 0.0032 0.0056 0.0074 0.0086 0.0104 0.0131 0.0141 | |
| Florida Colorado 0.0001 0.0001 0.0006 0.0004 0.0008 0.0008 0.0013 0.0017 0.0018 0.0024 0.0024 0.0026 | |
| Florida Connecticut 0.0018 0.0025 0.0018 0.0032 0.0043 0.0058 0.0076 0.0089 0.0106 0.0111 0.0112 0.0097 | |
| Florida Delaware 0.0002 0.0004 0.0010 0.0004 0.0005 0.0007 0.0009 0.0012 0.0013 0.0013 0.0013 0.0014 | |
| Florida District of Columbia 0.0004 0.0005 0.0005 0.0012 0.0011 0.0019 0.0036 0.0028 0.0035 0.0037 0.0035 0.0028 |