java

Java Server not able to encrypt/decrypt data with Blackberry's AESkey

Hi, I am developing a BlackBerry application where the server is in Java. Whenever AES encrypted data is sent to server along with PKCS5 Formatting, The server gets bad padding exception while decrypting it. Please help. Badly stuck in this issue thanks. ...

Need to calculate the distance between two points???

Hi, i need to create a class which calculates the distance between two points. I am stuck and i am a total beginner. Here are my classes: package org.totalbeginner.tutorial; public class Punkt { public double x; public double y; Punkt(double xkoord, double ykoord){ this.x = xkoord; this.y = ykoord; } ...

Problem processing input for online judge

This is related to my previous question I'm solving UVA's Edit Step Ladders and trying to make the online judge comply with my answer. I have used the method ReadLn() to adapt my textfile-reading program to this: import java.io.*; import java.util.*; class LevenshteinParaElJuez implements Runnable{ static String ReadLn(int maxLe...

Is Levenshtein's distance the right way to tackle this Edit Steps problem?

I'm familiar with Levenshtein's distance, so I decided I would use it to solve UVA's Edit Steps Ladder problem. My solution is: import java.io.*; import java.util.*; class LevenshteinParaElJuez implements Runnable{ static String ReadLn(int maxLength){ // utility function to read from stdin, ...

Equivalent for Python's lambda functions in Java?

Hi all, Can someone please tell me if there is an equivalent for Python's lambda functions in Java? ...

Which to learn first Java or javascript?

With the intent on becoming fluent on both to do a mix of web and application coding. Would one facilitate learning the other? ...

J2EE + Eclipse, What plugins do you use? And What for?

Hey Guys, I want to start working with J2EE, used to .NET What plugins do you use for java&j2ee on eclipse? Interesting things would be, Database Javascript UML UI Hibernate(are there plugins to work with hibernate?) Anything else that you use that helps your work. Cordially, ...

Compiling J2ME from command prompt

hi, i'm trying to compile the J2ME java files from command line from 2 week ago ! at now i can compile project successfully and also create JAR and JAD files . the files that i compile work equivocal, this means if i use basic class the same as TextField or Form or others this work successfully but if I use RecordStores OR more important...

Does the "new" keyword change the value of an object reference?

Let's say that I have a bunch of class instances that serve different purposes, so I want to be able to reference them directly by name: SomeObject aardvark = new SomeObject(); SomeObject llama = new SomeObject(); SomeObject tiger = new SomeObject(); SomeObject chicken = new SomeObject(); But then I also want an array of them for easy...

Semantic Search help needed urgently..

Hi, Im trying to create a semantic search using java as a base programming language. My task is to create a search prototype which contains triples namely patients, visits and doctors. If i search with a patient name the result should be the patients name and the the time of visit and the corresponding doctors name. Im going to use trip...

Installing Java Manually on windows?

I have seen many products bundeled with jdk, I wonder if there is a way where one can install JDK by simply unzipping contents to a directory. so, there is no icon created in add/remove programs, no registry entries etc. Also in this case: How can we configure java plugin for browsers? And how can we configure settings as seen via cont...

How can I find all the methods that call a given method in Java?

I need to get a list of all caller methods for a method of interest for me in Java. Is there a tool that can help me with this? Edit: I forgot to mention that I need to do this from a program. I'm usig Java Pathfinder and I want to run it an all the methods that call my method of interest. ...

Netbeans 6.5 prevents adding breakpoints to Java files. Configuration issue ?

I'm not able to add breakpoints to any Java file. It seems this problem has been reported in slightly varying contexts in the netbeans issuezilla. I could not find any concrete workarounds other than updgrade to NB6.7M2, which is currently not feasible. Other things I've tried are a JDK updgrade, spicy bat wings and a bottle of silverm...

Java webcam chat application

Hi there, I have been developing a chat application. And so, I want to create a webcam support to my application, like as mercury, so i had tryed search a lot of more with google, but i didnt find a good article, or tutorial, or something. I have readed the jmf guide, but what write in it, just a media player, and sound player, it is not...

How do I display a java ResultSet visually?

I'm looking for a way to display a java.sql.ResultSet on the screen. preferably built-into java or swing. If neither of those have a decent method that's simple, I'd consider spring. How? ...

Modifying a Swing Timer's Delay during Runtime

I'm developing a Queue simulation, using a Swing Timer to dequeue objects after certain amounts of time. The interval is determined by peeking at the next object in the queue, getting an integer from it, and setting the delay of its corresponding timer. Here's the relevant snippet from the program (Note: _SECONDS_PER_ITEM is a constant ...

How Do I Clone A JAXB Object

I have some jaxb objects (instantiated from code generated from xsd by jaxb) that I need to clone. The Jaxb class does not appear to provide an interface for doing this easily. I can not hand edit the class and can not extend it - so I need to create a helper/utility method to do this. What is the best approach? ...

Calculating a day given a Date

From a given Date I need to calculate midnight of its day. Here's what I came up with. It's so ugly that I figure there must be a better way. private Date day(Date creation) { Calendar calendar = Calendar.getInstance(); calendar.setTime(creation); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set...

Which Java thread is hogging the CPU?

Let's say your Java program is taking 100% CPU. It has 50 threads. You need to find which thread is guilty. I have not found a tool that can help. Currently I use the following very time consuming routine: Run jstack <pid>, where pid is the process id of a Java process. The easy way to find it is to run another utility included in the ...

jsp array list problem

hi i am trying to create an array that doesnt add items if the value/size is more than 20. this solution adds only 1 item and then stops even if the value is less than 20. how do i change it so that it accepts values only upto 20 max. package business; import java.io.Serializable; import java.util.ArrayList; public class Cart implemen...