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 hidden or 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
html,body,#wrapper { | |
width: 100%; | |
height: 100%; | |
margin: 0px; | |
} | |
.chart { | |
font-family: Arial, sans-serif; | |
font-size: 12px; | |
} |
This file contains hidden or 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
""" Poisson-loss Factorization Machines with Numba | |
Follows the vanilla FM model from: | |
Steffen Rendle (2012): Factorization Machines with libFM. | |
In: ACM Trans. Intell. Syst. Technol., 3(3), May. | |
http://doi.acm.org/10.1145/2168752.2168771 | |
See also: https://github.com/coreylynch/pyFM | |
""" |
This file contains hidden or 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
(function() { | |
var url = ["cdn.jsdelivr.net/velocity/1.1.0/velocity.min.js","cdn.jsdelivr.net/velocity/1.1.0/velocity.ui.min.js"]; | |
for(var i=0; i < url.length; i++){ | |
var v = document.createElement('script'); v.type = 'text/javascript'; v.async = true; | |
v.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + url[i]; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(v, s); | |
} | |
})(); |
This file contains hidden or 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
val conf = new SparkConf().setAppName("Simple Application") | |
val sc = new SparkContext(conf) | |
val hadoopConf=sc.hadoopConfiguration; | |
hadoopConf.set("fs.s3.impl","org.apache.hadoop.fs.s3native.NativeS3FileSystem") | |
hadoopConf.set("fs.s3.awsAccessKeyId", myAccessKey) | |
hadoopConf.set("fs.s3.awsSecretAccessKey", mySecretKey) | |
//Also | |
hadoopConf.set("fs.s3.awsAccessKeyId", System.getProperty("awsAccessKeyId")) | |
hadoopConf.set("fs.s3.awsSecretAccessKey", System.getProperty("awsSecretAccessKey")) |
This file contains hidden or 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
from locust import HttpLocust, TaskSet, task | |
import json | |
import os | |
json_data=open(os.path.dirname(os.path.abspath(__file__)) + "/small_payload.json").read() | |
data = json.loads(json_data) | |
class MyTaskSet(TaskSet): | |
@task | |
def my_task(self): |
This file contains hidden or 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var width = 960, | |
height = 500; | |
var colors = [ |
This file contains hidden or 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
public void trackGoal(String goalName, String trackingId, Map<String,String> analyticsArguments) { | |
final Options options = new Options().setAnonymousId(trackingId); | |
final Props p = new Properties("properties"); | |
for(KeyVal e : analyticsArguments.getKeyVal()) { | |
p.put(e.key(), e.val()) | |
} | |
analyticsClient.track("anonymous", goalName, props, options); | |
} |
This file contains hidden or 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
public void Publish(IEnumerable<Reservation> reservations, out int nextWaterMark) | |
{ | |
nextWaterMark = 0; | |
using (IRabbitMqClient client = _clientFactory()) | |
{ | |
var channel = client.GetChannel(); | |
foreach (var reservation in reservations) | |
{ |
This file contains hidden or 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
Analytics.track( | |
userID, | |
“search_availability”, | |
new Props().put(“metro_id”, 4), | |
new Options().setAnonymousId(trackingId)); |