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

January 28, 2020: In a dream this morning a bunch of people came into my apartment uninvited. All but one of them were maintenance people, and they started renovating my apartment. I argued with them that a little notice would have been nice.

While that was going on, I saw that the other person was a Tibetan monk. While the maintenance people started drilling and cutting, the monk walked around breaking all of my things. He’d pick up a glass thing and let it drop to the floor and break, and work harder to break other things. I ran over to him and asked, “Why are you breaking all of my things?”

He didn’t reply, but broke some DVDs in his hands. For some reason this made me more lucid in the dream, so I stepped on some of the DVDs he had dropped to the floor so I could crunch them more. “I get it,” I said, “it’s the whole ‘impermanence’ thing, right?” Then I thought of something and said, “Stay right here for a moment. Break something if you need to, but I’ll be right back.”

Then I went over to my DVD collection and grabbed my Dalai Lama video collection. I went back to the monk, handed him the DVDs, and said, “Here, you can break these, too. Or watch them. I don’t care.” Then I remembered that my tv started on fire when the maintenance people did something, but it didn’t matter, he took the DVDs and sat down silently.

Adam Warski shared code similar to this image during his video titled “Why Scala?”:

Adam Warski flatMap example and anonymous function with case statements

(To see his exact code, see that video.)

allStreets, flatMap, case statements, and function literals

Now he walks in quiet solitude
The forest and the streams
Seeking grace
In every step he takes
His sight is turned inside himself
To try and understand

~ John Denver

Snow on the Rocky Mountains (and John Denver lyrics)

I will continue to be.
But you have to be very attentive to see me.
I will be a flower or a leaf.
I will be in those forms and I will say hello to you.
If you are attentive enough, you will recognize me, and you may greet me.
I will be very happy about it.

This article contains a collection of quotes on industrial design from former Apple chief designer Jonathan Ive (or “Jony Ive,” as Steve Jobs called him). As an interesting note, Mr. Ive prefers to refer to himself as a “builder” or “maker” as opposed to a designer.

For those who don’t know of him, Jonathan Ive is credited with designing almost every Apple product from 1997 until roughly 2020. I (re)discovered Apple with an iPod in 2004, and given that very long string of success, I became interested in what Mr. Ive has to say about design, and to that end, here’s a collection of Jonathan Ive design interview quotes I’ve gathered over the last few years.

I really like this quote about “paying attention as if your life depends on it.” One night last spring I laid in bed, unable to move because of severe pain in my chest. Any time I tried to move the pain got worse, so I laid as still as possible. I was laying on my right side, looking at a bedside table, and all I could do was breathe and look at that table, what was on the table, and see the light coming in from outside. At the time I was going through tests to see if there was a hole in my heart, and at that moment I thought I was going to die, so I can tell you, I’ve never ever focused on my breath like I did at that time. I kept that state of mind until I passed out.

This quote comes from a book titled, “Mindfulness for Beginners,” by Jon Kabat-Zinn.

Pay attention as if your life depends on it

If you ever wanted to see the Ammonite REPL and ZIO, Option, Try, Either, Future in a Scala for-expression, here you go.

Ammonite REPL and ZIO, Option, Try, Either, Future in a Scala for-expression

As a note to self, while working on my “Generate the Table Of Contents code for this website,” I just needed to do create some “nested DIV” content using Jsoup, Scala 3, and Scala-CLI, and with the help of ChatGPT, I came up with this working code:

As a little note today, if you want to create a little startup file for the Scala Ammonite REPL, the way you do that is to create or edit this file:

~/.Ammonite/predef.sc

My free “Introduction to Functional Programming” video course is almost complete. Today I released 12 new lessons, starting with for Loops, Generators, and Guards, and ending with Lessons Learned.

After this there are about five final lessons (depending on what I decide to include), and by the end of the course we’ll start writing some ZIO code.

As always, many thanks to Ziverge’s Scala and Rust consulting services for sponsoring the creation of these “100% Free” videos, with no ads and no firewalls!

I can’t find the original source of this image and product, but I have always liked the “Live Brave” saying, which I first heard on the excellent Eli Stone tv series (which stars Johnny Lee Miller, who may be more well known for the movie Hackers and of course, Elementary).

Live Brave bracelet

Hello Peter, this is me ... your father ... Walter Bishop. (From one of my favorite tv series)

Hello Peter, this is me ... your father ... Walter Bishop.

As I continue to work through photos, this is a photo of a painting of a church, which I believe I saw in the lobby of the La Fonda hotel in Santa Fe, New Mexico.

Painting of a church, La Fonda hotel, Santa Fe, NM

Sunrise at Virginia Beach, April 9, 2017. No filters have been applied, this is what it looked like. :)

Ocean sunrise

Sled dogs, from the start of the 2011 Iditarod, on the lake in Willow, Alaska. (I took this photo that day.)

Sled dogs, from the 2011 Iditarod, Willow, Alaska

Always trust pure functions, they cannot lie. :)

I was going to add this to my free Thinking With Types booklet, but alas, it did not make the cut.

Always trust pure functions, they cannot lie

I’m pleased to report that Learn Functional Programming The Fast Way! was recently rated as a #1 best-selling computer programming and functional programming book. You can’t ask for much more than being a best-selling book in the entire computer programming category. :)

Best-selling computer programming and functional programming book

Despite the whole Santa Fe bedbug experience at the Sage Hotel, I still love Santa Fe, and the best restaurant I know there on an “average American income budget” is the Plaza Cafe in the downtown plaza area.

Functional Programming, Simplified — currently 5-star rated on Gumroad.com, 4.5-star rated on Amazon, and one of the all-time best-selling books on functional programming — is currently on sale in three formats (prices shown in USD):

PDF Format
$15 on Gumroad.com

PDF version of Functional Programming, Simplified

Paperback Book
Now $29.99 on Amazon

Print version of Functional Programming, Simplified

Kindle eBook
$14.99 on Amazon

Kindle version of Functional Programming, Simplified

MARCH, 2023: This book was previously named, Learn Functional Programming Without Fear, but I have renamed it to Learn Functional Programming The Fast Way. I think this name is more reflective of the ZIO and Cats Effect libraries being easier to learn than ever before (without having to know category theory), and the name is also consistent with my other book, Learn Scala 3 The Fast Way.

NOV., 2022: My new book, Learn Functional Programming Without Fear, is currently an Amazon Java and functional programming #1 new release. The book is now available in three formats:

PDF Format
$10 (USD) on Gumroad.com

Learn Functional Programming The Fast Way! (PDF Version)

Paperback
$30 on Amazon

Learn Functional Programming The Fast Way (Paperback)

Kindle
$10 on Amazon

Learn Functional Programming The Fast Way! (Kindle Edition)