Alvin Alexander | Java, Scala, Unix, Perl, Mac OS X

“Okay, well, here’s my story, here’s what you need to know. I’m just divorced and I had my heart broken badly by a woman that I really loved. But I think your heart grows back bigger. You know? Once you get the shit beat out of you, and the universe lets your heart expand that way. And I think that’s the function of all this pain and heartache that we all go through, you know, you gotta go through that to come out to a better place and that’s how I see it, anyway.”

One of the many great quotes from my favorite movie of the now, Must Love Dogs.

My book, Functional Programming, Simplified — 4.5-star rated on Amazon — is available in three formats:

PDF Format
$22 on Gumroad.com
(sale price)

PDF version of Functional Programming, Simplified

Paperback Book
$39.99 on Amazon
 

Print version of Functional Programming, Simplified

Kindle eBook
$24.99 on Amazon
 

Kindle version of Functional Programming, Simplified

November 29, 2019: A few days ago I made the PDF version of “Hello, Scala” free, and today I made the paperback version of “Hello, Scala” available again, and reduced it’s price from $20 to just $10. Click the image below to buy the book on Amazon.

As I’ve noted before, the contents of this book are being updated and improved, and in the future it will be available as Scala Book. The HTML version of those contents are currently available on the docs.scala-lang.org site.

In one of my ongoing dream series I’m a young man who works at a restaurant at night. Two nights ago I was working there when a female co-worker told me she bought a Christmas gift for me, and wanted to see if we could do a gift exchange. I hadn’t gotten her anything yet, so I said something like, “I, I ... I can’t do it right now because <insert excuse here>. How about tomorrow?”

After work I went out to buy something for her. “Think, think,” I said to myself, probing my dream memory, “what would be a nice gift?” Then I remembered that a few weeks ago she told me about something she always wanted when she was younger, so I went out and found that item, and wrapped it up.

Last night we exchanged gifts during a break at work. She opened hers first, and when she saw it she began to cry. “Uh-oh,” I thought, “now you’ve gone and made her cry. This might not be good.” But then she said it was beautiful and thoughtful, and said her gift to me was nothing compared to it.

Tonight I think I’m going to call in sick to work, or maybe just stay up all night and binge-watch Stranger Things.

A few people I’ve talked to recently who have (or had) cancer told me they can clearly remember the moment when their doctor told them that they had cancer.

In my case I do remember the conversation with the doctor, but that was more of a formality. When I picked up the phone to talk to her, I already had a pad of paper and a pencil in hand, and I was ready to write down the details she was going to tell me. Because in my case I was pretty certain that I had cancer when I saw the ultrasound results a few days earlier.

Until yesterday I only knew a little about a song called Alice’s Restaurant ... the end of it is the only part I remember. But yesterday I learned that it’s a story about some events that started on Thanksgiving Day, 1965. (You can find the story here on Wikipedia.)

It’s a long song — more of a funny story than a song — but here you go, Alice’s Restaurant, by Arlo Guthrie:

A friend introduced me to the movie Home for the Holidays many years ago, and it’s still the best Thanksgiving movie I know.

Home for the Holidays, the best Thanksgiving movie

The more I thought about it, the more I thought that the word pericarditis sounded familiar, so I searched an electronic diary I used to keep and found this entry from January 3, 2008:

“I don’t remember the whole dream, just the very end, where I woke up with the word ‘pericardium’ in my brain. There’s nothing too peculiar about this except for one detail: I don’t remember ever hearing that word before in my life.”

“Later in the morning I looked it up online to see if I made it up, and it is indeed a real word. Even cooler is that it’s related to the chest/heart, where my niece hit me. Wikipedia says it is ‘a double-walled sac that contains the heart and the roots of the great vessels.’”

“I'm not saying that I've never heard this word before, only that I can't consciously recall hearing it before, and I had to try several spellings before I got it right. What I’m saying is that my conscious mind didn’t know the word, but my dreaming mind did.”

The dreaming mind and subconscious in general fascinates me.

The Human Route, by Zen Master Seung Sahn, on a card from the people at DharmaCrafts.com.

The Human Route

This is a photo of a sign at the Mat-Su Regional hospital in Alaska back in 2010. A nurse there told me that if I could read it, I was healthy enough to go home. :)

A sign at the Mat-Su Regional hospital in Alaska

Last night I counted 17 dreams that happened or attempted to happen, and I know there were many more that I wasn’t lucid for. An interesting thing about being aware of my dreams is that I know how they affect me, i.e., whether they make me happy, sad, whatever. I always wonder if other people can’t remember their dreams, and if that’s where the saying “got out of the wrong side of the bed” comes from, meaning that they had a dream or series of dreams overnight that triggered them in a certain way.

I was about to get out of bed this morning when another dream started, so I let it play out to see what was going to happen. At first I was working with a man and a woman at some company, and we couldn’t figure out how something was supposed to work. Then the woman and I ended up making out in a car outside the building. After that, she and I were goofing around at some sort of amusement park. I was in a swimming pool, holding some sort of swim/water-related device I had just broken, and decided I had had enough of the dream, so I was about to wake myself up.

November 26, 2019: The PDF version of my book “Hello, Scala” is now free, and you can download it by clicking on the image below.

Future “updated and improved” versions of the book are being released as Scala Book. Currently an HTML version of the book is available here on the scala-lang.org website, and we’ll have PDF, MOBI, and ePub versions of that available once the creation process is automated and a few other issues are resolved.

But for now, click on the image below if you’d like to download the PDF of Hello, Scala for free:

Hello, Scala PDF

As a brief note today, if you need to read a binary file with Scala, here’s an approach I just tested and used. It uses the Java FileInputStream and BufferedInputStream classes:

Just fooling around a little bit at the moment, here are several ways to write for/do blocks with the “significant indentation” style in Dotty (Scala 3) as of Dotty v20:

“To be a programmer is to develop a carefully managed relationship with error. There’s no getting around it. You either make your accommodations with failure, or the work will become intolerable.”

~ Ellen Ullman (via this tweet)

This quote makes me think of all those years of exception-handling with Java. I never knew there was a better way to handle errors, so I developed a strategy of letting my exceptions bubble up to the controller level (as in model/view/controller), where I would deal with them. These days I know I can use Option/Some/None in Scala, as well as Try/Success/Failure.

I was talking to a doctor yesterday about Pericarditis and he said that one possible result could be catastrophic. I was well aware of that possibility, but I thought it was an unusual word for a doctor to use.

That being said, it does sound more powerful than you could die. A lot of people say, “You could die doing <fill in the blank>,” so maybe that phrase has lost some power, where “catastrophic” isn’t used that often to talk about one’s health.

Let it snow, let it snow, let it snow. These are the Colorado snowfall totals for the morning of November 26, 2019, with significantly more snow expected today. Image courtesy of this tweet by Troy Renck.

Colorado snowfall totals for the morning of November 26, 2019

If someday the Moon calls you by your name don’t be surprised, because every night I tell her about you.

~ Shahrazad al-Khalij

Cowabunga, me going to need more cookie dough.

~ Broomfield, Colorado, November 25, 2019 (Thanksgiving week)

Cowabunga, me going to need more cookie dough

Here’s some source code that demonstrates a quiet, concise, and attractive new programming language I’d enjoy using:

Scala 3 (Dotty), September 30, 2019