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

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

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.

I just read about Subaru of Indiana’s “Zero-Landfill” status. It makes me wonder how the rest of the world can be more like this.

Subaru of Indiana's Zero-Landfill status

If you want to be free,
Get to know your real self.

It has no form, no appearance,
No root, no basis, no abode,
But is lively and buoyant.

It responds with versatile facility,
But its function cannot be located.

Therefore when you look for it,
You become further from it;
When you seek it,
You turn away from it all the more.

~ Linji

I started to kill a gnat tonight, and as I went to hit it, it rocked back on its back legs, looked up at me and screamed, “Stop! It’s me, Zeus!”

I looked at it and said, “Zeus was too good, he taught me kindness and compassion; I can’t believe he would have been reborn as a gnat. But l’ll let you live. Go on, enjoy your life.”

Some long time ago I was working on a large software development project, and I wasn’t happy with either the quality or the velocity of our programming effort. So one night I sat down and tried to work out an activity diagram to show what our software development process needed to be, to improve both speed and quality. It turns out that a lot of this is just common sense, but for some reason or another team members would try to circumvent the process, which always led to more pain for everyone involved.

Every time I read an article or book about UML “Use Cases” I cringe a little bit. Every author says something like “Jacobson left the definition of a Use Case too open,” and then they try to work through some elaborate scheme of what a Use Case means to them. IMHO, the best use case definition was created in the early 1980s, long before Jacobson mentioned the term.

A couple of stories are bouncing around in my head, so I thought I’d write them down to get them out of there.

In story #1, I was meditating a few nights ago when “Boom!” I was standing in the house I grew up in. I always wanted to go back there to see what it was like with an older set of eyes, so I took my time in walking around, looking at and touching everything. Eventually I walked downstairs, and when I got there a young version of my mom came out of her bedroom and seem concerned about something. Then she looked at me and said, “Money is important, isn’t it?” I replied, “I suppose so,” and then she kept walking around with that concerned look, and then the scene ended just as fast as it began and I was back in the darkness of meditation.

In story #2, my family was at O’Hare Airport in Chicago, and I probably wasn’t a teenager yet, maybe thirteen years old at the most. I think I went to get a drink of water, and when I turned around an older hippie girl was standing there. She leaned down and pinned a little fake red flower on my shirt and said something spiritual, which I thought was cool. Then she asked if could give her some money. I didn’t have any money, and when I told her that, she ripped the flower off my shirt and stomped away much less peacefully. I remember thinking that her behavior wasn’t correct, and I suspect that incident made me mistrust religious people for quite some time.

(From a Facebook post from May, 2018.)

Several years ago I stepped away from a consulting gig. I had an opportunity to continue the gig, but I didn’t enjoy it, and didn’t like the direction the project was headed in. This quote from this article about the Denver Post expresses how I feel very well:

“I have total disagreement with how they're managing the place, but I'm not going to stand up and be overly critical of them. They've got the keys to the car and they can drive it any way they want to. But they're not driving it in a way that I want to be a passenger of the car.”

(That reminds me of the old Alaska sled dog saying: “If you’re not the lead dog, the view never changes.”)

For the first time in many years I just came across Kent Beck’s Four Rules of Software Design:

  1. Passes the tests
  2. Reveals intention (should be easy to understand)
  3. No duplication (DRY)
  4. Fewest elements (remove anything that doesn’t serve the three previous rules)

There are wording variations on those rules, but I got those specific words from this Martin Fowler post. As he notes, “The rules are in priority order, so ‘passes the tests’ takes priority over ‘reveals intention.’”

For more information on Kent Beck’s Four Rules of Software Design, see that link, or this link to the original rules on c2.com.

As a brief note this morning, I’d just like to offer a “thank you” to the people who have purchased my new book, Functional Programming, Simplified, as sales have certainly exceeded my expectations. I first offered the idea to the people at O’Reilly, and when they turned it down I was concerned that maybe they knew something I didn’t. But sales and feedback have all been very positive, so thank you for that.

Functional Programming, Simplified

When I first moved to Colorado I used to read the Denver Post, but for at least the last year I’ve read constant stories about reporting staff being gutted down to a bare-bones skeleton crew. These days I don’t even bother looking at it, which is a shame, because honest journalism is important in a free society.

Today the battle for journalism in Colorado continues, as employees of the Denver Post signed a letter about one of their colleagues being censored in the midst of what appears to be significant profit-taking by the newspaper ownership. (I saw “appears” because there is no mention of profit margins; every for-profit business must have a profit margin to stay in business.)

Update: If you’re interested in this sage, I recommend reading, They’ve Killed a Great Newspaper on westword.com.

The battle for journalism in Colorado (and the Denver Post)

If you ever need to batch-insert a lot of records into a MySQL/MariaDB database using the JDBC PreparedStatement (as in preparedStatement.executeBatch()) be sure to change the MySQL URL to use the rewriteBatchedStatements, as shown here:

"jdbc:mysql://localhost:8889/DATABASE?rewriteBatchedStatements=true"

For a recent project I needed to batch-insert about eleven million records into a MySQL database, and the runtime was about 55 minutes. Once I added rewriteBatchedStatements=true to the MySQL URL, the batch-insert time was reduced down to only three minutes. That one little change made all the difference.