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

If you’re coming to Boulder, Colorado, the TravelBoulder.com website looks like it might be a useful resource.

Back in 2013 I read the book Clean Code by Robert C. Martin, and in an effort to keep that book alive with me a little while longer, I decided to make my own “Cliffs Notes” version of the book on this page. One of my favorite notes from below is that a language named LOGO used the keyword to in the same way that Scala uses def, so a method named double would be defined as to double... instead of def double..., which seems like it would help developers name methods better.

I don’t know the origin of this “Do not let the behavior of others destroy your inner peace” Dalai Lama - Homer Simpson cartoon, but I like it.

Do not let the behavior of others destroy your inner peace

“Wherever you have friends, that’s your country; wherever you receive love, that’s your home.”

~ an old Tibetan saying, as read in The Book of Joy

Today’s mindfulness “lesson of the day” (mostly for myself) is a reminder to keep practicing, even when you don’t feel like it. You don’t get to choose when moments of enlightenment happen, so the best thing you can do is keep practicing so those moments will be possible when the right circumstances (karma?) come into alignment.

What happens is that over time, both the mindfulness and the enlightenment bits change the wrinkles in your brain, change your perspective and attitude, and cleanse the environmental conditioning of whatever happened to get you to this point. With continued practice you evolve (think “metamorphosis”) into a new person over time — this time a person of your own choosing, rather than a person conditioned by where and when you were born and lived.

Namaste. ;)

I just learned about Hanlon’s Razor, which states, “we should not attribute to malice that which is more easily explained by stupidity.” I have often been guilty of the malice assumption, so I found this interesting.

In a related note, Wikipedia’s definition of philosophical razors is also interesting.

If you haven’t tried it before, Scastie is an interactive playground for Scala. It also supports Dotty, which is pretty cool.

If you’re interested in metaprogramming with Scala, Scalameta is “a modern metaprogramming library for Scala that supports a wide range of language versions and execution platforms. Originally, Scalameta was founded to become a better macro system for Scala, but over time we shifted focus to developer tools and spun off the new macro system into a separate project.”

If you’re interested in the future of Scala, specifically Scala 3, the official Scala blog has an interesting article titled, Macros: The Plan for Scala 3. A beneficial part of reading at least part of the article is that you can learn a little bit about Tasty, “the high-level interchange format for Scala 3.”

Scala 3: Tasty, and the plan for macros

I just bought a bunch of MP3 music files from Amazon, and when I downloaded the zip file they provide onto my Mac, it was a bunch of files in a bunch of subdirectories; not really convenient to work with when you’re trying to import them into iTunes. So I used this Unix find command to move all of the music files from the subdirectories they were scattered in into the root directory that was created when I expanded the zip file:

cd Amazon-Music-Folder
find . -type f -exec mv {} . \;

If you ever need to either copy or move a bunch of files with a single command, I hope this example shows the correct find command syntax for your needs. (If you need to copy the files, use the cp command instead of the mv command.)

There are times when I work on images a lot with Gimp, and then there are times when I don’t work with Gimp for a month or two. When I don’t work with Gimp a lot, I tend to forget about all of the different things I can do with. Therefore, I have created this page as a “Gimp special effects cheat sheet” page to help remind me of all the cool things I can do with Gimp effects.

Under the covers — and sometimes above the covers — Scala is changing. These notes about Scala 2.13.0-M4 describe some of the changes coming to the Scala collections classes.

A few things not shown in the image are:

  • The scala-xml library is no longer bundled with the release
  • Procedure syntax (def m() { ... }) is deprecated
  • View bound syntax (A <% B) is deprecated
  • Assorted deprecated methods and classes have been removed

See the Scala 2.13.0-M4 release notes for more details.

Scala 2.13.0-M4 release notes (collections changes)

Interesting discussion of the day: A young woman who helped me at Best Buy today told me that one reason she works there is so she has something she can talk about with her father (tech stuff).

Ram Dass on being a parent, and a soul (and attachment).

Ram Dass on being a parent, and a soul

On this day (May 16th) in 1990, Muppets creator Jim Henson died. He left this note for his children. (There’s a little more information at lettersofnote.com.)

Jim Henson's letter to his children

Via Kelley Robinson, one of Martin Odersky’s slides at ScalaDays (May, 2018) is titled, “Realizing Scala’s Potential,” with these bullet points:

  • become more opinionated
  • simplify
  • eliminate inconsistencies and puzzlers
  • build on strong foundations
  • consolidate language constructs to improve: consistency, safety, ergonomics, performance

As Ms. Robinson writes, “Scala was a language toolbox, and that leads to fragmentation. Scala 3 wants to become more opinionated.”

Here’s another ScalikeJdbc SQL SELECT query example. In this example I use the concept of a “service,” which I probably originally got from the ScalikeJdbc website:

“Knowing that when light is gone, love remains for shining.”

~ from “To Flush, My Dog,” by Elizabeth Barrett Browning

This short interview titled The Tao of The RZA reminds me of the movie Ghost Dog:

“According to what one of the Elders say,
taking an enemy on the battlefield
is like a hawk taking a bird;

Even though it enters into
the midst of a thousand of them,
it pays no attention to any bird
other than the one that it has first marked.”