I am trying to calculate the info_hash value for a torrent. I read the whole torrent into StringBuffer, then cut it like the following:
d8:announce...info[d6:length...e]e
I can't seem to get the correct hash. Does reading the torrent into a StringBuffer corrupt the byte string at the end? Am I missing something?
public void calculate...
To learn GWT and Google AppEngine (GAE) I'm trying to create a simple application using GWT with two or three objects (entities). In this application one object, let's say Student, encapsulates ArrayList of other objects, say Classes and Books. Then it creates list of Students and sends it to Java code on GAE and stores it to the data st...
Okay... so I have a fairly interesting error... I declare a FileWriter called file, and I have it go through the following for loops:
for (int i = 0; i < a.radtot; i++) {
file.write("" + i * a.rstep);
for (int n = 0; n < a.timetot; n++) {
file.write("\t " + T[n][i]);
System.out.println(T[n][i] + " " + n + " " + ...
What's the difference between a .class file and a .java file? I am trying to get my applet to work but currently I can only run it in Eclipse, I can't yet embed in HTML.
Thanks
**Edit: How to compile with JVM then?
...
Hi, I am trying to play audio in a Java applet but it is not working. What could be the problem?
EDIT: Besides the limited number of files that Java can play, the problem was that I didn't realize that the bin folder (in Eclipse workspace) contains the .class file that is run. So my code referring to the getDocumentBase() couldn't find...
Hi all,
I'm trying to get the server URL of a currently running appengine java app from code. That is, if the app is running on my local dev machine I would like to somehow get returned "http://localhost:8080" but if it is running in prod I'd like to be returned "http://myappid.appspot.com". Are there any java or appengine API's that ca...
Hello!
I often encounter distributions of Java applications or libraries which
use Maven as their build tool.
Some of them, sadly, don't provide standalone (or redistributable) jars.
Is it possible to build Maven-based applications in such a way, that
the build result contains all dependencies and can be redistributed to work out-of-t...
http://buildr.apache.org/
http://ant.apache.org/
http://maven.apache.org/
What does another build tool targeted at Java really get me?
Is it so hard to write a plugin using Java versus writing it in Ruby?
If you use Buildr over another tool, why?
Side question: How many build systems does the Apache foundation need targeted at Ja...
Hi,
Can you please tell me if there is any open source library which generate 'timeline image' in Google Search result? (see below as an example):
http://www.google.com/search?q=history&hl=en&sa=X&tbo=1&tbs=tl:1,tll:1400,tlh:1599&ei=oL46SsOrIIy0sgPQrrCDCw&oi=timeline_histogram_nav&ct=timeline-histogram&c...
I realize that this may be tantamount to asking, "what's the best programming language?" (lots of debate and emotion), but I don't know what do but ask YOU about what Web Frameworks you've had good experience with.
Practically, to be adopted by our IT folks it needs to be HOSTED on Java; thus the two I listed in the subject above. I ins...
I have been trying to find a definitive resource for all of the hints that can be set through the Query.setHint(String,Object) method call in JPA, but I am coming up empty. Anyone know if a good reference?
...
I've created a custom Tokenizer in Solr that looks for named entities. I would like to be able to use this information to populate separate fields within the lucene/solr document.
As an example, I want to populate a multivalued field called, "locations" with all the location names that were extracted from the text. To extract location...
I am working in Eclipse on a Google AppEngine Java code. Every time I save a java file, the DataNucleus Enchancer starts off "Enhancement of Classes". Its quite irritating since it takes away focus when you are in full screen mode. Anybody knows how I can turn it off?
If I turn it off, will it affect my ability to deploy my application ...
My Java app displays its version number in a few places, so I store that as a public final variable in the app's main class. Is there any way to access that in my Ant build tasks? In the spirit of automating the build process, I'd like Ant to automatically name the zipped distributable with the current version number, but I'm not sure ho...
In Java 5, is there a default way to pass a URL to the system and have it launch the application associated with it?
For example http:// links would usually open IE or Firefox, but things like itms:// should open iTunes.
If possible I would rather not use Runtime.exec() to start some external process directly, because this would be plat...
I think I understand the basic concepts of MVC - the Model contains the data and behaviour of the application, the View is responsible for displaying it to the user and the Controller deals with user input. What I'm uncertain about is exactly what goes in the Controller.
Lets say for example I have a fairly simple application (I'm speci...
I am running some JUnit tests in Eclipse, and my code is generating an XML log file using the java logging APIs. (java.util.logging). Is there an easy way to view this XML log output in Eclipse, other than reading the raw XML? Specifically I want to be able to easily see what threads different log messages have come from.
...
My application has an XML configuration file which users now edit in a text editor. I want to provide a (Swing) form for editing this configuration. I have a DTD for the XML, but the application does not accept all XML documents validated by the DTD i.e. the application imposes more restrictions than those in the DTD.
I was about to sta...
What is the best way to tune a server application written in Java that uses a native C++ library?
The environment is a 32-bit Windows machine with 4GB of RAM. The JDK is Sun 1.5.0_12.
The Java process is given 1024MB of memory (-Xmx) at startup but I often see OutOfMemoryErrors due to lack of heap space. If the memory is increased to 1...
Have a Spring 2.5 webapp which runs fine under 1.6, but under 1.5 it can't find PostConstruct class.
Found the following which suggests I need common-annotations.jar (JSR-250) but cannot find anywhere to download it
...