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
let | |
old-arrow-cpp = import ( | |
builtins.fetchTarball { | |
name = "old-arrow-cpp"; | |
url = https://github.com/nixos/nixpkgs/archive/cdbf3f78bfd1f88259116f6f7cbcc6c5df0a9687.tar.gz; | |
# Hash obtained using `nix-prefetch-url --unpack <url>` | |
sha256 = "1j0lrjcqfp5pp54ls3wc054yyi4s6wpabs00d7sy9640fdrh8bd4"; | |
} | |
) {}; | |
arrow-cpp-overlay = self: super: { |
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
flink-nt = with pkgs; (flink.overrideAttrs (old: | |
rec { | |
name = "flink-1.9.0"; | |
src = fetchurl { | |
url = "http://mirror.serverion.com/apache/flink/flink-1.9.0/flink-1.9.0-bin-scala_2.12.tgz";#"http://mirror.serverion.com/apache/flink/${name}/${name}-bin-scala_2.12.tgz"; | |
sha256 = "0zc15v6nv3h262kyh31ahbdj2jxzv0i4izfnhsxbzrvrgalb5107"; | |
#hash = "sha512-..."; | |
}; | |
}) |
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
{ pkgs ? import <nixpkgs> {config = { allowUnfree = true; }; } }: | |
pkgs.stdenv.mkDerivation { | |
name = "cuda-env-shell"; | |
buildInputs = with pkgs; | |
[ git gitRepo gnupg autoconf curl | |
procps gnumake utillinux m4 gperf unzip | |
cudatoolkit linuxPackages.nvidia_x11 | |
libGLU_combined |
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.apache.flink.api.common.typeinfo.TypeInformation | |
import org.apache.flink.streaming.api.scala.{DataStream, KeyedStream} | |
import org.apache.flink.streaming.api.scala._ | |
import shapeless._ | |
import record._ | |
import shapeless.LabelledGeneric | |
import shapeless.labelled.FieldType | |
import shapeless.Witness | |
import shapeless.ops.record.Selector | |
import shapeless.syntax.RecordOps |
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
;; To do this we've provided scaffolding | |
;; that can be modified to achieve | |
;; your objective: | |
(with-primitive-procedures | |
[create-world simulate-world balls-in-box] | |
(defquery arrange-bumpers [] | |
(let [;; *** TASK: REPLACE THE FOLLOWING LINE WITH | |
;; STOCHASTIC CODE TO SAMPLE POSSIBLE | |
;; BUMPER CONFIGURATIONS *** | |
n-bumpers 4 ;; (sample (poisson 4)) ;; this is to let Anglican select the number of bumpers; maybe (poisson 2) is better |
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 cats.Id | |
// inspired by https://stackoverflow.com/questions/26834230/scala-implicit-for-arbitrarily-deep-functor-composition | |
object CaseStudy { | |
trait Functor[F[_]] { | |
def lift[A, B](f: A => B): F[A] => F[B] | |
def map[A, B](fa: F[A])(f: A => B): F[B] = lift(f)(fa) | |
} |