java

Performance cost of Java dynamic proxy

Many modern frameworks (Spring, Hibernate) provide very nice dynamic behaviors with use of Java dynamic proxies, but what's the exact performance cost associated with it? Are there public benchmarks available for Sun JVM? ...

Value checking logic inside or outside of a class ?

Take this skeleton class that someone wants to fill in to fetch RSS streams on a series of web sites: public class RSSStream extends Thread { public RSSStream(String rssStreamName,String rssURL,int refreshTime){ // constructor code goes here } } Now, let's consider that refreshTime has to be higher than zero and that rss...

Additional Ascii char 'Â' added in JSP request

Hi, I am facing the same issue in tomcat & jsp as listed in below asp issue http://stackoverflow.com/questions/350429/classic-asp-gremlims-getting-a-ainserted-into-text-whenever-an-html-special-cha Using tomcat 5 and jsp. When I type in a string containing like ±20°C and submit to another JSP the resultant parameter after submit is ±2...

maintain state with spring between requests.

Hi, I am new to spring so sorry if this is a beginners question, but the manual is not clear (at least not for me) My question is: how do I share state between requests in spring? I can send data from the controller to the view by using a ModelMap, but the data in the ModelMap is not sent back to the next controller by the view. How can...

Java Serialization Comparator

Hello, Is it possible to serialize a TreeMap with a comparator?? I've tested and it serializes well a treemap without comparator, when you add the comparator, it throws an exception. If I declare comparator as transient, it still doesn't work. It only works if I make every tree map transient but it doesnt serialize the trees in that c...

Java: MorseCode Converter

I'm trying to convert Morse code into text. I have two text files to use with this problem. morseCode.txt: I have a file that i read off that contains the letters and corresponding Morse code equivalent. morse.dat: Its the file that contains the encrypted message in Morse code I was able to read the first file properly and then store...

Is is possible to sign a java applet for free?

I made a weird applet which allows you to paint with your voice. Obviously it requires access to the microphone, but Java applets are not allowed access unless they are signed. As far as I can tell its difficult and involves cryptography, and, though its not clear, I think that I'm expected to pay MONEY to Verisign as well. This all seem...

How do you determine 32 or 64 bit architecture of Windows using Java?

How do you determine 32 or 64 bit architecture of Windows using Java? Thanks. ...

Java: Multidimensional Scaling?

I'm doing a Natural Language Processing project where I compute a bunch of attributes of a text, giving me a vector of values for each text. I want to compare these vectors with multidimensional scaling. What Java libraries/toolkits do you recommend for doing this? ...

Origin of term "reference" as in "pass-by-reference"

Java/C# language lawyers like to say that their language passes references by value. This would mean that a "reference" is an object-pointer which is copied when calling a function. Meanwhile, in C++ (and also in a more dynamic form in Perl and PHP) a reference is an alias to some other name (or run-time value in the dynamic case). I'm...

How can we make a movable sentence?

for example I want to have a sentence like "System" in my main frame which can move from left side of the frame to the right side of the frame or up to the down.how can I do it?? ...

Cannot set mnemonic in JLabel with HTML text

The following associates a JLabel with a JTextArea and sets a mnemonic that decorates the label. Pressing Alt-X on Windows moves the focus to the JTextArea. JTextArea textArea = new JTextArea(10, 20); JLabel label = new JLabel("Text"); label.setLabelFor(textArea); label.setDisplayedMnemonic(KeyEvent.VK_X); However, if ...

Eliminating empty elements when marshalling with JAXB

Using JAXB (2) is it possible to ensure that null values are not marshalled as () empty elements. For instance @XmlRootElement(name = "root") public class Root { @XmlElement(name = "name") protected String name; } Currently if name is null then I am marshalling <root> <name/> </root> I would like to produce <root> </roo...

How to pause execution of a program until a button is clicked in Java Swing

I have a program with a GUI that needs to open a separate window and wait for the user to select and option, then continue. I figure I should be doing this with the wait() and notify() methods, but I'm still trying to figure out exactly how to use those. A complicating factor is that things seem to work differently when the second window...

Java: Really simple scatter plot utility

I know there are many comparisons of java plotting libraries out there, but I'm not finding what I need. I just want a mind-numbingly simple toolkit that creates images of scatterplots from a set of coordinates. No GUI, no interaction, no fancy display, just a basic XY coordinate system with points. It wouldn't be the end of the world t...

How do I skip a breakpoint a set number of times in Java's jdb?

How do I skip a breakpoint a set number of times in jdb? jdb's help provides this hint: !! -- repeat last command <n> <command> -- repeat command n times # <command> -- discard (no-op) When I attempt to skip breakpoints n number of times however, like this: 80 cont or like this: 80...

How to strip down JVM to get the smallest install possible?

I have a Java app to deploy and want to deploy the JVM along with it (to simplify install). I want to have the JVM stripped down to only include the pieces the app needs to keep the distributable small. How can I strip down the JVM to bring the size down? Can this be done with the Java Kernel or is there some alternative to the Sun JVM t...

Handling data in ActionBean

Hello, how do I save data between two events in ActionBean? In the following example I create contact in addContact(), preserve it and save it to attribute contact. When i try to access that contact after redirectction, in addNumber(), its null. private Contact contact; ... public Resolution addNumber() { log.debug("addNumber() to ...

Java MDSJ produces NaN

Anyone have any experience with MDSJ? The following input produces only NaN results and I can't figure out why. The documentation is pretty sparse. import mdsj.Data; import mdsj.MDSJ; public class MDSJDemo { public static void main(String[] args) { double[][] input = { {78.0, 60....

Interoperability by using Spring and Hessian ? Is it possible ?

Hi, Spring in Action book says: Hessian, like RMI, uses binary messages to communicate between client and service. However, unlike other binary remoting technologies (such as RMI), the binary message IS PORTABLE to languages other than Java, including PHP, Python, C++, and C#. (316) Can you give me some advice how can i get it ? T...