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

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

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

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 coined 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.)