Tales from the jar side: Live Stream with Venkat, Assumptions in Spring Boot apps, Medium Day talks, AI tools from Java code, and the usual silly Toots and Skeets
Why are there Pop Tarts but no Mom Tarts? Is it because of the pastryarchy? (rimshot)
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of August 6 - 13, 2023. This week I didn’t teach any classes, but I did a lot of other stuff.
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.
Live Stream with Venkat
On Wednesday, on the Tales from the jar side YouTube channel, I held a Live Stream with my friend and industry legend Venkat Subramaniam. Here’s the replay link:
Venkat was his usual affable self. He’s always entertaining, and this was no exception. If you don’t have time to watch the whole thing, I did manage to extract two one-minute-long Shorts out of it. The first is about how he wound up becoming an expert in C++ (starting from nothing) in about a month:
Yup, that’s typical Venkat. The real lesson to learn from that story is that he will outwork anybody. He puts himself in the way of opportunities, of course, but he works harder than anyone I know. Even among the ambitious, highly motivated group of speakers on the NFJS tour, everybody knows Venkat probably puts in twice as many hours as the rest of us, probably put together.
As Nate Schutta is fond of saying, “He’s remarkably lifelike.”
The other Short I extracted was about the process he uses to generate the first draft of his books, which is frankly insane:
Most people have experienced getting into the flow, where time seems to fly by without thinking about it, but two full weeks of 18 hour days, consecutively? Sheer madness. Not to mention that his wife is a saint.
Other YouTube Activity
This week I published the follow-up to last week’s video on Assumptions
in JUnit 5. This time I talked about using them in a Spring Boot application to avoid accessing a web service unless you know it is up and available.
The idea is to make an HTTP HEAD request before running any tests and make sure you get back a successful response. The video considers five different ways of accessing a web service from Spring:
The new
HttpClient
API built into Java 11 and above,The traditional
RestTemplate
, a synchronous client that’s been in Spring for years,The newer
WebClient
class, which makes reactive requests,The cool new Http Interfaces technique added in Spring Boot 3.1, and
The not-yet-released
RestClient
class, which will be part of Spring 6.1. That class is like theRestTemplate
and is likely intended to replace it, but with an API similar to the WebClient.
Getting that last one to work was a bit of a challenge, because I had to figure out how to add the right dependency to my Spring Boot app that worked for a class that only in the upcoming milestone version.
For details, see the GitHub repository with all the code.
The real learning moment for me was when I couldn’t figure out how to use the Http Interfaces approach to make a HEAD request. There are annotations for GET, POST, PUT, and DELETE, but that’s all. I thought I saw a video that suggested if you do a @GetExchange
annotation and returned a ResponseEntity<Void>
, the system would automatically do a HEAD request, but that didn’t work for me.
Finally I decided to contact my friend Craig Walls, the author of the Spring in Action books (up to 6th edition now, with likely at least one more on the way) and a Spring expert, and ask him. He suggested using @HttpExchange(method = “HEAD”)
, which was one of those “Duh, I can’t believe I didn’t think of that” moments.
I made sure to thank him in the video. :)
Incidentally, you can see that this week I took the advice I got last week about thumbnails to heart. I created a thumbnail that does not simply repeat the title of the video, but is going after emotions to some degree. Let me know if you think it worked.
I should also mention that this time I did not share a link to this video on all my social media accounts. I’m trying to let the YouTube algorithm do its job, figuring out what the right audience of YouTube people might be for my video, rather than give it all those links from outside. In fact, I still haven’t shared it, which might not be a good idea. I’m still trying to figure all this out, so this is an experiment.
Finally, I made one other change to the YouTube channel: I replaced the banner at the top:
That’s a bit tricky, because on mobile both sides get cut off, so you need to place any content accordingly. I finally added images of my books. That’s another one of those marketing ideas that seems obvious in retrospect. Even if it’s not about selling the books themselves (and it’s probably not), it’s about establishing some credibility that I might know what I’m talking about, more or less. Also, I rearranged the playlists that appear on the home page. I have no idea what effect that will have either, but hey, this is probably better.
One more thing about the channel. Last week I passed the 500 subscriber milestone, which was pretty cool. This week, between the video above, the live stream, and the two Shorts, I passed the 100 video upload mark.
I’ve now added 103 videos to the channel. Look for number 104 tomorrow, which will be the video version of this newsletter.
Finally, I was notified of this little accomplishment:
This is all good news, of course. My channel is still small, but it’s growing. I just need to be patient with it and keep uploading new material on a regular basis, and it’ll all be fine.
Oh, and despite those little “awards,” I still haven’t subscribed to vidIQ. I’m glad they keep sending me the awards, but not so glad I’m willing to add yet another subscription to my list.
Medium Day
On Saturday I appeared on Medium Day as part of a panel discussing how to write technical books in general, and for Pragmatic Programmers in specific. I enjoyed the panel, though I initially struggled to join. It turned out I needed to hit the Settings gear icon in order to enable my mic and camera, and that cost me some time. Oh well.
The panel itself was small but fun. I’m glad I got to meet the other authors there. When asked if I had any advice for new writers, I went last, so most of the good comments were already gone. Still, I added:
When you first start a book project, it feels like emptying the ocean with a teaspoon. But keep at it, a little more every day, and one day you’ll look out and see only a lake, and then a pond, and then a puddle. It really does add up, like steady effort on anything else.
Don’t expect the final book to look anything like what you had in your head at the beginning of the process. The act of writing changes everything.
(This may be unique to me.) If you’re having trouble writing, tell a story that ends in a joke. I find if I have a joke to tell, I’ll write pages and pages to get the punchline. Then the editor can go, “um, no, that’s not funny,” and I can remove the joke and still have all the rest of those pages left. :)
Humor in both books and presentations is a high-risk / high-reward activity. When a reader or listener is confused, they don’t want to hear any jokes. But if they’re okay, a decent gag breaks up the monotony. It’s a balance. Besides, and this applies to me as much as anybody, most people aren’t nearly as funny as they think they are. It was for this reason that starting in my first book, Making Java Groovy, all my best gags are confined to the footnotes. That way if you’re trying to find an answer, you can skip them, but I have some friends that went for the footnotes first.
Btw, none of this advice applies to Venkat, but you probably knew that already.
There were two other talks on Medium Day I want to highlight. One was by Celeste Headlee:
In case you can’t read that, the title is Do Nothing: How To Break Away From Overworking, Overdoing, And Underliving. She was very good, with lots of historical info about how we adopted our constantly working culture rather than reaping the benefits of the incredible gains in productivity over the last few decades. As someone who has trouble letting go of work, I think I’m the target audience, especially as I head toward whatever constitutes retirement. I ordered her book immediately afterward.
The other talk was by noted science fiction writer and gadfly Cory Doctorow:
I’m afraid I’m still not comfortable using his new term in the title, but his ideas are really interesting. My only problem with him is that I find him very depressing, because I agree with a lot of what he’s saying and yet I feel I have no power (beyond what I already do) to make any of it happen.
His book related to that talk is called The Internet Con: How To Seize The Means Of Computation, and will be out next month. Depressing or not, I ordered it anyway.
Overall, I found the experience of Medium Day more valuable than I expected. I still doubt I’ll make much money there (last month my earnings skyrocketed to $9), but they put on a good show.
More AI Experiments
This week, on Friday at 1pm EDT, I have a free online presentation called Practical AI Tools for Java Developers:
I’ve been playing with the OpenAI API, from the creators of ChatGPT. I’ve got a few Java examples of that working, and have a few interesting things to say about it. I also managed to work with their Whisper API, which transforms audio into text.
This week one of the newsletters I read recommended Picogen, which provides a RESTful web service that allows you to interact with image generators Midjourney, Stable Diffusion, and DALL-E. I worked out the associated Java code and got it working for Stable Diffusion, but for some reason Midjourney is still giving me errors. If I can get it working, I’ll include it in the talk.
Incidentally, here’s an image generated by Midjourney from the following prompt:
Captain James T. Kirk in a light-saber battle with a Klingon on the bridge of the Enterprise.
I mean, no, but yes. Missed the point, mostly, but the point was a gag anyway. I’ll just say that the Stable Diffusion variations were worse.
Two weeks ago, I included an example where I used the Code Interpreter inside GPT-4 to render the Mandelbrot set. Last week I did the same for the Julia set. This week I thought I’d include the Buddhabrot set, which tracks elements that do not converge during the Mandelbrot iteration.
I can sort of see the Buddha if I turn my head sideways. I’m not sure what to do with that one, but it looks pretty cool even at this low resolution.
Anyway, if you’re around on Friday and you make it to the webinar, please say hi and let me know you’re a jarhead. As a teaser for any Java developers, here’s the GitHub repository, which should evolve a lot between now and Friday.
Toots and Skeets
Isn’t everything more complicated than it appears?
Here’s the latest from Tom Gauld, who creates comics for New Scientist:
Yup, that’s definitely an issue.
Musk vs Zuck
Zuck is ready to fight tomorrow. Musk keeps coming up with excuses. Zuck finally called him on it.
Can we just stop this, please? Everybody knows Zuck would destroy him, and we know that Musk is too much of a coward to actually get in the ring, and he’s too full of testosterone poisoning to let it go. I guess I’m keeping track out of morbid sense of curiosity, but that’s about it.
Good thing I work at home
I’ve made many mistakes in my life, but so far that’s not one of them.
Book banning in 2023. Sigh
Monsters, indeed.
Lord of the Rings joke
Woof.
Another Barbie joke, but a good one
The text reads, “She’s a former Queen of Naboo and sitting Galactic Senator. He’s just Ana-ken.” The poster is for the Padme movie, presumably.
Yup, Ana-ken. Lol. Is he Anakenough?
OMG that’s so true
That explains so much.
Finally, a Dad joke
I fell for it. Did you?
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:
Tales from the jar side Live Stream with Venkat Subramaniam
Medium Day on Saturday
This week:
New Features in Java, on the O’Reilly Learning Platform
Practical AI Tools for Java Developers, an NFJS webinar on Friday