Scala, Java, Unix, MacOS tutorials (page 163)

After the 0.1.2 release of Learning Functional Programming in Scala, it occurs to me that I need to be more explicit about my goals for the book. Some people seem to think that I’m trying to “sell” functional programming. That’s not the case at all. I’m just trying to be a reporter and explain what I’ve learned about FP after reading dozens (hundreds?!) of articles and many books on FP, learning Haskell, trying to apply these techniques to my own code, etc. I’ll explain this further in the next release of the book.

I haven’t watched all of this video yet, but it’s about how to build Scala projects with a tool named CBT.

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

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

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)

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.

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

“A little progress every day can add up to big results.”

(Think of the proverbial snowball rolling down a mountain.)

If you add ScalaCheck to an SBT project like this:

libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % "test"

it’s only available in the SBT “test” scope. This means that when you start a Scala REPL session inside of SBT with its console command, the ScalaCheck library won’t be available in that scope.

To use ScalaCheck with the SBT console (REPL), don’t use its console command — use test:console instead. A complete example looks like this:

$ sbt

> test:console

scala> import org.scalacheck.Gen.choose

Note that after you type test:console your project may be compiled, so that step may take a few moments.

In summary, use SBT’s console command to start a “normal” Scala REPL inside SBT, and use test:console to start a REPL that you can run tests inside of. (Note that this same advice also applies to using ScalaTest or specs2.)

“Even when I was just three years old, I could recall many previous lives. But to many people this sort of thinking isn’t acceptable, so now when I’m asked what I can remember, I just say ‘I remember when I was three years old.’”

~ a monk

When I meet people who seem stressed out (stress/anxiety/worrying), I try to encourage them to practice mindfulness meditation or yoga. I find both of those practices to be a wonderful way to quiet the thoughts in the mind. It may help to know that the basic practices are 100% non-religious, and both help to teach you how to breathe properly. (I recently learned that people who are anxious typically breathe in their chest, which is the wrong way to breathe. You want to learn to breathe in your lower abdomen.)

Personally, I enjoy living in the present moment, without thoughts about the past or future. I used to be an angry young man, and using these practices to calm my mind has made my life happier and more productive. A couple of times a year I still lose it, but these practices always help to re-quiet my mind.

(I think the image shown was created by Gemma Correll.)

Practicing mindfulness meditation and yoga to calm the mind

“I suffered, I learned, I changed.” I found this image on this Pinterest page, and it reminds me of the learning process in general, but mostly of learning about our own minds, feelings, and emotions.

I suffered, I learned, I changed

To me, a lot of Buddhist teachings are based on logic. Today I particularly like this quote from this LionsRoar.com article titled, Silencing the Inner Critic: “The judging mind is optional; it can be understood and released.”

It always amazes me how the brain works. I got to hear these lyrics from the Alanis Morissette song, Thank U, in a dream last night:

How bout no longer being masochistic
How bout remembering your divinity

“President’s spokesman can’t speak for the President.” *sigh*

President’s spokesman can’t speak for the President

If you happen to be looking for the free, HTML version of my book on Scala and functional programming, I’m currently in the process of moving it to this website. That way you (and I) can search it more easily, along with several hundred other pages I’ve written about programming in Scala. The first page of the content is available here: Learning Functional Programming in Scala.