I get a bunch of warning statements after I compiled my programs, I know I can switch them off, but I want to get them right, and yet I don't know the correct ways to fix them, for some of them it complains either way, like this one :
BS=(TreeSet)B.next()
BS=(TreeSet<Object>)B.next()
Any help please ? Here are some of them :
170: war...
I've started to read all available apple docs on this topic. A fast overview gave me a number of about 8.000 (eight thousand) DIN A4 PDF pages. About 10% of the content is almost equal for my feeling. After reading for 2 weeks now, I figured out that I would forget fast what I have been reading a week ago. Unless I start to do something ...
I can't seem to figure out how to make a resize drag handle in Java Swing. If you're not sure what I mean, open up the "Ask Question" page on this website and look at the bottom of the text area. It has a bar which you can drag in order to change the size of the area. I'm looking for a way to do this in Java Swing. I don't even know wher...
I am trying to run the following code from within Eclipse:
Process process = Runtime.getRuntime().exec("gs");
However I get the exception:
java.io.IOException: Cannot run
program "gs": error=2, No such file or
directory
Running gs from the command prompt (OS X) works fine from any directory as it is on my PATH. It seems ecl...
I'm confused by the following code:
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class GenericsTest<T extends List> {
public void foo() {
T var = (T) new LinkedList();
}
public static void main(String[] args) {
GenericsTest<ArrayList> gt1 = new GenericsTest<ArrayList>();
...
We're embarking on a project for a client. They plan on having about 50k users by the end of the year. We're pushing to use Pylons w/ Mako and SQLAlchemy, and our contact there is excited about it, but some of his colleagues are wary because it's not .NET or J2ee (they're used to enterprisey stuff).
Their web app will have some data an...
I want to develop a web application, like an online scheduler. (Yes I know it's been done a million times.)
Most of my experience is in Java, so I want to leverage that when considering technologies.
I've primarily been a systems developer with little exposure to UI programming, so I think this is where I will need to do most of my lear...
Hello. I am using Web Flow 2.0.7 with Spring MVC and Hibernate.
My problem is about custom converters for my custom types and database connection from within my converter.
Let's say I have a type Person and the Person has a field of my custom type Title, and all Titles are already in my database. Now I have an html form, in which a use...
Will Java code built and compiled against a 32-bit JDK into 32-bit byte code work in a 64-bit JVM? Or does a 64-bit JVM require 64-bit byte code?
To give a little more detail, I have code that was working in a Solaris environment running a 32-bit JVM, but now I'm getting issues after upgrading the JDK and Weblogic Server to 64-bit.
...
Hi,
I am trying to clear everything on my HTML form when I link back to it from a hyperlink.
Any ideas? My development language is java.
...
I'm writing a J2SE (Note, not JEE) application using Hibernate, and I need to provide a different connection to Hibernate for each thread of execution. These connections must be pooled, and each one has at the very least different authentication and, possibly, a different JDBC URL. The connections will be re-used (as can be inferred fr...
I have a Java program that runs many small simulations. It runs a genetic algorithm, where each fitness function is a simulation using parameters on each chromosome. Each one takes maybe 10 or so seconds if run by itself, and I want to run a pretty big population size (say 100?). I can't start the next round of simulations until the prev...
Hi,
i'm developing an app that make requests to the Musicbrainz webservice. I read in the musicbrainz manual to not make more than one request per second to the webservice or the client IP will be blocked.
What architecture do you suggest in order to make this restriction transparent to the service client.
I would like to call a me...
Here's what I am trying to determine...
I have a utility class to append lines to a textfile.
This must be used by a number of other classes, like
a common logging file.
In my first implementation, I had all the classes
that wanted to use it make a referenceless instance, e.g.
new Logger(logline,logname);
The constructor creates a Pr...
I want to get my feet wet with Spring/Hibernate. But I think I move along faster and am more motivated if I am working with code rather than just reading a book chapter by chapter.
Does anyone have any good ideas for a home project to work on to learn these technologies? Any exercises that you might have worked on and thought useful?
O...
My understanding is that Java's implementation of regular expressions is based on Perl's. However, in the following example, if I execute the same regex with the same string, Java and Perl return different results.
Here's the Java example:
public class RegexTest {
public static void main( String args[] ) {
String sentence ...
I'm looking to simulate the action of holding a keyboard key down for a short period of time in Java. I would expect the following code to hold down the A key for 5 seconds, but it only presses it once (produces a single 'a', when testing in Notepad). Any idea if I need to use something else, or if I'm just using the awt.Robot class wron...
I have written a socket program using read() and write().
Whenever I want to send large data using write(). I am unable to recieve data at a time. Means my data is divided into two section so how can I send large amount of data. or read the data at 1 time.
Also I am unable to know whether this is the problem of write() or read()
Thanks...
Hello everyone!
I have the following question:
I need to pass a parameter (for example ID ) when I finish a form and the action save the form's values, this will forward to the result = "success" and I need that the action that will be call in the success come with the ID and other parameters to later use in the next form for save this ...
The following code when run obviously prints out "B1/A2/B2". Now, is it possible for it to print "A1/A2/B2" instead (i.e. A#method2() should invoke method1() on A, not on B)?
Note: I have no such need to get pass polymorphism, this question is out of curiosity only.
class A {
public void method1() {
System.out.println("A1"...