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

5-Star Rated on Amazon.com
Domain Modeling
Made Functional

For the last week or two I’ve been packing a few boxes every night as I prepare for a move a few miles to the north. Last night I started packing the old Beginning Scala book, when I noticed a bookmark I had in it. When I flipped to the bookmark, I found code like this:

trait Shape
case class Circle(radius: Double) extends Shape
case class Square(length: Double) extends Shape
case class Rectangle(h: Double, w: Double) extends Shape

which was later followed by code like this:

Lightsaber is a free, open source application for Mac OS X systems that plays “lightsaber” sound effects as you move your mouse. Once Lightsaber is running, you can switch to any other application, and Lightsaber will play the sound effects when you move your mouse.

Note: Lightsaber has been tested on Mac OS X 10.9 (“Mavericks”) and 10.10 (“Yosemite”) systems. (It may also run on OS X 10.7 and 10.8, but I don’t have any computers running those older operating systems, so I can’t verify that at this time.)

As a quick programming note, the following code shows how I determine where I can store files on Mac OS X systems when writing Java or Scala applications:

For my TypewriterFX application (which plays Mac OS X typewriter sound effects), I wanted/needed to control the JVM that was used to run the application. The way it works, TypewriterFX plays sounds as fast as it can -- as fast as you type -- so I needed the JVM to be more like the old client JVM than a typical server JVM.

“Sometimes the elegant implementation is a function.” Image from this Twitter page.

Last week I ran into a situation where I was bundling a Java/Scala application on a Mac OS X system, which (as usual) requires you to bundle your code in a Jar file. I was working with the jnativehook library, where I saw some code like this:

Something I learned the hard way yesterday ... JavaFX ships with JDK 7, but it’s not in the classpath. This image shows the solution for when you want to use JavaFX in a Scala/SBT application. I found this answer on the ScalaFX website.

Using JavaFX with Scala (classpath)

This image telling where the name “lambda” (in lambda calculus) comes from is currently floating around on Twitter.

On a night when I was listening to Marian Call singing in the Fiske Planetarium in Boulder, Colorado, Madison Bumgarner, er, the San Francisco Giants, win the 2014 World Series. Photo from here.

(In 2010 I was at the Talkeetna Roadhouse in Talkeetna, Alaska, when the Giants won the World Series. Crazy the things that a person can remember, but that was a fun night.)

On this day (October 30), 1938, Orson Welles caused quite a stir. Image from this Twitter page.

One of five tips on writing in journalism, from this article.

Greg Joswiak talks about Apple products and quality, from this re/code article.

A “graphic recording” board created by Kelly Klingman, titled, “What VCs and board members look for in marketing.”

The new Alienware Area-51 looks very cool. I only wish it could run Mac OS X.

5-Star Rated on Amazon.com
Domain Modeling
Made Functional