wget http://downloads.typesafe.com/scala/2.11.6/scala-2.11.6.tgz
tar -xzvf scala-2.11.6.tgz
rm -rf scala-2.11.6.tgz
vim ~/.bashrc
export SCALA_HOME=/home/ec2-user/scala-2.11.6
from lxml import html | |
import requests | |
import unicodecsv as csv | |
import argparse | |
import json | |
def clean(text): | |
if text: | |
return ' '.join(' '.join(text).split()) |
""" | |
A bare bones examples of optimizing a black-box function (f) using | |
Natural Evolution Strategies (NES), where the parameter distribution is a | |
gaussian of fixed standard deviation. | |
""" | |
import numpy as np | |
np.random.seed(0) | |
# the function we want to optimize |
# Gist example of IB wrapper ... | |
# | |
# Download API from http://interactivebrokers.github.io/# | |
# | |
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install | |
# | |
# Note: The test cases, and the documentation refer to a python package called IBApi, | |
# but the actual package is called ibapi. Go figure. | |
# | |
# Get the latest version of the gateway: |
# AWS Version 4 signing example | |
# | |
# Example: | |
# Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7 | |
# Formulae: | |
# CanonicalRequest = | |
# HTTPRequestMethod + '\n' + | |
# CanonicalURI + '\n' + | |
# CanonicalQueryString + '\n' + |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Computes the distance correlation between two matrices. | |
https://en.wikipedia.org/wiki/Distance_correlation | |
""" | |
import numpy as np | |
from scipy.spatial.distance import pdist, squareform |
wget http://downloads.typesafe.com/scala/2.11.6/scala-2.11.6.tgz
tar -xzvf scala-2.11.6.tgz
rm -rf scala-2.11.6.tgz
vim ~/.bashrc
export SCALA_HOME=/home/ec2-user/scala-2.11.6
# Remove java 7
sudo yum remove -y java
# Install basic packages
sudo yum install -y git
# Download and install java 8
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
tar -xzvf jdk-8u131-linux-x64.tar.gz
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
"""Create a notebook containing code from a script. | |
Run as: python make_nb.py my_script.py | |
""" | |
import sys | |
import nbformat | |
from nbformat.v4 import new_notebook, new_code_cell | |
nb = new_notebook() |