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

Back in the day I had a concussion, and for a year or two afterwards I was able to open my physical eyes while I was asleep. Sometimes I could just do that intentionally — I would plan to do it — and other times it happened by accident, as in the case shown in this image.

Opening my physical eyes during a dream

[toc]

This page is my personal “cheat sheet” of stock market, investing, and business/accounting definitions. I don’t offer many explanations of things, but I generally link to the Investopedia and other sites for more details.

As a brief note today, I just wrote a Scala collect function for my free Scala video training courses, and wrote it as shown in this code:

Maybe someday I’ll learn to paint, but until then, I’ll keep creating images like this one, made from Silas in The Da Vinci Code.

“Is that a dagger or a crucifix I see?” ~ Blood of Eden, by Peter Gabriel

Faux painting of Silas, from The Da Vinci Code

Since I’ve written two functional programming (FP) books, I thought it might help to provide a comparison of them.

The short story is that both FP books have “limited technical jargon,” and as shown, The Little FP Book essentially has one purpose, which is to help Java/Kotlin/OOP developers learn functional programming as fast as possible, using a technique that I “discovered” over the last few years. Conversely, The Big FP Book covers many topics in great detail.

If you’re interested in more details, here are links to the two books:

Functional programming books, comparison

I’m not sure how many people can understand this, but once you’ve been through nine syncope events (and dozens of other pre-syncope events), and four cardiac events (“fake heart attacks”, also known as allergic angina), and a five-month heart infection (pericarditis), you just accept that death is going to happen, and it’s not in your control. So, personally, I just try to be grateful, and hopefully help others along the way, because I know that my time here is limited.

If I have died, please call ...

September, 2018: Before doctors figured out that I have a rare blood disease called Mast Cell Activation Syndrome (MCAS), I went unconscious nine times, typically vomiting while I was unconscious. The first three went like this:

  • During the first event I was stumbling around my apartment like I had been poisoned, splashing cold water on my face, and generally just trying not to die. Despite my efforts, I went unconscious. I only knew that because I threw up on the floor while I was out.
  • At the beginning of the second event I thought, “If I live through this one, I need to update my will.”
  • During the third event I thought, “Apparently I’m going to die soon. I just want other people to be happy, and if I live, I want to help them however I can.”

After that, for events #4 through #9, along with four subsequent cases of allergic angina — what I call “fake heart attacks” — I had no significant thoughts in my mind, just peace.

These days when something bad happens I recall those nine syncope events and four heart/cardiac events, and know that I could have died during any of them. When I think that way, all of today’s little problems seem insignificant.

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)

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

This is an excerpt from the Scala Cookbook, 2nd Edition. This is Recipe 24.7, Building Modular Systems with Scala 3.

Problem

You’re familiar with Martin Odersky’s statement that Scala developers should use “functions for the logic, and objects for the modularity,” so you want to know how to build modules in Scala.

The following paragraphs are a quote from Peter Gabriel, discussing a moment of “enlightenment” that reminds me of the movie V for Vendetta:

I was doing some gigs in Germany with Frank Zappa ... we were supporting Frank Zappa. And his audience in Berlin were very much old hardcore hippies, and they thought I was just cheap shit, and the boos was just ... this rain of stuff being thrown on the stage. It was very humbling.

Next night we’re in another German city and I thought, “Oh shit, here we go”, and we go out there again, and a similar sort of reaction, they hate it. But it wasn’t just the music, it was me, personally, you know, they meant it.

And suddenly I had one of those moments and I thought, “That’s it, I’m no longer afraid.

You know the thing you’re most scared of when you get on stage is being rejected and booed off, and I suddenly realized I’d been booed off and I was still out there. They didn’t like it any more, but I was still doing it, and they couldn’t stop me.

And I just started giggling. And Tony Levin looked over like I’d gone crazy. But it was a fantastic moment of enlightenment.

One of my uncles was Mousey Alexander. I didn’t know him very well, only meeting him a few times that I can recall. The most I remember about him was (a) watching him play drums at a jazz club in Chicago one time when I was young, and also (b) spending a little time with him on a vacation in New York. (In particular I remember going fishing with him and my dad in New York. We caught something like 40 small fish in an hour or two. Every time we dropped a line in the water we caught a fish in a matter of moments.) I also remembered that he called a lot of people “cat” or a “cool cat.”

I was told that he played on the Johnny Carson show and also played at The White House. I think he’s most well known for playing with Benny Goodman and Clark Terry. If you’re interested you can read more about him at that Wikipedia link, and thanks to YouTube you can also find some of his performances there as well, including this Doc Severinsen “Airmail Special.”

Mousey Alexander - The Mouse Roars

January, 2017: I was laying in bed last night, waiting to fall asleep, and the power went out. As I laid there thinking about how cold it would get, a gray telephone we had many years ago began ringing in the closet. I wondered what it was doing in there.

Instantly the scenery changed and I flashed back to an event I didn’t know about twelve years ago. As I observed it, it made me sad.

Then I kept going back in time, first to one event and then another.

Many years ago I was traveling and stopped at a donut shop in a small town. A young woman was working behind the counter, and I noticed that she had a tattoo of words on her left arm, but the words were upside down to me.

There was nobody else there at the time, so I said something like, “May I ask about your tattoo? It looks interesting.” I’m always fascinated by tattoos, because I assume they’re an expression of a person’s personality.

She moved her arm around so I could see the words, and explained that she gets nervous and panics a bit at times, like when the store gets busy. So at the store she’ll take someone’s order, then turn around like she’s getting the donuts, but look at her arm and read the words to herself as a way to calm down (like reminding oneself of a mantra).

I always thought that was smart, and I think of it myself when my own life gets hectic.

“A Yogi is one who has union with the supreme consciousness.”
~ Yogi Bhajan

“Samadhi is the culmination of yoga; it is a state of bliss and union with the universal spirit.”
~ B.K.S. Iyengar

“Seeing into one’s own nature is the goal of Zen.”
~ Thich Nhat Hanh

Back in March, 2010, I drove up to Alaska. This is the office of a little motel in Canada ... at the moment I can’t remember the name of the town, but I know where to find it. :)

Cute motel in Canada in the winter

I haven’t been back to Alaska in a long time now, but this is what the movie theater in Homer, Alaska looked like the last time I was there.

The movie theater in Homer, Alaska

Once upon a time, a black bear walked into the Breeze Inn in Seward, Alaska and was enjoying the view of the big glass windows ... but was encouraged to leave.

Bear walks into the Breeze Inn, Seward, Alaska

In honor of Rare Disease Day (February 28th), here’s  a today.com story about a woman who has a more severe form of the illness/disease I have. A few quotes:

“Johanna Watkins, 30, is allergic to almost everything and everyone, including her husband Scott, 29. She’s been diagnosed with mast cell activation syndrome, a rare and progressive immunological condition.”

“She has a list of 15 foods she can eat and that’s it. Even those foods make her feel ill, it’s just that they don’t kill her. She’s eaten the same two meals for two years.”

Update: In 2016 Johanna wrote this article, What I’ve learned being isolated and allergic to everything.

(The image is from the today.com story.)

Rare disease makes woman allergic to everything, including her husband

This is a terrific photo of the Flying Squirrel Bakery Cafe in Talkeetna, Alaska. The photo comes from this Facebook page, and their website is flyingsquirrelcafe.com.

Entrance to the Flying Squirrel Bakery Cafe in Talkeetna, Alaska