Nothing major here today, but here’s some source code to start a little Scala “date utilities” class:
As a final example of how to use type classes in Scala, I’ll show how to repeat the example from the previous lesson using the open source “Cats” FP library for Scala. With the examples you’ve seen already, this will be a quick process.
Step 1 is to clone my source code for this lesson, which is available at this URL:
If you looked at the source code for the Domain Modeling lessons you probably noticed that I said one thing, but did another. I said that I liked the approach of not including any methods in my
case classes, but then I wrote this code:
“A type class is an interface that defines some behavior. More specifically, a type class specifies a bunch of functions, and when we decide to make a type an instance of a type class, we define what those functions mean for that type.”
The source code for all of the type class lessons is available at the following URL:
In this section of the book I’ll cover Scala type classes, a programming technique that lets you add new behavior to closed data types. The use of type classes isn’t strictly limited to the functional programming style, but because they’re used so much in the Cats library — an FP library for Scala — it’s important to know how they work.
Here’s a link to Google’s announcement about ARCore Developer Preview 2.
Per siliconangle.com, Amazon is going to be backing the ONNX AI/ML project.
I just started working with the Android Room database persistence library, and since you’re not supposed to run things like database queries on the main thread (the UI thread), I was looking at other ways to run them.
In general, you probably won’t want to run database queries using a
Thread, but just to see how Room works, I wrote this Java Thread code, and confirmed that it works as expected:
As a note to self, here are some Android Room database persistence library examples:
Those tutorials don’t show how to properly use Room database access methods, so they’ll lead to Android “Application Not Responding” (ANR) errors. Therefore, here are some related Google/Android docs:
Finally, here’s my own Android AsyncTask REST example, which also shows how to use an
Tried to use someone’s software library.
Documentation was bad, couldn’t get it to work.
Used someone else’s.