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 numpy import linalg | |
import numpy as np | |
import time | |
""" This will generate a random NxN invertible matrix [1] """ | |
def generate_mat(n): | |
mat = list() | |
for k in range(n): | |
rv = np.linspace(1,1,n) | |
rv = rv*np.random.random(n) |
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 breeze.linalg._ | |
def generateMat(n: Int): DenseMatrix[Double] = { | |
val mat = DenseMatrix.zeros[Double](n,n) | |
for (k <- 0 until n) { | |
var rv = DenseVector.ones[Double](n) | |
rv = rv*math.random | |
rv(k) = rv(k)*(k+1) | |
mat(k,::) := rv.t | |
} |
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 java.util.*; | |
class JavaSample { | |
public static void main(String [] args) { | |
Random rand = new Random(); | |
final int N = Integer.valueOf(args[0]); | |
List<Double> list = new ArrayList<Double>(N); | |
for (int i = 0; i < N; i++) { | |
list.add(rand.nextDouble()); | |
} |
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 scala.collection.JavaConversions._ | |
object ScalaSample { | |
def main(args: Array[String]) { | |
val rand = new java.util.Random() | |
final val N = Integer.valueOf(args(0)) | |
var list = new java.util.ArrayList[Double](N) | |
for (i <- 0 until N) { | |
list.add(rand.nextDouble) | |
} |
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 akka.actor._, concurrent.ExecutionContext.Implicits.global, concurrent.duration._ | |
case object CreateChild | |
case object GetChildren | |
case object GetParent | |
case class Message(str:String, forward:Boolean=false) | |
class ChildActor extends Actor { | |
def receive = { | |
case msg: String => println(s"${context.self.path.name}: $msg") |
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
# Install release | |
./configure | |
make | |
make check | |
sudo make install | |
sudo ldconfig /usr/local/lib | |
# confirm install | |
protoc --version |
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
case `uname` in | |
"Linux") | |
export DOCKER_HOST="localhost" | |
#scala -e "println(sys.env(\"DOCKER_HOST\"))" | |
;; | |
"Darwin") | |
if hash docker-machine 2>/dev/null; then | |
export DOCKER_HOST=`docker-machine ip default` | |
#scala -e "println(sys.env(\"DOCKER_HOST\"))" | |
else |
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
{ | |
"id": "python-app", | |
"cmd": "python3 -m http.server 8080", | |
"cpus": 0.5, | |
"mem": 32.0, | |
"container": { | |
"type": "DOCKER", | |
"docker": { | |
"image": "python:3", | |
"network": "BRIDGE", |
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
play-multimodule-demo nate$ sbt test:compile | |
[info] Loading project definition from /Users/nate/Workspace/github.com/natemurthy/play-multimodule-demo/project | |
[info] Updating {file:/Users/nate/Workspace/github.com/natemurthy/play-multimodule-demo/project/}play-multimodule-demo-build... | |
[info] Resolving org.fusesource.jansi#jansi;1.4 ... | |
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/2.4.6/jars/sbt-plugin.jar ... | |
[info] [SUCCESSFUL ] com.typesafe.play#sbt-plugin;2.4.6!sbt-plugin.jar (4806ms) | |
[info] downloading https://repo1.maven.org/maven2/com/typesafe/play/sbt-routes-compiler_2.10/2.4.6/sbt-routes-compiler_2.10-2.4.6.jar ... | |
[info] [SUCCESSFUL ] com.typesafe.play#sbt-routes-compiler_2.10;2.4.6!sbt-routes-compiler_2.10.jar (4253ms) | |
[info] downloading https://repo1.maven.org/maven2/com/typesafe/play/sbt-run-support_2.10/2.4.6/sbt-run-support_2.10-2.4.6.jar ... | |
[info] [SUCCESSFUL ] com.typesafe.play#sbt-run-support_2.10;2.4.6!sbt-run |
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
curl -X POST http://marathon-master:8080/v2/apps -d @python-app.json -H "Content-type: application/json" | python -m json.tool |