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

I was listening to Must Love Dogs while driving yesterday (I’ve watched it so many times, I don’t need to see it to know what’s going on), and it reminded me that when I write about dogs in my books — Rocky, Zeus, Suka, etc. — these are some of the Siberian Huskies I’m writing about.

Must Love Dogs, and dogs in books

Back on May 19, 2013, we had a little problem with goats at the apartment complex I lived at in Broomfield, Colorado.

Goats at the apartment

Yesterday’s bad weather left a fresh coat of white on Mt. Whatsitsname.

White Rocky Mountain top, May 18, 2019

Years before I heard of Shinzen Young, I had always “enjoyed” practicing meditation in the cold. Some part of it probably goes back to childhood, when I had to wait for the schoolbus in the freezing cold of northern Illinois winters. (This was in the time before global warming.) I used to stand there without moving, and mentally I’d concentrate on not being cold, or at least not feeling the cold.

Many years later when I lived in Alaska, I used to enjoy going up into the mountains to basically inflict the same thing on myself. I always thought the “meditate deeply or suffer the consequences” approach forced me to meditate more deeply. This past winter that same “Do or die, there is not try” mentality forced me to maintain my focus and helped to combat my medically-induced lack of energy.

While reading some medical stuff recently I came across the phrase, “When you hear hoofbeats, think of horses, not zebras.” I thought it was essentially the same as Occam’s Razor, but Wikipedia says they’re different.

I prefer the phrase, “Sun does not set.” #talkeetna #alaska

Talkeetna, Alaska: Sun does not set

As my mind was wandering off earlier today, I started to wonder what it would take to create a Ruby puts or PHP echo statement in Scala. (For some reason my brain can never type “println,” and puts or echo are much easier to type.)

One simple way to mimic a puts or echo method is to use Scala's ability to rename things on import:

scala> import System.out.{println => echo}
import System.out.{println=>echo}

scala> import System.out.{println => puts}
import System.out.{println=>puts}

scala> echo("foo")

scala> puts("foo")

scala> puts(1 + 1)

In the next month I’m going to have a CT scan, an MRI, radioactive iodine, gamma radiation, more radiation, then more radiation. So it seemed fitting that I should buy The Incredible Hulk tv series DVD set. :)

Back in the day, this series was influential on me, and I was very aware of its influence. After moving out of Chicago we lived in a small town, and this series opened my eyes to the possibility of just wandering around and living a vagabond lifestyle.

When I was young I used to think, “How do I know where I should live? Where’s ‘home’? Maybe I should just wander around until I find a place that feels right.” That may sound unusual — it seems like most people want to settle down in one place — but I feel fortunate to have lived in many towns and many states, and gotten to know people in all of those places.

The Incredible Hulk tv series

When using Unix or Linux, if you ever need to find all files that contain multiple strings/patterns, — such as finding all Scala files that contain 'try', 'catch', and 'finally' — this find/awk command seems to do the trick:

find . -type f -name *scala -exec awk 'BEGIN {RS=""; FS="\n"} /try/ && /catch/ && /finally/ {print FILENAME}' {} \;

As shown in the image, all of the matching filenames are printed out. As Monk says, you’ll thank me later. :)

(I should mention that I got part of the solution from this page.)

Unix/Linux: Find all files that contain multiple strings/patterns

Here’s a photo of the view in Los Alamos, New Mexico.

Los Alamos, New Mexico

“The activity of consciousness, contrary to expectation, conceals the real nature of existence and represents it in a distorted way.”

~ Zen Training

This is a painting of a Native American Indian that I saw in Santa Fe, New Mexico. (Sorry, I don’t know the artists name.)

Native American Indian painting (red stripe over left eye)

I post this image from this tweet in memory of Kendrick Castillo.

When will the violence against our school children stop?

In memory of Kendrick Castillo

Here’s part of the road (I-25) from Colorado to Santa Fe, New Mexico.

The road from Colorado to Santa Fe, New Mexico

One thing I never thought about, but as an author you can end up with a lot of copies of your own books laying around.

Your own books laying around

“Zen is above all a matter of personal experience. The student is asked to accept nothing the truth of which he cannot demonstrate for himself, with his own mind and body.”

~ Zen Training

Old woman, trying to make a man feel guilty: “What would your mother say?”

Man: “She’d say, ‘I’ve been dead for ten years, leave me alone.’”

~ an episode of Midsomer Murders

I had never heard of the term “Yoda Conditions” until now, but I have seen them in some Java code where programmers put the constant first in an effort to avoid null pointer exceptions.

Yoda Conditions in programming

I don’t remember where I saw this code, but I took a photo of it a while back, and it shows a for loop as a Scala method body. I don’t think I’ve ever written anything like that before, so it impressed me enough that I took a picture of it.

A Scala `for` loop as a method body

I’m pleased to announce that my book, Functional Programming, Simplified, is now available in three formats:

PDF Format
$25 on
(sale price)

PDF version of Functional Programming, Simplified

Paperback Book
$39.99 on Amazon

Print version of Functional Programming, Simplified

Kindle eBook
$29.99 on Amazon

Kindle version of Functional Programming, Simplified