/* "org.jetbrains.xodus" % "xodus-openAPI" % "1.2.3", | |
"org.jetbrains.xodus" % "xodus-entity-store" % "1.2.3", | |
*/ | |
object XodusApp extends App { | |
import jetbrains.exodus.bindings.StringBinding.{entryToString, stringToEntry} | |
import jetbrains.exodus.env.StoreConfig.WITHOUT_DUPLICATES | |
val env = Environments.newInstance("data") |
/* library dependecies | |
"org.xerial" % "sqlite-jdbc" % "3.23.1", | |
"org.tpolecat" %% "doobie-core" % "0.5.3", | |
"org.tpolecat" %% "doobie-hikari" % "0.5.3", // HikariCP transactor. | |
"org.tpolecat" %% "doobie-specs2" % "0.5.3", // Specs2 support for typechecking statements. | |
"org.tpolecat" %% "doobie-scalatest" % "0.5.3", // ScalaTest support for typechecking statements. | |
*/ | |
object TryDoobie extends App { | |
import doobie._ |
With the recent announcement of cats-effect, a relevant question from the past resurfaces: why does IO
, which is otherwise quite Task
-like, not define both
or race
? To be clear, the type signatures of these functions would be as follows:
object IO {
def both[A, B](ioa: IO[A], iob: IO[B])(implicit EC: ExecutionContext): IO[(A, B)] = ???
def race[A, B](ioa: IO[A], iob: IO[B])(implicit EC: ExecutionContext): IO[Either[A, B]] = ???
}
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
#!/bin/bash | |
set -e | |
git reflog -n100 --pretty='%cr|%gs' --grep-reflog='checkout: moving' HEAD | { | |
seen=":" | |
git_dir="$(git rev-parse --git-dir)" | |
while read line; do | |
date="${line%%|*}" | |
branch="${line##* }" | |
if ! [[ $seen == *:"${branch}":* ]]; then |
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on