Records in Java look very promising to me and a great addition to the language. The ceremony of creating pure data holder classes will be well know to any Java developer. Sometimes we just create a class to transport some data from A to B. Most of the times we don’t even care about object… Continue reading Records in Java (JEP 359, preview)
Author: admin
Develop a game with p5.js (part 2)
Welcome back to the second part on how to develop a game with p5.js. Today we are going to add some interactions to our game. Wouldn’t be a real game if we couldn’t move around something, right? Now that we already have setup most variables that we need and the scene is set, the rest… Continue reading Develop a game with p5.js (part 2)
Develop a game with p5.js (part 1)
p5.js is a great JavaScript library to create little games that run directly in your browser. They even offer an online editor, so you can really just get started. Find out more about p5.js here: https://p5js.org/Or directly access the online editor: https://editor.p5js.org/ In this article I will show you a game we implemented as part… Continue reading Develop a game with p5.js (part 1)
Switch Expressions in Java (JEP 361)
With Java 14 we will get a new feature that simplifies the switch statement. It will provide a new and clearer way to write switch statements and in addition allows us to use switch as an expression yielding a value. New Syntax Forget about break! No fall through anymore – simple and concise. Today you… Continue reading Switch Expressions in Java (JEP 361)
Pattern Matching for instanceof (JEP 305)
Finally with Java 14 we get a (preview) feature I had on my wishlist for a long time. It eliminates the need to first test an object via instanceof operator and then (and I asusme it is the 90% case) cast it to exact that class in order to do something with it. Here is… Continue reading Pattern Matching for instanceof (JEP 305)
Launch Java Programs Without Compilation (JEP 330)
Since Java 11 we can run Java programs directly from the command line without the need to manually compile them first. Frankly speaking I don’t know if this is a feature I will ever use in my daily work as a developer. But it could be useful to learn Java and provides an easy way… Continue reading Launch Java Programs Without Compilation (JEP 330)
Java Collections Static Factory Methods
With Java9 we finally get an easy way to construct collections. I think the map is one that I will be using quite often. Now I can write: Map<String,String> lookupMap = Map.ofEntries( entry(“a”, “A”), entry(“b”, “B”), entry(“c”, “C”)); Instead of: Map<String, String> lookupMap = new HashMap<>(); lookupMap.put(“a”,”A”); lookupMap.put(“b”,”B”); lookupMap.put(“c”,”C”);
JavaScript und Physik
Gerade kürzlich ist mir die Formelsammlung der Physik in die Hände gefallen und ich hatte irgendwie Lust, ein Pendel zu programmieren. Ich habe früher bereits einen Artikel geschrieben, wie man mit JavaScript physikalische “Experimente” durchführen kann und bin nach wie vor der Überzeugung, dass dies eine ideale Tätigkeit ist, um das Programmieren zu erlernen. Man braucht… Continue reading JavaScript und Physik
AngularJS allow invalid values to be set on the model
The default behavior of AngularJS when you have a validator on an input field is to set the model to undefined if the validation failed. This might be convenient for most cases, but sometimes you want to have the invalid value in your model. It is really easy to tell Angular to allow invalid values on your… Continue reading AngularJS allow invalid values to be set on the model
Run EasyTax2014 with Docker
I just created a Docker image that runs the EasyTax2014AG application. It was pretty straight forward to write the Dockerfile. I have based it on the official Ubuntu image because I wanted the Dockerfile to be transparent so that you can actually trust there was nothing installed that tries to steal your data in some… Continue reading Run EasyTax2014 with Docker