View main.scala
// make sure the receiver emails are verified:
// https://console.aws.amazon.com/ses/home?region=us-east-1#verified-senders-email:
import javax.activation.DataHandler
import javax.activation.DataSource
import javax.activation.FileDataSource
import javax.mail.Session
import javax.mail.Message
import javax.mail.MessagingException
import javax.mail.internet.AddressException
View gist:5adedf63b7ac9108453572a6351e72f6
import javax.activation.DataHandler
import javax.activation.DataSource
import javax.activation.FileDataSource
import javax.mail.Message
import javax.mail.MessagingException
import javax.mail.internet.AddressException
import javax.mail.internet.InternetAddress
import javax.mail.internet.MimeBodyPart
import javax.mail.internet.MimeMessage
import javax.mail.internet.MimeMultipart
View main.go
package main
import (
"fmt"
"sort"
)
func tokensByAscending(t []int) func(i, j int) bool {
return func(i, j int) bool {
return t[i] < t[j]
View main.go
package main
import (
"time"
"fmt"
"math/rand"
)
func Decision(probability float64) bool {
// randFloat64() returns a float64, `0.0 <= f < 1.0`
View gist:0134ac365f8b414bf2ef9e0efca150e5
cut -f1,4 -d',' freq_1483051128.csv | sort | awk -F',' '{a[$1]+=$2}END{for (i in a){print i,a[i]}}'
View main.py
import threading
import Queue
import time
QUEUE_TIMEOUT_s = 0.1
WORKER_COUNT = 200 # play with this! If switching to multiprocessing, use ncores+1 (or 2)
NUM_TASKS = 1000
SLOW_ADD_TIME_s = 0.1
done_event = threading.Event()
View main.go
package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"strconv"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
View wavelet_test.csv
33.5827844 -0.837060000000001 3.367104
33.5827844 -0.822270000000003 3.344952
33.5827844 -0.807480000000002 3.344952
33.5917065 -0.837060000000001 3.363412
33.5917065 -0.851850000000002 3.37818
33.5917065 -0.837060000000001 3.381872
33.5917065 -0.866640000000004 3.400332
33.5917065 -0.911010000000001 3.422484
33.6006286 -0.881430000000002 3.418792
33.6006286 -0.911010000000001 3.45202
View wavelet_test.R
library(wavelets)
load_data <- function(filename, row) {
data = read.csv(filename, header=FALSE, sep=",")
return(data[[row]])
}
wavelet_transform <- function(data) {
Wavelet_out = matrix(0, 1, 8)
View wavelet_test.py
import pywt
import csv
import pandas as pd
import numpy as np
def read_csv(filename):
columns = defaultdict(list) # each value in each column is appended to a list
with open(filename) as f:
reader = csv.DictReader(f) # read rows into a dictionary format