As a quick note about traits in Scala, this StackOverflow page makes a few good points about sealed traits:
Here’s a short article on dzone.com that explains why you might not need to use
StringBuilder in Java any more.
In this article I assume that you already know at least a little bit about how to use AppleScript, and just want to know how to trigger a MacOS notification. At the end of the tutorial I show how to invoke the AppleScript code using Scala and Java.
If you want to try to use functional programming techniques in Java, this is a slide from a slideshow titled, Javaslang - Functional Java Done Right.
I’m just starting to write an RSS Reader application using JavaFX and Scala, and I thought I’d post the initial code here. This code shows several advanced Scala techniques that Scala developers might need to use when writing Scala code to interact with Java, and in this case, JavaFX.
Java FAQ: What are the rules about Java arithmetic (multiplication, division) involving mixed data types?
While working on a math problem in Java just a little while ago, I realized that I wasn’t comfortable with the Java mixed-type division rules. That is, I wondered if the result of this equation:
3 / 2
the same as the result of this equation:
3 / 2.0
or this equation:
3.0 / 2.0
If you’re interested in using speech recognition on the Raspberry Pi, check out this short tutorial on the CMUSphinx project website.
Note: The code shown below is a bit old. If you want to perform a “search and replace” operation on all instances of a given pattern, all you have to do these days is use the
replaceAll method on a Java
String, like this:
String s = "123 Main Street"; String result = s.replaceAll("[0-9]", "-");
That second line of code returns the string “
--- Main Street”. I kept the information below here for background information.