This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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'; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]))); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project ...> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-dependency-plugin</artifactId> | |
<version>...</version> | |
<executions> | |
<execution> | |
<id>analyze</id> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.lang.System.nanoTime; | |
/* | |
* Usage: | |
* final long then = TimeIt.start(); | |
* ... | |
* final long elapsed = TimeIt.elapsedSince(then); | |
* recorder.record(elapsed); | |
*/ | |
public class TimeIt { |
NewerOlder