http://www.christophermanning.org/writing/make-flickr-shapes-json-parsable/
@@ -303,13 +300,14 @@ | |
Get string length */ | |
ZEND_NAMED_FUNCTION(zend_if_strlen) | |
{ | |
- zval **str; | |
+ char *s1; | |
+ int s1_len; | |
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { | |
- ZEND_WRONG_PARAM_COUNT(); |
Python script to download/shallow clone the files of a directory at bitbucket. This is useful when you just want a copy of the files in a subdirectory of a repository without needing mercurial or having to download the entire repository.
{"links":[{"target":1,"source":0},{"target":2,"source":0},{"target":3,"source":0},{"target":4,"source":0},{"target":5,"source":0},{"target":6,"source":0},{"target":7,"source":0},{"target":8,"source":0},{"target":9,"source":0},{"target":10,"source":0},{"target":11,"source":0},{"target":12,"source":0},{"target":13,"source":0},{"target":14,"source":0},{"target":15,"source":0},{"target":16,"source":0},{"target":17,"value":22,"source":0},{"target":18,"value":24,"source":0},{"target":19,"value":28,"source":0},{"target":20,"value":19,"source":0},{"target":21,"value":19,"source":0},{"target":22,"value":26,"source":0},{"target":23,"value":28,"source":0},{"target":25,"source":24},{"target":26,"source":24},{"target":27,"source":24},{"target":28,"source":24},{"target":29,"source":24},{"target":30,"source":24},{"target":31,"source":24},{"target":32,"source":24},{"target":33,"source":24},{"target":34,"source":24},{"target":35,"value":1,"source":24},{"target":36,"value":12,"source":24},{"target":23,"value":1,"source":24},{" |
Rudimentary method of extracting JSON data from the ChicagoLobbyists sinatra app for a force directed graph
Created by Christopher Manning
Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.
Created by Christopher Manning
The wards in Chicago were recently remapped and I was mesmerized by the idea of creating an interaction that would animate the transition from the old to the new wards. I shortly found out that tweening polygons in a non-intersecting and interlocked fashion is a complicated topic. I've done a lot of reading about the math and research that has been done in this space and found a few interesting theories which I would like to implement in a future version. Currently, the morphing/tweening/interpolation is done with an array interpolator. Unfortunately, this technique causes the intermediate polygons to self-intersect and morph inefficiently. Ideally, I would overlay these polygons on a slippy map and there
By adding transitions, we can more easily follow the elements as they are entered, updated and exited. Separate transitions are defined for each of the three states.
Note that no transition is applied to the merged enter + update selection; this is because it would supersede the transition already scheduled on entering and updating elements. It's possible to schedule concurrent elements by using transition.transition or by setting transition.id
, but it's simpler here to only transition the x-position on update; for entering elements, the x-position is assigned statically.
Want to read more? Try these tutorials: