layout: true
.header[.grey[© 2018 Vladimir Lysyy | All rights reserved]] .footer[]
class: center, middle
name: title
import static java.lang.System.nanoTime; | |
/* | |
* Usage: | |
* final long then = TimeIt.start(); | |
* ... | |
* final long elapsed = TimeIt.elapsedSince(then); | |
* recorder.record(elapsed); | |
*/ | |
public class TimeIt { |
<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]))); | |
} | |
} |
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() |
#!/bin/bash | |
# | |
# A script to incrementally poll a log file. | |
# Subsequent invocations print lines added since the previous invocation. | |
# An assumption is that log lines begin with a timestamp 23 characters long (see/tweak the TS_LEN variable below). | |
# | |
# The state is stored in the file <original_filename>.seen as a last_line_no + last_timestamp pair last seen. | |
# If the state file is not there, or the line_no in the target file has the last_timestamp | |
# different from the one in the state file, then the file is printed from the line 1. |
<!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
<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, |
... | |
subprojects { | |
... | |
apply plugin: 'java' | |
apply plugin: 'scala' | |
sourceCompatibility = 1.8 | |
targetCompatibility = 1.8 |