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

“Let me have your view as to the reason of birth and death.”

~ D.T. Suzuki

“The real does not die, the unreal never lived. Once you know that death happens to the body and not you, you just watch your body falling off like a discarded garment. The real you is timeless and beyond birth and death. The body will survive as long as it is needed. It is not important that it should live long.”

~ Sri Nisargadatta Maharaj

Today I learned that a cousin’s wife died, and also that a man I used to enjoy talking to when I lived in Kentucky passed away six years ago. RIP, Kathy; RIP, Bill.

Bill Crump, Kentucky

Not much free time today, so I’ll mix two topics. First, this morning I apparently started a new dream series in which I’m a new doctor at a medical practice. Of course I get the worst patients as a result, so that was interesting.

Next, in the movie Midnight in the Garden of Good and Evil, I was wondering what the song is that the woman at the piano (sorry I don’t know her name) starts playing when John Cusack walks by. I was guessing it was Fools Rush In by Johnny Mercer, and when I looked up that song I saw that Rosemary Clooney did a version of it. She’s in White Christmas, which is one of my favorite movies, and I also knew that she was George Clooney’s aunt. What I didn’t know is that she lived in Mayfield, Kentucky, and she’s the mother of Miguel Ferrer, who I mostly know as FBI Agent Albert Rosenfield on Twin Peaks (and two days it was Twin Peaks Day).

Miguel Ferrer as FBI Agent Albert Rosenfield on Twin Peaks

Many people seem to struggle to say things that are either pleasant or unpleasant. I can’t speak for anyone else, but having gone through the process of not knowing if I was going to live through many days in 2016, I find it easier to say pretty much anything now. It’s like you really know your time is limited. If I had died one of those times instead of just getting sick and going unconscious I wouldn’t be here now, so it’s like I got some free tickets to have fun at the circus for a little while longer.

(I suppose that sometimes when you’re dealing with the opposite sex you have to be a little careful. Today I told a woman that I liked her hair (it was tinted red-ish), but then when I got “that look” I clarified it by adding that I didn’t say that because I wanted her to come over tonight to bake some cookies, I just liked what she had done with her hair.)

~ a Facebook post from February 25, 2017

To which a friend replied:

Nothing ventured nothing gained
No more lingering doubt remained
Nothing sacred or profane
Everything to gain
Cause you’ve nothing left to lose

For some examples in my new book on functional programming in Scala I needed to create a collection class of some sort. Conceptually an immutable, singly-linked list is relatively easy to grok, so I decided to create my own Scala list from scratch. This tutorial shows how I did that.

Background: What is a Cons cell?

The first time I learned about linked lists was in a language named Lisp. In Lisp, a linked list is created as a series of “Cons” cells. A cons cell is simple, it contains only two things:

Every year at the time of the NFL Combine I’m reminded that my hands are 10” in size, per the NFL measurement standard. I never thought of that as being particularly large, but it’s larger than guys like Patrick Mahomes, who comes in at 9.25”. That being said, he’s a great quarterback, and I’m not. :)

Per a 2015 tweet about the “Dow Joans,” Donald Trump says he should be loaded into a cannon and shot into the Sun. No excuses!

Trump says he should be loaded into a cannon and shot into the sun

Lights go out and I can’t be saved
Tides that I tried to swim against
Brought me down upon my knees
Oh I beg, I beg and plead

Come out of things unsaid
Shoot an apple off my head
And a trouble that can’t be named
A tiger’s waiting to be tamed

You are
You are

Confusion that never stops
Closing walls and ticking clocks, gonna
Come back and take you home
I could not stop, that you now know

~ from the song Clocks, by Coldplay

Mast cell disease isn’t enough, a DNA test for hemochromatosis shows that I’m a “compound heterozygote.” If you’re interested, you can find more information at hemochromatosis.org.

They say I got this disease from the combination of my parents DNA, but I’m guessing I got it from watching the Limitless tv series so many times. :)

Just call me a compound heterozygote (hemochromatosis)

FATHER, TALKING TO HIS SON: Life is a pain in the ass. I’ll tell ya’, you know. You work hard, try to provide for the family, and then for one minute ... everything’s good. Everyone’s well, everyone’s happy, and in that one minute you have peace.

SON: Pop ... this isn’t that minute.

~ from the movie, While You Were Sleeping

Happy Twin Peaks Day! (February 24th)

Happy Twin Peaks Day! (February 24th)

When I first looked at the sortInPlaceBy method that was introduced on mutable sequences in Scala 2.13, I couldn’t figure out exactly what it was supposed to do.

Unable to find any examples of “scala sortInPlaceBy” on planet Earth this evening (February 23, 2020), I had to resort to some actual work, and looked at the Scaladoc.

Reading the Scaladoc

This is what I see when I look at the Scaladoc for sortInPlaceBy on the ArrayBuffer:

def sortInPlaceBy[B](f: (A) => B)(implicit ord: Ordering[B]): ArrayBuffer.this.type

You can’t see by looking at that method what A is, so I scrolled up to the top of the page and saw this at the beginning of the Scaladoc:

“His name’s Chappy.”

His name’s Chappy

According to the City of Boulder, Colorado Government Facebook page, this photo from 1866 is one of the oldest known photos of Boulder, Colorado. As someone commented on that page, there are no trees shown in the area. I’m told that pretty much every tree you see in Boulder, Longmont, Louisville, Broomfield, etc., was planted by man.

Boulder, Colorado in 1866

These days it’s “wisdom consultant,” not “guru.”

I found this image on the Cambridge Zen twitter page, and it looks like the image originally comes from speedbump.com.

Wisdom consultant

Nansen and Joshu teamed up for some of the best stories in Zen literature. I’ve seen this exchange many times, but this particular translation comes from the book, Making Zen Your Own.

What is the Way? (Nansen and Joshu)

Famous presidential quotes:

Kennedy: We choose to go to the Moon ...

Reagan: Mr. Gorbachev, tear down that wall.

Trump: Do I look like a guy who needs hookers?

“Always do what you are afraid to do” ~ Ralph Waldo Emerson

Always do what you are afraid to do