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

Scala 3 FAQ: How does this ZIO HTTP and ZIO JSON code works, specifically the derives JsonEncoder portion of the code:

case class Greeting(message: String) derives JsonEncoder

Solution

In Scala 3, the derives keyword is used to automatically generate implementations for type classes. Here’s how this works in the context of ZIO JSON.

The Moon, heading for the back side of the mountains on the morning of December 3, 2020, somewhere in Colorado.

The Moon in the morning, December 3, 2020

As a brief note, if you need to debug a ZIO HTTP Request value, I just created this function to return its values as a String, and it appears to work properly:

I’ve written a lot about meditation before, and in this post I’d like to talk about something different that I do from time to time. You see, where many people like to go to a movie or watch the television, I use my meditating power to create my own “holodeck in my mind” to do anything I want to do.

I call this a “The Lion, the Witch and the Wardrobe” meditation, because I start by closing my eyes, start meditating in something like a savasana style, and then mentally go out through the back of a closet in a house I used to live in.

A cavern with a recliner

Once I come out the other side of the closet, I come to a path, where I take an elevator ten stories down into my mind, and that brings me to a Star Trek-like holodeck, as shown in this image:

A personal holodeck created during meditation

As shown, the holodeck has a virtual recliner where I can sit, relax, and start doing anything I want.

If you’re interested in what Colorado looks like, this is a photo from the Erie, Colorado area on November 3, 2020.

A photo from the Erie, Colorado area on November 3, 2020

“Courage doesn’t always roar.” I just found this image in a folder on one of my computers. I don’t remember where I took this photo, but I think I took it at a small restaurant in Boulder or Louisville, Colorado. The text comes from Mary Anne Radmacher.

Courage doesn’t always roar

This is a view of a portion of the Rocky Mountains, as seen from Longmont, Colorado, on December 31, 2020.

The Rocky Mountains, Longmont, Colorado, December 31, 2020

As a brief note, this is my IntelliJ IDEA keyboard/keystroke characters cheat sheet for macOS computers. This is the actual cheat sheet I look at on a daily basis, organized in the way I want it organized.

Here’s a comprehensive guide to implementing retry logic in ZIO 2 applications, using various scheduling strategies.

Please note that I haven’t double-checked that all of these examples compile as-is, but I do demonstrate many of these in my free Scala and ZIO 2 training videos. (I also added a complete working example at the end.)

Back in September of many years ago, I left the little cabin in Talkeetna, Alaska, and started the long drive back to the Lower 48.

Leaving the cabin in Talkeetna, Alaska

Here’s a photo of the snowy Rocky Mountains, from Longmont, Colorado, on November 10, 2020.

Longmont, Colorado, and the snowy Rocky Mountains

“I am everywhere. All are my expression. For me, there is no coming and no going.”

~ Sri Krishna, as quoted in I Am Not The Body, by Sri Nisargadatta Maharaj

While driving back from Golden, Colorado on November 10, 2016, I happened to be listening to Lady Cab Driver by the artist formerly known as Prince, and wondered if these days he would have called it Lady Uber Driver. I thought it was interesting how society in the present moment has an effect on music and writing.

And here’s a gratuitous photo of some cattle on the right and wrong side of the fence near Golden, a big field, and some mountains.

Drive back from Golden, Colorado (and Lady Cab Driver)

This page is a collection of over 65 quotes from mindfulness and meditation masters/teachers, and it’s specifically about the need for intensity of concentration in your meditation practice.

The quotes generally aren’t in any specific order, they’re just in the order in which I found them. The later quotes in this article are ones that I had to google for and then confirm, but that’s about the extent of the ordering.

Sri Nisargadatta Maharaj has been one of the top-five meditation teachers for me in the last year, so I’ve been asking some A.I. tools about his teachings, generally focusing on two statements he made many times. In short, he said that we should constantly:

  • Tell ourselves, “I am not the body,” and
  • Ask ourselves, “What am I?”

The rest of this article is from the conversations I’ve had with those A.I. tools here in 2024.

I’ve heard the song Hurt, performed by Johnny Cash several times lately, so I’ll make it today’s song of the day. I first heard it when I lived in the little cabin in Alaska in 2007, so along with a handful of other great songs I first heard there, it holds a special place in my heart.

The cabin in Talkeetna, Alaska

I’ve been working with ChatGPT lately to create images that go with “spiritual quotes,” and it created this image to go along with the Ram Dass quote, “Enlightened beings are pure awareness.”

Enlightened beings are pure awareness

Here are two favorite quotes from Anandamayi Ma. I think almost all of these quotes come via Ram Dass, but at the moment I can’t remember what book I saw this in. So at the moment, I assume that Ram Dass or one of his assistants spoke, wrote, or compiled almost all of the following, and I’ll link to one of his books once I can confirm this.

A great Zen quote from Zen Master Seung Sahn: “If you want Satori, Satori is far, far away.”

(Satori is a Japanese Buddhist term that means enlightenment, awakening, liberation, or self-realization.)