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

My favorite garbage dumpster in Seward, Alaska: “Look for moose.”

A garbage dumpster in Seward, Alaska

If you ever need to use the Scala 3 -source option with scalac or the SBT build.sbt file, the correct syntax is:

-source:3.1

It’s not clear from the scalac help text how the -source option should be used, and I just figured that out in my build.sbt file, which has these scalac options:

scalacOptions ++= Seq(
  "-deprecation",         // emit warning and location for usages of deprecated APIs
  "-explain",             // explain errors in more detail
  "-explain-types",       // explain type errors in more detail
  "-feature",             // emit warning and location for usages of features that should be imported explicitly
  "-indent",              // allow significant indentation.
  "-new-syntax",          // require `then` and `do` in control expressions.
  "-print-lines",         // show source code line numbers.
  "-unchecked",           // enable additional warnings where generated code depends on assumptions
  "-Ykind-projector",     // allow `*` as wildcard to be compatible with kind projector
  "-Xfatal-warnings",     // fail the compilation if there are any warnings
  "-Xmigration",          // warn about constructs whose behavior may have changed since version
  "-source:3.1"
)

A moth is a mapmaking creature. When it flies into a candle it’s working from an erroneous map. Maybe the moth’s map says, “Mating opportunities here.”

A human is also a mapmaking creature. Everyone operates from a map, and the map is always getting out of date. Life, the territory described by the map, moves quickly. This means that the map drifts away from the territory, eventually becoming more of a historical artifact than a useful guide.

When there is a wide gap between the map and current world, the person who made the map feels discomfort.

For however long it worked, it was a nice map, and now it doesn’t work any more. In this situation, unlike moths, humans have two choices. One is the path of discovery, in which the map is abandoned or redrawn over and over again.

The other path is one in which the more doubts you have about a map, the more strongly you insist it’s accurate. This is the path that leads the moth into the flame. If you follow this path, you’re living by a fiction, an erroneous map ... essentially what you’re doing is building a prison cell of non-reality to live in, your own little Alcatraz.

It’s the job of the koan to take down your prison walls, to undermine your fictions. Then you might discover that you’re not really suffering from other people or from circumstances. You’re suffering from your maps, your fictions, the prison you yourself have created.

A quote from a book titled, Bring Me the Rhinoceros: And Other Zen Koans That Will Save Your Life, by John Tarrant

Back around 4:30am on January 13, 2014, I pulled into a rest area in Virginia after staying in Virginia Beach for a while (and experiencing a tornado warning there), and found this cat waiting for me.

Cat at a rest area

It felt like we might have a tornado in Virginia Beach today, with that familiar and unusual low-pressure feeling. At one point it even looked like the ocean water was being pulled up into the sky.

~ January 11, 2014

Virginia Beach tornado weather

As I walked into the Starbucks today here in Virginia Beach, an alarm went off on my phone saying there was a tornado warning. So I asked the three people working there, “Which is worse, a tornado warning or a watch? I can never remember which is which.”

So rather than google it, we talked about whether “watch” or “warning” implied more danger, then we talked about some other things while we watched stuff go flying down the street. Never did figure out which is worse, but eventually I got a coffee.

Later in the day as I was walking down a street I came across a gift shop that had been blown all over the place by the winds, and found this t-shirt amongst the ruins.

~ January 11, 2014

National Sarcasm Society t-shirt

“One’s agony is assuaged to some extent even by speaking of it, but to whom shall I speak about it? For there is no one who will understand. The reality about the chord of love that binds you and me, dear, is known to my soul alone; and my soul ever abides with you. Know this to be the essence of my love.”

~ A god speaking about his love for a devotee in the Ramayana, as seen in the book, Miracle of Love

Back in 2013 I read the book Clean Code by Robert C. Martin, and in an effort to keep that book alive with me a little while longer, I decided to make my own “Cliffs Notes” version of the book on this page. One of my favorite notes from below is that a language named LOGO used the keyword to in the same way that Scala uses def, so a method named double would be defined as to double... instead of def double..., which seems like it would help developers name methods better.

