Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
package fpmax | |
import scala.util.Try | |
import scala.io.StdIn.readLine | |
object App0 { | |
def main: Unit = { | |
println("What is your name?") | |
val name = readLine() |
Welcome to the Ammonite Repl 0.8.0 | |
(Scala 2.11.8 Java 1.8.0_91) | |
@ import scala.util.Try | |
import scala.util.Try | |
@ val listOfTries: List[Try[String]] = List(Try("a"), Try("b"), Try("c")) | |
listOfTries: List[Try[String]] = List(Success("a"), Success("b"), Success("c")) | |
// I have a List[Try[String]] but I actually want a Try[List[String]]. |
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
This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.
def example = 2 // evaluated when called
val example = 2 // evaluated immediately
In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.
The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.