Tagged Questions
Java is a general-purpose programming language designed to be used in conjunction with Java Virtual Machine (JVM). "Java platform" is the name for computing systems that have installed tools for developing and running Java programs. Use this tag for questions referring to Java programming language ...
0
votes
0answers
16 views
how %f works in java
I saw %f mostly in tow different occasions. first, in printf which [I think] I know the usage but not the logic:
System.out.printf("%.2f", 3.1415); // will print 2 digits after decimal!
and also ...
0
votes
0answers
9 views
How run BIRT report from java?
I was design report by BIRT on eclipse and I can run it from run button how can I run it be java code?
0
votes
0answers
4 views
Forward calls from one android device to another through bluetooth
I am working on a project where I need to communicate between two android devices(one android smart phone for sure) and I need to implement the functionality to enable (audio in & out) from ...
-5
votes
2answers
34 views
Why use '<<' and '>>'? [on hold]
I am new in c++ and I learn the following program:
#include <iostream>
int main() {
std::cout<<"Your name?\n";
std::string name;
std::cin>>name;
std::cout<<"Hello ...
0
votes
0answers
23 views
C++ GUI vs Java GUI applications
I understand that Java has codes for developing GUI and graphics for programs. Can someone tell me about C++ GUI and how come there aren't textbooks about developing GUI applications. I do understand ...
0
votes
0answers
5 views
Moving users to/from security groups using Automation Script in Maximo 7.5.1
I work with Maximo 7.5.1 and I would like to use Automation Script to remove or add users from/to security groups. It basically means I need to delete or create records in GROUPUSER table in maxdb75 ...
0
votes
1answer
18 views
nullpointer exception requesDispatcher
String fn=request.getParameter("fn");
request.setAttribute("eno",eno);
RequestDispatcher rd = request.getRequestDispatcher("../WebRoot/displayperson.jsp");
rd.forward(request, response);
it will ...
0
votes
0answers
3 views
How do I reorient images when storing on S3?
I'm storing images on S3 for use in emails. When I view the image in an email, some of the images are rotated. I'm uploading using the AmazonS3Client, and uploading images using MultipartFormData in a ...
0
votes
1answer
10 views
How to pass a List<> in REST POST method using spring mvc
I'm trying to pass a List of similar values in the request body of a REST post method using spring mvc. Below is my sample code. Please let me know what is correct way to send the List in requestbody.
...
1
vote
1answer
10 views
Reusing ThreadPoolExecutor vs Creating and Disposing Ad Hoc?
I am building a multithreaded process that has a couple stages, each stage iterating through an unknown number of objects (hundreds of thousands from a buffered query resultset or text file). Each ...
-1
votes
0answers
6 views
Need to Implement multiple priority blocking queues with executor service framework ,
Looking for Queue Processing Prioritization Algorithm ,
Input - multiple requests with different priorities value.
need to maintain a steady transaction rate and tasks need to be executed on ...
-1
votes
0answers
14 views
Control flow Java nested loops
I can't seem to find the correct control flow. The second participant when has the same bookinput as first one should lead to booksIssued[0].count-- . however, all the participants are going into new ...
0
votes
1answer
8 views
How to access a cookieStore from other classes?
So I'm working on an app where I'm trying to store a cookie from a log in screen then access that cookie in another class.
How can I access the cookie store in the first class in the second class so ...
-1
votes
0answers
9 views
Why pitman yor process capture pow-law property?
I'm learning pitman yor process but i don't know why this process can capture pow-law property. Can you help me explain this problem?
0
votes
1answer
9 views
CSV displaying japanese hankaku(half-width) instead of zenkaku(full-width) in java
I am generating csv file using Java Bufferedwriter. I am trying to append zenkaku(full-width) number to csv file, but it is displaying hankaku instead of zenkaku. Can you suggest me to how to do this?
...
0
votes
1answer
36 views
How to return a string which matches the regex in Java
Here is a method which returns true/ false for each match. Instead I want to get the matched string if it matches. If it doesn't matches then don't return.
I can have an If condition to check if its ...
0
votes
2answers
19 views
Exception Handling with Scanner.nextInt() vs. Scanner.nextLine()
This question is solely for educational purposes. I took the following code from a textbook on Java and am curious why input.nextLine() is used in the catch block.
I tried to write the program using ...
0
votes
2answers
24 views
OO Design - Public API method implementation
Is it ever good practice to implement a public method to call another public method (in something like an API)? I fear duplication issues when the user of the API overrides these methods. I would ...
0
votes
0answers
45 views
If statement ignoring operator?
I'm trying to run an if statement inside of my for loop. However, it seems to be ignoring the operators...or something. I'm trying to get it to give the number of the question that contains the lowest ...
0
votes
0answers
7 views
Composite Key when a key is a class
I am trying make a composite-key at JPA, which one of this keys is a class and the another is an Enumeration.
But it is giving the following error:
Caused by: org.hibernate.MappingException: Could ...
0
votes
1answer
9 views
DigestOutputStream not reporting the correct digest value
I have the following inside a unit test to try and figure out why my DigestOutputStream is not calculating the correct digest for a test .jpg I have in the classpath.
The assertArrayEquals() passes ...
0
votes
0answers
4 views
Bean Validations in Jersey 2.6
I tried bean validations with Jersey 2.10 and Bean Validations works. I also tried to do bean validations with Jersey 2.6 and didn't work (may be i am missing something). Just want to check if Jersey ...
-1
votes
2answers
20 views
Spring and Hibernate example?
Anyone have a good Spring MVC and Hibernate tutorial for beginner? There are a numerious results that I can find on the search engine. But, unfortunately, after 4 trials and none of the tutorials work ...
2
votes
2answers
19 views
Java Converting date to epoch value produces false output
I am trying to convert the below date time string object into a unix epoch timestamp value. However, when i run the program i notice that it generates an epoch value of 1404461110000 which when i ...
0
votes
0answers
21 views
Access Denied - Cannot create a file in a certain directory
When I try to create a file in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp, I get the following error:
java.io.FileNotFoundException: C:\ProgramData\Microsoft\Windows\Start ...
0
votes
0answers
6 views
LWJGL not rendering my mesh, only the glClear color
I have a program written in lwjgl, and it's meant to render a cube, with each vertex colored differently. The problem I'm having is that it doesn't render the cube at all. Nothing shows up, why? I'm ...
0
votes
1answer
45 views
String Switch Statement Not Working
This program's purpose is to translate Morse code into English. I've divided the program's execution logic into three cases: the translation of one Morse code character, two characters and three+ ...
0
votes
1answer
11 views
Java XML update issue - appendchild() doesn't work
I have an issue when I append a new node to xml dom. The following code is the dom saving code in xmlFactory.java.
public static void saveUserDom(){
try {
TransformerFactory tf = ...
-1
votes
0answers
13 views
Hadoop study project
Is there a good Hadoop study project that I could work on?This is just to test/improve my knowledge in the area?Is a recommendation engine a good one to work on?
Please advise.
Thanks
0
votes
0answers
9 views
MapReduce Program Command Error
I have written a simple mapreduce program and am now trying to run it. Someone gave me this command to run:
hadoop jar <out jar> <main class> <arg1> <arg2>
My jar is called ...
0
votes
0answers
10 views
Eclipse startup failure Google plugins
I recently installed some Google plugins on Eclipse indigo and after restart it fails to load. The log file in workspace shows a bunch of errors surrounding !MESSAGE Class load Failure: ...
0
votes
2answers
26 views
Server and Client wont talk to each other
I am trying to make some sort of login system, but the server and client wont talk to each other. I am not quite sure why they wont talk to each other, but any help is appreciated.
P.S The port is ...
0
votes
1answer
9 views
TextFlow getPrefWidth returning -1
I'm trying to get the width and height of a TextFlow after the Text objects have been added to it
/*
* To change this license header, choose License Headers in Project Properties.
* To change this ...
0
votes
0answers
10 views
Know the type of a word on Lucene
I'm working on Lucene, as a Newbie and I'm searching a way to find in a tokenstream.
If it's a verb, a name, or other.
I see the method type() for the token's class but I'm using the class ...
-2
votes
0answers
37 views
Java vector explanation [on hold]
int getIntValue(Vector a, int place){
Integer product = (Integer) a.elementAt(place);
return product.intValue();
}
I have omitted specific values, but could you please explain the actions ...
1
vote
3answers
45 views
How to make a private variable in a public method
I have a public method but there is a variable inside that I don't want other classes to access. Could I do that like this?
public static void example() {
private {
String privateString = ...
2
votes
1answer
9 views
How to get Salesforce Oauth response?
I followed a tutorial to send a access token request to Salesforce. But I don't know how to get the response. My code below:
String baseUrl = ...
1
vote
0answers
28 views
Why my java project is compiling and executing from Maven even though there are some errors I have seen in Eclipse?
I checked out my company project from SVN. I did
mvn clean
mvn install
mvn exec:java
Every thing is working fine, But I have seen so many errors in eclipse. But no errors in Maven. Why is this ...
1
vote
3answers
15 views
How do I pull objects/array deep from a JSON parse in Android
JSON code: http://headytunes.co/?json=1
I am trying to pull the author name, but only repeating the first author in the JSON list. I am also trying to pull the thumbnail image and the multiple ...
0
votes
0answers
11 views
TransientPropertyValueException in unidirectional ManyToOne relationship
I'm getting this error after some changes I made, after reading other topics. The entity Neighbourhood, for example, has entity City annotated with @ManyToOne(optional = false, fetch = ...
-1
votes
0answers
14 views
What are the apis for Android code editor along with intelli sense [on hold]
In google play store there is an app called AIDE which gives a nice ide for running Java and android codes.
I'm looking to build Java ide. Are there any Code editor available? In fact AIDE gives ...
-5
votes
1answer
40 views
enhanced for loop (java) [duplicate]
how can i change out the for loop in this program:
public class deleteplz{
public static void main(String args[]){
String[] cdSporNavn = new String[4];
cdSporNavn[0]="fritjof i fjøset";
...
0
votes
1answer
16 views
Patterns for implementing common class behavior through a class heirarchy
I have a Java class hierarchy for which a sub-tree of the hierarchy implements the same static data and methods. I cannot inherit because they are all statics, but it smells to me when I am cutting ...
0
votes
2answers
39 views
repeating a program in java [on hold]
I've been trying to repeat this program, but when I do, I keep getting errors. I repeated it before, but it asked to repeat after every row of asterisks. This is what I have so far:
import ...
-3
votes
0answers
26 views
Java complier error [duplicate]
I'm a novice, learning Java. I tried to run my first program but keep getting this error below:
can someone help please?
Error: Could not find or load main class hello.universe.HelloUniverse
Java ...
0
votes
1answer
27 views
Null value when reading from a file in Java
So, I am trying to read a file in java. The file contains only one line, and is a batch of settings which are delimited by an asterisk.
The plan is to parse them into an array using .split method, ...
-1
votes
1answer
35 views
How Java client get a single returned byte form server?
I am writing a Java client program which can send a single character command to the server through the internal IP network then the server will return a single byte to report the status such as ...
0
votes
1answer
10 views
Jackson serialization includes subclass's fields
I had a problem when using Jackson to serialize an object. The fields in the subclass are missing in the file. I tried Gson but have the same problem as well. Can anyone help me with this? Thank you.
...
0
votes
1answer
40 views
Java regular expression matches too much
So I am writing a chess PGN parser, and I'm having trouble breaking up the file. Here are a few caveats:
I am slurping the entire file into a String, so what I have looks like:
[Event "Rising Stars ...
0
votes
2answers
18 views
updating JFrame again
The following code shown below will add 3 JLabels to a JFrame and then remove the 3 JLabels.
After 2 seconds it will repaint back the 3 JLabels.
import javax.swing.JFrame;
import javax.swing.JLabel;
...