My book, Functional Programming, Simplified — 4.5-star rated on Amazon, and their 6th-best selling functional programming book — is currently on sale in three formats:

PDF Format
$20 on Gumroad.com

PDF version of Functional Programming, Simplified

Paperback Book
Now $34.99 on Amazon
 

Print version of Functional Programming, Simplified

Kindle eBook
$14.99 on Amazon
 

Kindle version of Functional Programming, Simplified

“Sometimes I think of Frank as the catcher in the rye, standing at the edge of the cliff, trying to save the world.”

~ Catherine talking about Frank, in Millennium

(Holden: “Anyway, I keep picturing all these little kids playing some game in this big field of rye and all. Thousands of little kids, and nobody’s around — nobody big, I mean — except me. And I’m standing on the edge of some crazy cliff. What I have to do, I have to catch everybody if they start to go over the cliff — I mean if they’re running and they don’t look where they’re going I have to come out from somewhere and catch them. That’s all I’d do all day. I’d just be the catcher in the rye and all. I know it’s crazy, but that’s the only thing I’d really like to be.”)

[Questionnaire with a nurse recently]

NURSE: Do you drink?

ME: No.

NURSE: Smoke?

ME: No.

NURSE: (laughing) Don’t drink, don’t smoke; what do you do?

(Which leads us to this Adam Ant video.)

(And also, if it wasn’t for the mast cell disease, I might have my own personal margarita, daiquiri, and pina colada vending machine.)

“I met a dolphin down there, and I swear to God that dolphin looked not at me, but into my soul, into my goddamn soul, and said, ‘I’m saving you Megan.’ Not with his mouth, but he said it — I’m assuming telepathically — we had a connection that I don’t even know if I can explain.”

~ from the movie Bridesmaids

Bridesmaids movie dolphin quote

“I am in the world, but not concerned with the world. I am going through the marketplace, but not as a purchaser.”

~ Ram Dass, quoting Maharaji, quoting Kabir, in Miracle of Love

These are some notes from the initial test of psilocybin (the chemical in magic mushrooms) on 200 people by Timothy Leary and Richard Alpert. I think I found this in a book by Ram Dass (nee Alpert). Note that you can get the same effects more safely from meditation.

Notes from the initial test of psilocybin

Once upon a pre-pandemic day, I was sitting in the waiting area of a doctor’s office, writing notes all over my functional programming book as I edited it. Another patient came over and asked if the book was any good.

I was kind of immersed in what I was doing, so without looking up I said, “I hope so.” Then I looked up and started to add more, but just then he got called in before I could say any more. :)

A story about editing Functional Programming, Simplified

I know your anger
I know your dreams
I’m everything you want to be
Like Mussolini and Kennedy
Like Joseph Stalin and Gandhi

Neon lights, a Nobel Prize
A mirror speaks, the reflection lies
I sell the things you need to be
I’m the smiling face on your t.v.
I tell you one and one makes three
I exploit you, still you love me

You gave me fortune
You gave me fame
You gave me power in your own god’s name
I’m every person you need to be
I’m the cult of personality

~ from The Cult of Personality, by Living Colour, 1988

Here’s a great view of the Rocky Mountains and part of Boulder, Colorado, as seen from my apartment in Broomfield on December 21, 2013.

Snowy Rocky Mountains and Boulder, Colorado, December, 2013

I can’t remember the history of this image, but the metadata tells me that I created it on May 13, 2014. It looks like I took a slightly zoomed-in photo with an iPhone 5s, because that also appears in the metadata. This was the view I had from my second apartment in Broomfield, Colorado.

Snow on the Rocky Mountains, southeast of Boulder

Season 2, Episode 3 of New Girl is titled “Fluffer,” and without getting into the details, it reminds me that I ended two friendships for the same “fluffer” reason, I just didn’t know there was a name for it. (And I won’t link to the meaning of the word fluffer here because of its meaning, lol.)

January 5, 2011, Wasilla, Alaska: This is a photo of our parking lot, a half-inch or more of ice, and black gravel they’ll sweep up and re-use come March or April.

A thick layer of ice in the parking lot, Wasilla, Alaska