I’m trying to build a chat-like thing, and the idea is that whenever someone types, it gets sent and printed on every client connected. If I only open the server and one client, everything runs smoothly — whenever I send something from the client, it goes to the server and then it comes back and gets printed on the client.
Tag: java
Java Income Tax Calculator need to add prompt to add more customers
I have a java program that calculates users’ income taxes, with some help the project now runs correctly, but I am supposed to add an option for the user to process additional customers once they have finished with a customer by entering ‘y’ into a prompt. I need the prompt to say: “Process another customer? (y/n)?” Since the user could
how to resolve error executing ddl commands in spring boot
Hi I am new to spring Boot and i created new project(Demo) using spring initilizr Project structure is Project : Maven Project Language : Java Spring Boot : 2.4.2 application.propertites file is like I have Created some classes and controllers : Entity Repository : Service : Controller : But when i run the program i got error related to DB
fhir.executeBundle replacing resource id…How to prevent this?
I am using this Java code to upload a resource to a FHIRstore. The resource is as follows But the id i am using(123456) is getting replaced by a hexadecimal number. This does not happen while using fhirstores.import method Is there any way to stop executeBundle method from replacing my id…as i want to use custom id in my resource?
Simplest way to get current user logged in Keycloak
I have implemented a really simple keycloak integration on my maven java web app. Assuming I am calling a url directly for the keycloak log in page . After entering my username & password on success i am being redirected on mypage.html , the url is like this If I break this down its What would be the simplest –
Spring Webflux: how to compare results from two Mono streams and save based on filter
The situation is as follows: I have two MongoDB documents: User and Reproduction. Based on a check if the User has a Reproduction entry (document), I want to add another entity in MongoDB. Currently I am using Spring Webflux and Spring Reactive Mongo. Please see code below. My question is as follows: how can the result from the Mono be
How to sum elements of List
I want to sum the possibilities (of some characters) in the context of Shannon-Fano Algorithm. Example input/output Given poss as a List of Strings filled with possibilities. For example the possibilities are as follows: and the sum must be 1 (after adding all the possibilities). What I already tried Following code is what I tried. But the problem is that
Java path problems, ‘java’ is not recognized as an internal or external command, operable program or batch file. (javac too)
I know there are lot of questions like this but i tried their solutions and nothing. While i try to javac file.java i get ‘javac’ is not recognized as an internal or external command, operable program or batch file. And java file ‘java’ is not recognized as an internal or external command,operable program or batch file. My environment path is
java.lang.InterruptedException while running a batch file
I am trying to run a batch file which has set of services I want to restart. When I call this batch file from my Java application I get Interrupted Exception. My batch file My java code to run the batch file I’m getting the following error What am I doing wrong? Answer Looks like the problem is with the
Keycloak custom PasswordHashProvider, salt change on each connection
I am trying to create a custom PasswordHashProvider. I succeeded in creating the component, the algorithm is working, the password saved in the database is correct. A Salt is stored in a database, but I don’t understand how. I thought it was the base 64 salt, but it doesn’t match. I add logs in the console when creating a password