Instantly share code, notes, and snippets.

View error.txt
[info] Loading settings for project global-plugins from watch.sbt ...
[info] Loading global plugins from /Users/daniel/.sbt/1.0/plugins
[info] Updating ProjectRef(uri("file:/Users/daniel/.sbt/1.0/plugins/"), "global-plugins")...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-library;2.12.7: configuration not found in org.scala-lang#scala-library;2.12.7: 'master(compile)'. Missing configuration: 'compile'. It was required from org.scala-lang.modules#scala-xml_2.12;1.0.6 compile
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
View SlicePlate.scala
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View mra-worksheet.rb
# MRA - Multidimensional Relational Algebra
1 + 2 # => 3
-1 # => -1
s = [1, 2, 3]
t = [4, 5, 6]
-s # => [-1, -2, -3]
s + 3 # => [4, 5, 6]
View setByMod.java
/**
* Ensures that all disjoint index mod rings contain at least one
* set bit. If a disjoint index mod ring *already* contains a set
* bit, then its contents are guaranteed to be left unmodified.
* More rigorously, the first invariant is captured by:
*
* ∀ i . ∃ j >= 0 && j < mod . bits(i + j) == 1
*/
public void setByMod(int mod) {
if (mod >= 64) {
View flipByMod.java
/**
* Flips all bits for which index % mod == 0 such that
* the bits (i % mod >= 0 && i % mod < mod) are 0. The
* invariant here is that, for all ranges of i such
* that (i % mod >= 0 && i % mod < mod), there is *at least*
* one value of i such that get(i) == true.
*/
public void flipByMod(int mod) {
if (mod <= 0) {
return;
View flipByMod.java
/**
* Flips all bits for which index % mod == 0 such that
* the bits (i % mod >= 0 && i % mod < mod) are 0. The
* invariant here is that, for all ranges of i such
* that (i % mod >= 0 && i % mod < mod), there is *at least*
* one value of i such that get(i) == true.
*/
public void flipByMod(int mod) {
long flipper = 1L;
long mask = (1L << mod) - 1; // bitmask which covers everything >= 0 and < mod
View sparsenByMod.java
/**
* Inflates the bitset by a factor of `mod` such that
* bs.contains(i) == bs.sparsenByMod(o, m).contains(((i + o) % m))
* for all values of i, o, m.
*/
public BitSet sparsenByMod(final int offset, final int mod) {
long[] _bits = new long[_length * mod];
int preI = 0;
int postI = 0;
View better-leftShift.md

Better leftShift

This all happens after resplitting. We almost certainly need better implementations of Slice#take/drop/takeRange

  1. Partition columns by focus/unfocus
  2. (Lazily?) inflate unfocused columns and build eager definedness bitsets
  3. Build eager definedness bitsets for all focused paths
  4. Remove shifted component of focused column paths
  5. Group focused column paths by type
  6. ModUnion ((CType, Array[(Int, Column)]) => Column) same-type columns ([1, 2, "foo", 3, "bar", true, 4, false]). The Int here represents the offset into the mod ring, since we can't just use the array index due to the example I gave.
View PreparationsManager.scala
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View PreparationsManager.scala
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software