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

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

“Two Math for Dummies” books, from bizarro.com. :)

Math for Dummies

SALE: I’ve lowered the price of the PDF version of Functional Programming, Simplified to $20 for the 2019 holiday season. I don’t know when I’ll increase it again, but the usual selling price is as high as $35.

I like these Zen dog garden sculptures and I’d buy them for friends, but I learned a few years ago not to give gifts that might be construed as being religious. The same company also has cats, frogs, and turtles.

Zen dog garden sculptures

Expectations lead to suffering. :)

Buddha says expectations lead to suffering (Haven)