View gist:f473167ac91b2af4949c6340d4aa0c1b
// Finally tagless lambda calculus
object Final {
def varZ[A,B](env1: A, env2: B): A = env1
def varS[A,B,T](vp: B => T)(env1: A, env2: B): T = vp(env2)
def b[E](bv: Boolean)(env: E): Boolean = bv
def lam[A,E,T](e: (A, E) => T)(env: E): A => T = x => e(x, env)
def app[A,E,T](e1: E => A => T, e2: E => A)(env: E): T = e1(env)(e2(env))
def testf1[E,A](env: E): Boolean =
app(lam[Boolean,E,Boolean](varZ) _, b(true))(env)
View build.sbt
scalaVersion := "2.11.8"
scalaOrganization := "org.typelevel"
libraryDependencies ++= Seq(
"org.typelevel" %% "cats" % "0.9.0",
"org.atnos" %% "eff" % "4.0.0"
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3")
View gist:9fe9037d9a94595b35e96529fcdd4e9a
Python 3.6.0 |Anaconda 4.3.0 (x86_64)| (default, Dec 23 2016, 13:19:00)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
>>> import numpy
>>> data_dir = "/Users/debasishghosh/temp/ingest-intrusion-data/ingest-intrusiondata-tmp"
>>> train_data = data_dir + "/new_train_data.csv"
>>> train_labels = data_dir + "/train_labels.csv"
>>> test_data = data_dir + "/new_test_data.csv"
>>> test_labels = data_dir + "/test_labels.csv"
View gist:3adf3bde24336b5d4cef7f5eefe8367f
Debasishs-MacBook-Pro:skil-distro-1.1-SNAPSHOT debasishghosh$ /usr/bin/java -cp /Users/debasishghosh/skymind/lagom-skil-api/skildistro/target/skil-distro-1.1-SNAPSHOT/lib/*:/Users/debasishghosh/skymind/lagom-skil-api/skildistro/target/skil-distro-1.1-SNAPSHOT/native/*:/Users/debasishghosh/skymind/lagom-skil-api/skildistro/target/skil-distro-1.1-SNAPSHOT/lib/ext/* -Dplay.crypto.secret=as8dufasdfuasdfjkasdkfalksjfk io.skymind.skil.daemon.ProcessLauncherDaemon -port 9000
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/debasishghosh/skymind/lagom-skil-api/skildistro/target/skil-distro-1.1-SNAPSHOT/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/debasishghosh/skymind/lagom-skil-api/skildistro/target/skil-distro-1.1-SNAPSHOT/lib/slf4j-log4j12-1.7.19.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
20:39:18,894 |-INFO in ch.qos.log
#WARNING: Use at your own risk. No warranties expressed or implied. YMMV. Drive responsibly. Eat healthy.
#First, `cd` into the parent dir for all of your `sbt`/`maven` projects (I assume you have one of those)
find "$(cd ..; pwd)" -type d -name "target" -exec sudo tmutil addexclusion -p {} +
View xor_output.txt
====== org.deeplearning4j.examples.feedforward.xor.XorExample
o.n.n.NativeOps - Number of threads used for NativeOps: 4
Unable to guess runtime. Please set OMP_NUM_THREADS or equivalent manually.
o.n.n.Nd4jBlas - Number of threads used for BLAS: 4
Number of parameters in layer 0: 12
Number of parameters in layer 1: 10
Total number of network parameters: 22
o.d.o.l.ScoreIterationListener - Score at iteration 0 is 0.2070610076189041
o.d.o.l.ScoreIterationListener - Score at iteration 100 is 0.01497031468898058
View dl4j-errors.txt
2016-09-28 16:00:13,126 WARN org.reflections.Reflections - could not create Vfs.Dir from url. ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/System/Library/Java/Extensions/libQTJNative.jnilib]
either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
at org.reflections.vfs.Vfs.fromURL( ~[reflections-0.9.10.jar:na]
at org.reflections.vfs.Vfs.fromURL( ~[reflections-0.9.10.jar:na]
at org.reflections.Reflections.scan( [reflections-0.9.10.jar:na]
at org.reflections.Reflections.scan( [reflections-0.9.10.jar:na]
at org.reflections.Reflections.<init>( [reflections-0.9.10.jar:na]
at org.reflections.Reflections.<init>( [reflections-0.9.10.jar:na]
at org.deeplearni
View repo_freek.scala
import freek._
sealed trait Account
trait Repository {
sealed trait Repo[A]
case class Query(no: String) extends Repo[Xor[String, Account]]
case class Store(account: Account) extends Repo[Xor[String, Account]]
View repo.scala
import scalaz.Free
sealed trait Account
sealed trait RepoF[A]
// he algebraic data types
case class Query(no: String) extends RepoF[Account]
case class Store(account: Account) extends RepoF[Unit]
case class Delete(no: String) extends RepoF[Unit]
View freek_freak.scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_79).
Type in expressions for evaluation. Or try :help.
scala> import cats.std.option._
import cats.std.option._
scala> import cats.std.list._
import cats.std.list._
scala> import freek._