Trying to use https://github.com/japlscript/obstmusic to talk to Apple Music app on macOS with Java, I used to write native AppleScript and then java applescript library but that was removed from Java. In this method it looks for a existing folder playlist called songkong, it it finds it then returns it. If n…
Spring implements to kinds of Repository interface
I’m trying to study Spring more specific Spring Data but i have a question about the use of interface Repository and its derivatives classes and i asking you help for clarify them. For example i see this code example extends CrudRepository but i see the using of extends keyword but no implements. why ? …
How to upgrade spring framework version in spring boot
I am using spring-boot 2.3.3.RELEASE with the according spring-boot-starter-parent in maven. Due to the spring4shell CVE I wanted to upgrade the spring-framework to 5.2.20.RELEASE instead of the already included 5.2.8.RELEASE. I tried overriding the spring-framework.version property from spring-boot-dependenc…
Unable to send the logs to Splunk Enterprise local using log4j2
I’m using log4j2 and splunk within java to send logs into my Splunk Enterprise HEC (HTTP Event Collector) Splunk Enterprise is running in my local machine. I’m doing all log4j2 configuration programmatically. (I know this is not the correct way to do this but I’m still doing this for learnin…
Using generics with custom object in method parameters
I have 2 classes as below :: And I have a method in a service class : Now I need to pass ItemA or ItemB based upon some conditions in the caller. The return type doesn’t change in either case. How I can do that using generics or wild cards. This is what I am trying to achieve : Is
ValidationFailedException after Liquibase update to 4.9.1
We were using older Liquibase that we now wanted to update to 4.9.1 due to vulnerabilities in older versions. However, now at least one of our old migrations fails with ValidationFailedException: The constraintName is missing from <addPrimaryKey>. However, it worked just fine with the older versions. Ho…
When developing the back-end, do you want to believe that the front-end data will not go out of scope, and reduce some data verification
In the scenario where the front-end and back-end are separated and developed, what the back-end does is to receive the data transmitted by the front-end, perform corresponding processing, and finally return the processing result information. So, for the data sent by the front end (whether it is Get or Post), …
Does flatMap method only flattens the stream and not map it?
I see it’s written everywhere that flatMap flattens and map the stream but in practical for example in the below program using only flatMap we can’t perform mapping operation(changing it to uppercase). We need to separately use map method here. Is my understanding about flatMap wrong? Can anyone p…
How to add using element to a Collection Set using Streams?
Currently I am adding an element to a Collection Set like this. Is there a way to do this with Streams that does not use Stream.concat()? Answer I would suggest you to remodel the objects, you’re updating User’s favorites outside this should happen within the User class Read this OO Principle, Tel…
How would I move a blank space in a 2d array?
I’m working on a Slider puzzle game and I’m not sure how I would go about moving a “blank” around the array. The puzzle would something like this but randomized. Each method has a prerequisite indicating if it can move a certain direction or not. Answer Here is an example of how you co…