A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
#!/usr/bin/env python | |
import networkx as nx | |
# for each node: | |
# + degree centrality | |
# + closeness centrality | |
# + betweenness centrality | |
# + eigenvector centrality | |
# + page rank |
license: gpl-3.0 | |
height: 960 | |
border: no | |
redirect: https://observablehq.com/@d3/hierarchical-edge-bundling |
/* | |
* jquery.dynamicForm.js | |
* Arietis Software | |
* www.arietis-software.com | |
* 2009 | |
* version: 1.1 | |
* ---------------------------- | |
* Distributed under the GNU General Public License | |
* http://www.arietis-software.com/license/gnu/license.txt | |
* |
import org.apache.solr.common.* | |
import org.apache.solr.client.solrj.* | |
import org.apache.solr.client.solrj.impl.* | |
import org.apache.solr.client.solrj.response.* | |
basename = "apache-solr-3.5.0" | |
baseurl = "http://ftp.jaist.ac.jp/pub/apache/lucene/solr/3.5.0" | |
serverurl = "http://localhost:8983/solr" | |
buildscript { |
public static double DiceCoefficient(string stOne, string stTwo) | |
{ | |
HashSet<string> nx = BuildBigramSet(stOne); | |
HashSet<string> ny = BuildBigramSet(stTwo); | |
HashSet<string> intersection = new HashSet<string>(nx); | |
intersection.IntersectWith(ny); | |
double dbOne = intersection.Count; | |
return (2 * dbOne) / (nx.Count + ny.Count); |
#create a test index with shingle mapping | |
curl -XPUT localhost:9200/test -d '{ | |
"settings":{ | |
"index":{ | |
"analysis":{ | |
"analyzer":{ | |
"analyzer_shingle":{ | |
"tokenizer":"standard", | |
"filter":["standard", "lowercase", "filter_stop", "filter_shingle"] | |
} |
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding | |
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding |
// pre-render d3 charts at server side | |
var d3 = require('d3') | |
, jsdom = require('jsdom') | |
, fs = require('fs') | |
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>' | |
jsdom.env({ | |
features : { QuerySelector : true } | |
, html : htmlStub | |
, done : function(errors, window) { |
This example pulls together various examples of work with trees in D3.js.
The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.
One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.
Dragging can be performed on any node other than root (flare). Dropping can be done on any node.
Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.