Tales from the jar side: Functional Interfaces in JUnit, Beauty from AssertJ, A live stream with Nate Schutta, some AI tools and coding, HTTP interfaces in Spring, and the usual Tweets and Toots
I was happy last week before I started petting some baby ducks, but now I'm feeling a little down. (rimshot)
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of June 11 - 17, 2023. (Ha! Did you see that? I remembered to update the dates this week. 😊) This week I taught my Mockito and the Hamcrest Matchers course and Week 3 of my Spring and Spring Boot in 3 Weeks course on the O’Reilly Learning Platform, and my basic Functional Java course as an NFJS Virtual Workshop. I also was active on YouTube, publishing one long-form video, one YouTube Short, and holding one Live Stream.
Regular readers of (and listeners to, and now video viewers of) this newsletter are affectionately known as jarheads, and are far more intelligent, sophisticated, and attractive than the average newsletter reader (or listener, or viewer). If you wish to become a jarhead, please subscribe using this button:
As a reminder, when this message is truncated in email, click on the title to open it in a browser tab formatted properly for both the web and mobile.
YouTube Activity
The big video I released this week talked about the functional interfaces Executable
, Supplier
, and ThrowingSupplier
in JUnit 5 assertions.
The video is fairly technical, but anyone who has used Java 8 or above should be able to follow it without any trouble. Functional interfaces were introduced in Java 8, and the library developers also added the java.util.function package, with its categories of Consumer
, Predicate
, Function
, and Supplier
interfaces. JUnit 5 added Executable
and ThrowingSupplier
, and the video talks about why that was done and where they are used.
I released the video on Saturday morning, so it’s been available for about a day and a half. So far it has about 85 views, which is very good for me. I hope it will do well as the work week begins, too, but we’ll see.
(Of course, Monday is a new federal holiday in the US: Juneteenth, which commemorates the date in Texas when word finally made it to the slaves there that they were free. There’s a lot to unpack in that statement, but I’ll save that for next week.)
The other video I released this week is a rather silly YouTube Short, called AssertJ is SO BEAUTIFUL!!🥰😍!! (with the emoticons in the title)
The idea is that I used the AssertJ testing library to write a test for a thrown exception that was wrapped around another one, and the resulting code was so short, descriptive, and beautiful it nearly reduced me to tears. Or something like that. Feel free to take a look. It’s less than 60 seconds long, and it’s all about the emotions and attitude. :)
The pattern I see emerging is that the long-form videos are relatively serious, containing solid information, while the Shorts are mostly about connecting to emotions. There’s really not enough time or space in portrait mode to do much more than that, but they work well that way.
Finally, the other YouTube-related activity I did this week was hold another Live Stream, simultaneously on YouTube and LinkedIn. In it, I talked to my friend and fellow NFJS speaker Nate Schutta:
I have a bit of a confession to make. If that thumbnail image looks a bit off to you, meaning the layout isn’t as symmetric or well-organized as it ought to be, it’s because I did it wrong. I used a Canva template, but unfortunately the template I chose had the dimensions appropriate for Instagram rather than a YouTube Live Stream. Once I realized I that, I had to resize everything before uploading the image. At least I’ll know better for next time.
As always, I had a lot of fun talking to Nate. He works for VMware, and has his own channel, hosted on VMware’s site, called Between Chair and Keyboard. As he said, he mostly created it as an excuse to talk to his friends, and that probably expresses the purpose of my channel as well as anything.
Feel free to check it out if you’re interested. My plan is to run one every other week. Anything more often makes it really hard to coordinate schedules with guests.
Descript
I finally got a subscription (sigh — yet another monthly fee) to the product called descript, which many people I follow feel is the future of video editing. When you upload video files, it transcribes them into text. Then any edits you make to the text also wind up editing the video. That means if you delete a line in the script, the corresponding part of the video is removed as well.
That’s pretty cool, but there’s more. It has an automatic capability to remove “filler” words from your script, like “um” or “uh”, automatically. That then removes the same sections from the video.
It also lets you cut all long pauses (for example, longer than 3 sec) down to a short time, like 1 sec. That one burned me this time, however, because when I imported my video from my regular software (ScreenFlow), and then let descript remove the longer breaks, it cut out a few of the transitional gaps I’d added myself for things like section introductions, and I couldn’t figure out how to add them back. Oh well. I’m at the start of yet another learning curve, but such is life in the software world.
One really cool feature of descript, which I’ve only begun to figure out, is its overdub capabilities. That means you can add lines to the script and then choose an AI-provided voice to read them in the video. Better yet, if you upload your own recording of about 30 minutes in length, it will train an AI to use your voice on any new lines you add. I uploaded a Tftjs (this newsletter) video of about that length, and the next day it had my “voice” ready. I did a brief test, but I haven’t really used it in earnest yet.
The last feature it has, and this is one of the real attractions to me, is its ability to add captions to the video that are beautifully formatted. I tried it, but haven’t really used it yet. My plan is to make another YouTube Short this week and let descript add the captions in “karaoke mode,” which means the current word is highlighted as you go along. I think that will work really well with a Short. I’m not sure how great it would be for a full-length video. I guess I’ll have to experiment.
AI Stuff
I’ve been spending a lot of time on various artificial intelligence related products. I may wind up adding a semi-regular section to the newsletter about them.
One I already mentioned is descript, which classifies its overdub capability as AI supported. See that section of this newsletter for more details.
I also spent a fair amount of time with the classic, ChatGPT, but I added more to it in two ways:
I added a browser plugin called Sider: ChatGPT Sidebar. Whenever I do a regular google search in the URL bar, it automatically opens up a sidebar in my browser with the response from ChatGPT. You can also right-click and select Explain (or a few other options) for the same purpose. Since the data training ended in the summer of 2021, the information might be out of date, but the summaries and explanations are often useful. I expect this is exactly the sort of thing that Google will eventually replace with its own built-in version, but so far I’ve found Bard (Google’s ChatGPT competitor) to be so underwhelming I’m willing to try something else for the time being.
I added my credit card to OpenAI so that I could write code using the ChatGPT API. That seems useful. I tried it out by using a Java-based API called openapi-java provided by Theo Kanning. All I can say so far is that it works on the basic samples, and I’ve probably burned a few hundredths of a cent trying it out. At the least, I ought to be able to build an NFJS talk about around it.
Speaking of the OpenAI API, a developer in China by the name of Libing Chen created a Spring Boot starter called, naturally enough, Spring Boot ChatGPT Starter. It looks straightforward enough to use. This morning (and I mean really early this morning, given that the presenter was in Malaysia at the time) Josh Long did a quick Live Stream demonstrating how to use it. Here’s the link if you’re interested. I’m not really sure what to do with this, but it will only grow.
I subscribed to a (free for a change) newsletter by Noah Edelman called The Neuron, which talks about AI trends and tools. Seems pretty balanced so far. They also maintain a curated list of tools, which I expect will change a lot over time.
Rather a lot of items, really, but I guess that’s appropriate given how much time I’ve been spending on them.
Http Interfaces in Spring Boot 3.1
One other small item before I go to the tweets and toots. Last week I watched a video by Dan Vega on using the new HTTP interfaces in Spring Boot. I’ve been working with them for a little while, but since I tended to access publicly available web services, I mostly stuck with GET requests to tiny services that didn’t collect any user information.
In (at least) one of his videos (this is the one I watched, but I’m pretty sure this one also), Dan used the service called JSON Placeholder. I think I’d heard about it, but never used it and forgot. JSON Placeholder gives you rest-based endpoints for the HTTP verbs GET, POST, PUT, PATCH, and DELETE, all with some hard-coded JSON data.
I worked up an example of my own (highly influenced by Dan’s) that accessed several of them, once with a regular WebTestClient
from Spring Boot and once using those Http Interfaces. Feel free to check out the GitHub repository if you’re interested in either seeing it or playing with the code. Again, Dan gets an assist at the very least. His YouTube channel is here.
Tweets and Toots
We’ve All Been There
Yeah, I can see that. From the same author:
Wow, a Lord of the Rings Ship of Theseus joke. Don’t see one of those every day.
Liminal Spaces
Once again, Natalie Wynn (who goes by @ContraPoints on Twitter), released a “Tangent” to her Patreon supporters ($2 and up). It’s all about philosophical ruminations on the concept of liminal spaces, which is a term I’d only heard a couple of times and knew nothing about. Her Patreon feed is here. It’s long this time (about 80 minutes, as she said), but she’s always fascinating to listen to and it gave me much to think about.
For the record, liminal spaces are those places “in between,” like tunnels and corridors, that “portray empty or abandoned places that appear eerie, forlorn, and often surreal.” As usual, she knew the literature (yes, there’s a literature on them) and connected the ideas to many fields, including philosophy, architecture, and the feeling of being in a transitional phase in your life. I recommend watching her talk, if you don’t mind the small subscription fee.
Watch I-95 Being Rebuilt
You may have heard about the major accident that occurred on I-95 outside Philadelphia last week, when a truck crashed, burst into flames, and caused an overpass to collapse. This tweet gives this link, which you can watch as a broadcast on Twitter, to see the repairs in action. It’s way more interesting to keep on in the background than I expected.
According to the governor (quoted in this AP report), I-95 will be reopened in as little as two weeks. That’s awfully hard to believe, but we’ll see. I’m really glad I don’t need to drive anywhere near the place.
Twitter Crumbles On
This Mastodon thread of toots tells the fascinating story of Twitter’s expansion into a new building in Boulder, CO that everybody knew was going to be empty, and the resulting disasters that followed:
It’s an excellent reminder that Twitter was badly managed long before Elon took over, though as usual he only made the problems worse.
The Reddit Rebellion
I read a fascinating discussion this week about the differences between the terms business and industry. Industry is when people cooperate to produce a product at minimum cost that they can sell to generate income. Business is when companies erect barriers to that value so they can charge you for access. All those subscription fees I mentioned earlier about the various AI services are business, the actual services are industry.
The contrast really came to the fore over the past couple of weeks as the owner of the social media site Reddit decided to start charging a fortune for access to its data, pretty much putting all third-party clients out of business. Rumor has it this was done simply to build up the value of the site before it launches an IPO that should make the founders billions and, as usual, everybody else next to nothing.
Here’s an explainer at Vox, and Casey Newton’s Platformer newsletter goes into a lot of detail about it all. The problem with charging is that it’s purely business, not industry — the value of the site is the collection of posts made by its members, all of which were done without any financial reward, plus the moderation of all the subreddits done by volunteers. The owner of Reddit hasn’t contributed anything other than the infrastructure, so effectively what he’s selling is the gatekeeping.
In response, a few thousand (!) moderators decided to hold a strike by making their subreddits private over last weekend. The response by the owner was wait it out, claiming all the drama will pass. Of course, that reaction was about the biggest challenge he could throw in their faces, so now most mods are trying to maintain the blackout indefinitely.
The next move was for the owner to try to replace the moderators, which, remember, are volunteer positions that involves tiny bits of power and lots of aggravation. When that didn’t work, he threatened to have them removed for non-compliance and simply make the subreddits public again.
You can’t get away with such heavy-handed idiocy on the web. The best response I’ve seen so far is this:
Isn’t that awesome? I’ve linked that to the actual thread, in case you want to take a look. It’s great. For the record, John Oliver has been very supportive, and even provided some goofy looking pictures from his HBO (wait, there’s no more HBO, I mean MAX) show.
The owner (who I’m am persistently not naming because screw that guy) demonstrated he is simply another awful tech bro by saying out loud that he admires the steps Elon Musk has taken since acquiring Twitter. That, by itself, should disqualify anyone from being taken seriously about anything ever again.
I guess they do have one thing in common, though. Both men are taking what were considered to be flawed but valuable assets and doing their best to burn them to the ground.
A Chess Joke
Saw this the other day:
Yes, I can see how that might be a problem.
A Seriously Dated Reference…
… but I’m sure my audience will get it immediately.
A complication is that in the desert, you can’t remember your name, 'cause there ain’t no one for to give you no pain.
(Now try to get that song out of your head for the next hour or so.)
Speaking of dated jokes
Here’s a link to Know Your Meme in the wildly unlikely case you don’t get the joke.
I wish I’d seen this last week…
… when I was including all the related jokes, but better late than never:
Presented without further comment other than to get the popcorn ready.
First Star Wars, now Star Trek
If I’m going to include a Star Wars joke, I feel obligated to include a Star Trek one as well:
Explains a lot.
In honor of Pride Month
Finally, there’s this:
I’m assuming the car was good with it.
Have a great week everybody!
The video version of this newsletter will be on the Tales from the jar side YouTube channel tomorrow.
Last week:
Functional Java, as an NFJS Virtual Workshop
Mockito and the Hamcrest Matchers, on the O’Reilly Learning Platform
Week 3 of my Spring and Spring Boot in 3 Weeks course, ditto.
This week:
Reactive Spring, on the O’Reilly Learning Platform (APAC time zones)