I am currently working on a encryption and decryption service for my application, using Google Tink. The problem is the following: I want to program it without using (nearly) duplicate code and therefore I had the idea of using generics. If parsing the Strings to a byte[] is the only option I will be doing th…
Tag: java
Spring Boot MongoDB: Can @GeneratedValue and @Column annotations be used?
I have been learning how to use MongoDB in Spring Boot; for this purpose I am trying to build a service that allows sending posts and commenting on posts in a forum. Currently I have created a model class for forum posts: In RDBMS like PostgreSQL I would use @GeneratedValue to automatically generate ID value …
In Azure DevOps, how to gracefully restart when deploying an app to Functions
In Azure DevOps Pipeliens, when deploying an app to Functions, the app may restart during the process of the app. Is there a way to monitor if the Functions app is running in the pipeline, make sure it’s done, and then deploy the app? Conditions Functions runtime: Java Trigger: Service Bus Trigger I tri…
Create a unique string from a selection of data (that is reverse engineerable)
I attempting to write an app that allows users to enter information/data and gives back a unique string that represents that data. I then want someone else (on a different device) to be able to enter that unique string and get back the inputted data from the first user A vastly simplified example is that I ha…
Simple Linked List: getting an ‘error – found cycle’ in code
I have this reverseList function: But I get an error that says ‘found cycle in the LinkedList’ when iterating specifically through ‘curr.next = prev’ and ‘prev = curr’. Any ideas on why this might be occuring? Thanks Answer As far as I can tell you are testing your code wit…
Creating a parameterized constructor to determine upper bound for randomized side lengths
Im working on a project for class and we have to create a Triangle class that will hold the lengths of each side of the triangle. I created a default constructor that gives each side of the triangle a random length no more than 6. Were asked to create a parameterized constructor that allows the caller to dete…
Why can’t Postman find my Spring REST API?
I created a very basic Spring Boot project with REST APIs. I tried connecting it to my Angular app but it was getting some CORS security error so I switched to Postman. I’m trying to test it using Postman but I keep receiving a 404 not found error on Postman. Why am I not able to connect to my backend
Binding two Property classes and I need to merge them to one and Bind that too
I am working in a library which configures Property classes through Spring properties in an application.yml file. I am moving from a deprecated prefix(com.myapp.deprecated) to a new prefix(com.myapp.newprefix). I want to maintain old applications that are already using the deprecated prefix for a short while …
Spring boot Bean annotation and instance variable flow in Configuration
I am new to the spring boot framework and I have some confusion regarding the @Bean annotation and how the instance variable gets changed by the Bean. I have a below example and if someone can answer my questions will be really helpful: If I am defining restTemplate in my instance variable will userRestTempla…
Java – changing an arraylist from another class
So, I’ve made a public arraylist that I need to change from another class. shielded is an arraylist, that stores the UUID as a string of every player that has toggled the shield on. This code does not affect the array in class one, but still lets me toggle it just in that class. After accessing it in Cl…