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
/** | |
* 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) |
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
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")) |
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
#!/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" |
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
// ... | |
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) | |
// ... |
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
~/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... |
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
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 |
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
~/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 |