I hereby claim:
- I am randerzander on github.
- I am randerzander (https://keybase.io/randerzander) on keybase.
- I have a public key ASCodRRwJM9qPoQ6VvIz9cMx_U62fP7QCTDFkdE7PBnuuwo
To claim this, I am signing this object:
| %angular | |
| <div id="map" style="height:500px;width:100%;"></div> | |
| <script type="text/javascript"> | |
| function initMap() { | |
| var USA = {lat: 39.8282, lng: -98.5795}; | |
| var map = new google.maps.Map(document.getElementById('map'), {zoom: 17, center: USA }); | |
| var POIs = {}; | |
| $.each(window.angularVars.data, function(i, v){ | |
| POIs[v.values[0]] = v.values; |
| import json | |
| from org.apache.commons.io import IOUtils | |
| from java.nio.charset import StandardCharsets | |
| from org.apache.nifi.processor.io import StreamCallback | |
| class PyStreamCallback(StreamCallback): | |
| def __init__(self): pass | |
| def process(self, instream, outstream): | |
| # To read content as a byte array: | |
| # data = IOUtils.toByteArray(instream) |
| from org.apache.commons.io import IOUtils | |
| from java.nio.charset import StandardCharsets | |
| from org.apache.nifi.processor.io import StreamCallback | |
| import os, sys, imp, traceback, time | |
| parser_path = '/scripts/parsers/' | |
| class PyStreamCallback(StreamCallback): | |
| def __init__(self, result): | |
| self.result = result |
| import spark.implicits._ | |
| import org.apache.spark.sql.types._ | |
| import org.apache.spark.sql.Row | |
| val schemaString = sc.textFile("/data.csv").take(1)(0) | |
| val rdd = sc.textFile("/data.csv").filter(line => line != schemaString) | |
| val fields = (schemaString.split(",").slice(0, 9) ++ Array("stat", "value")) | |
| .map(fieldName => { | |
| if (fieldName contains "value") | |
| StructField(fieldName, DoubleType, nullable = true) |
| FROM centos | |
| # minifi-cpp build | |
| RUN yum install -y git | |
| RUN yum install -y wget | |
| RUN yum install -y epel-release | |
| RUN yum groupinstall -y 'Development Tools' | |
| RUN yum install -y cmake | |
| RUN yum install -y boost-devel boost-static libxml2-static libxml2-devel libuuid-devel leveldb-devel |
| sudo su | |
| yum update -y | |
| yum install -y wget git | |
| curl -fsSL https://get.docker.com/ | sh | |
| service docker start | |
| curl -L https://github.com/docker/compose/releases/download/1.15.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose | |
| chmod +x /usr/local/bin/docker-compose | |
| mv /usr/local/bin/docker-compose /usr/bin | |
| usermod -aG docker centos |
I hereby claim:
To claim this, I am signing this object:
| from org.apache.commons.io import IOUtils | |
| from java.nio.charset import StandardCharsets | |
| from org.apache.nifi.processor.io import StreamCallback | |
| import os, sys, imp, traceback, time | |
| from urlparse import urlparse | |
| parser_path = '/home/dev/projects/scripts/parsers/' | |
| class PyStreamCallback(StreamCallback): |
| # Generate all substrings of string recursively | |
| def substrings(string): | |
| #base case | |
| if len(string) == 0: return '' | |
| else: | |
| ret = [string] | |
| #Slide from left | |
| for x in range(0, len(string)): | |
| sub = string[x:-1] | |
| ret.append(sub) |
| import sys, os, cgi, _thread | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| class MyServer(SimpleHTTPRequestHandler): | |
| #Custom POST handler that saves POSTed file content to local disk | |
| def do_POST(self): | |
| post_env = { | |
| 'REQUEST_METHOD': 'POST', | |
| 'CONTENT_TYPE': self.headers['Content-Type'], | |
| } |