In an effort to share some source code (but without taking the time to explain it), here’s some Java source code that I just used to create a JFreeChart chart/graph of some data that I use in my Android football game:
As a brief note today, I was working on a Java/Android application recently, and I needed a “tail” function when I was working on a Java list. What I mean by that is that Scala has a
tail function that returns all elements of the list except for the head element, like this:
scala> val x = List(1,2,3,4) x: List[Int] = List(1, 2, 3, 4) scala> x.tail res1: List[Int] = List(2, 3, 4) //head element removed
and I wanted the same thing in Java.
As a little note today, if you ever need to extract a subset of a Java list or array, here are some examples of the Java
And in the category of “Strangest Things I Never Knew About Java,” I give you ... CAFEBABE.
I’m horrible at date calculations — what do you mean by “between”? — but I do know that April 10th is the 100th day of all non-leap year years.
As often happens, I have about 50 browser tabs open, and in an effort to close some of those down, these are some of the best links I found while working with RxJava a week or two ago:
I may work on this a little more over time, but here’s a little look at what errors, checked exceptions, and unchecked exceptions look like in Java:
RxJava's Observable class has plenty of methods that can be used to transform the stream of emitted items to the kind of data that you need. Those methods are at the very core of RxJava and form a big part of it's attraction. But there are other methods, that do not change the stream of items in any way - I call those methods side effect methods.
In my spare time back in 2011 I created a Java version of the old Unix/X-Windows “Xeyes” application. If you ever used Xeyes, you know it as a set of eyes that are displayed on-screen, and follow the mouse cursor as you move it around.
Now in 2019 I just brought it back to life, and here’s a 56-second video that shows how it works: