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

“Who you think you are will always be frightened of change. But it doesn’t make any difference to who you truly are.”

~ Ram Dass

For some reason or another today I was curious about this question: If you flipped a coin ten times, what are the odds that the coin would come up heads ten times, or tails ten times)?

I'm sure there is a way to determine this statistically, but I don't know how to do that, so, being new to Ruby, I wrote a little Ruby simulation program — essentially a Monte Carlo simulation of the problem — to find the answer. (Pretty boring, I know, but hey, I was bored, interested in learning Ruby, and didn't feel like reading any more of The Stand right now.)

“I touch the future – I teach.”

Christa McAuliffe

Wow, so a local sports news guy named Mike Klis tweeted, “Don’t confirm to Nicki,” then deleted that tweet and wrote this tweet, confirming that he meant to write that as a DM but made it a tweet instead, thereby shooting himself in the foot twice.

Don't confirm to Nick tweet

I don’t know how my father was raised, but at times he could be domineering, mean, and negative. That has created a “cause and effect” karmic ripple that continues to influence people generations later, and long after his death.

(To be clear, he wasn’t all bad.)

Duck looks surprisingly calm after what appears to be a rough landing.

Duck has a rough landing

westword.com has this great interview with Alfred Williams. He’s a former football player who played at the University of Colorado, and then played for the Broncos at the end of his career, helping them win two Super Bowls. These days he’s on the radio, and he’s great to listen to in the afternoon. He seems like a really nice guy, and I’ve wondered how he gets along with his radio partner, who occasionally doesn’t seem like a nice guy, and the article touches on that.

A corn farm in Spring Grove, Illinois created this nice tribute to the Chicago Cubs World Series win. From the article, “the maze is a full 28 acres of land with about 10 miles of trails.”

Corn field tribute to the Cubs

Eddie: How’s it going, man?

Tito: I’m okay.

Eddie: Yeah? Sure? ‘Cause you look like you got a little hitch in your giddyup.

From the movie, The Heartbreak Kid

(A friend said a similar thing to me recently.)

Because I think it’s often best to “learn by example,” I’ve become a connoisseur of SBT build.sbt examples, and this build.sbt file from Lihaoyi’s PPrint project demonstrates a lot of SBT variables:

August 31st is a new anniversary for me: One year ago today I hit rock-bottom health-wise. On that day, despite feeling very sick, I needed groceries and went to the store. By the time I got to the milk section I was shaking quite a bit, and when I tried to pick up a half-gallon of milk, I didn’t have the hand strength to hold onto it, and it fell to the floor. It exploded open and soaked my lower legs and feet.

After a few moments of humiliation, I thought I better find a store employee so they could clean it up. As I walked around trying to find someone, tears were welling up in my eyes because I was so upset about my health; I couldn’t even grip a half-gallon of milk. I finally found someone, a young, healthy man — healthy, like I used to be — and when we got back to the milk section he nicely said, “No worries, don’t cry over spilled milk.” That made me want to cry even more.

When I was laying in bed later that afternoon (because that was all I could do by that time), I started doing research on my phone, and made a decision to stop taking a medication a kidney specialist started me on in February. Stopping that medicine made me even sicker in some ways, but that turned out to be a good thing: It became the final clue that I have Mast Cell Activation Syndrome. These days, other than significant dietary restrictions, I live a relatively normal life.

I was working on some new code for my functional programming in Scala book today. At one point I thought everything looked okay, and then I decided to generate some Scaladoc to see what certain things looked like. Admittedly I’m a bit tired today, but when I saw that Scaladoc I thought, “Good grief, Al, what sort of ugly API have you created?”

Scaladoc-driven design

The comical part of my recent surgery was that my iPhone 5S kept dying, both before and after the surgery. Something is going on where the iPhone completely loses reception, and the only way to fix it — the only hope of fixing it — is to completely restore the phone using a secret handshake technique they taught me at the local Apple Store. (They also told me this technique only works about 10% of the time, and kindly suggested I buy a new iPhone because the 5S is almost four years old.)

iPhone 5S next to a Moto E

I’m just catching up on my email backlog, and want to thank everyone for the well wishes. I’m now ~95% recovered from Surgery #6 (which was also Invasive Procedure #11), and back to full-time work.

As a quick example of how to use a Thread with a basic Handler in an Android application, the following code creates a view where the text in the TextView is updated to show the current date and time when the Button is tapped.

Java source code

First, here’s the Java source code for a file class named ThreadHandlerActivity:

“It’s okay, I know you’re scared. Okay, just don’t be scared. Just don’t fight it, okay?”

From the excellent movie, Thunderheart

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 berkeley.edu page has a bit of a graphic related to Norvig’s work.

Latency numbers programmers should know