Category "java"

CLinker.toCString replacement in Java 18

Java 16, as part of incubating package jdk.incubator.foreign, used to provide convenient way to convert Java Strings to C strings of arbitrary Charset using Mem

Room database RawQuery() is not work on "IN" and "NOT IN" clause

I have my one table like UserTable. @Entity public class UserTable{ @PrimaryKey(autoGenerate = true) private int userId; private String userName;

In AnyLogic, how can I use the findFirst function but for three different agent populations / data types?

Question: Is there a way to write one function that would account for the different data types? Would generics work and if so how do you do that in AnyLogic? Ba

Netbeans (12x)/Maven include and load embedded resources?

Simple question, how to include and load embedded resources from a Maven based project when using Netbeans 12x In a traditional/Ant based project, it's possible

Chronicle Bytes: How to write bytes in big endian order on a little endian machine?

I'm using the Bytes<U> interface from here. The underlying buffer is created as follow: Bytes<?> buf = Bytes.elasticHeapByteBuffer(MAX_SIZE); buf.wr

useAbstractionForFiles OpenAPI WebClient not working

I am using OpenAPI generator (Gradle plugin version 5.4.0) to generate a few API calls. One of said calls, revolves a file download from an external service i.e

Why iterate data twice in java

In my program all work properly but problem is the total like get twice for one user i try to iterate properly but i am not succeed i can try to solve this prob

why connect zookeeper take a long time on windows?

I'm run a simple demo that using the java zookeeper client to connect zookeeper server. It take a long time(at least 10 seconds) to connect successful on window

Different Java Regex matching behavior when using UNICODE_CHARACTER_CLASS flag

I was testing the behavior of the Pattern.UNICODE_CHARACTER_CLASS flag for different punctuation characters and noticed that the matches for grave accent charac

Spring Cloud Contract with Wiremock - how to choose Scenario manually?

Im working in a project using Spring Cloud Contract and Wiremock to create integration tests. Everything was fine until we need to add multiple responses to the

java.sql.SQLException: Column 'serialnumber' not found. (spring boot)

I am writing to-do list web app with spring boot. I Have 2 entities: User (fields: userid (ID), username, password Item (fields: serialnumber (ID), task, userid

gRPC file upload detect content type of file on server

I am trying to do a file upload on via client streaming gRPC. Sending a file via streaming from client to server. I have implemented this code for server side w

Android AudioFocus with AudioTrack hardly works

I use AudioTrack to play some audio like GPS navigation does. Of course, I need to ask for an audio focus, but my ugly code doesn't make the trick as I expected

Immutables autogenerated for MongoDB throws "Can't find a codec for class Immutable.."

Problem Description. So I have an item that I want to use with MongoDB @Value.Immutable @Gson.TypeAdapters @Criteria.Repository interface Person { @Criteria

Preferred way to convert openapi 3 document (json or yaml) to markdown, adoc or any other static format

I try to find an easy way in java to convert an openapi 3 document (json or yaml) in a static format like markdown, html or adoc. Searching around I've found a

How to convert https url to File in Java?

I have an https url which is of String format. How can I convert it to File? I tried this but I'm getting error - URI scheme is not "file" public static File c

how to playback audio blob from Spring boot App

I am storing an audio blob(recorded voice) in angular and then I am calling a spring boot API to store it in azure blob storage as so: submit(){ const

how to format String to Date with format dd-mm-yyyy in java [duplicate]

I need some support. I desired convert a variable String to Date. The variable Date should be format dd-MM-yyyy. import java.util.Date; .

How should I reconfigure the arrow "->" to not print when done with with my pathing?

I'm trying to create an optimal path to collect as many 1's as I can but after I execute my code, I still have an arrow pointing to nothing as there are no more

Exact Change with Java

I am struggling with a homework assignment for a Java class. My code is listed below. I am having a problem with my dollars and quarters and outputting correctl