These are my notes from creating a Play Framework 2.8 project on January 2, 2022, using Scala 2.13, MySQL, and Slick. I share these notes here because I found it hard to find the correct versions of everything that needed to be used, and the correct syntax in the application.conf file. Unfortunately the Play 2.8 documentation is not up to date, so this was much harder than I expected it to be.
Scala, Java, Unix, MacOS tutorials (page 40)
Thanks to Scala being both an object-oriented programming language and a functional programming language, here on the last day of August, 2021, the Scala Cookbook (for Scala 3) is the #1 new release in both the OOP and FP categories.
UPDATE: The book is still #1 in both categories on September 7, 2021 — one month after the Kindle release.
(In the image shown, the Amazon OOP category is on the left, and the FP category is on the right.)

As this image shows, as of September 14, 2021, the Scala Cookbook is still a #1 new release in both the object-oriented programming (OOP) and functional programming (FP) categories. Because these are the two main computer programming categories, and the Cookbook has been a #1 new release for a month now, it was suggested that it might be a Great 2021 Geek Gift Idea. I can’t argue with that. :)
(The image here shows two browser windows, with the OOP page on the right overlapping the FP page on the left. The images were taken on September 14, 2021.)

This is an excerpt from the Scala Cookbook, 2nd Edition. This is Recipe 20.3, Reading a CSV File Into a Spark RDD.
Problem
You want to read a CSV file into an Apache Spark RDD.
Solution
To read a well-formatted CSV file into an RDD:
This is an excerpt from the Scala Cookbook, 2nd Edition. This is Recipe 20.2, Reading a File Into an Apache Spark RDD.
Problem
You want to start reading data files into a Spark RDD.
Solution
The canonical example for showing how to read a data file into an RDD is a “word count” application, so not to disappoint, this recipe shows how to read the text of the Gettysburg Address by Abraham Lincoln, and find out how many times each word in the text is used.
After starting the Spark shell, the first step in the process is to read a file named Gettysburg-Address.txt using the textFile
method of the SparkContext
variable sc
that was introduced in the previous recipe:
This is an excerpt from the Scala Cookbook, 2nd Edition. This is Recipe 20.1, Getting Started with Apache Spark.
Scala Problem
You’ve never used Spark before, and want to get started with it.
Solution
When you use Spark professionally, your data will probably be spread across multiple computers — maybe thousands of computers — but to get started with Spark you can do all of your work on one computer system in “local mode.” The easiest way to do this is to start the Spark shell, create an array, and go from there.
This is an excerpt from the Scala Cookbook, 2nd Edition. This is Recipe 3.8, Formatting Numbers and Currency.
Scala 3 Problem
You want to format numbers or currency to control decimal places and separators (commas and decimals), typically for printed output.
This is an excerpt from the Scala Cookbook, 2nd Edition. This is Recipe 2.11, Creating Your Own String Interpolator.
Scala 3 Problem
You want to create your own string interpolator in Scala 3, like the s
, f
, and raw
interpolators that come with Scala.
Linux/Unix FAQ: On a Unix system, how do I redirect both STDOUT (standard output) and STDERR (standard error) to /dev/null, aka, “the bit bucket”?
Solution
To redirect both STDOUT and STDERR to /dev/null on Unix/Linux systems, use this syntax:
$ my_command > /dev/null 2>&1
With that syntax, my_command
represents whatever command you want to run, and when it’s run, its STDOUT output is sent to /dev/null (the “bit bucket”), and then the 2>&1
syntax tells STDERR to go to the same place as STDOUT.
Note that this syntax can be used to redirect command output to any location, but we commonly send it to /dev/null when we don’t care about either type of output, and at some point in Unix history the /dev/null file became known as the bit bucket because of this.
So if you needed to know how to redirect both STDOUT and STDERR to the bit bucket, I hope this is helpful.
In Anchorage, Alaska, Walmart has apparently trained the ravens to help with the return of carts. If you look carefully you’ll see that there are at least five ravens in this photo.
~ December 9, 2010

People occasionally ask me, “What’s the easiest way to learn functional programming?” If you look at all of the books on the right side of this image, I can tell you that reading all of those books wasn’t an easy way to learn functional programming (FP):
IMHO there’s a much easier way to learn the FP basics: I’ve made almost 40% of my book, Functional Programming, Simplified, freely available.
The lessons in the free PDF you can find at that URL include:
Dateline Broomfield, Colorado, November 30, 2011: This was a Rocky Mountain sunset on that evening.

“Keep inventing, and don’t despair when at first the idea looks crazy. Remember to wander. Let curiosity be your compass. It remains Day 1.”
~ Jeff Bezos, in this sec.gov message to employees and shareholders
As kind of a crazy thing, I haven’t given a live presentation in fifteen years. But last week I was asked to give a two-hour talk about writing and editing, and after that I decided to create this video presentation on YouTube, titled, Almost Everything I Know About Writing. It’s a 33-minute long presentation that’s based on the introduction to the original presentation, and if you’re interested in technical writing, I hope it’s helpful.
“I can’t judge. There are two kinds of people in Alaska: those who were born here, and those who come here to escape something. I wasn’t born here.”
~ Rachel Clement, Insomnia
“Do that thing that will charm you, that will make you say, ‘Yes, it’s the real me.’ Do that, and you’re alive.”
(I don’t remember where that quote comes from,
but I like it.)
As a quick note, I wrote this little Unix/Linux shell script that I named sbtnew
to run the sbt new
command (with the template shown), and then delete the project and target directories that sbt new
creates in my current directory:
#!/bin/sh # sbtnew: a script to run 'sbt new' and then clean up the project and target directories # version: 0.1 # license: GNU GENERAL PUBLIC LICENSE, see https://choosealicense.com/licenses/gpl-3.0/# # [1] create a new Scala 3 project sbt new scala/scala3.g8 # [2] clean up the 'project' and 'target' directories if [ -e project ] then echo "i see project" rm -rf project fi if [ -e target ] then echo "i see target" rm -rf target fi
Please note that this project/target directory situation seems to be getting better with new versions of sbt, so this sbtnew
shell script may not be needed in the future, but I still like it because it’s easier to remember than the full sbt new...
command. One day I’ll also add the ability to rename the directory to what I entered, because for some reason sbt new
changes the name to lowercase.
My (former) cattle neighbors in Broomfield, Colorado, who I discovered on the afternoon of December 4, 2011.

As I noted here on the Valley Programming website, I just released Version 0.1 of my Automated GUI Testing (AGT) software. It still needs a lot of work, but a key is that I added in some basic image-recognition capability. This means that as a GUI tester, you don’t have to rely on pixel coordinates; you can instead write, “Find this icon on the screen, and when it’s visible, click it.” Similarly, you can also write, “When this given icon goes away, do (whatever you need to do).”
I’ll write more about AGT over time, but for today, I’m happy to get to Version 0.1.
This is a photo from the drive from Santa Fe, New Mexico north to Colorado, taking the back roads (Route 285) rather than the expressway. I took this photo in March, 2015.
