java

java

  • All Sites

4 answers

create new instance from existing instance

For some reason when I create a new instance of an object from an existing instance and change values in the new instance, it also changes the values in the existing instance. I would prefer if it ...

4 answers | 24 secs ago by Temp on Stack Overflow stackoverflow.com
3 answers

Remove customized duplicates from objects

A file contains a list of pairs like U1,U2 U3,U4 U5,U1 U2,U1 U4,U5 U4,U3 it should write results in another file U5,U1 U4,U5 it means U2,U1 are considers duplicates of U1,U2 Please ...

3 answers | 41 secs ago by bkaass on Stack Overflow stackoverflow.com
1 answer

Android Programming how can i convert or cast widget to java string

I am basically getting the value of a Textview in Android and then hashing that Text but I am getting an exception String can not be converted into Android.Widget.TextView This is my simple code ...

1 answers | 46 secs ago by user1949387 on Stack Overflow stackoverflow.com
0 answers

Word Basic Forms not covered in Stemming and Lemmatization

I need to find basic forms of words. i have been through alike questions. i am using porter stemmer and stanford core NLP for stemming and lemmatization. Consider following 3 sets of words A,B,C:- ...

3 answers

Best way to find unique number in an array

The following is taken from a job interview: In a given array, which contains integers, each number repeats itself once except for one, which doesn't repeat. Write a function that finds the ...

3 answers | 1 min ago by Adam on Stack Overflow stackoverflow.com
0 answers

Data structure that provides a way to acquire intersecting periods with low computational cost

I have a (large) set of data. It consists of elements with timestamp property, so I would call them events for clarity (although it could be any comparable property). If I want to be able to acquire ...

1 answer

How to approach Inputprocessing

I am currently trying to build an Options menu in Libgdx using scene2d and im trying to find a way how to approach User input. I want to implement going back to the mainmenu when the back key on ...

1 answers | 2 mins ago by Valentin on Stack Overflow stackoverflow.com
0 answers

Programing deploying but give a 404 error Spring

I am learning spring and am making an practice program. I am getting the following a 404 error when I run the program. I will post the whole console output at the end. I am trying to implement the DAO ...

5 answers

Difference between bitwise inclusive or and exclusive or in java

public class Operators { public static void main(String[] args) { int a = 12; System.out.println("Bitwise AND:"+(12&12)); System.out.println("Bitwise inclusive ...

0 answers

FacebookError exception in android

I am trying to integrate Facebook login with my android application but whenever I try to login i get this "FacebookError Exception". Can anyone plz tell me what's causing it and how to handle it? I ...

0 answers

Is .txt extension necessary in File() constructor?

Like in the method i have attached i have used practiceData.txt i am getting same results while using just practiceData in file constructor so is it ok to use file without any extension or txt is ...

0 answers

Reading through a txt file and finding words java

I'm trying to develop a program that reads a 7 digit number and corresponds all possible words from a txt file. The numbers on a telephone correspond to 3 letters, i.e. 2 has "A" "B" "C" all the way ...

6 answers

datetime datatype in java

Which data type can I use in Java to hold the current date as well as time?. I want to store the datetime in a db as well as having a field in the java bean to hold that. is it java.util.Date ?

6 answers | 9 mins ago by akshay on Stack Overflow stackoverflow.com
0 answers

Spring boot with transactional configuration

I am new to Spring Boot. I was trying to use Spring Boot with hibernate and mysql DB. I was trying to search for how to use spring's transactional configuration using spring boot. In normal spring ...

4 answers

How do I repeat code for a certain case in a switch statement and not repeat it for others? (See code in desc.)

I am making a Text-Based Adventure game. In one room, I want to ask the player what to do, and if he goes through the door he/she moves to the next room. If he/she picks up the flashlight, the "what ...

4 answers | 9 mins ago by Arjun on Stack Overflow stackoverflow.com
0 answers

JPQL compare associated collection size to Long

I am trying to write a named query that finds Companies whose employee number exceeds a certain number, which is passed as a Long. query.setParameter("empNr", 5L); This is what i came up with ...

0 answers

Calculating Constants for Miller-Rabin Primality Testing

I'm trying to write an implementation of the Miller-Rabin Primality testing algorithm. For a user entered n that is to be tested, the first step is to calculate constants k and m such that n-1 = n^k * ...

1 answer

Does Junit require java 1.5 for play framework 2.3?

I'm starting with a simple play framework 2.3 project written in java. I've create the project using activator and run eclipse command in order to create eclipse style project. Then I've imported in ...

0 answers

Best way to execute HTTP GET in onCreate()

I'm coding an Android client that connects to a REST API. Since Android 3.0 it is not allowed to perform blocking network operations on the main thread, so I'm looking for the best way to implement ...

0 answers

Trouble getting parameters from Android to PHP file for SQL query

I have tried searching about this but could not find any useful answers. I am attempting to run a query on my database (hosted on a web server) from my Android emulator using eclipse. I can confirm ...

3 answers

NetBeans could not install some modules

I am using NetBeans 7.4 DEVELOPMENT VERSION 2, All packages. First I used NetBeans 7.2, All packages. Then I was notified that I have updates. So I updated it to 7.4 DEVELOPMENT VERSION. Then again ...

1 answer

Not able to delete a blob - GAE Java

With a proper Blob Key, I'm not able to delete a blob entry.. here is my code BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); BlobKey blobKey = new ...

1 answers | 14 mins ago by Amith GC on Stack Overflow stackoverflow.com
2 answers

The Java code is not working to create an agent (JADE)

I have this simple java code: public class AnAgent extends Agent { protected void setup() { System.out.println("Hello "+getAID().getName()+". I am ready. You?"); } } I read ...

2 answers | 14 mins ago by Snake Eyes on Stack Overflow stackoverflow.com
1 answer

Why is my program giving me the wrong output when I run it?

I'm making a program where I look through a text file of 11 names, check to see if a certain name is in the file, add new names, delete names, and then close the file to update it. This is the data ...

1 answers | 15 mins ago by dinax on Stack Overflow stackoverflow.com
0 answers

AutoCompleteTextView custom Adapter always showing same value

My logcat shows these results:: [Vanilla Extract, Salt, Spinach (raw), Egg, White Sugar, Milk, Salmon, Butter, Prosciutto, Olive oil, Baking Powder, Tomato Sauce, Flour] 03-29 21:20:52.337 ...

0 answers

Print the nodes of binary tree column-wise, using recursion and iteration

I am trying to code for both recursive and iterative approach to a problem. Below is a recursive code to print the nodes of binarytree column wise. Basically I have count of root as 0 and if I move ...

0 answers

Sound plays on every buttonclick, then suddenly stops playing at all

My Users should click a button 10 times, and on every buttonclick it should play a short ( 0.5 sec) different sound. And in general, it works. but if I run my app, like for 10 times, the sound stops ...

4 answers

Java Editable JCombobox Keylistener event for Enter key

I have editable JCombobox and I added keylistener for combobox editor component. When user press 'Enter key' and if there is no text on the editable combobox I need to display message box using ...

0 answers

Resource ícones JFrame

Boa tarde. Estou tendo problemas com meu aplicativo. Ele executa com alteração do ícone no JFrame. Ao compilar ele para: "Runnable Jar file" e compilar com: Launch4j para binary, o aplicativo ...

1 answer

Meteor Mongo and Android App Sharing DB

I am trying to create a meteor project that allows android apps to access its DB. We have understanding of Meteor (me) and Java android development (friend). Could anyone experienced in this field ...

15 30 50 per page
1 2 3