Skip to content

Instantly share code, notes, and snippets.

View wadejensen's full-sized avatar

Wade Jensen wadejensen

  • Brisbane / Sydney, Australia
View GitHub Profile
~/repos/snowplow-mini  v0.6.1±
$ vagrant up
/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/util/which.rb:37: warning: Insecure world writable dir /nix/store/fa6x8wrsaj1lkb32hqv8wcpp4hiaxqbz-bazel-0.24.0 in PATH, mode 040777
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/xenial64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/xenial64' version '20190605.0.0' is up to date...
==> default: Setting the name of the VM: snowplow-mini-1560726310
==> default: Vagrant has detected a configuration issue which exposes a
==> default: vulnerability with the installed version of VirtualBox. The
Wades-MBP:snowplow-mini wjensen$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' version '20190604.0.0' is up to date...
==> default: Setting the name of the VM: snowplow-mini-1560287512
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
@wadejensen
wadejensen / snowplow-mini-vagrant.log
Created June 11, 2019 02:28
Local snowplow-mini with Vagrant attempt
~/repos/snowplow-mini  master
$ git clone https://github.com/snowplow/snowplow-mini.git
~/repos/snowplow-mini  master
cd snowplow-mini
~/repos/snowplow-mini  master
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
@wadejensen
wadejensen / perfTest.scala
Created November 8, 2017 01:13
Trying to work out why line 5 is super expensive
// ...
var alpha = atan2(sLambda * cEpsilon, cLambda)
// This calculation is 100X more expensive than trig functions on NDArray of same size
val temp = alpha.cond( Conditions.lessThan(0.0) ) * (2 * math.Pi)
val alpha2 = alpha + temp
val delta = asin(sLambda * sEpsilon)
// ...
@wadejensen
wadejensen / parse-options.sh
Created November 1, 2017 04:18 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@wadejensen
wadejensen / gist:ae5732567ea7f93cdee58f769a2b97da
Created October 25, 2017 13:20 — forked from rgorsuch/gist:b404c658551a6a8aeb35
scala: print all URLs on classpath
def urlses(cl: ClassLoader): Array[java.net.URL] = cl match {
case null => Array()
case u: java.net.URLClassLoader => u.getURLs() ++ urlses(cl.getParent)
case _ => urlses(cl.getParent)
}
val urls = urlses(getClass.getClassLoader)
println(urls.filterNot(_.toString.contains("ivy")).mkString("\n"))
@wadejensen
wadejensen / NeighbourBinarySearch.scala
Last active September 25, 2017 03:04
Scala binary search for exact match or neighbour on floating point numbers
/**
* A functional binary tree search for floating point numbers which finds
* a neighbour to the search target in the given list.
* Returns upper or lower index if target is outside min and max of list.
* @param start Lower index of the array to search
* @param end Upper index of the array to search
* @param target Value being searched for in list
* @param list Sorted list of values to search
* @return Index of a neighbour to the target within list
* (not guaranteed to be nearest neighbour)