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

"Enlightenment of the wave". From the book, Zen Speaks, Shouts of Nothingness. The book is filled with wonderful cartoons like this.

Zen Speaks: Enlightenment of the wave

“The mind can proceed only so far upon what it knows and can prove. There comes a point where the mind takes a higher plane of knowledge, but can never prove how it got there. All great discoveries have involved such a leap.”

As a quick note, if you want to embed a Scala source code example in your Scaladoc comments, just put the source code block in between {{{ and }}} characters in your comments, as shown in this example:

How to format source code blocks in Scaladoc comments


“The Precogs are never wrong. But occasionally they do disagree.”
~ Minority Report
 

This article shares the source code for a Monte Carlo simulation that I wrote in Scala. It was inspired by the movie Minority Report, as well as my own experience.

Background

For the purposes of this simulation, imagine that you have three people that are each “right” roughly 80% of the time. For instance, if they take a test with 100 questions, each of the three individuals will get 80 of the questions right, although they may not get the same questions right or wrong. Given these three people, my question to several statisticians was, “If two of the people have the same answer to a given question, what are the odds that they are correct? Furthermore, if all three of them give the same answer to a question, what are the odds that they are right?”

“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 blood disease but still plodding along every day.

It's about how hard you can get hit and keep moving forward

“Meditation is to bring the complex consciousness to simplicity and innocence without pride and arrogance.”

B.K.S. Itengar, The Tree of Yoga

Had another dream this morning that I was running on all fours. Rather than ask myself, “Why in the world am I doing this?”, I now just accept that I’m a dog (or a cat, or some other animal) in the dream. That helps me go along with whatever is happening in the dream, rather than fight it and wake up.

(Notes from a dream on June 28, 2016)

I can’t remember the name of the motel where I saw this, but this is a photo of a painting of sled dogs that I came across in Healy, Alaska, just north of Denali. (I remember the motel because I used to work with a nice guy named Carson, and a guy that could have easily passed as his twin brother worked there.)

Sled dog painting in Healy, Alaska

In my younger days this wasn't much of a problem. Unfortunately gravity seems to have increased significantly since the 1980s.

Stuck basketball

Tin Man by Miranda Lambert is a bit of a downer, but it’s the prettiest song I’ve heard in a while.

“A thousand days of training to develop, ten thousand days of training to polish.”

“It takes a thousand days to forge the spirit, and ten thousand days to polish it.”

~ These are two variations of a quote I saw today by Miyamoto Musashi

Intellij IDEA has a reall nice help-tip hover tool that helps to explain some of Scala’s advanced language features. In this case the code Monad[M[_]] is a higher-kinded type, which I hope to explain more in my new book.

Scala advanced language features

“Everyday life is like programming, I guess. If you love something, you can put beauty into it.”

~ Donald Knuth

Back in 2011, I lived in Palmer, Alaska. I drove about an hour down to Anchorage to visit a friend, then drove back to Palmer just after 1:30am. During the drive back I didn’t need my headlights on to see, but I kept them on so other cars could see me more easily. It was like driving during a very long “dawn” or “dusk” period.

Let the Sun shine (Anchorage, Alaska)

“How to write ‘Hello, world’ in Haskell.” This was even more humorous this morning when I saw it shared on Twitter by someone who is recruiting Haskell developers.

How to write 'Hello, world' in Haskell

A funny thing about life is that the worst video I’ve ever made (about the vi/vim editor) now has over 175,000 views.

Every once in a while I have a dream where someone is speaking in a language I don’t understand. This morning a woman said something that sounded like, “Yada yada yada Thich Nhat Hanh yada yada.”

I replied, “I’m sorry, I don’t know what you’re saying, but I think I heard ‘Thich Nhat Hanh’ in there.”

She got excited and seemed to repeat the same phrase faster, “Yada yada yada Thich Nhat Hanh yada yada!”

Being clever, I decided to speak very slowly: “I .. don’t .. know .. what .. you’re .. saying, but it sounds like it might be in French.”

Her: “Français?! Oui. Yada yada yada Thich Nhat Hanh yada yada!”

Unfortunately I then had the familiar feeling that I was about to be pulled away from the scene. She had been speaking with her hands a lot, so I held her hands with mine and said, “Something is wrong with my body, I have to go now. Come back again and we’ll try to figure this out,” and with a little “whoosh” I woke up in bed.

(A Facebook post from June 13, 2016.)

This is a sample .gitignore file that I use for Scala SBT projects:

architecht.io has this interesting interview with Bradford Cross on AI and startup businesses. I don’t know much about AI, but from my experience with it, I’m sure that you want to “own” the data.

Bradford Cross on AI and startups
Table of Contents1 - Linux crontab: How to run a command every minute2 - Descriptions of the crontab date/time fields3 - Run a crontab command every hour4 - Run a crontab entry every day5 - Run a crontab entry every 5 minutes6 - Unix and Linux “crontab every” summary7 - Unix and Linux crontab reference information

Linux crontab FAQ: How do I schedule Unix or Linux crontab jobs to run at intervals, like “Every five minutes,” “Every ten minutes,” “Every half hour,” and so on?

Solution: I’ve posted other Unix and Linux crontab tutorials here before (How to edit your Linux crontab file, Example Linux crontab file format), but I’ve never included a tutorial that covers the “every” options, so here are some examples to demonstrate this crontab syntax.