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

Another Jonathan Ive design interview quote from dezeen magazine. The full original article is here on time.com.

This python.org page has a nice discussion on Unicode and the history of character codes. It’s good background material in case you ever wondered how we got where we are, and how character codes work on computers.

I recently wrote a little application to convert pages from a PDF to plain text. The GUI portion of the application looks like this:

As you can see, the application just needs the name of a PDF file to convert, along with the page you want to start at and the page you want to end at. There are several ways I could make the application more convenient to use, but since I don't plan to use it that often, I can deal with its limitations.

Here’s the Scala source code for an Akka Actor I use in an application where I convert PDF pages to plain text:

Every time I go back to writing GUI programs, I find that I want to document my UI layout code, especially when I use something like a JGoodies layout in a Java/Swing application. I just took a look around and found some ASCII drawing programs, which may help me create the documentation I’m looking for, i.e., an ASCII drawing I can put in my Java/Scala comments, above my UI layout code. I created this particular drawing with asciiflow.com.

One way to to get the IP address of a Linux system from the Linux command line is this:

$ hostname -I

That’s the hostname command, followed by a capital letter i as a command line parameter. On my Raspberry Pi system, this command returns its IP address — and only its IP address — like this:

10.0.1.9

It’s nice that this command returns only the IP address, because that means I don’t have to pipe together several commands to get what I need.

As the title of this blog post implies, this article contains a collection of Monad tutorials. I’ll only include the good ones as I find them (because there’s obviously no value in reading a bad Monad tutorial).

Here is the current list:

Phil Jackson requires that NY Knicks’ players participate in “mindfulness” training. If you’ve read any of Phil Jackson’s books, you know why this is.

You know that old saying about people having skeletons in their closet? I forgot that I had this one (leftover from Halloween) until I started the process of packing and moving to my new apartment.

It looks like the hot tub at my new apartment complex is open year round. (See the area in the photo with the colored lights.) That looks intriguiging.

The first Siberian Husky I ever knew had “raccoon eyes” like this when he was young. As he got a little older the dark markings faded away and his face became mostly white, but in the first year or so he looked like this. This photo comes from a story about why huskies have blue eyes.

I haven’t tested this with other Java components, but if you want/need to get the “system font”, this code gets the default system font from a JEditorPane component:

val outputArea = new JEditorPane
val fontFamily = outputArea.getFont.getFamily

That code is written in Scala, but as you can see, it converts easily to Java. On Mac OS X 10.10, fontFamily ends up being “Lucida Grande”.

If you ever need to use a JGoodies FormLayout and PanelBuilder, and want to fill and grow components both vertically and horizontally, I hope the following code is helpful:

As the ExtremeTech article states, “The curvy masterpiece, called the Vision G-Code, is covered in special multi-voltaic paint that can generate fuel from both solar and wind energy.”