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

Here are two good quotes from this article, Why companies are leaving the Cloud:

“Another significant driver was the failure to meet internal expectations, at 24%.‘Unmet expectations’ describes most technology trends I’ve been involved with, including client/server, enterprise application integration, service-oriented architecture. and now cloud.

Those surveyed also cited unexpected costs, performance issues, compatibility problems, and service downtime. The most common motivator for repatriation I’ve been seeing is cost. In the survey, more than 43% of IT leaders found that moving applications and data from on-premises to the cloud was more expensive than expected.”

IntelliJ IDEA MacOS FAQ: What are the keystrokes to switch to the previous editor tab and next editor tab when using IntelliJ IDEA on a Mac/MacOS system?

Solution

To move to the next editor tab and previous editor tab when using IntelliJ IDEA on macOS, these keystrokes work for me:

  • [Command][Shift][LeftBracket] moves to the previous editor tab
  • [Command][Shift][RightBracket] moves to the next editor tab

Also note that when I write:

  • [LeftBracket] I mean the [ character
  • [LeftBracket] I mean the ] character

As a brief note today, when you’re using SBT and its build.sbt file with Scala projects:

  • use %% in library dependencies when referring to Scala-specific libraries, and
  • use only one % character when referring to other JVM dependencies, like Java dependencies/libraries

Here are some examples of this syntax:

I recently started reading the “spiritual classic” book, I Am That, by Nisargadatta Maharaj. The book is rated 4.8 stars on Amazon and 4.4 on Goodreads, so that’s pretty impressive.

After reading the first 100 pages or so, I’m glad to report personally that there isn’t anything significantly new here for me. Even though I never saw Ram Dass refer to Nisargadatta Maharaj, the words in this book are remarkably similar to those in Ram Dass’s best books, which I have already written about. That is, the words are a little different, but all of the concepts are the same, and they are consistent with what I know about meditation.

In my earlier posts on the best Ram Dass book to start with and the best Ram Dass books I know, I didn’t mention his book, Grist for the Mill.

Since I forgot to mention it, today I’d like to note a few things about it. First, I think it’s a really good book, it’s just not the first Ram Dass book I’d recommend.

US Magazine has a little story on the separation of Coldplay singer Christ Martin and Gwyneth Paltrow, and it includes this quote about Rumi’s The Guest House and a book called Man’s Search for Meaning (by Holocaust survivor Viktor Frankl) that I read almost thirty years ago. (I don’t know too many Coldplay songs, but I do like Clocks.)

Coldplay’s Chris Martin: So happy to be alive

Listen with ears of tolerance.
See through the eyes of compassion.
Speak with the language of love.

~ Rumi

“As a general principle, any positive state that you experience within the context of silent sitting practice (when you reach the state of samadhi), you must try to attain in the midst of ordinary life.”

~ Shinzen Young’s teacher

“Have you got any cookies?”

~ Frank Burns, in M*A*S*H

Frank Burns, Mash: Have you got any cookies?

In my experience, some “judgy” people will make up their own opinion about you — about what you should do or shouldn’t do — when they don’t know all the facts. I use the word judgy, because if you’re a Christian, Jesus was very clear on this point:

Judge not, that ye not be judged.

To wit, sometimes you just have to let people be wrong about you. (From this tweet by TinyBuddha.)

Sometimes you just have to let people be wrong about you

Some day I might write a book called, Random Conversations with Strangers While Aimlessly Wandering Around, and it will include stories like this:

Many years ago I walked into a favorite bakery in Alaska. Nobody was there, no customers or employees, so I took a few minutes to look over the cookies and donuts to decide what I wanted.

Finally a young woman came out of the back room. I knew from previous donut/cookie runs that she was born in Ohio, moved here about five years ago, was nineteen years old, and would be twenty in a few months. As she brought out a tray of something new, she said, “Oh, I’m sorry, I didn’t hear you come in.”

I replied it was no problem, it gave me a chance to think about what I wanted. We chatted for another minute or two and then she looked around and said, “Can I be honest with you?”

A funny moment from the tv series Life: “Did he ever have a head injury?”

Life tv show: Did he ever have a head injury?

Every spring I think about moving back to Alaska. This is a photo of the cabin I lived in in Talkeetna, Alaska back in the day.

The cabin in Talkeetna, Alaska

If you’ve never seen the movie Starbuck, it’s very good, and often very funny. This is one scene where a pregnant women is trying to come to grip with various feelings she is dealing with.

The park scene in the movie Starbuck

I just saw this drawing on the Learn You a Haskell website, and I wish I had done something visual like it for the Scala Cookbook. It does a nice job of showing the head, tail, init, and last functions (methods).

Scala sequences: head, tail, init, last (visual, image)

Scala/Java/Kotlin String FAQ: How do I replace left brackets and right brackets — i.e., the [ and ] characters — in a String when using methods like replaceFirst and replaceAll?

Solution

If you’re using Scala, Java, Kotlin, or other JVM languages, and need to replace left or right brackets in a String, I found the following solution, which seems to work well with String methods like replaceFirst and replaceAll.

My meditation tip of the day: If you really, really, really can’t take time out to meditate, the best thing you can do is pay ruthless attention to the present moment during your daily activities. And the best way to do that is through mantras or noting practices.

“You can meditate while talking to someone, while washing the dishes, while driving. As your experience grows, you eventually come to a point where you are so present that there is a kind of a merging of inside and outside. When that happens, ‘focus’ becomes more than an extremely interesting and pleasant experience; it becomes a transformative experience.”

“Eventually a delicious figure-ground reversal takes place. In the beginning, meditation is something that happens within your day. Eventually, the day becomes something that happens within your meditation.”

~ From “The Science of Enlightenment: How Meditation Works

As a quick note, if you have a problem using Alfred snippets on Mac/macOS, where (a) your snippets are being displayed to you properly, but (b) aren’t pasting properly, see this url on alfredapp.com for the solution.

After trying to manually remove and then re-add permissions — as suggested on the Alfred forum — I found this page and the tccutil command. Following their instructions, I first shut down Alfred and then ran this command at the command line:

> tccutil reset All com.runningwithcrayons.Alfred
Successfully reset All approval status for com.runningwithcrayons.Alfred

I then restarted Alfred, and all of the “snippets” functionality began working again, including showing my snippets when I press my shortcut key combination, and then expanding and pasting in my snippets.