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

Land of Lisp is one of the most interesting, quirky books I’ve read in quite a while. IMHO, Lisp can be a tough language to read, but the author, Conrad Barski, keeps it interesting.

Land of Lisp (book)

Update, May 3, 2020: I added the single-page HTML version of the book to the Downloads section below.

Back in the summer of 2019, a book publisher approached me and asked if they could buy the rights to an “introduction to Scala” book I had independently published and titled, “Hello, Scala.” The book is about 225 pages long and provides a brief-but-thorough introduction to the Scala language.

I came extremely close to signing with that publisher, but as fate would have it, right at that time I saw some people on contributors.scala-lang.org say something to the effect, “If only we had an online book ...”

Scala/Akka problem: In some situations you can’t pass an ActorRef to another actor, so you want to see how to “look up” an Akka Typed actor so you can send a message to it.

Solution

There are at least two ways to find other Akka Typed actors, and both involve using the Akka Receptionist. The example shown here in the solution shows how to find an actor asynchronously, and the example shown in the Discussion shows how to use the ask method to find another actor synchronously.

In both examples I’ll use the idea of creating an actor system that works like Amazon Echo devices. The basic idea is that a device like this has ears to listen to you, a mouth to speak to you, and a brain to do all of its work. In these examples the Brain actor will need to discover the Mouth actor.

Some moose on the road at Denali National Park, May 1, 2018.

Moose on the road at Denali National Park

A moose traffic jam in Denali, Alaska.

A moose traffic jam in Denali, Alaska

This image comes from 2014, but it’s still a cool idea today. Someone created an art project in Juneau, Alaska that allowed people to complete the sentence, “Before I die I want to ...”

Before I die I want to ... (Juneau, Alaska)

I had hoped to stay away from the hospital a while longer, but after a telehealth call, I had to visit the local hospital today.

In the area of the hospital I went to there were only four hospital employees and no customers except for me. One woman at the front door was a gatekeeper. She asked questions and checked to see if I had a fever. After that there was one receptionist working and two people in the lab area.

After checking in I went to sit down in my usual area, and then I noticed that seating area was gone, and most of the other chairs had been removed. All of the medical offices down the hallway in the first picture were closed, and then I saw the blue sign on the way out.

Had to go to the hospital today (May 1, 2020)

A little bathroom wall inspiration (in the form of creative writing) for the day. Fear nothing! :)

Fear nothing

Scala/Akka Typed problem: You want to see the proper way to shut down Akka actors.

Solution

There are two main ways to shut down Akka Typed actors:

  • Send them a “graceful shutdown” message, and let them shut themselves down by calling Behaviors.stopped

  • As a parent, stop a child actor with actorContext.stop(actorRef)

Scala/Akka problem: You know that an actor that “blocks” is bad for your system, so you want to create Akka Typed actors that don’t block.

Solution

With Akka Typed, the mantra is always, “Delegate, delegate, delegate.” It’s important that high-level actors delegate work to lower-level actors, so the high-level actors can be free to receive new messages and respond to them immediately.

God speaks to each of us as he makes us,
then walks with us silently out of the night.

These are the words we dimly hear:

You, sent out beyond your recall,
go to the limits of your longing.
Embody me.

Flare up like a flame
and make big shadows I can move in.

Let everything happen to you: beauty and terror.
Just keep going. No feeling is final.

Don’t let yourself lose me.

Nearby is the country they call life.
You will know it by its seriousness.

Give me your hand.

~ Irrfan Khan, 1967-2020

Mast cell disease is a blast (I say facetiously). Two days ago I bought a Chicago-style pizza, and since then I’ve had six slices of the pizza. Today, after a second glass of a “Simply Watermelon” drink, I decided to take a break from work. I had been sitting behind the computer and knew I was feeling drowsy, but when I tried to stand up I realized just how bad things were. As I tried to stand up my legs starting shaking as if I barely had enough muscular strength to stand. In fact, I didn’t, so I crawled to the bathroom to take my mast cell “rescue” drugs.

For some reason other people with mast cell disease get itchy and have hives as their first reaction, but my body’s first reaction is often syncopy and pre-syncope — passing out. After I took the rescue drugs I laid down for a while, and eventually felt much better when they kicked in.

I spent a little time working on the Scala Book recently, and came up with this new cover design. I’d like it be a little lighter, but at the moment I don’t like it when it’s white on the bottom with black text.

A new cover for Scala Book

Though it might not be wise
I’d still have to try
With all the love I have inside
I can’t deny

I just can’t let it die
’Cause her heart’s just like mine
She holds her pain inside

So if you ask me why
She wouldn’t say goodbye
I know somewhere inside

There is a special light
Still shining bright
And even on the darkest night
She can’t deny

So if she’s somewhere near me
I hope to God she hears me
There’s no one else
Could ever make me feel
I’m so alive

I hoped she’d never leave me
Please God you must believe me
I’ve searched the universe
And found myself
Within her eyes

~ This I Love, Guns N’ Roses

(This is an underrated song from the Chinese Democracy album, though I must say, if you really listen to it, you might end up depressed for about a week.)

This is an old article I wrote back in 2009, but hopefully it’s still relevant in 2020:

Today I’m going to ask you to put yourself in the position of someone that needs to hire someone to do whatever it is you do. Completely imagine that you are this person. For instance, I design software systems, and I usually sell my services to other IT people, so I’ll put myself in the shoes of an IT Manager, or a Project Manager who needs an architect like myself.

Putting myself in their shoes, I have a good feel for all the technical skills I think an architect needs. After a lot of legwork, I finally finish interviews with two different people, and their technical skill sets are so good and so close I can’t tell the difference between them — they’re technical twins!

This is a photo of some nurses in Denver, Colorado, blocking anti-lockdown protests. The image comes from this Twitter page.

Nurses in Denver, Colorado, blocking anti-lockdown protests

Back in 2016 I heard that Paxton Lynch scored 18 on his Wonderlic test, so I took a short version of the test, just ten questions. (I’ve only had nine hours of sleep the last two nights, that’s all I’ve got.) Without any practice or even knowing what to expect, I scored a 70 (woo-hoo).

I might have done better, but I ran out of time and didn’t get to the last two questions because I didn’t initially know that there was a time limit on the test. I’d like to think I would have done better when I was 22 years old because a lot of questions seem geared to people who have just studied specific things in high school and college.

My Wonderlic test score

This lesson about “The Middle Way” is a favorite short story from the book, Zen Master Raven.

The Middle Way

How to stop time, travel in time, escape time ... the image is from this Pinterest page.

How to stop time, travel in time, escape time ...

In the last post about Mary Rose Cook, the reason I originally found her work again today is because she wrote a Little Lisp interpreter in JavaScript. (116 lines of code.) As shown in the image, the beginning of the article is a very quick introduction to Lisp.

Little Lisp interpreter