An example of how to animate a d3-cloud word cloud.
Based on https://github.com/jasondavies/d3-cloud/blob/master/examples/simple.html.
from gensim import corpora, models, similarities | |
import logging | |
# Working through @RadimRehurek's Gensim tutorials: http://radimrehurek.com/gensim/index.html | |
#logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) | |
# Tutorial 1: Acquire and normalise texts, build and serialise dictionary and corpus | |
# http://radimrehurek.com/gensim/tut1.html |
An example of how to animate a d3-cloud word cloud.
Based on https://github.com/jasondavies/d3-cloud/blob/master/examples/simple.html.
A reminder of how to shrink the root partition of a fresh Arch Linux installation on a Raspberry Pi.
I wanted to make more room on a 4GB SD card for a Linux From Scratch build, so I resized the root partition down to 700mb and created a new 3GB logical partition next to it.
I didn't have another Linux machine available, so I used OSX Mavericks to write the original Arch image to the SD card and do the initial filesystem resize. Everything else was done on the Pi itself.
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed. | |
* | |
* If you are unfamiliar with LESS, you can read more about it here: | |
* http://www.lesscss.org | |
*/ |
// Select text of a content editable | |
// http://stackoverflow.com/a/6150060/2806996 | |
// Example usage: $('[contenteditable]:first').selectText() | |
$.fn.selectText = function() { | |
var range = document.createRange(); | |
range.selectNodeContents(this[0]); | |
var sel = window.getSelection(); | |
sel.removeAllRanges(); | |
sel.addRange(range); |
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
function randomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
** | |
* The first commented line is your dabblet’s title | |
*/ | |
.wrapper { | |
position: relative; | |
} | |
.line { | |
position: absolute; | |
height: 1px; |
// Credit Christopher Chiche & Clemens Tolboom | |
// - http://stackoverflow.com/a/14426477/2806996 | |
d3.selection.prototype.moveToFront = function() { | |
return this.each(function(){ | |
this.parentNode.appendChild(this); | |
}); | |
}; | |
d3.selection.prototype.moveToBack = function() { | |
return this.each(function() { |
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
function randomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
dir=$(cd $(dirname $0) && pwd) |