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

“In enlightenment, death has no relevance to one’s state of being.”

As I reflected on the meaning of Easter this morning, I remembered this quote from Tibetan lama, teacher, physician, sculptor, and painter, Chagdud Tulku Rinpoche. The quote is from his book, Life in Relation to Death.

As a note to self, if you see this sbt error message with sbt 1.4.8, it’s a known issue:

java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiOutputStream

The short solution to the problem is to upgrade to sbt 1.4.9 or newer. The problem and solution are discussed in this Github sbt issue.

This is a photo of some white-tipped trees on a cloudy, overcast day in Louisville, Colorado, March, 2016 (a few miles east and south of Boulder, Colorado).

Louisville, Colorado: White trees on a cloudy day

A “Boulderstrong” sign at the King Soopers in Louisville, Colorado, to honor the people who were killed at the mass shooting in Boulder last week.

Boulderstrong: King Soopers in Louisville, Colorado

I got vaccinated this past week at Boulder Community Hospital, in Boulder, Colorado.

I got vaccinated (Boulder, Colorado)

Functional programming is interesting. On the one hand it’s very (extremely!) disciplined. But on the other hand, people can’t agree on certain definitions. As an example, here are the “three principles of functional programming,” from this tweet:

1. Orthogonal composability
2. Maximum polymorphism
3. Maximum deferment

Conversely, here are the “three pillars of functional programming,” from Functional and Reactive Domain Modeling:

1. Referential transparency
2. Substitution model
3. Equational reasoning

When I learned OOP I saw that it was based on several principles that everyone agrees upon. When I started learning FP (and later took two years to write Functional Programming, Simplified) I was surprised there wasn’t a single accepted definition of functional programming. I ran across the principles/pillars in the last two days and was reminded of that again.

March 23, 2021, a day after the horrible assault rifle mass shooting in Boulder, Colorado, gave a us a day that looked a bit like Alaska. The ground here in Colorado never looks like Alaska, but today the mist in the mountains and overcast sky looked like Alaska, and made me feel a bit more like I was at home here.

An Alaskan day in Colorado

When I edit my own text, I make comments like those shown in the images. A few of my own:

  • Nice start — dig deeper
  • Just say what you mean
  • You lost me
  • Feels fake — write from the heart (or, write to your muse)
  • Passive!

When I write books I try to complete a chapter, then get away from it for at least a month, then come back and edit it like this.

The images here are from the excellent movie, Finding Forrester.

On editing writing

The Scala 2.13 collections’ class updates introduced two new “chaining operations” named pipe and tap. Here’s a quick look at how they work, plus a little extra fun at the end.

pipe

pipe works like a Unix pipe, passing values to functions. For example, given this setup:

import scala.util.chaining._
import scala.language.implicitConversions

def plus1(i: Int) = i + 1
def double(i: Int) = i * 2
def square(i: Int) = i * i   // we’ll use this one later

As a brief note today, for the last year or so I’ve been experiencing various “visions” when I wake up at night. I mentioned them to a doctor recently, and he said, “No, you’re not crazy, they’re referred to as hypnagogic hallucinations.” I found out that more accurately, the ones I’m experiencing are known as hypnopompic hallucinations.

If you’re interested in what these look like, here are three that I experienced recently. I regularly see images of “splatter” on the ceiling, and they can be all sorts of color. Last night they were mostly black, but the night before that they were red and pink:

Hypnopompic hallucinations - color splatter on ceiling

A few years ago I had a party at my house, and there was a woman there that I didn’t know, but I felt like I knew her. To be clear, I knew that she worked with a group of people I had invited, but I didn’t know her. Yet, it was a strange feeling, a thousand miles past deja vu. Maybe I had seen her somewhere before, but I couldn’t place it.

When that thought came to me I was talking to some other people, so I shrugged it off for the time being. The party had just begun, and I figured we’d meet soon enough. A little while later a trash can became full, so I took the bag out of the can and walked it to a garbage can outside by a detached garage. I put the bag in the can and turned around, only to be startled to see the woman standing there.

“How do I know you,” she asked.

Imagine being 30 years old, and life is good. You’re healthy, vibrant, and even astonishingly good at math.

But then just a few moments later you can’t make sense of the world. You don’t know what’s real and what’s not.

You begin hearing voices that aren’t there. Maybe you see things that aren’t there.

Shortly after this you’re put into a “mental institution.”

That’s what happened to my mom. For whatever reason, shortly after I was born, she was stricken with schizophrenia.

(If you’ve ever seen the tv series Fringe, my mom is almost exactly like Walter Bishop, or vice-versa.)

Git FAQ: How do I view the detailed commit history for a file with git?

Solution: When you want the detailed git commit history for a file, this is the best git command I know:

This is a sunset from my old apartment complex in Broomfield, Colorado, on March 17, 2020.

Rocky Mountain sunset, March 17, 2020

A Rocky Mountain sunset, near Boulder, Colorado, November 24, 2016.

A Rocky Mountain sunset, near Boulder, Colorado

When I was very sick in 2015-2016, I used to tell my doctors it felt like I had been “drugged.” When I could see that they couldn’t understand or believe that, I’d tell them that it felt the way you feel after surgery, groggy and woozy.

For the most of this year I’ve been eating very well, but yesterday I went to see a movie (Logan) and had some popcorn. Shortly after eating the popcorn I started to feel sick, and today I feel like I’ve been drugged.

This — as I have learned — is life with mast cell activation disease, known as MCAD or MCAS.

“I’ve seen a lot of my friends lose their passion and end up in a rut, afraid to take a chance. ‘Night Moves’ is about romantic passion, but ‘Ship of Fools’ is about passion for life. Maybe a guy’s working a job he doesn’t like, and he sees an ad about the Alaska pipeline or something that excites him. But there are problems. His family says it’s too cold in Alaska or whatever. So he passes it up and just keeps on with something he hates.”

~ From Bob Seger, about his song, Ship of Fools

Over this past weekend, March 13-14, 2021, Denver, Colorado and the surrounding areas had the fourth or fifth largest snowstorm in recorded history. Before the snow stopped last night I saw that Denver had already had 24.1” of snow. This is a photo of my car and some neighbors cars here in Longmont, Colorado.

March, 2021 snowstorm (Longmont, Colorado)