Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| pip install networkx distance pattern | |
| In Flipboard's article[1], they kindly divulge their interpretation | |
| of the summarization technique called LexRank[2]. |
| d3.json( | |
| "data/statistics.geojson", | |
| function (json) { | |
| //dimensions | |
| var w = 980; | |
| var h = 480; | |
| //get the center of the data | |
| var center = d3.geo.centroid(json); | |
| var svg = d3.select("body").append("svg") | |
| .attr("width", w) |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| #!/usr/bin/env osascript -l JavaScript | |
| // usage: google-earth-perspective-to-geojson.js xSamples ySamples > currentPerspective.geojson | |
| function run(argv) { | |
| var xSamples = argv[0] || 50; | |
| var ySamples = argv[1] || 50; | |
| var ge = Application('Google Earth Pro'); |
| height: 1000 |
Built with blockbuilder.org
Nesting and summarizing data is a very common task for data analysis. I thought it would be nice to view parallel ways of nesting and summarizing with both
tidyr and dplyrd3.js ...v4 for funTo avoid context switching, I'll take advantage of the R package V8. If you are an R user, then these d3.js gists might be helpful d3 nest examples and Mister Nester.
| # Author: Jean-Remi King <[email protected]> | |
| """ | |
| Illustrate how a hinge loss and a log loss functions | |
| typically used in SVM and Logistic Regression | |
| respectively focus on a variable number of samples. | |
| For simplification purposes, we won't consider the | |
| regularization or penalty (C) factors. | |
| """ | |
| import numpy as np | |
| import matplotlib.animation as animation |
| /* | |
| * Wrap a block of text to a given width | |
| * via http://bl.ocks.org/mbostock/7555321 | |
| */ | |
| var wrapText = function(texts, width, lineHeight) { | |
| texts.each(function() { | |
| var text = d3.select(this); | |
| var words = text.text().split(/\s+/).reverse(); | |
| var word = null; |