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

“It was unbelievable,” a drained Moya told a handful of reporters after the match. “He’s such a fighter, a warrior. I have no words to describe for what I saw today.”

Four years ago, at the 2013 French Open, Nadal explained how he had learned to enjoy suffering in big matches, finding the joy of winning so much better as a result. The indomitable spirit -- no matter what travails Nadal has endured -- has not waned.

On Friday, we saw the grimaces on his face, the clenched fists, screams of vamos. The emotion was raw, especially when he lost the fourth-set tiebreaker. Moya could barely watch.

2016: The National Park Service is nice, I like the Redwoods and Volcanoes.

2017: I will follow the National Park Service into battle.

Hi, my name’s Ray. I’ll be drawing your blood today as soon as I finish this Capri Sun.

*misses hole 4 times then punches straw through bag*

(Reminds me of a few people who have drawn my blood.)

Scotch neat, please.

Umm ... this is a Starbucks.

*sigh*

Okay ... a scotch “grande.”

Without much discussion, here’s an Android ListView/ListFragment with its Back/Up/Home button enabled:

An Android ListFragment/ListView with Back/Up button enabled

(That button used to be a Home button, but now it’s used for the Back/Up action.)

And here’s the source code for that ListView/ListFragment:

space.com has this article about scientists going rogue as “a response to the Trump administration's order for at least four government agencies to stop all communications with the public.”

Going rogue (NASA, NOAA, and more)

I don’t know what happened to Freedom of Speech in the U.S., but I like this.

Freedom of speech?

After working with Scala for a long time, I had to come back to Java for a while to work on an Android app. Right away I missed a lot of things from the Scala world, including all of the built-in Scala collection methods, and other things as simple as the Scala Tuple classes.

If you haven’t used them before, a Scala Tuple class lets you write code like this:

Tuple<String, Integer> t = new Tuple<>("age", 41);

If you’re comfortable with generics, the Java implementation of a Tuple class like this is simple:

When I was sick last summer I couldn’t even come close to thinking about a Map while programming. Feeling much better these days after radically altering my diet, I have used many maps over the last two days to solve programming problems elegantly:

Map<Tuple<Position,RatingType>, Spinner> positionRatingSpinnerMap = new HashMap<>();

That code gives me an easy way to lookup an Android Spinner widget based on a football player’s position (QB) and rating type (short passer, long passer, runner).

I have to say, it feels good to have my brain back.

The top five regrets of the dying:

1) I wish I hadn’t worked so hard
2) I wish I had stayed in touch with my friends
3) I wish I had let myself be happier
4) I wish I had the courage to express my true self
5) I wish I’d lived a life true to my dreams instead of what others expected of me

When you have a rare genetic mutation (I prefer the term “posthuman”), doctors like to give you orange jugs.

MCAS and orange jugs

One of my gripes with both MacOS and Ubuntu is that it’s harder than it needs to be to grab a window corner or edge to resize it. IMHO, designers are choosing form over function.

This page from the Busy Coder’s Guide to Android discusses Android performance, including the Android hardware acceleration setting shown in the image.

Android hardware acceleration setting

I just learned that MacOS has a softwareupdate command, and further learned that it has a --ignore option, which may or may not let you ignore useless updates. For example, my Mac prompts me daily to update Keynote, Numbers, and Pages, which I rarely (rarely!) use, so I don’t want to bother updating them. I’m hoping the a softwareupdate command will help me with this.

Forbes has a good article on the causes of the Samsung Note 7 battery explosions, including everything Samsung did to understand the problem, and a little bit about where they’re going from here.

If you ever need to embed an Android ListView in a LinearLayout or RelativeLayout, I can confirm that this code works.

(This SO approach may also work. Here’s another one.)

“Awareness admits no obstructions. It can be boundless even when we are confined.”

~ A Tibetan monk in Bloomington, Indiana (Arjia Rinpoche)

“And all becomes clear. Wish I could make you see this brightness. Don’t worry, all is well. All is so perfectly, damnably well. I understand now, that boundaries between noise and sound are conventions. All boundaries are conventions, waiting to be transcended. One may transcend any convention, if only one can first conceive of doing so. Moments like this, I can feel your heart beating as clearly as I feel my own, and I know that separation is an illusion. My life extends far beyond the limitations of me.”

~ Cloud Atlas

Dear diary: Filed under the category of “transparent dangling carrots,” today I learned/realized that there is a surface reason the Dalai Lama talks about practicing compassion, and also a much deeper reason. It’s really quite a trip, though with my limited knowledge, for all I know it’s turtles stacked on turtles stacked on turtles.

(A diary entry from January 21, 2015. Dalai Lama quote: “If you want others to be happy, practice compassion. If you want to be happy, practice compassion.” Image from this link.)

Dalai Lama quote: If you want others to be happy, practice compassion

“Do not fall in love with people like me. I will take you to museums, and parks, and monuments, and kiss you in every beautiful place, so that you can never go back to them without tasting me like blood in your mouth. I will destroy you in the most beautiful way possible. And when I leave you will finally understand, why storms are named after people.”

~ Caitlyn Siehl