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 org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.functions.{col, regexp_replace, substring_index, udf} | |
def time[R](block: => R): R = { | |
val t0 = System.currentTimeMillis() | |
val result = block | |
val t1 = System.currentTimeMillis() | |
println("Elapsed time: " + (t1 - t0) + "ms") | |
result | |
} |
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 | |
# NVIDIA K80 drivers. | |
wget http://us.download.nvidia.com/tesla/396.44/nvidia-diag-driver-local-repo-ubuntu1604-396.44_1.0-1_amd64.deb | |
sudo dpkg -i nvidia-diag-driver-local-repo-ubuntu1604-396.44_1.0-1_amd64.deb | |
sudo apt-key add /var/nvidia-diag-driver-local-repo-396.44/7fa2af80.pub | |
sudo dpkg -i nvidia-diag-driver-local-repo-ubuntu1604-396.44_1.0-1_amd64.deb |
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 cvxpy import * | |
import numpy | |
# Problem data. | |
m = 30 | |
n = 20 | |
numpy.random.seed(1) | |
A = numpy.random.randn(m, n) | |
b = numpy.random.randn(m) |
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 nvcr.io/nvidia/cuda:9.2-devel | |
# Install Python 3.6. | |
RUN echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" >> /etc/apt/sources.list.d/python.list && \ | |
echo "deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" >> /etc/apt/sources.list.d/python.list && \ | |
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys BA6932366A755776 && \ | |
apt-get update && \ | |
apt-get install git curl python3.6 python3.6-dev -y | |
# Install pip for Python 3.6. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.