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
var proxy = require('proxy.js')(); | |
proxy.run(); |
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
var express = require('express'), | |
app = express(), | |
https = require('https'), | |
request = require('request'), | |
bodyParser = require('body-parser'), | |
PROXY_PORT = 12345, | |
HTTPS_POST = 443, | |
API_ENDPOINT = '/api', | |
CONTENT_TYPE = 'application/json', | |
HTTPS_HOST = 'sub.domain.com', |
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
// Server creates a stream of text in EXEC_INTERVAL time period | |
var net = require('net'), | |
EXEC_INTERVAL = 1000, | |
server = net.createServer(function(socket) { | |
setInterval(function() { | |
// Make sure data ends with a new line | |
socket.write('Echo ...' + '\n'); | |
}, EXEC_INTERVAL); | |
}).listen(8000); |
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
import socket | |
import random | |
HOST = '127.0.0.1' | |
PORT = 50007 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind((HOST, PORT)) | |
s.listen(1) | |
conn, addr = s.accept() |
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
var ws = new WebSocket("ws://localhost:8888"); | |
ws.onopen = function() { | |
ws.send("Hello, world"); | |
}; | |
//When Client Received a Message | |
ws.onmessage = function(evt) { | |
console.log(evt.data); | |
}; |
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
# pip install websocket-client | |
from pyspark import SparkContext | |
from pyspark.streaming import StreamingContext | |
from websocket import create_connection | |
def take_rdd_send_to_socket(time, rdd, num=1000): | |
result = [] | |
taken = rdd.take(num + 1) | |
print("-------------------------------------------") | |
print("Time: %s" % time) |
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
--- | |
title: "Capstone First Milestone Report: Feature Engineering" | |
author: "Amir Hossein Rahnama" | |
date: "11 June 2016" | |
output: html_document | |
--- | |
####Introduction | |
In this report, we are analyzing I have tried to start by showing a summary of all three data source from SwiftKey in terms of size. You can obtain the data with following code: | |
```{r eval=FALSE} |
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
library(text2vec) | |
library(SnowballC) | |
library(doParallel) | |
library(microbenchmark) | |
library(tm) | |
con <- file("/Users/ara/dev/personal/r/final/en_US/en_US.blogs.txt", "r") | |
blogs <- readLines(con, encoding = 'UTF-8') | |
close(con) |
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
es-master: | |
image: 'elasticsearch:latest' | |
command: 'elasticsearch --network.host=0.0.0.0 --node.master=true --cluster.name=escluster' | |
restart: always | |
es-develop: | |
image: 'elasticsearch:latest' | |
command: 'elasticsearch --network.host=0.0.0.0 --cluster.name=escluster --discovery.zen.ping.unicast.hosts=es-master' | |
deployment_strategy: high_availability | |
links: | |
- es-master |
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
FROM python:3 | |
MAINTAINER Amir Rahnama "amirrahnama@gmail.com" | |
COPY . /app | |
WORKDIR /app | |
RUN pip install -r requirement.txt | |
RUN pip install --editable . | |
ENV FLASK_APP mini/app.py |
OlderNewer