java

64-bit Java Apps: Is a 64-bit OS, 64-bit JRE and 64-bit Application required?

Hi: This question is about 64-bit Java apps in general, although I came upon it because of working with Netbeans/Eclipse. I'm using a 64-bit processor with a 64-bit OS (Windows 7). I wanted to run Netbeans/Eclipse with more than 4GB of heap memory (i.e., using the Xmx flag), but I'm running into some confusion. There doesn't appear t...

Dynamic Pie Charts

I am searching for a free charting library, either in Java, JS, or Flash, that allows for drill-down type interaction. An example of this sort of behavior can be found in the trends section on mint.com. JFreeChart seems like the generally recommended choice for charting purposes, but from a little browsing of their API there doesn't seem...

Is there a simple image processing library for Java similar to ImageMagick?

I am aware that Java includes very advanced image processing API's but what I'm looking for is a pure Java API (uses Java2D) that is "phrased" in terms more appropriate to common tasks of web image processing i.e. I want to write: image.scale(0.2) instead of AffineTransform t = new AffineTransform(...) t.resize(...) t.translate(...) ...

How does Java implement hash tables?

Does anyone know how Java implements its hash tables (HashSet or HashMap)? Given the various types of objects that one may want to put in a hash table, it seems very difficult to come up with a hash function that would work well for all cases. ...

Creating a web service for use in an internal application and exposing it to others

For my web application, I am thinking about using the Spring framework. Initially, I was thinking of having different actions like create user or login, but now I have to expose some functionality to other applications. Should I create a web service that I call from my application and others do as well, or create an action from Spring ...

java dynamic array sizes?

I have a class xClass that i want to load up in to an array of xClass so i have a declaration like xClass mysclass[] = new xClass[10]; myclass[0]= new xClass(); myclass[9]= new xClass(); the problem is i dont know that there will be a need for 10 i may need 8 or 12 or any other number for that matter until runtime. Can I change the nu...

What does it mean to call a Java method using "new" in a statement?

Say, I have a code snippet like this: public static void main(String[] args) { new Main().myFunction(); } Where myFunction is another method (could be non-static) defined in the same class as Main. Why would you do the above? Why not just do: myFunction(); ...

Palindrome Question

I had a question regarding a basic program I was writing said whether a word such as racecar is a palindrome or not. All my methods which reverse the string, strip the punctuation work but the one that determines if it is a palindrome does not. /** * Determines if a series of letters makes a palinedrome * * @param str All punctuat...

How do I edit a XML node in a file object, using Java

There are a lot of examples on the internet of "reading" files but I can't find anything on "editing" a node value and writing it back out to the original file. I have a non-working xml writer class that looks like this: import org.w3c.dom.Document; public class RunIt { public static Document xmlDocument; public static void m...

Listening for new child components in Swing

I have a specific requirement that all children of a particular JComponent have double buffering turned off. I can recurse through it easily enough and disable them when needed, but I'd like to detect the addition of new children components regardless of their position in the hierarchy and disable it then. I've taken a look at addHiera...

How to validate if a signed jar contains a timestamp?

After a jar is signed and the -tsa option was used, how can I validate that the time stamp was included? I tried: jarsigner -verify -verbose -certs myApp.jar But the output does not specify anything about the time stamp. I'm asking because even if I have a typo in the -tsa URL path, the jarsigner succeeds. This is the GlobalSign TSA U...

Algorithm Question On Finding All Valid Words In Dictionary

Given a dictionary (just a list of strings). You receive a feed of an unknown number of letters from an external source. Given the string of letters, how would you go about listing all valid words (from the diciontary) you can make from any combination from those letters. So if you receive: abpplead You should find apple, bad, pad, le...

JavaDocs for Tibco datagrams (TibrvMsg)?

Does anyone know of available Javadoc for Tibco rvd datagrams (specifically, class "com.tibco.tibrv.TibrvMsg")? It is not hard to decompile classes to get signatures, but that does not tell a lot about expected optimal usage and such. All I need is simple read/write functionality for interoperability purposes, but ideally using recommen...

Java Transaction API (JTA) Overview Help

Can someone give me a good explanation on the motivation and application of JTA in modern Java applications? I don't want overly technical details. But just a paragraph on why do we need JTA, what does JTA accomplish, and maybe a piece of pseudo code showing how JTA is being used? ...

Does HibernateTemplate work with Envers? If so, how?

I am trying to use Envers on a project that also uses Hibernate and Spring - and I appreciate a lot the code reduction offered by HibernateTemplate. I configured Envers under JPA, and after a few tweaks I was able to have the schema generated by the EnversHibernateToolTask Ant task (including the auditing tables). However, when I write ...

JUnit: How to simulate System.in testing?

I have a Java command-line program. I would like to create Junit test case to be able to simulate System.in. Because when my program runs it will get into the while loop and waits for input from users. How do I simulate that in JUnit? Thanks ...

Regular Expression (Java) anomaly - explanation sought

Using Java (1.6) I want to split an input string that has components of a header, then a number of tokens. Tokens conform to this format: a ! char, a space char, then a 2 char token name (from constrained list e.g. C0 or 04) and then 5 digits. I have built a pattern for this, but it fails for one token (CE) unless I remove the require...

Java socket server make Windows server 2003's network die

Hi all, I'm developing a socket server/client application by JAVA for server and J2ME for client. Everything was ok when I tested the server in my windows XP. However, then, a serious problem occurred, when I deployed my socket server to server running Windows Server 2003. MY Windows server was lost network connection when my client tri...

Java Bing Image Search

Hi All, I have a small application in java which searches images using bing image search. The problem I am facing is that, its getting only first 20 images. May be because when we search on bing.com it populates first 20 images first and then its an infinite scrolling feature. Is there any way to search more than 20 images using bing?...

ExecutorService's surprising performance break-even point --- rules of thumb?

I'm trying to figure out how to correctly use Java's Executors. I realize submitting tasks to an ExecutorService has its own overhead. However, I'm surprised to see it is as high as it is. My program needs to process huge amount of data (stock market data) with as low latency as possible. Most of the calculations are fairly simple ar...