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

Sorry, it's a quiet week here on I have family in town this week on vacation, and they're keeping me pretty busy.

Here are two good quotes about coaching from this Jon Gruden article:

“He had a good demeanor about him, the way he got his point across. He always told me it was always about your demeanor and how you get your point across. He said, ‘You have to be a car salesman.’ If you want to sell plays, you can’t be short on energy. People want to be associated with people that have a lot of energy and love what they do and show enthusiasm, not someone who just walks in there and kind of goes through the motions.”

“I always tell people,‘You’ve gotta have a why.’ If you have a reason why, you’re most likely going to succeed. ... And those are the types of things as a coach, when you know those things, those are the buttons you can push. When you’re not hustling, when you’re not doing those things, it’s like, ‘Is that the type of example you’re trying to set for your little brothers?’ When you don’t know those things, you can’t use those things.”

This is definitely not my thing, but if you’re interested in eating squirrel meat, head over to Bentonville, Arkansas for the World Championship Squirrel Cook Off (which I learned about while sitting at the Subaru dealership in Boulder a few days ago).

When planning my brother-in-law’s funeral with a woman at the funeral home (I don’t know if she is considered a funeral director or something else), my father-in-law decided to get a limousine for the immediate family members. The limo would take everyone from the funeral home to church, then to the cemetery, and finally back to the funeral home.

When we were told that the limo could hold seven people and we calculated there were eight people we wanted to get in, I was voted off limo-island, but the funeral home woman said I could ride in the hearse. After clarifying whether I’d be sitting in the front or laying in the back – she said the front – I asked if I could drive the hearse. While she never said “yes,” I think she said, “Um, sure,” and I know that she later told a co-worker that I would be driving.

I doubt that most people know it, but authors always enjoy receiving letters of “thanks” like this one. Writing is often a lonely, solitary business, and to hear that your work has helped other people is always satisfying. If there’s a book you’ve read that you really enjoyed, I encourage you to write the author a brief letter of thanks. They’ll appreciate it more than you’ll know.

Author love letters of thanks

JMH is an SBT plugin for running OpenJDK JMH benchmarks. Per its docs, “JMH is a Java harness for building, running, and analysing nano/micro/milli/macro benchmarks written in Java and other languages targeting the JVM.”

They also recommend reading an article titled Nanotrusting the Nanotime if you’re interested in writing your own benchmark tests.

I just saw that this is a way you can easily determine the blocksize of a filesystem, at least a Mac/Unix/Linux filesystem:

$ echo foo > foo

$ du -h foo
4.0K    foo

I tried to do the same thing with touch foo, but that didn’t work. Without digging into it more, the key seems to be in having very little text in the file, at which point the du command shows the minimum block size for the file.

I drove back from Kentucky to Colorado today following the death of my brother-in-law, and got to enjoy a beautiful view of a full moon for much of the day, including a stop at a rest area in Indiana this morning.

Full moon over an Indiana rest area

Since my brother-in-law passed away on Monday I haven’t felt like working — and I haven’t had any time to work — but on the rare occasions I’ve thought about work, I’ve thought that Scala is a beautiful programming language, and I’m fortunate to be able to work with it.

After a long illness, my brother-in-law passed away this morning, August 20, 2018. Godspeed, Kenny.

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.

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

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