I need to parse HTML 4 in Java.
Ideally I'd like an implementation that is SAX compatible.
I'm aware that there are numerous HTML parsers in for Java, however, they all seem to perform 'tidying'. In other words, they will correct badly formed HTML. I don't want this.
My requirements are:
No tidying.
If the input document is invalid H...
I'm trying to send a byte[] (using PUT) with Restlet but I can't find any info on how to do it. My code looks like this:
Request request = new Request(Method.PUT, url);
request.setEntity( WHAT DO I PUT HERE?, MediaType.APPLICATION_OCTET_STREAM);
I had expected to find something along the lines of ByteArrayRepresentation, just like the...
Hey there,
I'ld like to analyze the certificate of a given url and get some details of it. Do you know any ways to do this? A command-line tool can be something like downloadSSLCert https://my.funny.url/ > certFile and then analyzing it for e.g. the fingerprint of the cert. It can be a command line utility, a c/c++/objective-c or java c...
Apologies if this is a repost, I could not find the search terms to locate a similar question.
The application that I work on has support for plugins that can be loaded or unloaded at runtime. There are several API hooks that allow these plugins, among other things, to register richer objects then those provided out of the box. When a p...
Hi.
I'm currently using shared memory for IPC between Java and C++ apps, but looking for a more convenient alternative.
Can someone advice better method, but with same performance speed?
Thanks!
...
I have to parse some xml with java SAX parser. As I was busy, I saw that the state pattern could be used here.
There are clear states and state transitions defined, resembling the structure of the xml document.
To implement the state pattern, I have to define a interface (or abstract class). The most obvious interface methods would b...
Hi!
I'm creating a Rails application and on it, there should be a Java Applet.
My question and problem is that the applet must be tightly integrated with the Rails parts. I must be able to get a list of all users, update an image, etc... And there's a surprisingly small amount of information available on the Internet of how to use appl...
What results when you pass an empty string to a Java enum .valueOf call?
For example:
public enum Status
{
STARTED,
PROGRESS,
MESSAGE,
DONE;
}
and then
String empty = "";
switch(Status.valueOf(empty))
{
case STARTED:
case PROGRESS:
case MESSAGE:
case DONE:
{
System.out.println("is valid status");
...
This just came up again. I see people doing it both ways. Which one is correct?
['ja:va]
or
['dza:va]
I have an observation that English-speaking cultures where J is read as [dz] use the second option, while those where J is read as [j] (German, for example) use the first option.
I personally prefer the second [dz] variant, since th...
I have something like this:
Map<String, String> myMap = ...;
for(String key : myMap.keySet()) {
System.out.println(key);
System.out.println(myMap.get(key));
}
So is myMap.keySet() called once in the foreach loop?
I think it is, but want your opinion.
I would like to know if using foreach in this way (myMap.keySet()) has a pe...
Has anyone used both Joone and Encog in production applications? Is there something you needed to do in a production app with one or the other where the product fell short?
...
I'm writing a complex setup/installer application in native C++/MFC. I would very much like to be able to detect the version of Java that is installed (if any).
Is this possible, and so, how?
...
Hi,
I have an application that open an other class using intent :
private void createRepository(){
Intent j = new Intent(this, Repository.class);
startActivityForResult(j, ACTIVITY_CREATE);
}
In Repository.class we have the onActivityResult method :
public void onActivityResult(int reqCode, int resultCode, Inte...
I'm developing a Java Web Application that runs a series of financial calculations for a user. When a financial calculation is run, roughly 30 different inputs are used to calculate 15 different values over a maximum of 18 years (max 15*18 expected values). As you can tell, there is a considerable amount of information to compute and val...
I just wrote a whole blurb on how I reached this point, but figured it's easier to post the code and leave it at that :)
As far as I can tell, the performance of test3() should be the same as test1() - the only difference is where the exception is caught (inside the calling method for test1(), inside the called method for test3())
Why ...
Hello everybody.
First of all i would like to say that i got so much help in java in last few days, and would like to thanks everybody for their help.
Now to my question. I am very new to JSF...
I would like to know how can i read a value of input text from the managed bean.
I know it is possible to read this way and it is very stright...
Hi guys,
I had posted a question a few days ago and thanks a lot to those who already responded. I am reposting the question because it seemed like I needed to clarify our requirements. So here it goes in more detail.
I am trying to get a very small desktop app built - something that can be downloaded by people very quickly. I am tryin...
I want to get a diff between two versions of a code file (of the Java/C#) variety - and from that get a list of methods (names) impacted. Has this been implemented?
I presume this would require an AST Analysis of the lines that come back from the diff.
The point of this would be to refine checkstyle/findbugs to just work on the method...
I have created a simple server client application using java NIO.
I used a single selector there for accepting connection, reading data and writing.
But I want an application where 1 selector will be busy in accepting the connection while the 2nd selector will read the data and the 3rd selector will write the data.
Means I donot want to...
Hi.
I'm trying to calculate a percentage "factor". That is, given a 20%, convert it into 0.2 (my intention is to later multiply values by that and get the 20% of the values).
Anyway, the question is related with this piece of code:
public static void main(String[] args) {
int roundingMode = BigDecimal.ROUND_FLOOR;
BigDecimal hundred...