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

Mike (Pastor/Lawyer): Why’d you want to see me?

Sam (Prisoner): Papa told me you were a spiritual man, and that we need to help each other.

Mike: Help each other? Well ... you’re the one in jail.

Sam: [laughs] Well, there’s all kinds of jails. One of the worst is the prison of wrong thoughts. I was locked up there for many years until I found the key and opened the door.

(from the movie Mountain Top)

Today’s song of the day is, Can You Read My Mind, from the 1978 Superman movie.

There may be better ways to do this, but when I was writing a mobile app, with the JavaScript client written in Sencha Touch and the server written with the Play Framework, I wrote some curl scripts to simulate GET, POST, DELETE, and PUT request (method) calls to my Play Framework REST/RESTful web services.

Today’s song of the day is Sinner’s Prayer, by Godsmack’s Sully Erna.

“You’ve got a new face, new fingerprints, a new name. A lot of thought went into it.”

~ a little humor for those in the know

The name Remo Williams

It’s just another day in paradise
As you stumble to your bed
You’d give anything to silence
Those voices ringing in your head
You thought you could find happiness
You thought you would be satisfied
But you never will —
Learn to be still

~ from The Eagles song, Learn To Be Still

“They can be a great people, Kal-El, they wish to be. They only lack the light to show the way. For this reason above all, their capacity for good, I have sent them you, my only son.”

~ Jor-El, the first Superman movie

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:

Lie
Awake
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
Table of Contents1 - Effects are related to monads2 - Not a side effect, but the main effect3 - Effectful functions return F[A] rather than [A]4 - Summary5 - Notes

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 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: