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 matplotlib import pylab # .exe install is on sourceforge | |
| import numpy# easy_install numpy | |
| from mpl_toolkits.basemap import Basemap # easy_install basemap | |
| # functions to create some random data points and convert them to meters via the map projection | |
| def create_points_in_lon_lat(N=10000): | |
| return zip(numpy.random.standard_normal(N)*360, numpy.random.standard_normal(N) * 45) | |
| def convert_lon_lat_points_to_meters_using_transform(points, tran): | |
| # maybe there is a better way to get long/lat into meters but this works ok |
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
| #!/bin/bash | |
| # | |
| # this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe | |
| # mounted at /mnt. It should be run early on the first boot of the system. | |
| # | |
| # Beware, This script is NOT fully idempotent. | |
| # | |
| METADATA_URL_BASE="http://169.254.169.254/2012-01-12" |
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
| /** | |
| * bisecting <master> <input> <nNodes> <subIterations> | |
| * | |
| * divisive hierarchical clustering using bisecting k-means | |
| * assumes input is a text file, each row is a data point | |
| * given as numbers separated by spaces | |
| * | |
| */ | |
| import org.apache.spark.SparkContext |
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
| # References | |
| # - https://www.tensorflow.org/versions/r0.10/tutorials/word2vec/index.html | |
| # - https://github.com/tensorflow/tensorflow/blob/r0.10/tensorflow/examples/tutorials/word2vec/word2vec_basic.py | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import collections | |
| import math |