The Delaunay triangulation, the dual of Voronoi tesselation, creates a planar, triangular mesh for a given set of points. This example updates the Delaunay triangulation in response to mouse interaction! Colors by Cynthia Brewer; algorithm by Steven Fortune; implementation based on work by Nicolas Garcia Belmonte; interaction inspired by Raymond Hill.
This file contains 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
$ rake assets:precompile --trace | |
** Invoke assets:precompile (first_time) | |
** Invoke assets:environment (first_time) | |
** Execute assets:environment | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute assets:precompile | |
rake aborted! | |
Sass::SyntaxError: Invalid CSS after "...(__p,arguments)": expected "{", was ";};with(obj||{}..." | |
(sass):1 |
This file contains 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
# Old code | |
i = 0 | |
@views.each do |view| | |
while (view[1].to_s != (@startDate+i).to_s) && (i < 30) do | |
#if no data for that day put 0 views in | |
@monthViewArray.push(0) | |
i+=1 | |
end | |
#otherwise put in the number of views | |
@monthViewArray.push(view[0]) |
Force layout with background Voronoi cells
This file contains 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
{ | |
size: 10000, | |
"query" : { | |
"match_all" : {} | |
}, | |
"filter" : { | |
"geo_distance" : { | |
"distance" : "10000m", | |
"distance_type": "plane", | |
"geo" : [37.411, -77.653] |
I hereby claim:
- I am meekohi on github.
- I am meekohi (https://keybase.io/meekohi) on keybase.
- I have a public key whose fingerprint is E652 7C33 B864 6056 5299 D1A2 D73E ED09 D0EB AD2A
To claim this, I am signing this object:
This file contains 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
c.on('add',function(e){ | |
$(this._container).attr("id",gram.id+"_circle"); | |
}); |
This file contains 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
/* | |
This example throws this (uncatchable) exception: | |
/node_modules/aws-sdk/lib/request.js:34 | |
throw e; | |
^ | |
NoSuchKey: The specified key does not exist. | |
*/ | |
var secrets = require('./secrets').development; |
This file contains 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
#include <stdio.h> | |
#include <iostream> | |
using namespace std; | |
#include "opencv2/core/core.hpp" | |
#include "opencv2/features2d/features2d.hpp" | |
#include "opencv2/nonfree/features2d.hpp" | |
#include "opencv2/highgui/highgui.hpp" | |
#include "opencv2/nonfree/nonfree.hpp" | |
using namespace cv; |
This file contains 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
// Get CImg.h from http://sourceforge.net/projects/cimg/ | |
#include "CImg.h" | |
using namespace cimg_library; | |
int main() { | |
const CImg<> img("image.jpg"); | |
// Estimate gradient (uses forward finite difference scheme). | |
const CImgList<> gradient = img.get_gradient("xy",1); |