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

One thing you learn when you really become dedicated to mindfulness practice is that every moment you aren’t being mindful, you’re feeding your ego. Any thought about the past or future solidifies this “ego-cage” you have built up in your mind.

(Note: I saw the term ego-cage in a book, but I don’t remember which one.)

Another good interview question of late was something like, “Who are some of your heroes, or people who have motivated you?”

I forgot to mention Bernie Glassman, from whom I learned that you don’t have to go off and meditate in the mountains to become enlightened.

You can learn more about him here on Wikipedia if you’re interested. And here’s a link to The Dude and the Zen Master on Amazon.

Interview question: Who are your heroes, or people who have motivated you (Bernie Glassman)

This page provides a comprehensive overview of error-handling strategies in ZIO 2. My hope is that you can use this decision tree to determine good/best approaches for handling errors in your ZIO effects. Each section includes a use case (question/answer), brief explanation, and ZIO 2 example.

As a brief note, I have ensured that the following examples compile, but at some point I need to take the time to double-check my work.

I haven’t interviewed for a job in many years, and yesterday I had my first interview in 14 years. I thought I could just pick up where I left off many years ago without any practice, but boy was I wrong.

I *did* want to talk about my health saga from 2012-2019 because it’s an important part of who I am today, but I talked about it too much. All I wanted to say was that (a) I got very sick and went unconscious many times before Doctor #26 found that I was born with a rare blood disease, (b) everything is fine now, and (c) the important part of that saga is that I gained much more empathy for people going through things, and I also learned that I wanted to be more of service to other people. But I blabbed on about the health stuff for too long, and I regret that. If they offer me a second interview after that, they will be very kind, indeed.

(I also could have added something useful like, “If you’re constantly itchy, have hives, or frequently get sick, feel free to ask me any questions you want later.”)

In my mind I thought that because I had written about this stuff many times before that I didn’t need to talk about it, but in retrospect I realized that it would have helped to talk about this stuff with other people before any interviews.

I also thought that I had conquered a lot of things with my ego, but this was another kick-in-the-butt reminder of where I really am.

“I slept and dreamt that life was joy. I awoke and saw that life was service. I acted and behold, service was joy.”

~ Rabindranath Tagore

My favorite garbage dumpster in Seward, Alaska: “Look for peace, look for love, look for good things, look for moose.”

A garbage dumpster in Seward, Alaska

AppleScript FAQ: Can you share some iTunes/Music AppleScript examples (example scripts)?

As I've been working a lot with macOS speech recognition software lately, AppleScript has once again become important in my life. I've been writing a lot of small AppleScript scripts — including AppleScript iTunes scripts — and I thought I'd share snippets of code from those iTunes scripts here for anyone else they might benefit.

2021 Update: Wherever it says “iTunes” below, substitute the word “Music”, as Apple has renamed the iTunes application to Music.


It was driving me crazy that the quality of the songs I was streaming from a website known as Bandcamp sounded better than the quality of the songs I was playing from my iTunes (now Music) collection. In my case, I recently bought a Marian Call CD named “Something Fierce”, and had imported the songs from that CD into iTunes. But the songs I streamed from Bandcamp sounded better than the songs I imported from the CD; how could this be?

I dug into the problem and found two simple fixes, both in iTunes. In this article I'll show you how to make those fixes to dramatically increase your iTunes sound/music quality.

I recently took an online “assessment” test with a company named SHL. In general it was good and interesting, but after thinking about it, one thing it really lacked was a concept of “context.”

For instance, one question was something like, “Are you comfortable talking to strangers?” Well, that depends on the context of the situation. In the context of being at a grocery store I generally have my earbuds in and leave strangers alone until I talk to the cashier, but in the context of work, I pretty much talk to everyone. Two different contexts, two totally different answers.

So as I’m answering the questions I keep asking myself, “What’s the context?” Unfortunately I didn’t share this at the end of the SHL test when they give you a little room to comment, so I thought I’d share that here in hopes someone there might see this.

As I wrote in Different meditation/mindfulness practices, different cultures, and they all talk about witnessing/noting, mindfulness and meditation masters (teachers) from different cultures, countries, and styles of practice often teach the same thing in different ways: a style of mindfulness meditation known as witnessing or noting.

To me, a simple way to think about this is that as your body goes along with its daily life, all you have to do is simply narrate what your body is doing at all times, in the present moment.

If you like, you can think of yourself as being the witness/soul, watching the body, and noting what it’s doing, like a birdwatcher does when they note what birds are doing in a forest. It’s that simple.

(This is a recounting of a long dream from October 1, 2016.)

We were playing at our camp when my older brother — who was standing on higher ground than I — saw something in the distance. He stood upright, then perfectly still. After a few moments he turned to me in a look of panic I had never seen before, pointed in a direction opposite from where he was looking, and screamed, “Run! Run!” I was startled at his behavior but I knew that something was very wrong, so I ran. And I ran.

I ran as fast as I could, weaving through the brush and constantly changing my course as I was chased by a white man on a dark horse. I thought I might be close to safety when I darted through some bushes, but I ran right into a creek that was too wide to jump across. As I paused for a moment to decide how to continue, the white man shot me in the back.

In intense pain and sudden shock, I stumbled forward into the creek, bent over with one hand in the creek. As I attempted to stand up and regain my balance, I was shot in the back again. This time my body flew forward towards the opposite side of the creek. I tried to control my fall but could not, and my torso slammed against the land. The right side of my face was pressed against the ground, my eyes still open. My right arm was trapped under my body, my left arm was somewhere down my left side. My legs lay in the creek’s water.

If you’re interested in logging in a ZIO application, the following example shows a collection of different ways you can write log messages. I also show how to create your own custom log format, so the output logging from this application looks like this:

I’m starting to publish my next free video course, called ZIO HTTP + Caliban. You can find it at that website, and it’s free, thanks to the people at Ziverge.

Free video training course: ZIO HTTP + Caliban

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.)

“Enlightenment always comes after the road of thinking is blocked.”

Lindsey: Don’t tell me you’re seeing inside them again. (long pause) What are people like, on the inside?

Jeremy: Inside most people there’s a feeling of being separate, separated from everything.

Lindsey: And?

Jeremy: And they’re not. They’re part of absolutely everyone, and everything.

Lindsey: Everything? I’m part of this tree? Part of my dog barking over fences? You’re telling me that I’m part of some fisherman in Italy, on some ocean I’ve never even heard of? There’s some guy, sitting on death row, I’m part of him, too?

Jeremy: You don’t believe me.

Lindsey: It’s hard to believe that. All of that.

Jeremy: That’s because you have this spot that you can’t see past. (Putting his finger on her forehead.) My grams and gramps had it, a spot where they were taught they were disconnected from everything.

Lindsey: So that’s what they’d see if they could? That they’re connected?

Jeremy: And how beautiful they really are. And that there’s no need to hide, or lie. And that it’s possible to talk to someone without any lies, with no sarcasms, no deceptions, no exaggerations or any of the things that people use to confuse the truth.

~ a conversation from the movie Powder

“He’s more myself than I am. Whatever our souls are made of, his and mine are the same.”

“Goddamnit!”

Every so often a woman in a lucid dream this morning yelled out like that, so after the fourth or fifth time I had to ask her about it. “Why do you keep saying that?,” I asked.

“Gets your attention, doesn’t it?”

“Yeah, I guess so.”

“There you have it.”

“There I have what?”

“Your ego is writing checks your body can’t cash.”

~ from the movie, Top Gun