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

A Machine Learning Bestseller
Introduction to
Machine Learning
with Python

If you ever wondered what the theme song is from The Dead Zone tv series, it’s a song called New Year’s Prayer, by Jeff Buckley.

I haven’t looked into it, but somehow the song New Year’s Prayer was released on an album almost a year to the date after Mr. Buckley died, drowning in the Misssissippi River.

Per this tweet, back on May 15 Martin Odersky shared a slide with these contents:

The essence of Scala: Fusion of functional and object-oriented programming in a typed setting:

- Functions for the logic
- Objects for the modularity

When you get started with functional programming (FP) a common question you’ll have is, “What is an effect in functional programming?” You’ll hear advanced FPers use the words effects and effectful, but it can be hard to find a definition of what these terms mean.

This is a photo of the rubber duck, Mr. Bubble bath soap, and bathtub at the Talkeetna Roadhouse in Talkeetna, Alaska. I stayed there several times, but I’ll guess this was from the fall of 2010.

The rubber duck at the Talkeetna Roadhouse

As I was sitting in my favorite coffee shop in Seward this afternoon, a dog walked in the back door and just stood there, looking at everyone. The owner tells me he was looking for a good poker game. ;)

~ photo from Seward, Alaska, February 25, 2011

A dog walks into a coffee shop

I originally wrote a long introduction to this article about how to work with the Scala Option/Some/None classes, but I decided to keep that introduction for a future article. For this article I’ll just say:

  • idiomatic Scala code involves never using null values
  • because you never use nulls, it’s important for you to become an expert at using Option, Some, and None
  • initially you may want to use match expressions to handle Option values
  • as you become more proficient with Scala and Options, you’ll find that match expressions tend to be verbose
  • becoming proficient with higher-order functions (HOFs) like map, filter, fold, and many others are the cure for that verbosity

Given that background, the purpose of this article is to show how to use HOFs rather than match expressions when working with Option values.

A cartoonized bearded version of me, circa 2021.

Cartoon, bearded me

This is me with a mustache, circa early 2021. I had this mustache for a few minutes when I shaved off my beard. Hopefully I look like a cowboy, lol. :)

Me, with a mustache, black and white

Today (February 19th) is an anniversary for me. After knowing “something” was wrong for a long time — I used to tell doctors it felt like I had been poisoned or was experiencing the symptoms of anaphylaxis or sepsis — I went unconscious for the first time on this date in 2014.

While that in many ways was a horrible event — if I had fallen to the right instead of the left when I blacked out, I probably would have cracked my head on the bathtub and died right then — in the end it was necessary for doctors (and I) to take things more seriously, which resulted in seeing a total of 26 doctors to learn that I have MCAS, a rare but treatable non-contagious blood disease (something I was born with).

I’ve gotten back into creating faux paintings again recently, and this is one of Silas, from The Da Vinci Code.

Faux painting of Silas, from The Da Vinci Code

This is THE speed limit sign on the Dalton Highway in Alaska. If I remember right, this is the only speed limit sign you’ll see when headed north from Fairbanks heading towards Prudhoe Bay.

I started off driving about 50 mph, but then after realizing I was the only person on the road — an almost-entirely entirely dirt road — I drove as fast as conditions allowed, typically a little over 90 mph.

The speed limit sign on the Dalton Highway, Alaska

Last week I was trying to remember the name of a hotel in Wyoming that has/had a big boot in front of it. Then Google came up with an interesting suggestion. :)

Wyoming big booty hotel

Let it be known that on February 17, 2021, I finished writing the last chapter of the Scala Cookbook, 2nd Edition. Everything from here on out is editing and verifying the rest of the content.

Scala FAQ: Where are Coursier files stored on macOS?

Solution: The files Coursier downloads are located under this directory on macOS:

~/Library/Caches/Coursier

More specifically, in early 2021 they’re located under this directory:

~/Library/Caches/Coursier/v1

In a related note, this is my current JAVA_HOME, via Coursier:

/Users/al/Library/Caches/Coursier/jvm/adopt@1.11.0-9/Contents/Home

See the Coursier docs for more information.

At $50 or $60, I know the Scala Cookbook, 2nd Edition — estimated at 700+ pages — is expensive. But if it helps to know it, I’ve been working on one recipe for three days. And this isn’t the only one. Asking questions on Gitter channels, the Contributors website, testing and reporting bugs for developers, digging through code. All so you don’t have to. ;)

TIL that you can import/load a JAR file into the Ammonite REPL using this command:

import $cp.foo.`simpletest_3.0.0-0.2.0.jar`

During a dream this morning, I was going off to college and my wife’s grandparents gave us a stack of papers, thinking I could use them at school. The papers were all like plain printing paper, and most were clean, but some of them had things written or printed on the back side. They were big on using everything, so the implication was that I could use the blank side for my needs.

When I flipped one of the pages over I saw that there was writing in my grandfather’s handwriting. It was like a diary page, with today’s date on it (with a different year), and it had two notes about his wife. The first was, “Take care of you Dilly,” meaning that he would take care of her. The second was, “Seriously, I think that was the best meal you have ever made.”

~ February 16, 2021

Traditionally I’ve spent a number of springs in Virginia Beach.

#MeepMeep

Virginia Beach or bust?

The tv series Becker was one of my favorites back in the day, and I always wondered why it wasn’t available on DVD. I just looked, and it’s now available at Amazon, just released in 2018.

A favorite episode that helped me snap out of a personal funk was when Becker finally got to be with his long-lost love, a woman he pined for for many years. When he finally had a chance to reunite with her it turned out she was wild and crazy, ran up his credit card bill, then took off. In its own way, that episode helped me get over someone I felt the same way about.

Becker TV series now on DVD
A Machine Learning Bestseller
Introduction to
Machine Learning
with Python