Community-Managed AWS Lambda Base Images for Java 21

I’ve added a new custom base image for Java 21 on Lambda to complement the community base images already available for Java 17, Java 18, Java 19, and Java 20. You can find the images on the ECR Public Gallery and DockerHub and the source code on GitHub. Java 21 is an LTS release with some of the most exciting new features Java has seen in a long time, so everyone should be looking to upgrade ASAP!

I’ve also released a custom Lambda runtime for Java 21, if that’s more your speed.

These should be plenty to get you started on your AWS Lambda + Java 21 adventure!

Continue reading “Community-Managed AWS Lambda Base Images for Java 21”

Java 21 Custom Runtime for AWS Lambda

By standing on the shoulders of giants (I’m looking at you, Mark Sailes), I was able to turn around an AWS Lambda Custom Runtime for Java 21 on Java 21 launch day. Instructions to use it are in the repo’s README. All files required to create your own function are in the releases, so no building required.

There are a couple of known issues, particularly around CDS (Class Data Sharing), per the but they appear to be (mostly) cosmetic at first blush. It’ll be fun ironing that out.

I’m also looking forward to releasing a custom image for Java 21, too, as soon as an updated Amazon Corretto image drops.

Happy hacking!

Postgres Upsert: Created or Updated?

The excellent PostgreSQL database supports the following syntax for the common upsert SQL pattern:

INSERT INTO table(id, column1, column2)
VALUES (@id, @value1, @value2)
ON CONFLICT (id) DO UPDATE
SET
    column1=EXCLUDED.value1,
    column2=EXCLUDED.value2
RETURNING *

With this syntax, you can insert a new row with the given values, or update the existing row to the given values, using the row’s primary key (or other indexed key). Very handy!

But did the resulting upserted row insert or update?

Continue reading “Postgres Upsert: Created or Updated?”

ISO 15924 Codes to Unicode Scripts… and Back Again!

The writing system that people use can actually tell you a lot about the person: where they are, what language(s) they speak, and so on. The two main standards for writing systems are ISO 15924 and Unicode. They are closely related to each other, but not every ISO 15924 entry has a corresponding Unicode script, e.g., the Afaka writing system (Afak).

There and Back Again

I just released a new dataset to help people map from one to the other and identify writing systems that are mostly historic in interest, and therefore not interesting in a modern context.

Continue reading “ISO 15924 Codes to Unicode Scripts… and Back Again!”

emoji4j v15.0.1 Released

A new version v15.0.1 of my emoji processing library, emoji4j, for Java 8+ just dropped. Here are the updates:

  • Update to Unicode 15
  • New method GraphemeMatcher#results()
  • Imroved documentation
  • Even more tests

There is also now a Cookbook in the emoji4j wiki to help users solve hard or common problems with emoji4j.

Enjoy!

Parsing Rich Social Media Text

If you ever need to convert “plain” social media text like:

Hey @importantguy, check out my project https://www.mycoolproject.com/ #PrettyPlease

into “rich” social media text like:

Hey @importantguy, check out my project https://www.mycoolproject.com/ #PrettyPlease

Then you need a social text parsing library. The industry standard is twitter/twitter-text, but it doesn’t work for everything. (For example, it only parses valid Twitter mentions, but will not parse all valid TikTok mentions, since those screen names can contain a “.”.) So while you may need to customize for your specific use case(s), this post should at least give you a good starting point.

Continue reading “Parsing Rich Social Media Text”

Techniques for Solving the Toughest Problems

I’m a software architect, software engineer, data scientist, and analyst by trade. So far in my career, I have faced more and different problems than the average bear. This is a list of some of the techniques I have used to crack some of the harder nuts in my career. They’re pretty simple, so don’t expect any major revelations, and they’re obviously focused on my own experience as a technical knowledge worker. I’ll probably add some new ones over time, too. But I hope they’ll be useful to others, no matter their background.

Rubber Duckie, You’re the One

I certainly did not invent rubber duck debugging, the practice of explaining your code to a theoretical (or real) rubber duckie, but I’m a big believer in it.

You make coding lots of fun!

Explaining your thinking and logic to another person forces you to structure and justify your thinking, which often helps tease apart related concepts and clarify reasoning (or lack thereof). And it turns out that it doesn’t even matter if the other person talks back!

Continue reading “Techniques for Solving the Toughest Problems”