java

Java 3D plot library?

Ok so I'm doing a project on visualization of some financial stuff in java, the main objective is to take some input from the stock market, run it through a few equations and then plot the result as a 3D plot. I have almost everything done BUT the visualization (which is the most important I guess). At first I was thinking about using j...

How to send signal to JVM created by JNI_CreateJavavm call?

Hello Guys Is there any possibility that I can directly send signal to a Java virtual machine which is created by calling JVM_CreateJavavm in native C/C++ code? e.g.: For a normal Java process, say its pid is 12345, I can send a signal 3 to it like this ... kill -3 12345, and hopefully I could trigger javacore or heapdump by changing...

Dos and Don'ts while using references in Java

What are the dos and don'ts while using references in Java? ...

problem with valueOf(), converting a char to Character in Java

Hello, I'm trying to convert a char to Character before it gets pushed on a stack but get a "cannot find symbol error", I don't see what the problem might be. This is how I pass the char to the stack: stack.push(valueOf(in)); Where 'in' is a char. ...

Assert that two java beans are equivalent

This question is close, but still not what I want. I'd like to assert in a generic way that two bean objects are equivalent. In case they are not, I'd like a detailed error message explaining the difference instead of a boolean "equal" or "not equal". ...

Hibernate - changing connection string during runtime

I have JSF + Hibernate app. During runtime, i need to change database, to which user is connected. For example, User can manually switch databases in my app, so app is connected to the chosen one. I read about Hibernate Connection Provider. Can it help me? ...

Is there any online IDE for Java?

It doesn't have to be full blown of course, and console output only would be enough. I'd like it to be able to work on some program parts on any PC which has internet connection. I'm really looking for a lightweight IDE I can also use for quick tests Related: Web-based Java IDE ...

how can I create a password?

I want to give maybe a million password to some users that should be like: it must have at least 6 characters it must have digits and also letters Should I use Random here? How? ...

Applying one test to two separate classes

I have two different classes that share a common interface. Although the functionality is the same they work very differently internally. So naturally I want to test them both. The best example I can come up with; I serialize something to a file, one class serialize it to plaintext, the other to xml. The data (should) look th...

Detect or prevent Commons Net FTPClient from blocking on read.

I'm using the Commons Net FTPClient class to periodically poll an ftp site and attempt to download a file. Occasionally the thread is blocking indefinitely when trying to read from the site and I wondered if anyone else had encountered this problem and could offer any workarounds? I'm using FTPClient's retrieveFileStream(String) method...

PHP Integer base timestamp importing to Java Long base timestamp

I get Integer timestamp from PHP program, but in Java timestamps are ing Long format. So how can I convert this PHP Integer timestamp to Java Long format and convert that long format to Date object? ...

Using Sonatype nexus in local network

I've successfully created a small software engineering environment (SEE) for Java applications that is - amongst other tools - based on maven and nexus. My actual problem is - not a real surprise - that nexus usually requires access to the internet to to get the requested artifacts from the central repositories. But the SEE has to be str...

Special Ocassion parser in JAVA

Hey guys, I am working on a date parser in Java. Just wanted some information on if there is any java library which could parse special occasions like for example if I give input as: Christmas or new year, it returns a date for this. Thanks in advance. Regards, Pranav ...

Java: Calculate SHA-256 hash of large file efficiently

I need to calculate a SHA-256 hash of large file (or portion of it). My implementation works fine, but its much slower than the C++'s CryptoPP calculation (25 Min. vs. 10 Min for ~30GB file). What I need is a similar execution time in C++ and Java, so the hashes are ready at almoust the same time. I also tryed the Bouncy Castle implement...

how to combine java.util.Calendar and HQL Between

I'm trying to get the books that were loaned between two dates. Since data has the lovely 2009 is shown as 109 feature I decided to use calendars. However when writing my HQL I ran into the problem that BETWEEN doesn't view a Calendar as a date. Now I'm wondering if there's a solution for this. Or am I stuck writing functions in my clas...

Connecting to MSSQL using Hibernate

How to connect to the MSSQL database by using Hibernate in Netbeans 6.7.1? Please advice. The dialect is disabled for me. ...

Setting floating point formatting locale for JSF / ICEfaces?

I am writing a JSF (ICEfaces) application using resource bundles to handle internationalisation. The application nicely applies the (default) Dutch "nl" locale for the resource bundle but fails to apply the same locale on formatting floating point numbers, even if I explicitly set the locale for a page using <f:view locale="nl">. How d...

how to visible a class in another package on Jikes RVM

Iam going to implement 'on the fly' gc in Jikes RVM,The phases of the gc have to be implemented in the MMTk/src group, but the handshakes have to be implemented in the RVMThread.java which is in rvm/src (not visible in MMTk/src). So the question arises How can i make class files in rvm/src visible in MMTk/src. ...

Tabulating an option of a select tag

Hi everyone, I am currently developing a Struts (1.3.10) application and I'm trying to show in a combo box a set of data. Every single option(row) is a String created by the union of 3 different Strings. My question is if it's possible to tabulate that information in every option from the combo box, to show the information like the exa...

Enum values().length vs private field

I have enumeration like this: public enum Configuration { XML(1), XSLT(10), TXT(100), HTML(2), DB(20); private final int id; private Configuration(int id) { this.id = id; } public int getId() { return id; } } Sometimes I need to check how many fields I have in enumeration. What is the best solution? Should I use a method "...