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
demo: lib420.so | |
LD_PRELOAD=./lib420.so ls -l | |
.PHONY: demo | |
lib420.so: lib420.c | |
gcc -shared -o lib420.so lib420.c | |
clean: | |
rm lib420.so |
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.mllib.clustering import KMeans, KMeansModel | |
from pyspark.mllib.linalg.Vectors | |
from numpy import isnan | |
from IPython.lib.pretty import pprint | |
# hypotesis: mtb offroad normal, mtb road normal, mtb flat intervals, mtb hill intervals, road normal | |
def do_clustering(sc, sqlCtx): | |
ss = sqlCtx.sparkSession | |
activities = ss.read.json("gs://chemikadze/strava-analysis/activities_full.json") | |
train_data = activities.rdd \ |
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
scala> case class Scalar(s: String) | |
scala> case class Sequence(s: Seq[String]) | |
scala> object ScalarMatcher { def unapply(x: Scalar) = Some(x.s) } | |
scala> object SequenceMatcher { def unapply(x: Sequence) = Some(x.s) } | |
scala> Scalar("x").s match { case ScalarMatcher(x) => x ; case _ => "because fuck you" } | |
<console>:11: error: scrutinee is incompatible with pattern type; | |
found : Scalar | |
required: String | |
Scalar("x").s match { case ScalarMatcher(x) => x ; case _ => "because fuck you" } |
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
- get-properties: | |
action: getEnvironmentProperties | |
output: | |
props: result | |
- compute-properties: | |
action: serialize | |
precedingPhases: [get-properties] | |
parameters: | |
format: JSON |
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
# launch and add to env | |
application: | |
interfaces: | |
values: | |
subnet: bind(const#network.subnet) | |
prefixLength: bind(const#network.prefixLength) | |
configuration: | |
values: bind(const#configuration.values) | |
configuration: | |
configuration.values: |
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
application: | |
configuration: | |
input.image: "us-east-1/ami-aede32c6" | |
input.image-user: "Administrator" | |
input.instance-size: "m1.medium" | |
input.password: "123QweAsd" | |
input.recipe-url: "https://dl.dropboxusercontent.com/u/250836/jenkins.tar.gz" | |
input.jenkin-server-url: "http://23.20.248.221:8080/" | |
input.quantity: "1" | |
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
launch: | |
steps: | |
provision-do: | |
action: provisionVms | |
parameters: | |
jcloudsNodeNamePrefix: test | |
roleName: cloud | |
imageId: us-east-1/ami-f666929e | |
hardwareId: m1.medium | |
vmIdentity: Administrator |
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
function setup_mcollective() { | |
CFGNAME=$1 | |
HOST=$2 | |
PORT=$3 | |
USER=$4 | |
PASSWORD=$5 | |
cp /etc/mcollective/$CFGNAME.cfg /etc/mcollective/$CFGNAME.cfg.orig | |
sed -re 's/connector = .*/connector = rabbitmq/' < /etc/mcollective/$CFGNAME.cfg.orig > /etc/mcollective/$CFGNAME.cfg | |
cat >> /etc/mcollective/$CFGNAME.cfg <<EOF | |
direct_addressing = 1 # ??? |
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
Compiled from "anon-class.scala" | |
public final class Parent$$anon$1 implements IChild { | |
private java.lang.Object notReferenced; # notReferenced field is not prefixed | |
private java.lang.Object Parent$$anon$$referenced; # referenced field is prefixed | |
private java.lang.Object notReferenced(); # notReferenced field is private | |
private void notReferenced_$eq(java.lang.Object); | |
public java.lang.Object Parent$$anon$$referenced(); # referenced field is public | |
private void Parent$$anon$$referenced_$eq(java.lang.Object); | |
private scala.Function0<java.lang.Object> lambda(); | |
public Parent$$anon$1(Parent); |
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 org.scalameter.api._ | |
import scala.util.Random | |
import scala.collection.mutable | |
import scala.collection.mutable.Builder | |
object MirrorBenchmark extends PerformanceTest.Quickbenchmark { | |
val sizes = Gen.range("size")(100, 500, 100) | |
val maps = for (sz <- sizes) yield { | |
val r = (0 until sz) | |
val random = new Random() |
NewerOlder