java

java

  • All Sites

1 answer

Can weblogic or other config affect the use of oracle table function?

I met a strange problem when using oracle table function. Two environments: local and remote, the code is the same only some config varies and they share the same database. The oracle table function ...

2 answers

Java confusion with parameter passing in constructors

I'm creating a BMR calculator, and I have a class called User. This class contains all the methods used to calculate the BMR, as well as a constructor to pack the user's data (age, gender, weight, ...

0 answers

Fix or Replace the Handler code to auto-random

I need help in here, so i want to use Handler to auto-Random my case list every 2 second the full code is like this public class play extends Activity implements View.OnClickListener{ int number; ...

0 answers

Counting each alphabet character in an array of Strings Java

I have an array of Strings. (Each string is only one character, but in order to use the scanner, I had to make it an array of strings, because there's no input.nextchar.) I want to find out how many ...

14 answers

How do you implement a re-try-catch?

Try-catch is meant to help in the exception handling. This means somehow that it will help our system to be more robust: try to recover from an unexpected event. We suspect something might happen ...

1 answer

How to see if a button in JColorChooser was chosen and how to assign that to text in a different window?(Java)

I have a java program and I want to create a color chooser that when selected saves that color and sets it to a JLabel, button, background etc. How can i get it? Here is the code below public class ...

0 answers

Appropriate use of Spring Integration Java DSL plus AmazonS3InboundSynchronizationMessageSource

I'm using a AmazonS3InboundSynchronizationMessageSource to read in what may amount to millions of files strewn across an S3 bucket's sub-directories organized by type >> year >> month ...

0 answers

Java Code : Return Y integer with same bit sets as X & having | X - Y | minimum value

I happened to come across one question : Given integer 'x' (Only positive), write an algorithm that returns integer 'y' such that it has the same number of bits set as 'x' and is not equal to 'x' and ...

4 answers

Java - how to check whether another (non-Java) process is running on Linux

I'm having some weird problems with this. We are using Xvfb virtual desktop manager and want to make sure it's running before I continue. Using pure shell, I could do this easily: ps -ef | grep ...

4 answers | 8 mins ago by AWT on Stack Overflow stackoverflow.com
0 answers

XSSFWorkbook error

I am new to POI. I am trying to read an xlsx file with the code below in Eclipse. I am not using Maven and as far as I know I have imported all the relevant packages (dom4.jar, poi.jar, ...

0 answers

Export very wide (more than 1600 column) queries to CSV

In my current project, we have many small-ish tables stored in a postgres database. The most common operation is to export a csv file, which is a selection of columns from some/all of the tables ...

3 answers

How to (not) deal with high memory uses?

I'm new to profiling java applications and I was uncertain when I saw my small application could take up to 800MB memory twice as much as the whole operating system and around 450MB after some user ...

5 answers

How can I set the star color of the ratingbar?

How can I set the star color of the ratingbar? I want yellow stars.

5 answers | 14 mins ago by Finn Su on Stack Overflow stackoverflow.com
2 answers

Program that reads a csv, sums two columns, outputs to a new csv

I haven't done java for 1-2 years so please bear with me. My project is to read a csv file that contains sales data. The data within the file includes a "Product ID" column and "Units Sold". I ...

2 answers | 15 mins ago by werm on Stack Overflow stackoverflow.com
1 answer

Helo with ArrayList

new here and openly admit that I am terrible at Java and hate it all together, but i need this class so i gonna struggle through it. Here it goes: For HW we are given a few java classes to DL, the ...

1 answers | 15 mins ago by KeyLimePi on Stack Overflow stackoverflow.com
4 answers

How is type inferred where return type is also upper and lower bound for method parameters

Lets suppose we have the following code: class A {} class B extends A {} class C extends B {} public static <T> T testMe(List<? super T> list1,List<? extends T> list2) { ...

0 answers

get updated cell in datatable - primefaces - java

In my datatable has several fields. My intention is that when you edit any of these fields and press the button , this row will be sent to my backbean to be changed. The problem is that when the ...

1 answer

How to add an Object into a certain x,y position in a 2D array of Objects

I am making a game in Java and need to add an Object into a certain part of a 2D 4x4 array of null objects. How would I do that?

2 answers

Using Spring Dynamic Languages Support from Groovy Configuration

I'd like to use Dynamic Languages Support of Spring Framework, to create a reloadable bean (at runtime!) from a Groovy script. I want to avoid xml configuration, and use annotations (or similar) ...

0 answers

SDN 4 + OGM 1.1.1 @Index(unique = true) is not working

I know this question has been asked before, but looks like not with SDN 4 and OGM 1.1.1 Here is my code on the @NodeEntity @NodeEntity public class Company { @GraphId private Long id; ...

1 answer

IllegalMonitorStateException Java

I'm doing some work for the university in which we have to develop a monitor in Java that gives us mutual exclusion and synchronization of resources. The brain of this monitor is a system modeled with ...

3 answers

Balancing parenthesis detection?

So I need to create a program that can determine if a set of parentheses is balanced or not as well as determine which parenthesis is the first "offending parenthesis" meaning the first parenthesis to ...

3 answers | 26 mins ago by btrballin on Stack Overflow stackoverflow.com
0 answers

Updating dirty raw contact

I created a raw contact which is updated if there is any changes from the contact. Peradventure, the user deletes the raw contact before the next sync, the contact has a dirty flag. From my ...

1 answer

BMR (Basal Metabolic Rate) Calculator

Been working on a BMR calculator on and off for a while now. Created an interface and been over different ways to store user input, different ways to calculate BMR/TDEE etc. I created another class ...

1 answer

Uso de Swingworker em conexão com banco

Tenho um aplicativo em java que fiz no meu trabalho, para controlar sequência de numeração de ofícios, o mesmo fica em formato jar na rede(fiz usando swing em java + HSQLDB). Um problema que não ...

1 answer

How to eliminate duplicate entries within a stream based on a own Equal class

I do have a simialar problem like descripted here. But with two differences first I do use the stream api and second I do have an equal() and hashCode() method already. But within the stream the ...

2 answers

Eclipse Mars integration with WAS Liberty server 8.5.5.6 does not recognize some Java EE 6 installed features

I recently installed WAS Dev tools in Eclipse Mars from this site (https://developer.ibm.com/wasdev/downloads/). I'm using the latest version of Websphere Liberty Profile (WAS Liberty with Java EE 7 ...

0 answers

Android Pdfdocument issue. conflict with adobe reader?

okay so im using the native pdfdocument api on android to make a pdf file. this is actually straight forward and the file it creates is perfectly fine. however adobe pdf viewer is the only app that ...

1 answer

How can I set up a simple gradle project that uses sqlite4java?

I'm starting a simple java test project using sqlite4java and building using java. I can get the core sqlite4java library downloaded easily, but I'm not sure what the best (any!) way to get gradle to ...

0 answers

How to decrypt tomcats encrypted datasource password in spring

I have a datasource in tomcat which has password that is encrypted using some algorithm and I want to decrypt the same when i establish connection with DB. Following is my spring config code ...

15 30 50 per page
1 2 3