detecting Java version from Bash


Yesterday I wrote about cross JVM testing using Travis CI.

testing Scala apps on macOS using Travis CI

Here's how we can test Scala apps on macOS using Travis CI. This is adapted from Lars and Muuki's method: Testing Scala programs with Travis CI on OS X

dist: trusty
language: scala
    ## build using JDK 8, test using JDK 8
    - script:

cross JVM testing using Travis CI


Oracle is moving to ship non-LTS JDK every 6 months, and LTS JDK every 3 years. Also it's converging to OpenJDK. In this scheme, JDK 9 will be EOL in March 2018; JDK 10 will come out in March 2018, and EOL in September 2018; and LTS JDK 11 that replaces JDK 8 in September 2018 will stay with us until 2021.

As we will see quick succession of JDKs in the upcoming months, here's a how-to on testing your app on JDK 8, JDK 9, and JDK 10 Early Access using Travis CI.

dist: trusty
language: scala

removing commas with sbt-nocomma


This post introduces sbt-nocomma that introduces nocomma { ... } macro that removes commas from build.sbt:

import Dependencies._
lazy val root = (project in file("."))
  .settings(nocomma {
    ThisBuild / organization := "com.example"
    ThisBuild / scalaVersion := "2.12.4"
    ThisBuild / version      := "0.1.0-SNAPSHOT"
    name := "Hello"
    // comment works
    libraryDependencies += scalaTest % Test



As tweeted, I made some sbt stickers.

I made these for myself, but I've been sharing them with the contributors to the sbt ecosystem.

If you've ever reported a bug, answered Stackoverflow question, helped someone else's build problem, created an sbt plugin, given a talk about sbt, or sent in a pull request, please come say hello at ScalaMatsuri or Scala Days.

herding cats: day 17


Wrote herding cats: day 17 featuring initial and terminal objects, product, duality, and coproduct.

Coursera machine learning memo

Model representation

x(i) denotes input variables (feature vector), and y(i) denotes the output (target variable). A pair (x(i), y(i)) is called a training example. A list of 1 .. m training example is called a training set.

Supervised learning can be modeled as a process of coming up with a good function h called hypothesis that predicts y from an unknown x.

For instance, given square footage, predict price of a house in some city. In the above, hθ(x) is modeled as a linear function. The hypothesis hθ(x) = θ0 + θ1 x is called linear regression with one variable (or univariate linear regression).

sbt server with Neovim


This is part 3 of sbt server integration series. I've covered VS Code and Sublime Text 3 thus far.


encoding file path as URI reference


In this post I am going to discuss an old new problem of encoding file path as Uniform Resource Identifier (URI) reference.

As of 2017, the authoritative source of information is RFC 8089 - The "file" URI Scheme written by Matthew Kerwin.

Future readers might also want to search for "file URI scheme RFC", and find the latest version. If you're a programmer, read the RFC. This post is to raise the awareness of the some of the issues around file to URI encoding, but it's not a substitution.

Recently I've been running into interop problems as some platforms are unable to parse file:/foo/bar. But this is not the first time I'm having trouble with file path represented as URI. Considering that the notion of filesystem goes back to 1960s, and URL has been around since 1990s, it's surprising that we haven't come to a concensus on this. But then again, like decimal numbers, once you start digging deeper, or start exchanging data, we find some glitches in the Matrix.

sbt server with Sublime Text 3


On Tech Hub blog I demonstrated how to use sbt server from VS Code to display compiler errors from a running sbt session. In this post, I'll show how to do that for Sublime Text 3.




Over the weekend I assembled an Ergodox.

  • Infinity ErgoDox Ergonomic Keyboard Kit via massdrop
  • Cherry MX Brown switches
  • Datamancer Infinity Ergodox Hardwood Case (Black Walnut / Original) via massdrop
  • Plum Blossom PBT Dye-Subbed Keycap Set (OEM, Blank) via massdrop

Syndicate content