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.
| object Main extends App { | |
| AvoidLosingGenericType.run() | |
| AvoidMatchingOnGenericTypeParams.run() | |
| TypeableExample.run() | |
| TypeTagExample.run() | |
| } | |
| class Funky[A, B](val foo: A, val bar: B) { | |
| override def toString: String = s"Funky($foo, $bar)" | |
| } |
| task compileGwt (dependsOn: classes, type: JavaExec) { | |
| buildDir = "${project.buildDir}/gwt" | |
| extraDir = "${project.buildDir}/extra" | |
| inputs.source sourceSets.main.java.srcDirs | |
| inputs.dir sourceSets.main.output.resourcesDir | |
| outputs.dir buildDir | |
| // Workaround for incremental build (GRADLE-1483) | |
| outputs.upToDateSpec = new org.gradle.api.specs.AndSpec() |
| package fpmax | |
| import scala.util.Try | |
| import scala.io.StdIn.readLine | |
| object App0 { | |
| def main: Unit = { | |
| println("What is your name?") | |
| val name = readLine() |
| -- View pg_stat_activity with temporary files informations (file list and total file size) | |
| -- version 0.3 | |
| SELECT | |
| pg_stat_activity.pid AS pid, | |
| CASE WHEN LENGTH(pg_stat_activity.datname) > 16 | |
| THEN SUBSTRING(pg_stat_activity.datname FROM 0 FOR 6)||'...'||SUBSTRING(pg_stat_activity.datname FROM '........$') | |
| ELSE pg_stat_activity.datname | |
| END | |
| AS database, |
Copyright © 2017 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#Some discussions on logging from docker: Using logstash Using Papertrail
A lot of this boils down to whether you want a single or multi-process (systemd, supervisord etc.) container...