How to run a Scala application in a jar file while setting the classpath

Background: I don’t know why, but without looking into it, all I know is that I could not use the Java Sound API from within SBT. Whenever I tried sbt run, I kept getting the following error message, even though I knew that my app and sound file worked when I packaged my Java application normally:

javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file

As part of the debugging process I created a little shell script named that contained these two lines:

Getting a random element from a list of elements in Scala

In working on projects like SARAH and other apps where I’m trying to make a computer seem more “human”, I’ve been making my software reply to me in random ways. What I’ve found is that this ends up being an easily repeatable pattern, where you have a list of possible replies, and then you randomly return one of those replies.

Three free Savasana-like guided meditations (MP3 audio recordings)

The links in the Downloads section below connects you to three free MP3 audio files I’ve made during the past several days. These files are guided meditation sessions that are somewhat similar to what you might experience in a Savasana meditation session at the end of a yoga class, but they’re also different.

Methods on the Scala collections classes, organized by category

When I wrote the Scala Cookbook, I gave each recipe and then each chapter my full attention. I thought that if I wrote each recipe as well as possible, and included important recipes in each chapter, well, I wanted each chapter to be worth the price of the entire book. That was my goal.

As a result of this effort -- and perhaps to the chagrin of my editor -- the Scala collections chapters ended up being 130 pages in length.

Syndicate content