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
PATH=/Users/CBare/bin:$PATH | |
export CLICOLOR=1 | |
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx | |
alias ls='ls -alph' | |
alias path='echo -e ${PATH//:/\\n}' | |
alias libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}' | |
alias du='du -kh' | |
alias df='df -kh' |
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 ubuntu:16.04 | |
RUN apt-get update && apt-get install -y less && apt-get install -y octave | |
VOLUME ["/source"] | |
WORKDIR /source | |
CMD octave |
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 os | |
from boto.s3.connection import S3Connection | |
from boto.s3.connection import OrdinaryCallingFormat | |
## retrieve AWS credentials from environment variables | |
aws_key = os.getenv('AWS_KEY_ID') | |
aws_secret = os.getenv('AWS_SECRET_KEY') | |
## Ordinary calling format necessary because of dots in | |
## bucket name. See: https://github.com/boto/boto/issues/2836 |
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
## Sample from an estimated probability density | |
sample.density <- function(dd, size, jitter=FALSE) { | |
x <- sample(dd$x, size=size, prob=dd$y, replace=TRUE) | |
if (dd$n < 2) jitter=FALSE | |
if (jitter) { | |
w <- mean(dd$x[2:length(dd$x)] - dd$x[1:(length(dd$x)-1)]) / 2.0 | |
x <- x + runif(size,-w,w) | |
} | |
return(x) | |
} |
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
--- | |
title: "Directionality of mPower features" | |
author: "J. Christopher Bare" | |
date: "June 6, 2016" | |
--- | |
```{r imports, echo=FALSE, message=FALSE, warning=FALSE} | |
library(synapseClient) | |
library(ggplot2) | |
library(scales) |
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
""" | |
======================================================= | |
How to access Synapse from Amazon Lambda with Python | |
======================================================= | |
Here we show an example of adding a row to a Synapse table | |
through an AWS Lambda script. | |
Caveat: Any operation that requires chunked file upload | |
fails on AWS Lambda. The execution environment for |
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
""" | |
Combine feature extraction output .csv files | |
""" | |
import csv | |
import os | |
dir = "/home/ubuntu/mhealthx_output/feature_tables/voice_openSMILE-2.2rc1_gemaps" | |
data=[] | |
for filename in os.listdir(dir): | |
print filename |
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
## Messages for challenge scoring script. | |
import string | |
import sys | |
import warnings | |
## Module level state. You'll need to set a synapse object at least | |
## before using this module. | |
syn = None |
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
############################################################ | |
## | |
## Create EC2 Machines | |
## | |
## Start up EC2 instances for each member of a Synapse | |
## team, emailing them the details of their assigned | |
## machine. | |
## | |
## [email protected], November 2015 | |
## |
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 json | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import synapseclient | |
from collections import OrderedDict | |
syn = synapseclient.Synapse() | |
syn.login() |