Try as I might, I can't get a JNLP file to run locally (via a double-click). It seems to be an issue of locating a jar file, even when I specify it relative to the jnlp file. I get the following error:
The field <jar>href has an invalid
value: helloworld.jar
This happens even when the JNLP file is in the same folder as helloworld...
Hi,
I am facing a problem with a stopping thread which is in a synchronized block. I am using TCP socket. The problem is that I am waiting on a DataInputStream object and I want to create a new socket again but it doesn't allow me to do because of the synchronized block.
I have tried with Thread.interrupted(). I cannot avoid the synchr...
I am using depth-first search to identify paths in a directed weighted graph, while revisiting nodes that belong to a cycle, and setting cutoff conditions based on total distance traveled, or stops from the source node.
As I understand, with recursion an explicit stack structure is not required for depth first search, so I was wonderin...
I want to generate a .torrent file in Java, but I don't want a big API that does anything like scraping trackers, seeding, etc. This is just for a client that generates meta data. What lightweight solutions exist? I am only generating a .torrent of a single .zip file.
Thanks!
...
I need to translate from XMI to OWL (XML/RDF serialized) in Java, so essentially this is XML to XML translation and most probably I could just play with regex and use replaceAll to what I need, but that seems very messy way to do it.
What would you suggest so that it will be easily customizable later (my OWL model might change slightly i...
The problem with this code is I'm getting the popularity of an author as 0% (I mean zero percent if the number of borrowed books is 14 and the total number of books borrowed of the selected author is 3 - it should be 21.42%). Why is this happening?
All result are correct except the last one:
Author is 0 % popular (for above given data...
Hi,
I am creating an application which retrieves images from the web. In case the image cannot be retrieved another local image should be used.
While trying to execute the following lines:
Drawable drawable = Common.getDrawableFromUrl(this, product.getMapPath());
if(drawable.equals(null)){
drawable ...
float per = (num / (float)totbrwdbksint) * 100;
i m getting the value of per as say 29.475342 . i want it to round off upto two decimal places only.like 29.48 .how to achieve this?
...
I'm parsing XML in java using StaX, but my XML is not well-formed so the parser will throw error. In XML, there are unclosed-tags
for example :
<person>
<name>John</name>
<age>21
...
...
</person>
the <age> tag doesn't has closed tag </age>. So I need to fix the XML first..
how can I fix the XML to close the unclosed-tag?
...
In my program when I'm using
line.replaceAll("(", "_");
I got a RuntimeException:
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.accept(Unknown Source)
at java.util.regex.Pattern.group0(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)...
We are using Coqsoft Treegrid component in out web application. Though it has many cool features, it is native code (developed in C++) and a bit difficult to maintain.
Could somebody please suggest a better option.
I also need grouping (multilevel) by columns.
Thanks
...
Hello,
I am java developer, (using Spring-MVC)
never worked much on javascript,
But I would love to have ajax features like auto-complete, ajax-form-validation, 'server-backed-pagination for catalog (or grid)' in my applications..
And there are lot of frameworks like Dojo, prototype, YUI, jquery, etc. etc.
so My question is..
which fra...
hi i want to take out the common content in the 2 FACES JSPS and put in one jsp and include two tabs in that FACESJSP and those two tabs will show the differet content any help with sample code pls?
...
I created a class MyList that has a field
private LinkedList<User> list;
I would like to be able to iterate the list like this:
for(User user : myList) {
//do something with user
}
(when my list is an instance of MyList).
How? What should I add to my class?
...
Hi,
I read "Effective Java" by Joshua Bloch and removed the 'Constant Interface anti-pattern' from our application. The trick is to use Non-instantiable util class whose constructor is private, and define all the constants as 'public static final'
I have to extend the this constant util class. I can only do this when I change the constr...
OK I have so much questions regarding my file sharing application that I don't know where to start. My Java knowledge is very limited and I will be satisfied with any help you provide me.
That being said, here come the questions.
Firstly, I'm working on a user login method that needs to look sort of like this:
import java.io.File;
imp...
Consider following assumptions:
I have Java 5.0 Web Application for which I'm considering to use Lucene 3.0 for full-text searching
There will be more than 1000K Lucene documents, each with 100 words (average)
New documents must be searchable just after they are created (real time search)
Lucene documents have frequently updating inte...
I am a big fan of auto-boxing in Java as it saves a lot of ugly boiler plate code. However I have found auto-unboxing to be confusing in some circumstances where the Number object may be null. Is there any way to detect where auto-unboxing is occurring in a codebase with a javac warning? Any other solution to detect occurrences of unboxi...
This doesn't work,
Runtime.getRuntime().exec("stat /*");
nor this;
Runtime.getRuntime().exec(new String[] {"stat", "/*"})
Is there any way around it ?
Thanks,
...
HI
I made a method in my class that is:
public void addInfo(String username, String password, String name, String family) {
try {
String sql = "INSERT INTO user VALUES (?, ?, ?, ?)";
PreparedStatement pst = conn.prepareCall(sql);
pst.setString(1, username);
pst.setString(2, password);
...