Hi there!
I want to share some information between two classes (A and B), which are running in different java programs. Instead of writing a whole communication protocol I want to use the java build-in rmi classes for that purpose. Currently class B is able to run a method which belongs to class A remotely. Is it somehow possible to use...
Using Drools 3.0.6 (old, I know), what is an efficient evaluation for finding a fact in a known, fixed and quite large array or collection (the inverse of contains, i.e. "is contained in").
Using an OR series of normal "equals" results in StackOverflowError as the array/collection can contain a few thousand entries, as the Drools binary ...
How do I use a fully qualified host name for the "java.naming.provider.url" property in the "env" parameter passed into (J2EE) InitialContext class. Whether I pass in an IP address, or a fully qualified (host.domain...) host name, the lookup( name) call will fail, saying it cannot find the hostname, where the hostname is just the "basen...
I'm just getting started with Hibernate, and all the examples I'm seeing so far look pretty much like the tutorial in the Hibernate documentation:
package org.hibernate.tutorial.domain;
import java.util.Date;
public class Event {
private Long id;
private String title;
private Date date;
public Event() {}
/* Acces...
I am presenting the user with some exam. Users are not to proceed into the actual site before they pass this exam. However, there will be some users who will have a choice to bypass the exam until some date (say month from current date). So these users have a window of a month to take the exam. until then they can click 'Proceed' on t...
Hello all,
I have a working speech solution that I'd been playing with over the years, part of which includes integration with FreeTTS. I'm using a client server model and trying to figure out how to adjust the volume on the generated speech that I write to the output stream. There appears to be two approaches in FreeTTS. There's the st...
I'm maintaining a J2ME application where I found a http request to http://www.google.com in application initialization. I asked the developer why there is a request to google. He said that this way the other requests that the application makes would be faster.
I removed this request to google.com and the other requests got slower.
Can ...
Hello!
I wonder if there's a good documentation (or a (viewable) ebook) about
the lifecycle of Swing components.
Is "lifecycle" the correct term, anyway?
I hope to find answers to question such as:
How, when, in which order painting methods are called?
How, when, which events are called by whom?
What is the exact sequence of method ...
I need a max function in my jstl, so i am writing a static function and exposing it in the tld as a jstl function.
The problem is, i dont know what type the arguments will be, int, long, double etc. Do i have to create a function for each data type?
or
Maybe i can just write the function for doubles, and pray that jstl will do the con...
Hi,
I am currently thinking about Caching Strategies and more importantly avoiding any duplication of data inside the cache. My query is kind of language agnostic but very much programming related.
My question is regarding the efficient caching of paged or filtered data but more than that, distributed caching. The latter I have decid...
I have a little java applet where I create 2 threads, one thread repaints and the other moves an image from a point to where the user clicks. The problem is that when I call the move function it loops until the image is where the user clicks but it wont repaint until I break out of the loop even though the thread doing the moving and the...
I'm trying to learn more about basic Java and the different types of Throwables, can someone let me know the differences between Exceptions and Errors?
...
I have a set of time stamped values I'd like to place in a sorted set.
public class TimedValue {
public Date time;
public double value;
public TimedValue(Date time, double value) {
this.time = time;
this.value = value;
}
}
The business logic for sorting this set says that values must be ordered in desc...
I have a sample code that was built with Netbeans.
It has a build.xml file so I downloaded ant and try to run it.
I've got this error message:
...... nbproject\build-impl.xml:76: Platform is not correctly set up
For what I can see, this is fixed by "simply" downloading Netbeans and running the sample from there, but... I don't want...
I have two related entities, say
@Entity
public class Book {
@ManyToOne
Shelf shelf;
}
@Entity
public class Shelf {
@OneToMany(mappedBy="shelf")
Set<Book> books;
}
If I fetch an empty shelf (no books), create and persist a new book to the shelf and then fetch that shelf again, its books collection is empty. When I run...
I have control of a small piece of an application built on Eclipse, and I'm having a problem creating a DefaultCellEditor. The code actually uses a subclass of DefaultCellEditor, but I can recreate the problem using DefaultCellEditor, so that's what I'm going to ask about, hoping that it will solve the problem with the actual class. I'...
Hi...
I'm trying to run several instances of a program accessing a sqlite database in java (always the same file) and actually I don't know whether it's possible or not that several jobs access the same database....
...
I'm using Java DatagramSocket class to send a UDP data gram to an endpoint. The datagram must arrive at the endpoint in 60ms intervals.
I'm finding that DatagramSocket.Send can often take > 1 ms (close to 2) to package and send packets no greater than 56 bytes. This causes my packets to be delivered at 62 ms intervals, rather than 60m...
I have a situation in which I need to re-attach detached objects to a hibernate session, although an object of the same identity MAY already exist in the session, which will cause errors.
Right now, I can do one of two things.
1.) getHibernateTemplate().update( obj )
This works if and only if an object doesn't already exist in the hibe...
Hi,
So I have an example question as follows:
Explain how a JSP page is executed and what kind of problems may occur.
I'm fine with the first part, compile the static html and the scriptlets to java to be served by the servlet etc.
But I'm stumped by what problems may occur? The JSP page is held in memory... so maybe that may exhau...