Here’s another photo from my drive from Fairbanks, Alaska to Deadhorse and Prudhoe Bay.
Scala, Java, Unix, MacOS tutorials (page 15)
Today people on Twitter are noting the farthest north they’ve ever been. The farthest north I’ve ever been is Prudhoe Bay, Alaska. I drove there when I lived in Talkeetna.

This is one of my favorite traffic signs in all of the world. You can find it if you drive north from Anchorage, Alaska towards Wasilla and Palmer.
When I lived in Alaska in 2010-2011, I would take the exit to the right to go to Palmer. If you keep going straight you’ll go to Wasilla, followed by Willow, Talkeetna, and eventually Denali and then Fairbanks. (If you’re really gung-ho, as I was, you can also keep driving to Prudhoe Bay, if you don’t mind 400 miles of dirt roads in the Arctic Circle.)
And as you can tell from the highway numbers 1 & 3, there aren’t many main roads in Alaska. :)

This is THE speed limit sign on the Dalton Highway in Alaska. If I remember right, this is the only speed limit sign you’ll see when headed north from Fairbanks heading towards Prudhoe Bay.
I started off driving about 50 mph, but then after realizing I was the only person on the road — an almost-entirely entirely dirt road — and how late it was going to be when I got to Prudhoe Bay, I drove as fast as conditions allowed.

Scala performance FAQ: Is there a reliable way to determine the number of processors (CPUs) or cores when writing Scala code?
Solution
As I was reading this article on ZIO performance tuning, I decided to look into whether there is a reliable way to determine the number of CPUs or cores on a computer using Scala (and therefore Java, Kotlin, and other JVM languages).
The solution is that there seems to be a reliable way to determine the number of CPUs or cores in Scala. In short, use the Java Runtime
class to get the information. This Scala example shows how to do it:
If you struggle with any form of addiction AND are also interested in mindfulness and meditation — to the point of being interested in enlightenment/awakening — this quote from Daniel Ingram may be a helpful motivator:
“Stagnation is guaranteed if you cling to pleasant sensations.”
In other words, you won’t make any progress on the enlightenment path until you get past the clinging to pleasant sensations — i.e., the pleasant sensations that you are addicted to.
Ram Dass offered a quote that’s in the same ballpark: “One way to get free of attachment is to cultivate the witness consciousness, to become a neutral observer of your own life.”
(A friend of mine dealt with addiction for as long as I knew her, and I know she was also looking for any motivation to quit, so I try to share anything I learn that might be helpful.)
In this ZIO performance tuning article by Pierre Ricadat, there’s this nice tip about using ZIO.foreachDiscard
instead of ZIO.foreach
:
“One of ZIO's common operators is ZIO.foreach
, which allows you to run an effect for each item in a collection. There's also ZIO.foreachDiscard
that is faster if you don't need to collect results (e.g., if your effect returns Unit
).”
For more details, see that article.

Here’s a quick Scala example that shows how to convert multiple spaces in a string to a single space:
scala> val before = " foo bar baz bonk "
before: String = " foo bar baz bonk "
scala> val after = before.trim.replaceAll(" +", " ")
after: String = foo bar baz bonk
As a “note to self” as much as anything, I just updated the following Scala videos and/or video pages:
- Video: Scala Intersection Types
- Video: Scala Opaque Types
- Video: Partial Functions
- Video: Partiallly-Applied Functions
- Video: Scala Extension Methods, Part 1
- Video: Scala Extension Methods, Part 2
- Video: Multiple Parameter Groups in Scala
I had a small issue with these pages, and I think that issue is now corrected.
The best way to keep a prisoner from escaping is to make sure he never knows he’s in prison.
~ Dostoyevsky
Leave your front door and back door open. Let your thoughts come and go. Just don’t serve them tea.
~ Shunryu Suzuki
Zen is not some kind of excitement, but concentration on our usual everyday routine.
~ Shunryu Suzuki
If you want to know your own mind, there is only one way: to observe and recognize everything about it. This must be done at all times, during your day-to-day life no less than during the hour of meditation.
~ Thich Nhat Hanh
Seeing into one’s own nature is the goal of Zen.
~ Thich Nhat Hanh
Treat everyone you meet as if they are God in drag.
~ Ram Dass
All things that appear in this world are illusion. If you view all appearance as nonappearance, then you will see your true nature.
~ Zen saying
When one realizes their own true nature, they will be free from birth and death.
~ Zen saying
Zen is keeping the mind which is before thinking.
~ Zen Master Seung Sahn
As I’ve been learning more about Scala and functional programming, I’ve been looking at accomplishing more tasks with recursive programming techniques. As part of my studies, I put together a number of Scala recursion examples below, including:
The goal of serving mankind is a noble one. Unless, of course, it happens to be in a Twilight Zone episode. ;)
