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

Linux/Unix FAQ: Can you share some Linux find command examples?

Sure. The Unix/Linux find command is very powerful. It can search the entire filesystem to find files and directories according to the search criteria you specify. Besides using the find command to locate files, you can also execute other Linux commands (grep, mv, rm, etc.) on the files and directories you find, which makes find extremely powerful. 

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

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.”

The Onion “reports” that the Dalai Lama says that his next life will be his last one before he retires.

The Dalai Lama to retire after his next life (The Onion)

I haven’t tried it yet, but as a note to self, Scala 2.12.5 introduced a new -Ybackend-parallelism N compiler flag with which “the backend can now run in parallel on N threads.”

“When Yahoo bought Viaweb, they asked me what I wanted to do. I had never liked the business side very much, and said that I just wanted to hack. When I got to Yahoo, I found that what hacking meant to them was implementing software, not designing it. Programmers were seen as technicians who translated the visions (if that is the word) of product managers into code.

This seems to be the default plan in big companies. They do it because it decreases the standard deviation of the outcome. Only a small percentage of hackers can actually design software, and it’s hard for the people running a company to pick these out. So instead of entrusting the future of the software to one brilliant hacker, most companies set things up so that it is designed by committee, and the hackers merely implement the design.

If you want to make money at some point, remember this, because this is one of the reasons startups win. Big companies want to decrease the standard deviation of design outcomes because they want to avoid disasters. But when you damp oscillations, you lose the high points as well as the low. This is not a problem for big companies, because they don’t win by making great products. Big companies win by sucking less than other big companies.

So if you can figure out a way to get in a design war with a company big enough that its software is designed by product managers, they’ll never be able to keep up with you ... The place to fight design wars is in new markets, where no one has yet managed to establish any fortifications. That's where you can win big by taking the bold approach to design, and having the same people both design and implement the product. ”

~ I hope to write more about this at some point, but for now this is a long quote from a Paul Graham blog post titled, Hackers and Painters

I was surprised to read in this TechCrunch article that Apple now has the second-most autonomous vehicles registered in California. A bigger surprise was seeing that GM has nearly double the amount that Apple has.

Apple has the second-most autonomous vehicles registered in California

Facebook tells me that I found this quote by Janis Ian back in 2014. Still seems like a good idea. :)

Janis Ian - Buy a book instead of a drink
Table of Contents1 - Benefits of automated GUI testing2 - Keys to automated GUI testing and continuous integration3 - Beware automated GUI testing software sales pitches and recorders

Introduction: I first wrote this article about automated GUI testing many years ago, but I find that it still holds today.

I just wrote most of the following note on the Apple Mac Java-dev mailing list, and I'd like to share it here as well, because I think it captures my thoughts on the benefits of automated GUI testing and GUI testing software.

I ran automated GUI tests part-time (4-6 hours per week) on a project with 8-12 developers, and saw some good benefits. True, in the 80/20 rule, 80% of the problems were due to UI changes and communication, like “We forgot to tell you we split the Name field into First Name and Last Name,” but with a good automated GUI testing tool, one test may fail, but the rest of the automated GUI test suite keeps running (see Fowler’s continuous integration). Furthermore, with a good GUI testing tool, something like this is also a minor change to get the test running again.

Here’s a quick look at how to convert a Java Map (such as HashMap) to a Scala Map using the JavaConverters object:

// import what you need
import java.util._
import scala.collection.JavaConverters._

// create and populate a java map
val jMap = new HashMap[String, String]()
jMap.put("first_name", "Alvin")
jMap.put("last_name",  "Alexander")

// convert the java map to a scala map
val sMap = jMap.asScala

If you ever need definitions of scalac compiler options (up to Scala 2.12.2), here you go.

Per this Wired security news this week story, a company named Securus claims to be able to track nearly any cell phone in the United States, within seconds.

A company claims to be able to track any cell phone in the U.S.