Tuesday 22 October 2024

Git: Adding your own commands

So I do have a habit of adding my own commands, simply as an alias, simply in the startup scripts of my *nix account and it works fine.

But apparently it also can be done inside git.

So in the example in [1], the new command is "git eradicate".

It was added to the ~/.git-config file as:

eradicate = "!git reset --hard; git clean -fdx"

"-fdx" will also remove files that are mentioned in the .gitignore file.

As there are settings in there, this is perhaps not what you want.

According to the manual in [2] regarding git clean, the option "-x" has the following interesting effect:

"Don’t use the standard ignore rules (see gitignore[5]), but still use the ignore rules given with -e options from the command line. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git restore or git reset) to create a pristine working directory to test a clean build."

In that case, perhaps the one below is safer:

eradicate = "!git reset --hard; git clean -fd"

References

[1] Medium.com - SE Radio, Git Eradicate, Progress On JMS
https://medium.com/nipafx-news/jpms-support-for-module-versions-a-research-log-2c96f5d0c1ee
[2] Git - --distributed-is-the-new-centralized - Git Clean
https://git-scm.com/docs/git-clean
explainshell.com
https://explainshell.com/explain

Monday 14 October 2024

Devoxx 2024 - Writeup

So, I went to Devoxx 2024 and I thought it would be good idea to write up what I've witnessed, and what I've missed and thought was interesting.

What I would have liked to see

And since these things are available on the Internet, I'll see about viewing them afterwards.

Notes

The Security Manager will be removed, which makes sense. It's one of the last things left over from the "Java Apps running in your Browser" - days. Nowadays, all the security takes place in dockers and containers and operating systems etc.

JEP stands for Java Enhancement Proposal. But these can be very different. Apparently there are "Process" JEPs and "Informational" JEPS (for example JEP 14).

StringTemplates was removed from the JDK for now, next iteration of the design in the works soonish.

With the new Memory API, there's a focus on making it secure, because a lot of security breaches and hackers make use of badly written code that messes with memory. The white house even published something about it. See the references. In the future there might even be a Draft JEP for it "Integrity by Default".

In the early days, arithmetic and memory fetch had the same cost. Nowadays the CPUs are soo fast, arithmetic has a much faster operation speed, than a memory fetch. This needs to be taken into account when designing language features.

Quotes

Some relevant quotes that I picked up during talks, always fun:

“We do these things not because they are easy, but because we thought they would be easy.”
“I apologize for writing you a long letter. I did not have time to write a short one.”
- Blaise Pascal
“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.”
- Antoine de Saint-Exupéry

References

Sheets - Java 23 Better Language, Better APIs, Better Runtime
https://slides.nipafx.dev/java-x/#/
Sheets - Memory API patterns, use cases and performance
https://speakerdeck.com/josepaumard/memory-api-patterns-use-cases-and-performance
Devoxx Google Cloud
https://cloud.google.com/developers/devoxxbelgium
WebForJ
https://documentation.webforj.com
Martin Fowler - Anemic Domain Model
https://martinfowler.com/bliki/AnemicDomainModel.html
Github - DevoxxGenie
https://github.com/devoxx/DevoxxGenieIDEAPlugin
IntellIJ Plugins - DevoxxGenie
https://plugins.jetbrains.com/plugin/24169-devoxxgenie
Amsterdam Voxxeddays
https://amsterdam.voxxeddays.com/
Google Notebook
https://notebooklm.google.com/?pli=1
Oracle Cloud
https://go.oracle.com/LP=144680
OpenJDK - JEP 14: The Tip & Tail Model of Library Development
https://openjdk.org/jeps/14
Crafting AI Prompts Framework - Adversarial Prompting
https://craftingaiprompts.org/documentation/adversarial-prompting#adversarial-prompting
Project Valhalla
https://openjdk.org/projects/valhalla/
The White House - Press Release: Future Software Should Be Memory Safe
https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/
Quarkus In Action
https://developers.redhat.com/e-books/quarkus-action
The best Java 22 feature: concurrent gathering
https://softwaregarden.dev/en/posts/new-java/gatherers/concurrent/
GitHub - Modern Java In Action
https://github.com/nipafx/modern-java-demo