I want to pass a Java string variable to Javascript function which I am calling in Java code. Somehow the value of string remains as null. Is there any way to do this?
Here is some sample code
cb.set(CheckBox.ONCLICK,"displayCB(" + e.getFormName() + ",document.Profile.UniqueForm"+"_TestOpt)");
So in above line of code i am calling di...
I am having some problems and I'm sure it's something stupid.
So I have a query like
SELECT name, id, xyz FROM table ORDER BY ?
then later down the road setting the ? doing a
ps.setString(1, "xyz");
I am outputting the query and the value of xyz in the console. When I loop through the ResultSet returned from the PreparedStatemen...
(See this question in ServerFault)
I have a Java client that uses Socket to open concurrent connections to the same machine. I am witnessing a phenomenon where one request completes extremely fast, but the others see a delay of 100-3000 milliseconds. Packet inspection using Wireshark shows all SYN packets beyond the first wait a long ti...
I can't find it, I have looked at:
/etc/tomcat6
cd ~tomcat6 -> /usr/share/tomcat6
Where can I find the tomcat.conf in Linux Ubuntu?
...
In Java,
I need to read lines of text from a file and then reverse each line, writing the reversed version into another file. I know how to read from one file and write to another. What I don't know how to do is manipulate the text so that "This is line 1" would be written into the second file as "1 enil si sihT"
...
Java garbage collector runs with priority 1, due to which it is not guaranteed that System.gc() will actually execute if called.
Is there any way to change its priority? This shall enable me to run if I want.
...
I'm using Eclipse JDT to build a Java refactoring platform, for exploring different refactorings in memory before choosing one and saving it. I can create working copies of the source files and edit them (for example to rename a type, using ASTRewrite), and I also want to rename one or more of the working copies. I'd hoped that the renam...
Is it possible to execute iwconfig (or any other shell based program) from a java application and then parse the output somehow?
If yes, how?
...
I'm using Eclipse JDT to build a Java refactoring platform, for exploring different refactorings in memory before choosing one and saving it. I can create collections of working copies of the source files, edit them in memory, and commit the changes to disk using the JDT framework.
However, I also want to generate new 'working copy' sou...
I have some input text, which contains one or more human person names. I do not have any dictionary for these names. Which Java library can help me to define names from my input text?
I looked through OpenNLP, but did not find any example or guide or at least description of how it can be applied into my code. (I saw javadoc, but it is pr...
I want to put State objects (which are HashMaps with Character as key and State as Value into an ArrayList named allStates. Should I override the equals and hashCode methods here? Why? How?
This code is for the Automaton and State classes I've built so far:
class State extends HashMap<Character, State>{
boolean isFinal;
boolean isIni...
Hi,
I'm looking for a java AJAX framework which I can include into my existing webapp. I've found sweetDev RIA . Are there such other frameworks which I could look into it?
...
At the end of my computations, I print results:
System.out.println("\nTree\t\tOdds of being by the sought author");
for (ParseTree pt : testTrees) {
conditionalProbs = reg.classify(pt.features());
System.out.printf("%s\t\t%f", pt.toString(), conditionalProbs[1]);
System.out.println();
}
This produces, for instance:
Tree Odds of...
Hi all,
We have an existing java-based heavyweight project that needed an interactive script interpreter. After a fair amount of research we eventually ended up with Jython, one of the reasons being that the customer's group already has a large amount of python expertise, and it's an easier sell to give them an api in a language c...
We usually define some beans with their properties in the Spring context file and write some setter methods in the class.
Let's say I wanna do the opposite. I have a bean in the context file and want to declare some properties from the class..or initialize values of declared properties in the context from the class. How do I do that?
...
So I written up a small script to search in a folder in the current directory named /files/
All files are in *.txt file format and the tool will find any string inside the file. This does not search for file names, only the contents of the file:
Example of my problem:
Enter string to find:
Enter string to find: 6570
Enter string to ...
Original problem: Calculate the number of nodes [SOLVED].
I have another similar problem, and both of these have been killing me for a while now.
I can calculate the number of words fine now. Thank you very much for your assistance.
The issue is now calculating the summation of depths [the sum of the individual depths for all childre...
about = new JMenuItem("About");
about.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A((Toolkit.getDefaultToolkit().getMenuShortcutMask()))));
JMenu help = new JMenu("Help");
help.add(about);
I was wondering why my aaccelerators were not working. I am running this in snow leopard with JavaSe-1.6 VM. They do work if I pull the menu d...
In Eclipse, I would like to set a breakpoint on a Java default constructor. I can't simply double click to the left of any line of code since default constructors have no source code - they are implicitly generated by the Java compiler.
I'd like to be able to set such a breakpoint without modifying the existing code.
...
I am having difficulty calculating the summation of depths [the sum of the individual depths for all children of the root] for a given BST. I have the total number of nodes for the tree, and I am trying to calculate the average depth for the tree, requiring I have this depth sum.
Recursion and I don't get along very well.. I am finding ...