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

I’m not sure what the proper term for this is, but there is (was) a glacier on the other side of this mountain in Seward, Alaska, and the resulting “cloud” came pouring in over the mountaintop one day when I was there.

Clouds pouring over a mountain

Scala FAQ: Can you use a question mark to end a Scala method name?

Answer: Yes, you can. Just use an underscore character before the question mark. For instance, here’s a method named alive_?:

def alive_? = true

Another possible approach you can use is to use backtick characters around the method name, without using an underscore...

Doctor: This isn’t the type of cancer where we tell you to go fishing.

Me: Phew, that’s great to hear, because I really don’t like fishing.

This is a photo of a day tour boat in Resurrection Bay, Seward, Alaska

Tour boat, Resurrection Bay, Seward, Alaska

Here are some of the lyrics from one last Sully Erna song today, this one named Seven Years:

If there was no tomorrow
Would you still remain the same?
Or live your life so shallow
And take it for granted everyday?

So take away tomorrow
And tell me again why we blame
Why we waste all our time
When time may not wait another day

So again, years go by
So many tears I cried

Now that we’re through
I’ll still honor you
And harmlessly swallow my pride

It’s time to fall away
It’s time to separate
And maybe we’ll be alright
Seven years gone by

For seven years
I’ve tried to make it
But how long can I take it
It’s time to fly
Seven years gone by

If there was no tomorrow
Would you still retain all your hate?
Or live your life with no one to spite
And free your spirit again

Here’s another beautiful “unplugged” song from Sully Erna, this one is named My Light. A few lyrics:

You always bring me light
And you help me find my way
A gentle kiss goodnight
Is the innocence I crave

Here I am
Humbled and amazed
This beautiful little miracle of life
Was gifted to me

And here I am
I never thought I’d say
If ever I could live my life again
I’d live it your way

You’ve always brought me life
And you’ve helped me find my way
A simple kiss goodnight
Is the innocence I crave

Under the light you shine on me
I promise I will be there for you baby
I’d never wanna leave you anyway
You’ve become my light

I cross my heart that’s in your hands
With hope that you will always be my best friend
I promise I will be there ’til the end
You’ve become my light

Under the light you shine on me
I promise I will be there for you baby
I’d never wanna leave you anyway
You’ve become my light

I cross my heart that’s in your hands
With hope that you will always be my best friend
I promise I will be there ’til the end
You’ve become my light

You’ve become my light
You’ve become my light ...

I’m a fan of many Godsmack songs, and this is their lead singer, Sully Erna, playing piano and singing a beautiful song named Until Then. (With Irina Chirkova playing the cello.) A few lyrics:

Watching you run through my head
I’m alone again, but not for long my friend

We face another day
And distance has come and taken you far away again
But I’ll see you soon my friend
And then I’ll sing you my song

I can’t go home alone again
No I can’t
My friend
Until then

Eyes, I recognize
Taking me back
Familiar to me from some other time
Or maybe another life

Remember our times, and know who I am
The memory stays, until we can breathe as one again
And I’m coming back my friend
And then I’ll sing you my song

And I can’t go home alone again
No I can’t go home all alone again
No I can’t go home all alone again
No I can’t
My friend
Until then

“Every wall is a door.”

~ Ralph Waldo Emerson (also, the Kool-Aid Man)

The name Homer on The OA reminded me that my uncle was named Elmer, but we knew him as Uncle Mousey. He was a famous jazz drummer, and he called everyone Cat or Cool Cat. When he visited, my dad made him smoke his special, hand-rolled cigarettes outside (and often joined him). Here’s a short video of him on the drums with some other cool cats. :)

(Men in the Alexander clan don’t live long. He passed away at 66, my dad died younger than that, and their other brother — who was a favorite cool cat — died in his 40s. I assume complications related to mast cell disease was involved in there.)

This is the Index entry for recursion in the third edition of Programming in Scala. :)

Recursion - see recursion (index entry)
Table of Contents1 - Sample data2 - From match expressions to higher-order functions3 - Notes4 - Resources5 - Comments

I originally wrote a long introduction to this article about Scala Options, but I decided to keep that introduction for a future second article in this series. 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

This page contains a list of my favorite “mindfulness reminder” quotes. In particular these are short, concise quotes that I think work well with my “Just Be” mobile app.

Just Be is currently an app for Android users. If you haven’t seen it before, this is what the reminders/notifications look like when you receive them on an Android phone or tablet:

Kotlin FAQ: How do I iterate over a Map in Kotlin?

Solution: Here’s an example of how to iterate over a Map in Kotlin using a for loop:

val map = mapOf("a" to 1, "b" to 2, "c" to 3)

for ((k,v) in map) {
    println("value of $k is $v")

Intelligence is something we are born with. Thinking is a skill that must be learned.”

~ Edward de Bono

April 24, 2015: I don’t know how you spend your mornings, but these days I spend 40 minutes each morning administering intravenous medicine to myself via a PICC Line that has been inserted/installed in my arm and chest. You can read about the whole experience in my diverticulitis diary if you’d like.

(April 24, 2017: Today marks the 11th consecutive month that I haven’t required a trip to the ER, which is pretty much a record for my last four years.)

PICC Line in my arm

“You have to let go when you leave the physical plane. When I was guiding psychedelic trips, people would bad-trip because they couldn’t let go as their consciousness expanded and they faced eternity. You have to let go of your individuality, your name, your history, your friends, your cat, your body. That letting go is meeting the infinite. A conscious being holds on nowhere.”

~ Ram Dass

Hey, waitress, pour me another cup of coffee,
Pop it down, jack me up, shoot me out, flyin’ down the highway,
Lookin’ for the mornin’ ...

~ Drivin’ My Life Away, Eddie Rabbitt

One thing about being named Alvin Alexander is that I’ve been called Al, Alvin, Alex, and Alexander by various people lately. I don’t mind any of them, but I laugh at Alex because I used that as a fake name when I traveled to Alaska in 2007 and 2010. (I was also known as Ken in Alaska.)

One thing about specifically being named Alvin is that when people are happy with me they call me Al, and when they’re unhappy they tend to yell, “Alvin!” I don’t know if that’s just a chipmunk thing or if everyone with a multi-syllable first name goes through it, but I’ve noticed that as well.

Famed programmer Joe Armstrong passed away this weekend. He created the Erlang programming language, based on the actor model, and without using Google, I’m pretty darned sure that Erlang had an impact on Akka, the very cool actor library for Scala. Here’s an article Mr. Armstrong wrote some years ago, titled, Why OO Sucks (OO as in OOP).

Because functional programming is like algebra, there are no null values or exceptions. But of course you can still have exceptions when you try to access servers that are down or files that are missing, so what can you do? This lesson demonstrates the techniques of functional error handling in Scala.