layout: true
.header[.grey[© 2018 Vladimir Lysyy | All rights reserved]] .footer[]
class: center, middle
name: title
<project ...> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>...</version> | |
<configuration> | |
<compilerArgs> | |
<arg>-Xlint:all,-options,-path,-sunapi</arg> |
<project ...> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-dependency-plugin</artifactId> | |
<version>...</version> | |
<executions> | |
<execution> | |
<id>analyze</id> |
import static java.time.Instant.ofEpochMilli; | |
import static System.out; | |
class ts2dt { | |
public static void main(String... args) { | |
out.println(ofEpochMilli(Long.valueOf(args[0]))); | |
} | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); | |
body { font-family: 'Droid Serif'; } |
layout: true
.header[.grey[© 2018 Vladimir Lysyy | All rights reserved]] .footer[]
class: center, middle
name: title
def timeit (warmups: Int, trials: Int) (block: => Unit): Unit = { | |
import Math.{min,max} | |
for (i <- 1 to warmups) block | |
var total = 0.0 | |
var best = Long.MaxValue | |
var worst = Long.MinValue | |
for (i <- 1 to trials) { | |
val beg = System.nanoTime() |
import static java.lang.System.nanoTime; | |
/* | |
* Usage: | |
* final long then = TimeIt.start(); | |
* ... | |
* final long elapsed = TimeIt.elapsedSince(then); | |
* recorder.record(elapsed); | |
*/ | |
public class TimeIt { |
<configuration scan="false" debug="true"> | |
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%d{HH:mm:ss.SSS} > %-5p > %t > %c > %m%n%rEx{full, | |
java.lang.reflect.Method, | |
org.springframework.aop, | |
org.springframework.transaction, | |
org.springframework.security, | |
org.springframework.web, | |
org.springframework.cglib, |
object StampedLockSyntax { | |
def syncRead[T](lock: StampedLock)(block: => T): T = { | |
val stamp = lock.readLock() | |
try { | |
block | |
} finally { | |
lock.unlockRead(stamp) | |
} | |
} |
[program:activemq] | |
directory=/path/to/activemq/base | |
command=/path/to/activemq/base/bin/activemq console | |
user=activemq | |
redirect_stderr=true | |
autostart=true | |
autorestart=false | |
stopasgroup=true | |
killasgroup=true | |
stdout_logfile=/path/to/activemq.log |