Here are the supplementary materials for my (Jonathan Whitmore's) 2017 Keynote for the USC Career Conference Beyond the PhD.

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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Matlab code to produce PCA animations shown here: | |
% http://stats.stackexchange.com/questions/2691 | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Static image | |
clear all | |
rng(42) |
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
# encoding: utf-8 | |
import bokeh.models as bkm | |
import bokeh.core as bkc | |
from bokeh.util.compiler import JavaScript | |
class AudioPlayerModel(bkm.layouts.Column): | |
""" | |
Audio player using https://howlerjs.com/. |
These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line
see http://stefaanlippens.net/pretty-csv.html for more information.
- Jonathan Whitmore, PhD
- Data Scientist, SVDS
- @jbwhitmore
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
# Based on example here https://trac.ffmpeg.org/wiki/Encode/YouTube | |
text=$(basename $1 .wav) | |
ffmpeg -i $1 -filter_complex \ | |
"[0:a]avectorscope=s=640x518,pad=1280:720[vs]; \ | |
[0:a]showspectrum=mode=separate:color=intensity:scale=cbrt:s=640x518[ss]; \ | |
[0:a]showwaves=s=1280x202:mode=line[sw]; \ | |
[vs][ss]overlay=w[bg]; \ | |
[bg][sw]overlay=0:H-h,drawtext=fontfile=/usr/share/fonts/truetype/fonts-japanese-gothic.ttf:fontcolor=white:x=10:y=10:text=$text[out]" \ | |
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy $text.mkv |
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 os | |
import re | |
from nbconvert.nbconvertapp import NbConvertApp | |
from nbconvert.postprocessors.base import PostProcessorBase | |
class CopyToSubfolderPostProcessor(PostProcessorBase): | |
def __init__(self, subfolder=None): | |
self.subfolder = subfolder |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os | |
from subprocess import check_call | |
def post_save(model, os_path, contents_manager): | |
"""post-save hook for converting notebooks to .py and .html files.""" | |
if model['type'] != 'notebook': | |
return # only do this for notebooks | |
d, fname = os.path.split(os_path) | |
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d) | |
check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d) |
NewerOlder