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

In Scala, Nothing is a bottom type, which means it is a subtype of every other type in the type system. It represents a data type that has no instances.

Essentially, Nothing is used to indicate that a computation or function will never produce a result normally, either because it throws an exception, enters an infinite loop, or encounters some other abnormal termination.

Visually, this is what the Nothing type looks like in the Scala type hierarchy (image courtesy of this scala-lang.org page):

The Scala type hierarchy and the Nothing data type

Scala: Common uses of Nothing

Some common use cases of Nothing include:

March 16, 2024: As a brief note today, I recently started using Ezoic for the ads on this website, and so far my revenue is much greater than it was with Google AdSense. My ad revenue has increased 100%, maybe more.

For a long time I was afraid to switch to another company besides AdSense because I had not heard of Ezoic and others, but after several weeks on their platform, all is well.

I should also say that I was very busy, and I thought that “making the switch” might take a while, but if you have existing AdSense and Analytics accounts, it doesn’t seem to take too long. The actual time I spent on a computer to make the changes was probably about 4-8 hours overall, but in calendar time it took a few days because of the AdSense and Analytics integration (waiting), and a few other configuration things I had to wait for. (So, several days in calendar time, but 4-8 hours in actual time.)

A few days ago I found this black paint that “turns any surface into a chalkboard.” I’ve been painting the backs of some cheap cabinets, whose backs are now exposed after I moved some furniture around. If you know me, you know I like to have surfaces I can write on. :)

Black paint that "turns any surface into a chalkboard"

As the caption says, Margaret Hamilton, Apollo flight software designer, stands next to a tall stack of software code that was printed out, circa 1969. Image from this Twitter page.

Update: There’s more about Margaret Hamilton on this vox.com page.

Margaret Hamilton, Apollo software designer, next to her code

Per the BoulderCast website, these are the largest snowstorms in the history of Boulder, Colorado.

Boulder, Colorado: Largest snowstorms in history

[toc]

Scala math FAQ: How do I square a number in Scala, such as squaring an Int, Double, Long, or Float?

Solution

You can square a number in Scala in at least two different ways:

  1. Multiply the number by itself
  2. Call the Java Math.pow function or the scala.math.pow function

These are some old notes from my meditation practice about “The purpose of mindfulness,” or, stated another way, “Why bother being mindful?”

The purposes of mindfulness

As far as I can tell, mindfulness has these purposes:

This is a photo of the Shiloh Missionary Baptist Church, in Palmer, Alaska. It used to be on my bike-riding path when I lived in Palmer.

Shiloh Missionary Baptist Church, Palmer, Alaska

This is part of a little log cabin church that used to be on my walking/biking path in Palmer, Alaska.

Little log cabin church in Palmer, Alaska

Dateline, 2015: 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 and shining on the table.

Pay attention as if your life depends on it

I didn’t get to spend much time with her, but I met Kate Johnson at the 2013 Buddhist Geeks Conference and she seemed like a very nice person. I love this quote: “Activism is the rent I pay for living on the planet,” which originally comes from Alice Walker. There’s a little story about Kate Johnson here on LionsRoar.com.

Activism is the rent I pay for living on this planet

I don’t mean to brag, but if you have the mug ...

Alaska stud muffin (coffee mug)

I saw Ender’s Game at the movie theater and thought it was a good movie, but given its dark nature I never expected to watch it again. But after buying a new television — my previous tv was smaller than my iMac, and so old that it didn’t have any HDMI or USB connections — I saw the movie marked down to $5, and it now has the distinction of being the first movie I watched on the new tv. Kudos to Asa Butterfield (probably 15 years of age at the time the movie was made), he pretty much carries the entire movie, with a little help from Harrison Ford and a few others.

Ender’s Game

This is a favorite “gratitude” quote that I keep in my Just Be “mindfulness reminder” app.

A favorite 'mindfulness reminder' quote

How big is your data? This slide comes from this Twitter page.

How big is your data?

“There is nothing intrinsically problematic about this ordinary perspective. The problem comes when it is the only perspective available to a person, which unfortunately is the usual case.

Enlightenment, or freedom, comes when we also have a complementary perspective that we can access at any time. To have this complementary perspective, we must come into direct contact with the third level of consciousness, the Source.

When we are in direct contact with the Source, self is not perceived as a separate particle, objects are not perceived as solid, and space becomes elastic and can collapse to a dimensionless point, taking everything with it to the Unborn. And time is cyclic — self and scene arise from and return to that unborn Source over and over.

“In the beginning, meditation is something that happens within your day. Eventually, the day becomes something that happens within your meditation.”

~ From “The Science of Enlightenment: How Meditation Works

When I first learned about Scala I lived in Talkeetna, Alaska, population ~876 (in the summer). Talkeetna is mostly known as a base for expeditions to Denali, and for possibly inspiring the excellent tv series, Northern Exposure. Some of my first Scala blog posts were written while sitting in this cafe. :)

The image shown comes from this Flying Squirrel Bakery Cafe Facebook page.

The Flying Squirrel Bakery Cafe, and Bernie

Can you grow the size of your brain through meditation? This image comes from a story titled, “Mind of the Meditator,” in the latest issue of Scientific American.

Can you grow more brain?

If you’re looking for the Fringe episode with the song, “Seen All Good People”, by Yes, it’s the Season 2, Episode 4 episode named, “Momentum Deferred.” It’s just before the 20-minute mark of that episode. It’s the one where Walter starts playing the song, hits the table, and Peter starts putting the wires on Rebecca Kibner (Theresa Russell).