d3 scatterplot example using the Breakfast Cereal Dataset from http://idvbook.com and based on the scatterplot example at http://bl.ocks.org/mbostock/3887118
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
package com.notmetron.stellar; | |
import org.apache.metron.common.dsl.Context; | |
import org.apache.metron.common.dsl.ParseException; | |
import org.apache.metron.common.dsl.Stellar; | |
import org.apache.metron.common.dsl.StellarFunction; | |
import java.util.List; | |
public class TimeFunction { |
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
import sklearn | |
import numpy as np | |
import math | |
import pickle | |
import collections | |
class DGA: | |
def __init__(self): | |
self.model = { 'clf': pickle.loads(open('./dga_model_random_forest.model','rb').read()) | |
, 'alexa_vc': pickle.loads(open('./dga_model_alexa_vectorizor.model','rb').read()) | |
, 'alexa_counts': pickle.loads(open('./dga_model_alexa_counts.model','rb').read()) |
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 flask import Flask | |
from flask import request,jsonify | |
import socket | |
app = Flask(__name__) | |
@app.route("/apply", methods=['GET']) | |
def predict(): | |
h = request.args.get('host') | |
r = {} | |
if h == 'yahoo.com' or h == 'amazon.com': |
Here's a d3 plugin that allows you to create a polygon selection. You instantiate it just like d3.svg.brush.
var brush = d3.svg.polybrush();
It has an extra public method that 'brush' does not, and that's 'isWithinExtent(x, y)'. You can use this method to test if a given point falls within the drawn extent.
if (brush.isWithinExtent(x, y)) {
console.log("I'm inside!");
}
- Click into the drawing area to start the selection frame
- move the mouse to resize the selection frame
- Release the mouse button to resize the selection frame
(The circles are just for illustrating purposes)
I hereby claim:
- I am cestella on github.
- I am cstella (https://keybase.io/cstella) on keybase.
- I have a public key whose fingerprint is 50E6 D91A 3DBC 81BC B07C A91A 4B40 C1AF D0D2 850C
To claim this, I am signing this object:
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
#!/bin/bash | |
BRANCH_NAME=$1 | |
shift | |
for project in $@;do | |
pushd $project >& /dev/null | |
MAX=""; | |
MIN=""; | |
CURR_FILE=""; |
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
#!/bin/sh | |
WORK_DURATION=$(echo "60 $1 * p" | dc) | |
PLAY_DURATION=$(echo "60 $2 * p" | dc) | |
echo "WORK DURATION: $WORK_DURATION seconds" | |
echo "PLAY DURATION: $PLAY_DURATION seconds" | |
while : | |
do | |
echo "WORKING FOR $1 minutes" | |
sleep $WORK_DURATION && \ | |
echo "^G" && \ |