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
// 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 |
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 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 |
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
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] |
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
package main | |
import ( | |
"time" | |
"fmt" | |
"math/rand" | |
) | |
func Decision(probability float64) bool { | |
// randFloat64() returns a float64, `0.0 <= f < 1.0` |
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
cut -f1,4 -d',' freq_1483051128.csv | sort | awk -F',' '{a[$1]+=$2}END{for (i in a){print i,a[i]}}' |
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 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() |
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
package main | |
import ( | |
"database/sql" | |
"gopkg.in/gorp.v1" | |
"log" | |
"strconv" | |
"github.com/gin-gonic/gin" | |
_ "github.com/go-sql-driver/mysql" |
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
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 |
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(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) | |
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 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 |