scala

How to use the Lightbend Config library in a Scala or Java application

Table of Contents

  1. Solution
  2. Discussion
Table of Contents1 - Solution2 - Discussion

Scala problem: You want to be able to read configuration files that are written in the Lightbend “Config” file format.

Back to top

Solution

Lightbend — initially named Typesafe — created a configuration file format named HOCON, which stands for, “Human-Optimized Config Object Notation.” As an example, a small HOCON configuration file looks like this:

Notes on using Dotty (Scala 3), SBT, and VS Code together

As a note to self, here are some ways to work with Dotty (Scala 3), SBT, and VS Code (Visual Studio Code).

Create a Dotty project:

sbt new lampepfl/dotty.g8

Launch VS Code inside that project directory, with Dotty support:

sbt launchIDE

Start SBT as usual:

sbt

Those notes are just a reminder for myself, but hopefully they’ll also help others work with Dotty, SBT, and VS Code.

The “Hello, Scala” paperback is just $10

November 29, 2019: A few days ago I made the PDF version of “Hello, Scala” free, and today I made the paperback version of “Hello, Scala” available again, and reduced it’s price from $20 to just $10. Click the image below to buy the book on Amazon.

As I’ve noted before, the contents of this book are being updated and improved, and in the future it will be available as Scala Book. The HTML version of those contents are currently available on the docs.scala-lang.org site.

“Hello, Scala” PDF is now free

November 26, 2019: The PDF version of my book “Hello, Scala” is now free, and you can download it by clicking on the image below.

Future “updated and improved” versions of the book are being released as Scala Book. Currently an HTML version of the book is available here on the scala-lang.org website, and we’ll have PDF, MOBI, and ePub versions of that available once the creation process is automated and a few other issues are resolved.

But for now, click on the image below if you’d like to download the PDF of Hello, Scala for free:

Hello, Scala PDF

How to read a binary file with Scala (FileInputStream, BufferedInputStream) alvin November 26, 2019 - 3:28pm

As a brief note today, if you need to read a binary file with Scala, here’s an approach I just tested and used. It uses the Java FileInputStream and BufferedInputStream classes: