I have a problem while call com.google.firebase.cloud.FirestoreClient.getFirestore() in a Java Application inside a Quarkus Server which is Running on an Alpine 3.15.4 inside a Docker container. I have created a small demo. The results are: Configuration 1 Enable in the docker file Results: init ok shell fail…
Tag: java
Calling an abstract method from an interface without overriding it
I am working on a Java project and want to understand the source code before implementing mine into it. The problem im facing is, how can the source code uses the abstract method from an interface without actually overriding it? At first, I came to this statement: DeviceService deviceService = context.deviceS…
Java – Check if any of the words is contained in the text
I was trying to implement a method which checks whether a list of words is contained in a text. The problem is I cannot use the contains method because I just want the word to be detected (if the word is ‘car’ then with the string ‘cars’ the method should return false). In addition, th…
how to count the number of words in each line in Java?
My task is to count the number of words on each line of a text file, separated by space. The text file has 5 lines. I am very new to Java. I have so far this code with the B1TextLoader class and several methods. My output is: however, I want it to print something like How can I achieve this?
How to getQueueUrl as an array with an array of queueName?
Is there a way to get an array response for val getQueueUrlResponse on SQSClient.getQueueUrl method call with an array of sqsNames? I have many sqsNames and I’d like to batch the request into one request, I’d like to avoid hitting SQSClient multiple times. So if I have 10 elements in Array sqsName…
helpe to convert from java to php [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago. Improve this question I have written a java code and I need help writing it in PHP because I do…
how to change the background color of my listview based on a given data as a parameter in android
I have an android application that basically scan a barcode. I have a lists of items and I would like to change a color of my list once the item has been scanned. Please find the image below for reference. I would like to change a background color of item to red only if the item remaining is zero. There
How can I dynamically find the end of an object array inside of a JSON response using GSON?
I am working with a given JSON response. The API I’m using provides responses like such: As you can see, the response provided contains what I interpret to be 1 object array (size changes depending on what is being queried) and 2 objects. (data is the array, meta and links are the objects) I have ran in…
Can the following two cron expressions be used interchangeably?
I am trying to understand how Cron expressions are written and interpreted in Java. I am unable to understand how the two expressions listed below differ in physical sense: Expression 1: * * * 1/1 * ? * Expression 2: * * * * * ? * I referred to the description provided by CronExpressionGenerator and their des…
create keycloak endpoint to provide custom authentication
I am trying to extend keycloak by creating a new endpoint to authenticate users. The point is, user is not stored in keycloak, the user is stored in an external system. The external system will call the new endpoint and provide token (will contains user info), clientId, and clientSecret. and (somehow) we will…