Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
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 re | |
def strip_margin(text): | |
return re.sub('\n[ \t]*\|', '\n', text) | |
def strip_heredoc(text): | |
indent = len(min(re.findall('\n[ \t]*(?=\S)', text) or [''])) | |
pattern = r'\n[ \t]{%d}' % (indent - 1) | |
return re.sub(pattern, '\n', text) |
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 pyspark import SparkContext | |
import numpy as np | |
from sklearn.cross_validation import train_test_split, Bootstrap | |
from sklearn.datasets import make_classification | |
from sklearn.metrics import accuracy_score | |
from sklearn.tree import DecisionTreeClassifier | |
def run(sc): |
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
#!/bin/sh | |
# Setup encrypted disk image | |
# For Ubuntu 14.04 LTS | |
CRYPTFS_ROOT=/cryptfs | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install cryptsetup |
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
/** | |
* compute percentile from an unsorted Spark RDD | |
* @param data: input data set of Long integers | |
* @param tile: percentile to compute (eg. 85 percentile) | |
* @return value of input data at the specified percentile | |
*/ | |
def computePercentile(data: RDD[Long], tile: Double): Double = { | |
// NIST method; data to be sorted in ascending order | |
val r = data.sortBy(x => x) | |
val c = r.count() |
Starting from February 2019, Oracle JDK updates will require Commercial license if you make any business using Java (eg, you're a Java Developper not spending only your spare time developping with Java).
It includes Java not only on your server, but on your laptop as well.
What's nasty is Java versions will remains free to download since if you use it as an individual/personal use, you
won't be concerned by the commercial aspects of the license.