Thursday, 31 July 2025

LocalSend

I've always had problems getting files transferred from tablets, mobile phones, photocamera, MacBooks, Linux, Windows.

It often boils down to having to install an app of somekind, or mounting a virtual filesystem (if we're talking about Linux) or installing a driver. And as I do not do it often, I always forget which tool I used and what steps I had to take.

Well, not anymore!

Thank the heavens for LocalSend1. It does everything I need, in a very easy way and it's Open Source too!

It's just a small network app that uses a REST Service and HTTPS to transfer files to other instances of itself on the Local Network. No internet required.

Addendum

The only thing to keep in mind, is that some devices (notably my MacBook) will ask for permission from you before allowing LocalSend (or any other Network App) to actually access the Local Network.

References

[1] LocalSend: Share files to nearby devices
https://localsend.org/#/

Tuesday, 22 July 2025

John Cleese Quote on Creativity

“Nothing will stop you being creative so effectively as the fear of making a mistake. To play is to experiment. What happens if I do this? What would happen if I do that? What if. The very essence of playfulness is an openness to anything that may happen. The feeling that whatever happens it's okay. So you cannot be playful if you're frightened that moving in some direction will be wrong. Something you shouldn't have done. You are either free to play or you're not. So you gotta risk saying things that are silly, and illogical and wrong and the best way to get the confidence to do that is to know while you're being creative nothing is wrong. There's no such thing as a mistake and any dribbel may lead to a breakthrough.”
- John Cleese

I find that the quote above also applies to Software Design.

In that regard, having Technical Debt is a great way to slowdown or downright stop creativity.

Thursday, 10 July 2025

@Nonnull versus @NotNull

A quick small blog...

So, we have two (seemingly) conflicting annotations for the same thing1.

Even people who know exactly when to use what have a chance to pick the wrong one, especially with the use of Code Completion and AI nowadays.

So here's a quick rundown, but the reference below is much more in depth:

import javax.annotation.Nonnull;

@Nonnull
IDEs and Compilers use it for Static Analysis of code. (Though the RetentionPolicy is set to RUNTIME)
import jakarta.validation.constraints.NotNull;

@NotNull
Validation Frameworks (like ORMs) use it during Runtime for checks.

What about Nullable values?

import javax.annotation.Nullable;

@Nullable
IDEs and Compilers use it for Static Analysis of code.

There is no @Nullable available for jakarta.validation.constraints. By default things are nullable, unless explicitly mentioned otherwise.

When not to use @NotNull

The primary really important thing to take away from this is to not do the following:

It might work, your IDE might complain or it might not, but at runtime this will be ignored, unless this method is called by a Framework as mentioned above.

Addendum

Don't use javax.validation.constraints.NotNull. It's been superseded by Jakarta when Oracle moved Java EE to Jakarta. See [2].

Referenties

[1] Medium - Understanding @NotNull vs @Nonnull in Java: A Practical Guide to Null-Safety
https://medium.com/@mesfandiari77/understanding-notnull-vs-nonnull-in-java-a-practical-guide-to-null-safety-5e179e918f37
[2] Medium - Difference between javax.validation and jakarta.validation
https://medium.com/@ovinduuu/difference-between-javax-validation-and-jakarta-validation-df0c6dbe5cb3