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

The story of the two wolves, from the movie, Tomorrowland. (You’ll have to see the movie to know the answer, if you don’t already.) (Or Google it. It’s actually an old American Indian story, not a Disney thing.)

Tomorrowland movie quote

“Don’t cling to a mistake just because you spent a lot of time making it.”

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

“Go out there and have huge dreams, then show up to work the next morning and relentlessly incrementally achieve them.”

~ from the book, How Google Works

“No dreams come without a bill. The reality of making something happen is just a ton of hard work.”

~ Peter Gabriel

This was the rocky mountain sunset in Erie and Longmont, Colorado on the evening of October 22, 2021.

Erie/Longmont, CO sunset, October 22, 2021

Summary: This tutorial demonstrates how to fire macOS system notifications with AppleScript and Scala (or Java).

In this article it helps if you already know a little bit about AppleScript, though that’s not completely necessary. Near the end of the tutorial I show how to invoke the AppleScript code using Scala, so feel free to skip down to there if you just want to see that — you can always read the stuff at the top for reference later.

Back in 2020 I started writing a series of blog posts that I titled, Thinking With Types. Here in October, 2021, I just took some time to make some bug fixes and additions to it. If you’re interested in it, you can download the PDF here:

Thinking With Types, v0.2

Knowing of my interest in Zen, a friend of mine sent me this photo of a letter from Albert Einstein to a parent grieving after the loss of a child:

Albert Einstein, Zen Master

If you know something about Zen, you know that Einstein is writing about the “oneness” of the universe. Zen tries to teach us about this through techniques like Zen Meditation (zazen), and the concept of all things being interdependent.

Probably the most important scene in the movie, I.Q. :)

When was the last time you went ‘Wahoo’?

“I think you’re the kindest, sweetest, prettiest person I’ve ever met in my life. I’ve never seen anyone that’s nicer to people than you are. The first time I saw you ... something happened to me. I never told you but ... I knew that I wanted to hold you as hard as I could. I don’t deserve someone like you. But if I ever could, I swear I would love you for the rest of my life.”

~ from the movie, Groundhog Day

October 11, 2011: After moving from Alaska to Colorado I spent about ten days trying to decide to live, and was staying in two hotels, one on the south side of Denver (in the Denver Tech Center area) and another on the north side. On this day I made the decision to live northwest of Denver and east of Boulder, and moved into my first apartment in Broomfield, and made this post on Facebook:

“Day one in the new apartment, slept on the floor, and there’s nothing to eat. Planning skills are questionable. But the fireplace is nice.”

We’ve had a lot of beautiful sunsets around here lately. Hard to believe that just about four days ago we had our first snow of the season.

Sunset in Boulder, Colorado (October 7, 2013)

Look mummy, there’s an aeroplane up in the sky. :)

It’s that time again in Colorado, late September leading into October leads to a lot of balloons in the sky.

Look mummy, there’s an aeroplane up in the sky

In the third line of Alanis Morissette’s song, Thank You, she sings, “How about them transparent dangling carrots?”, and in this article I’ll take a little look at what that line means.

A song about enlightenment

Ms. Morissette’s entire song is about gaining enlightenment — also known as awakening — and from that perspective, a transparent dangling carrot is anything that leads you to take a path of pursuing or gaining enlightenment. In the song she mentions things like terror, disillusionment, frailty, consequence (karma), and silence; each of these can be considered motivational “carrots” that are capable of pulling a person down a path where they want to seek enlightenment.

The “carrot” reference

As a brief personal note, I just remembered that back during 2014-2017 when I went unconscious seven times — a process known as syncope, and pronounced sync-oh-pee — I would later find out that the reason I went unconscious is because I didn’t feel the initial symptoms of MCAS. Those initial symptoms were suppressed because I was taking a statin.

So while I was taking a statin I would feel sick, like I’d been poisoned, and then go unconscious in a process that took 2-15 minutes. But on September 1, 2016, I stopped taking the statin because of some things that happened in the previous days. To my surprise, after I stopped taking the statin I would feel bad from the MCAS much earlier in the process, and then I’d also get hives, rashes, and other symptoms hours before entering pre-syncope. This gave me an opportunity to take more medicine to avoid the actual syncope event.

So, my personal experience is that taking a statin suppressed the initial mast cell disease symptoms, and that led me to go directly to syncope events without first having hives, rashes, etc.

“Hard work always beats talent if talent doesn’t work hard.”

~ Kevin Durant

Which reminds me of this Mike Ditka quote: “Effort without talent is a depressing situation ... but talent without effort is a tragedy.”

I like to mess with book covers, so I created this alternate version of the 2021 Scala Cookbook cover. :)

Scala 3 Cookbook, alternate cover design

A great new feature in the Scala 3 Scaladoc is that you can search for methods by supplying a method/function signature. For instance, imagine that you’re new to Scala, and you have this list:

List("Ken", "Frank", "Lori")   // A

Furthermore, you know that you want to get to this list, which contains the length of each string in the first list:

List(3, 5, 4)                  // B

I had to go to the hospital in Boulder, Colorado this past weekend, and took this photo while driving in on Arapahoe Road. There are several beautiful views of the mountains and Boulder as you drive west into town on Arapahoe or South Boulder Road, and this is one of them.

Moon over the mountains over Boulder, Colorado