java

using constructor from the super class

Hello, Java does not allow multiple inheritance, meaning that a class cannot inherit from two classes, which does not have anything in common, meaning that they are not on the same inheritance path. However, a class can inherit from more classes, if these classes are super classes of the direct super class of the class. But the class in...

How do I send a stream from a Java applet to an ASP .NET web site?

I would like to be able to send a stream of binary data to an asp .net website from a java applet hosted in the same website. I found this link which talks about this issue, but I am unsure how to actually receive the data on the website. The streams I will be sending will probably be in the order of 1mb-20mb in size and I will need to...

How do I inherit from multiple extending generic interfaces?

I have a few classes such that: public class XMLStatusMessage extends XMLMessage {} public abstract class XMLMessage implements IMessage {} public interface IMessageListener { public void onMessage( IMessage message ); } public interface XMLMessageListener <T extends XMLMessage> extends IMessageListener { public void onMe...

Ideas on this alternative to ORM + RDBMS?

I am currently developing a proof of concept for an alternative data store. The reason why is I need to enhance a read-mostly clustered webapp, but also because I want to free myself from the pain of the sometimes overly-complex ORM+RDBMS solution. Overall the idea is quite similar to a distributed cache with persistence (letting the cl...

Annotating inherited properties for persistence

Assuming I have a class A as follows: class A{ int id; int getId(){}; void setId(int id){}; } And a class B as follows: @Entity @Table(name="B") class B extends A{ string name; @Column(length=20) string getName(){} void setName(){} } How can I annotate the inherited id field from A so that Hibernate/JPA knows ...

java drivers for data acquisition hardware?

I need to do some data acquisition & would like to use Java to program my data acquisition application. Right now I am using a LabJack which has a Java wrapper for its driver & it's working ok for simple stuff but I need to upgrade to something real. anyone aware of a data acquisition platform (NI or Measurement Computing or one of the ...

Strategies for the diagnosis of Java memory issues

Hello, I've been tasked with debugging a Java (J2SE) application which after some period of activity begins to throw OutOfMemory exceptions. I am new to Java, but have programming experience. I'm interested in getting your opinions on what a good approach to diagnosing a problem like this might be? This far I've employed JConsole to ...

Java and .net for PHP programmer

Hey! I have been programming with php for a few years. I do like php and hope to keep working with it for a few more years, but I see that my company is going into the java world. Can anyone recommend any good books, tutorials, podcast´s, whatever that will help me learn java? Something basic and intermediate would be nice. Also if ther...

Code Review in Java?

I saw some questions similar but none answer this question. For performing java code reviews what do you often look at. Do you recommend books, articles, tools which impressed you most on it. ...

Java Prepared Statement arguments!

I am planning to replace repeatedly executed Statement objects with PreparedStatement objects to improve performance. I am using arguments like the MySQL function now(), and string variables. Most of the PreparedStatement queries I have seen contained constant values (like 10, and strings like "New York") as arguments used for the "?" ...

Is there a simple way to remove a TimeSeries from a displayed JFreeChart Chart?

I have a Swing application which uses JFreeChart to display one of a series of queries. Some of these queries have a composite TimeSeries key. Each component of this key can contain a few values, but when rendered makes a very noisy graph. I would like a simple way for the users to hide/show some of the TimeSeries in the displayed Chart ...

Build management/ Continous Integration best practices

How does your team handle Builds? We use Cruise Control, but (due to lack of knowledge) we are facing some problems - http://stackoverflow.com/questions/419133/code-freeze-in-svn Specifically, how do you make available a particular release when code is constantly being checked in? Generally, can you discuss what best practices you use i...

invalid header file while using jar for archiving

When i use this cmd line : jar cmf arshad.mf ars.jar *.class i get this error : invalid header field name:Manifest-version This is my manifest file : Manifest-Version: 1.0 Main-Class:t i made the manifest file with notepad in UTF-8 encoding - is there any problem with the manifest ? ...

What data mining application to use?

The last I used was weka . The last I heard java was coming up with an API (JDM) for it. Can anyone share their experiences with the tools. I am mostly interested in using the tools for classification/clustering (weka does a decent job here) and the tool should have good API support. ...

JMF and RTP Protocol

Hello everyone. I am doing a project which consists of a video-conference system in Java and using the RTP protocol. The problem is that I can not pass the stream to the clients, that I capture in my webcam. Someone can give me a hand. I already turned off my firewall, but does not waork. Thank you ...

increase clarity of a graph

I am using jfreechart for plotting graphs. The problem is that if have more entries on the X-axis, then the X-axis parameters are not visible. How should I solve that? ...

explicit serialVersionUID considered harmful?

I am probably risking some downvotes on this. It seems to me that explicitly specifying serialVersionUID for new classes is bad. Consider the two cases of not changing it when layout has it should have been changed and changing it when it should not have. Not changing when it should have been changed occurs almost only when it is expl...

How to run test cases on a list of slightly different jars ?

I have a list of jar files, all containing slightly different versions of the same system. I want to execute a set of test cases on each jar file while being able to obtain the results for each jar (via RunListener or something like that). I am a bit confused with the class loading problems that are implied. How can I nicely do this ?...

Java: Receive a multipart HTTP response

I'm writing a Java client application to receive live M-JPEG video from an IP camera. The video is sent by the camera as an endless multipart HTTP message where each part is a single JPEG frame. I need to process each of these frames as they arrive, so I'm hoping there's a way to make an HTTP request that asynchronously triggers an event...

How to deep copy an irregular 2D array

How can I deep copy an irregularly shaped 2D array in Java? Ie. int[][] nums = {{5}, {9,4}, {1,7,8}, {8,3,2,10}} I'm unable to use Arrays.arrayCopy() for some reason (versioning?) Thanks ...