Scala, Java, Unix, MacOS tutorials (page 61)

A Gimp “oilified” view of Nolan Ryan’s windup. I got the original image from this YouTube video.

Nolan Ryan’s windup, from his fifth no-hitter

I’ve often wondered about the difference between the terms emptiness and interdependence in Buddhism, and came across this excellent Accidental Buddhist blog post recently, which includes this paragraph about a conversation the Dalai Lama had:

I was just reminded that the Visual Scala Reference is a very cool project for visualizing the Scala collections methods.

(I was just looking at some marble diagrams here in May, 2022, and they reminded me of this Scala project.)

Visual Scala Reference project

Linux crontab FAQ: How do I schedule Unix/Linux crontab jobs to run at time intervals, like “Every five minutes,” “Every ten minutes,” “Every half hour,” and so on?

Solution

I’ve posted other Unix/Linux crontab tutorials here before — such as How to edit your Linux crontab file and Example Linux crontab file format — but I’ve never included a tutorial that covers the crontab “every” options, so here are some examples to demonstrate how to run crontab commands at time intervals, like every minute, every five minutes, every ten minutes, every hour, and so on.

Somehow I’ve managed to write 620 pages of the second edition of the Scala Cookbook without knowing about AsciidocFX, an Asciidoc editor that shows a live preview of your content.

AsciidocFX, a WYSIWYG Asciidoc editor

My software tells me that I took this photo of the big open sky here in Broomfield, Colorado on January 26, 2014.

Big open sky, Broomfield, Colorado

I’m a fan of many Tom Hanks movies, and I’m also a fan of his comments in regards to COVID-19:

“We don’t know what’s going to happen with COVID-19. The idea of doing one’s part, though, should be so simple: Wear a mask, social distance, wash your hands,” Hanks told host Hoda Kotb. “That alone means you are contributing to the betterment of your house, your work, your town, your society as a whole. And it’s such a small thing. ... It’s a mystery to me how somehow that has been wiped out of what should be ingrained in the behavior of us all.”

People who knew us at the end might be surprised by this, but one thing I wish I had asked my business partner more often was, “How are you doing? Really, how are you?”

While working with the sbt and Mill build tools recently, and updating Scala and Java versions like crazy, I’ve been trying to verify some things in my Scala applications. Just now I wrote this little Scala 3 / Dotty application to print out all system environment variables and properties:

Kind of a weird situation: I’ve been thinking about moving lately, and that led to the thought that if a doctor told me I only had six months left to live, I know where I would live. But I generally like a lot of things about Colorado, so I live here. Hmm...

sbt FAQ: How do I show the Scala version that sbt is using?

Short answer

Issue the scalaVersion command at the sbt prompt.

Longer answer

I was having a problem getting a certain Scala feature to work when I compiled my code with sbt, and even though I knew I had set the Scala version in my build.sbt file, I wanted a way to double-check that sbt was indeed using that Scala version. That’s when I found I can issue the scalaVersion at the sbt prompt.

More info

Also, these sbt commands can point you to more information:

  • about
  • settings
  • help settings

And here are a few related links:

I always wondered if this ever happened: Three people were injured when a whale collided with a boat (or vice-versa) in the waters just north of Juneau, Alaska.

Just like my Jenny Lane Cottage painting, this is another small version of a “faux painting” I recently created from a photo. This one is of a sidewalk in Santa Fe, New Mexico.

The complexity of this image was in removing several modern aspects from the original photo, including signs that were on those green columns, and cars that were in the street. Everything after that is what has become fairly standard work with Gimp for me, including making it look like an oil painting, and signficantly modifying and enhancing the colors.

Sidewalk in Santa Fe, New Mexico

July 19, 2015: Lately I have been thinking about writing a functional programming book, and if I decide to do that, I might include a variation of this Ward Cunningham example of how to parse HTML <table> tags recursively. His code is written in Java, and you can read about it here.

Ward Cunningham example of recursively parsing HTML tables

On June 25, 2020, I tweeted that Coursier was providing a way to make installing Scala and Scala-related tools easier. I’ll look into that more soon, but in this tutorial I’ll show something different: How to install multiple JVMs/JDKs with Coursier.

My favorite line from this “Bear Safety” sign in Alaska:

“Play dead unless it starts to eat you, then fight back.

bear safety sign in Alaska

A favorite sign in Alaska. Anchorage to the right, Fairbanks to the left. Keep it simple.

A favorite Alaska sign (Anchorage/Fairbanks)

If you want to create and populate a Java ArrayList with Java 9, 11, and newer, you can use this syntax:

List<> ints = ArrayList<Integer>(List.of(1,2,3));

As shown, this uses the usual ArrayList constructor and the Java List.of method. Once you have an ArrayList like this you can continue to add new elements to it as usual:

ints.add(4);

The front of my current apartment complex in Broomfield, Colorado faces the Rocky Mountains, and the back-right portion of the complex has these neigh-bors.

The neigh-bors (horses in Broomfield, Colorado)

FWIW, my week leading up to the Memorial Day weekend went like this:

Tuesday: Went to the liver doctor, he said my numbers are greatly improved, no worries, keep up the good work. A couple of hours later I started having chest pain, and eventually went to the ER. Their first two tests didn’t show any heart issues, but they wanted me to take a stress test the next day.