Tales from the jar side: Live Stream with Baruch Sadogursky, AI Tools for Java Developers, I am become Barbie, Destroyer of Worlds, and more Tweets / Toots / Skeets
What's a web developer's favorite tea? URL Grey (rimshot)
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of July 16 - 23, 2023. I spent this week at ÜberConf, in Westminster, CO (just outside of Denver). I gave a full-day workshop on Latest Features in Java, and six additional talks:
AI Tools for Java Developers
Mental Bookmarks and the Fractal Nature of Success
Upgrade to Modern Java, parts 1 and 2
Java Testing with JUnit 5
Mocks, Stubs, and Spies with Mockito 5
Most of that was my usual fare. The AI talk was truly new, and I discuss that a lot in the rest of this newsletter.
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.
ÜberConf Live Stream
While at ÜberConf, I arranged to do a Live Stream on the Tales from the jar side YouTube channel with Baruch Sadogursky.
Baruch is a real character. He’s lived in many countries around the world, and his career has many twists and turns. As some of you may know, for several years he was my co-host on the Groovy Podcast.
At the time, Baruch was a Developer Advocate for JFrog. In our live stream, he told a great story about how that job title came about. I extracted it into a YouTube Short:
It’s a great story.
Baruch was employee number 10 at JFrog, and after 11 years there the company went public. I knew he did well in that, because he took a sabbatical, during which he spent about a year (!) relaxing in the Mediterranean (!!) before he decided to go back to work.
Baruch now works as a Principal Developer Advocate for Gradle, Inc. We had a lot of fun talking together.
AI and Me
While I gave several talks at ÜberConf, the biggest new one was called AI Tools for Java Developers. I covered a lot of topics in that, ranging from ChatGPT to Google’s Bard to Anthropic’s Claude to the new AI Assistant inside IntelliJ IDEA.
During the conference, Facebook (I still refuse to call them Meta) released it’s newly revised tool, called Llama 2. I was able to try that out today at this link. To give you an idea what that was like, here’s a discussion I had with it about summarizing a file.
If it can access Google Drive or Dropbox through a link, I figured I could use the jwebserver
program added in Java 18 on a local directory. I set that up and asked it about a PDF file in the root directory.
That didn’t go well:
You’re very welcome, and may I say sarcastically, from the bottom of my heart, you’re a lying idiot. I must admit I kind of expected that. More to the point, one thing I’ve learned about these tools is that asking them what they can or can’t do is like asking a toddler what they can or can’t do. They’ll give you an answer, because they know you’re expecting an answer, but that answer probably has no connection to reality.
Reading a file from a local link is something Bard can do, by the way, and the Java code I discuss in the next section meant I could read the file myself and send it to ChatGPT.
AI tools: the OpenAI API
For my talk, I wrote Java code to work with the OpenAI API. Since I’m using Java, the code wound up being more complicated and verbose than in other languages, but it still worked. The API is simply a series of REST calls. I send an HTTP POST request to the base URL, containing JSON data with my messages, and it responds with JSON data as well.
I tried to simplify the code by using records for the JSON data, the Gson parser for JSON, and the built-in HttpClient
library from Java. I’m calling the chat-gpt-3.5 turbo engine, which is okay but not great. I’ll no doubt experiment with gpt-4, but that’s a lot more expensive.
At the moment, for example, the GPT-3.5 model is about $0.0015 / 1K input tokens, $0.002 / 1K output tokens, and GPT-4 is about $0.03 / 1K input tokens, $0.06 / 1K output tokens. 1K tokens is about 750 words. For all my experiments, both preparing for the presentation and clean up afterwards, I’ve spent about 3 cents so far, using GPT-3.5 exclusively. I think I can handle that. 😊
If you want to see the code, my GitHub repository called openapidemo is located here. I plan to keep revising it and adding examples.
AI tools: Descript
As part of my talk, I included a demo of Descript. I know that has nothing specifically to do with Java developers, but people seemed interested anyway. The morning of my talk, Descript released a new version with the “Eye Contact” capability included, though it was marked Beta.
I prepared the following YouTube Short, which illustrates:
Writing a script and having Descript speak the words out loud for me,
Using the overdub capability trained on my own voice.
With the new Eye Contact capability.
So-called “studio sound,” which cleaned up the audio from my travel mic used in my hotel room. That’s in the second scene. The first scene is the AI overdub.
The short (only about 30 seconds long) starts with a few sentences that I wrote but never spoke. Then I used the new Eye Contact capability, and though it’s not obvious, I kept looking away from the camera.
The result is not bad, actually. If you’re interested in that capability, Meredith Marsh made a better short about it this morning.
If you’re interested in Descript, check it out through my affiliate link here. If you wind up subscribing, I get a small reward, but the price is the same to you either way.
AI Tools: Canva
Another tool I showed in the presentation is Canva. I used its Magic Design tool to create a new presentation called AI Tools for Java Developers (imagine that). It put together seven slides with some moderately useful text and some decent graphics for me.
I then went to Midjourney and asked it to create a picture of a robot drinking coffee while coding in Java. It didn’t quite do that (typical, or at least typical for me), but it did give me this:
I put that into the presentation, replacing one of the existing images. I pointed out that in the picture, the robot had two cups of coffee, and while I didn’t mind that, the second one seemed unnecessary. I therefore used Canva’s Magic Eraser to get rid of the second cup.
I didn’t quite get there at first. Erasing the second cup left behind a shadow, believe it or not, which the tool enhanced. I had to erase that as well. Still, the process worked. I then added music to the background, and used Canva’s Beat Sync tool to make the slide transitions happen on the downbeat each time.
I don’t know how often I’ll use something like that, but it made for a nice demo. If you want to see the result, I posted it on LinkedIn here.
Tweets / Toots / Skeets
Barbenheimer
The internet apparently has settled on the term Barbenheimer for the Barbie movie / Oppenheimer double feature. I haven’t seen either one yet, though I plan to go to the Oppenheimer movie some time in the next couple of weeks.
I did start collecting clever memes, however. Here are a few:
That’s a good one. This one is rather dark:
Um, yeah.
I watched a great video this week by Todd in the Shadows as part of his One Hit Wonderland series, called “Barbie Girl” by Aqua. I had no idea how much Mattel hated that song, which I guess isn’t surprising. From what I understand, they denied adding that song to the movie, but then added it anyway. I imagine too many people were expecting it to leave it out entirely.
Last, but not least:
What’s the quote from the Bhagavad Gita? I am become Barbie, Destroyer of Worlds? Something like that.
I think sums up the reactions from some weird conservatives:
Enough of that. Let’s move on.
Living in the moment
We all have a price. Some are higher than others.
Please don’t do this
That’s really mean, but I laughed.
For the record, sudo
means “superuser do,” so the command is executed with higher privileges, rm
means delete, / is the root directory (meaning you’re going to wipe out everything), the r
flag means recursive (so all the way down), and the f
flag means forced (so no verification prompts required). I’ve always seen this gag as sudo rm -rf /
, which is bad enough. Reversing the flags to make it look like an abbreviation for French is inspired, in a truly evil sort of way.
As the planet boils
That’s a real sign in Death Valley, though it has a reputation for being set too high in order to please the tourists. The National Weather Service did say the temperature there was 120 degrees at midnight on Friday, which is quite bad enough.
Accept Cookies (Y/N)?
I can’t believe that never occurred to me.
Finally, in the immortal words of Carl Sagan:
I feel really bad that I laughed at that, but I’ll get over it eventually.
Wait, one more.
User interface design is hard
Wow. Sure, no documentation needed.
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:
ÜberConf
This week:
Managing Your Manager, on the O’Reilly Learning Platform