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

As a quick note today, I have been converting parts of the Scala Cookbook from a plain text format to a Markdown format, and as part of that I needed to add some newline characters to add spacing to the document. This wouldn’t be bad if it was a few pages, but it’s hundreds of pages, so I decided to use the Unix sed command to do the work.

I may have written it here before, but the first few functional programmers I “met” online were real condescending a-holes. Fortunately I eventually met other FP developers who weren’t like that at all. Unfortunately some of the loudest voices and first responders were of the a-hole type, and that creates a bad image for the FP community.

Image from this Twitter page.

espn.com has this video where female rugby player Georgia Page suffers a broken nose, then makes two tackles.

Don’t fall into the trap of thinking that famous people didn’t have any obstacles. This page has a little quiz where you match up famous people and their disabilities. (You’re supposed to match the people in the first column to the disability they have in the right column.) The answers are available at the page I linked to.

One thing I like about Functional Programming (FP) is that it makes programming much easier. Whenever fear and doubt creep into my mind when I’m writing code I think, “A pure function depends only on its inputs and outputs, and as long as (a) I get the right inputs and (b) I know the equations, then (c) I know I can write one function,” something like that. Put another way, when things get overwhelming, it helps to have a motto of, “One function at a time.” (Image from the book, Haskell: The Craft of Functional Programming .)

Normally when I have physical pain I meditate in a way as to get far away from it, but this image shows part of an article by Shinzen Young where he writes about how to meditate into the pain.

After shutting down some other players, including Derrick Rose of the Bulls, Matthew Dellavedova is making life miserable for Steph Curry. Image from espn.com.

I started to write a joke or two, but this picture from Apple’s 2015 WWDC (developer’s conference) speaks volumes about the ratio of male to female developers attending the conference. Photo from this Twitter page.

In my younger days this wasn’t much of a problem, I’d just jump up there and get it.

If you need to turn off (disable) java.util.logging logging, adding this line of code to your main method seems to work:

I like looking at source code from other developers, I almost always learn something. In this case I knew that a try expression in Scala returned a value, but I have never used it like this. This example is from the book, Learning Concurrent Programming in Scala.

I’m considering using Easy Rules as a simple “rules engine” in my Android Football Game application, primarily because (a) there are a ton of “rules” involved in having the computer call offensive and defensive plays, and (b) I’m trying to find a way to simplify that code and make it more maintainable.

The Easy Rules website has a Hello, world demo you can look at to get started, but after that, here is my example.

[toc hidden:1]

This is an excerpt from the 1st Edition of the Scala Cookbook (partially modified for the internet). This is Recipe 3.11, “How to use pattern matching in Scala match expressions.”

Some old Unix command-line humor, from this gnu.org page.