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

This is a quote from The Mastocytosis Society on their Facebook page. The interesting part for me is that I had almost all of these symptoms for many years, but my doctors and I didn’t know there was a disease/illness known as MCAS:

“We agree that some patients, in the early stages, manage their disease by avoiding triggers. An example would be someone who figures out that they cannot use a hand mixer because their hand and arm itches, so they use a stand mixer instead. They may not realize that this is a symptom of mast cell activation in response to vibration, but may simply avoid hand mixers. There are probably lots of people who do this for a long time until they develop multiple symptoms that affect many organ systems, such as chronic itching, dermatographism, diarrhea, abdominal bloating, reflux, headaches, lightheadedness, brain fog, skin rashes, intolerance to heat, cold, or temperature change, shortness of breath, severe reactions to bee/wasp/other venom stings, sensitivity to odors or chemical smells, reactions to medications, especially antibiotics and opioids, anxiety/depression and inability to tolerate alcohol.”

“Morbid and creepifying, I got no problem with, as long as she does it quiet-like.”

This is a list of Android code examples I’m starting to allow me to create rapid prototypes of Android applications using Android Studio. This is a very early list, I hope to be adding many more Android code snippets over time.

Jonas Bonér has put together a list of “latency numbers every programmer should know” as this gist. Peter Norvig put together a much earlier version of this list, and this page has a bit of a graphic related to Norvig’s work.

Latency numbers programmers should know

If you’re interested in Android performance benchmarks, seems to have some simple charts, like the image shown.

Android CPU performance benchmarks

My cellphone just died, so I’ve been looking at cellphones, and also cellular carriers. Skipping the cellphone part of the story, cellular reception in Colorado is notoriously bad. I can barely make a phone call with AT&T in my apartment in Broomfield, CO, and I also have problems when I travel in Louisville and Boulder.

AT&T coverage in Colorado

Today I finally found a good map to show the problem at This first image shows their coverage map for AT&T in my area:

ATT cellular coverage in Broomfield, Colorado

Noting Gone may lead to a spontaneous spirit of love and service (bodhicitta). As I’ve said, where sensory events go to is where they sensory events arise from. Gone points to the source of your own consciousness ... so Noting Gone can lead to a spontaneous sense of oneness with — and commitment to — all beings.”

From the book, The Science of Enlightenment: How Meditation Works by Shinzen Young.

In Scala you can declare a type alias. Typically you do this to create a simple alias for a more complex type.

Using a type alias to simplify a complex type

For example, on this page I note a good example where someone on StackOverflow first defined a type alias named Row, and then created a second type alias named Matrix as a list of rows:

Here’s a little fun with Scala functions, including the use of andThen and compose:

scala> val add1 = (i: Int) => i + 1
add1: Int => Int = <function1>

scala> val double = (i: Int) => i * 2
double: Int => Int = <function1>

scala> val addThenDouble = add1 andThen double
addThenDouble: Int => Int = <function1>

scala> addThenDouble(1)
res0: Int = 4

scala> val doubleThenAdd = add1 compose double
doubleThenAdd: Int => Int = <function1>

scala> doubleThenAdd(1)
res1: Int = 3

(Inspired by the book, Functional and Reactive Domain Modeling, and my own book, Learning Functional Programming in Scala.)

If you’re interested in Domain-Driven Design (DDD), here is a link to an article titled “Effective Aggregate Design” by Vaughn Vernon.

(The article is available as three short PDFs that form the basis for his book, Implementing Domain-Driven Design.)

“Streaming platforms such as Spark or Flink use functional programming principles, with Scala as the implementation language. This isn’t without a reason; finally we’ve found that the mathematical foundations of functional programming provide the strongest basis to modularize our domain models.”

~ Functional and Reactive Domain Modeling

I don’t recall hearing of the words “reify” or “reification” in my OOP years, but that may be because I studied aerospace engineering in college, not computer science. Since learning FP I often see those words, so I thought I’d try to understand their meaning.

The short answer is that the main definition seems to be:

“Taking an abstract concept and making it concrete.”

For the longer answer, I found the following definitions and examples of reification.

This page contains a collection of over 100 Scala String examples, including strings functions, format specifiers, and more. I don’t provide too many details about how things work in these examples; this is mostly just a collection of examples that can be used as a reference page or cheat sheet. (I do show the output of most examples.)

First, here are some basic uses of the Scala String class to help get us warmed up:

If you want to create multiple Scala Futures and merge their results together to get a result in a for comprehension, the correct approach is to (a) first create the futures, (b) merge their results in a for comprehension, then (c) extract the result using onComplete or a similar technique.

Linux grep FAQ: How can I perform a recursive search with the grep command in Linux?

Solution: find + grep

For years I always used variations of the following Linux find and grep commands to recursively search subdirectories for files that match a grep pattern:

find . -type f -exec grep -l 'alvin' {} \;

This command can be read as, “Search all files in all subdirectories of the current directory for the string ‘alvin’, and print the filenames that contain this pattern.” It’s an extremely powerful approach for recursively searching files in all subdirectories that match the pattern I specify.

The Milky Way is moving at over half a million miles per hour. (In the time it took me to type that, we sailed about 1,500 miles through the Universe.)

Inside the Milky Way, the Earth revolves around the Sun at 66,600 mph.

The Earth rotates around its axis at about 1,040 mph (depending on your latitude).

And yet, somehow I feel like I’m sitting perfectly still in this chair.

That’s quite an illusion.

Solar eclipse today, surgery tomorrow. Let’s get this party started!

“Your parents name you, but they haven’t a clue who you are. Your friends nickname you because they know exactly who you are.”

~ Sting

I hate it when everyone in a dream keeps asking why you’re snoring. At first it’s embarrassing, then after a while it’s more like, “Bah! Leave me alone.”

As a quick note, here are some examples of the Java 8 lambda Thread and Runnable syntax.

Java 8 Thread/Runnable lambda syntax

First, here’s the Java 8 lambda syntax for a Runnable, where I create a Runnable and pass it to a Thread: