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

If you’re interested in a simple, pretty, instrumental song, Rain, by Simply Three might fit the bill. I especially like the little bicycle rider guy in the taxi cabi window.

Zachary: I ran into one of my brother’s work buddies, he introduced me to Tai Chi. It saved me.

Longmire: How so?

Zachary: I like to put it like this ... I went to church a lot as a kid, and we were always taught to love our enemies. Tai Chi taught me something new — to love the enemy inside me, as well. So I don’t look at peace as the absence of conflict any more. I see it as the acceptance of conflict.

(From the tv series Longmire)

This page contains a large collection of examples of how to use the Scala ArrayBuffer class.

Use the ArrayBuffer class when you want to use a general-purpose, mutable indexed sequence in your Scala applications:

I thought about writing a “functional programming in Kotlin” book, but I think that Kotlin and Scala are similar enough that Functional Programming, Simplified will be good for Kotlin programmers as well as Scala programmers.

August 15, 2011, Palmer, Alaska: I just got a flush letter from a local hospital. I guess I shouldn’t have put “You have my gallbladder” and “Your nurses seem really nice” as my top reasons for wanting to work there.

When using Scala, if you ever need to list the subdirectories in a directory, or the files under a directory, I hope this example is helpful:


object FileTests extends App {

    // list only the folders directly under this directory (does not recurse)
    val folders: Array[File] = (new File("/Users/al"))
        .filter(_.isDirectory)  //isFile to find files


If it helps to see it, a longer version of that solution looks like this:

I just learned that Warren Buffett’s shareholder letters can be found here in PDF format.

The first time I started to go back to work after moving to Colorado, I ended up with thyroid cancer. Then I went unconscious seven times, had two fake heart attacks, and eventually learned I have a rare blood disease that caused those problems and more. Then I had diverticulitis twice, possibly epiploic appendagitis several times more, and ended up having to have part of my colon removed. Come September I’m not going to look for work, I’m just going to be like Kramer and show up at someone’s office.

As a quick note, here’s an example of how to use the Kotlin sortedWith syntax with an anonymous function (lambda). Given this list of integers:

val list = listOf(7,3,5,9,1,3)

Here’s an example of how to use sortedWith using a Comparator and lambda:

“And when things got hard, you started looking for something to blame, like a big shadow. Let me tell you something you already know. The world ain’t all sunshine and rainbows. It’s a very mean and nasty place and I don’t care how tough you are, it will beat you to your knees and keep you there permanently if you let it. You, me, or nobody is gonna hit as hard as life. But it ain’t about how hard you hit. It’s about how hard you can get hit and keep moving forward. How much you can take and keep moving forward. That’s how winning is done.”

I enjoyed this quote from Rocky Balboa the first time I saw the movie, and I appreciate it even more now after getting my a** kicked by this f-ing blood disease, but still grinding along every day.

It's about how hard you can get hit and keep moving forward
Table of Contents1 - GET, POST, DELETE, and PUT examples2 - More POST examples3 - Headers returned by the server4 - Discussion5 - Summary

There may be better ways to do this, but as I’m writing a mobile app with the client written in Sencha Touch, and the server written with the Play Framework, I’ve written some curl scripts to simulate GET, POST, DELETE, and PUT request (method) calls to my Play Framework “RESTful” services.

Tomorrow (August 15th) is the last day in 2018 that the Sun will set after 10pm in Talkeetna, Alaska.

The last day the Sun sets after 10pm

Here’s a quick example of how to use the Kotlin groupBy syntax on a list, with the result of each example shown in the comments:

val names = listOf("kim", "julia", "jim", "hala")

names.groupBy { it -> it.length }  //LinkedHashMap: {3=[kim, jim], 5=[julia], 4=[hala]}
names.groupBy({it}, {it.length})   //LinkedHashMap: {kim=[3], julia=[5], jim=[3], hala=[4]}

Carlos Castaneda meets Denali: “Does this path have a heart?”

For me, the path that led me to Alaska had a heart. For others, that path may have no heart, but another path does.

Carlos Castaneda meets Denali: 'Does this path have a heart?'

Two good quotes about work this morning:

“The harder you work the less competition you’ll find.”
~ Shane Parrish

“There are no traffic jams along the extra mile.”
~ Roger Staubach.

Here's a brief message for married people stuck in lousy marriages. One thing I learned about marriage is that it’s about teamwork, and if one partner isn’t part of that team — or doesn’t appreciate the other person — it’s no marriage at all, it’s just two people sharing bank accounts and living quarters. I strongly believe that a marriage partner should be someone who builds you up, not one who tears you down.

(I was reminded of that when I saw this image on Facebook today.)

Better off being single

Motley Fool has an excellent collection of Jeff Bezos quotes going back to the 1990s.

If you open your mind for me
You won’t rely on open eyes to see
The walls you built within
Come tumbling down, and a new world will begin
Living twice at once you learn

You’re safe from pain in the dream domain
A soul set free to fly
A round trip journey in your head
Master of illusion, can you realize
Your dream’s alive, you can be the guide but

I will be watching over you
I am gonna help you see it through
I will protect you in the night
I am smiling next to you
(in Silent Lucidity)

(I’ve been having a crazy amount of lucid dreams lately, and as a result I can’t listen to this song loud enough.)

This page contains a large collection of examples of how to use the Scala Map class, including most of the methods that are available on a Vector. (Currently well over 100 examples.)

With the fireweed blooming in Alaska, summer will soon be yielding to fall and winter.

Fireweed blooming in Alaska (and winter coming)