java

Is java.net.Socket.setSoTimeout reliable?

From the JavaDoc for setSoTimeout Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised,...

Data in J2ME RecordStore does not persist across sessions

I'm building a mobile app with J2ME, and I've found that the data I write into a RecordStore can be accessed while the program is still running but it is lost after quitting and restarting it. No exception is thrown, the data is simply lost. UPDATE: Thanks everyone for your suggestions. I'm using NetBeans on Windows 7. I'm not sure if i...

Interrupt/Cancel a stuck connect() call

Sometimes when I call connect() on a third-party proprietary JDBC driver, it never returns and a stack trace shows that it is stuck waiting for a socket read (usually). Is there a generic way to forcibly cancel this operation from another thread? It's a blocking I/O call so Thread.interrupt() won't work, and I can't directly close the so...

remove method in java BST

Hello everyone...I do have a hw question...I have to write a remove method for a binary search tree, so far what I have is below but I keep getting a bunch of errors associated with my remove method and I'm not sure why...would someone please be able to check my code. Thank You. I also tried to create a find method but I'm having some tr...

Simple way to get wrapper class type in Java

I have a piece of code where i need to pass the class of a field in a method. Because of the mechanics of my code i can only handle reference objects only and not primitives. I want an easy way of determining if a Field's type is primitive and swap it with the appropriate wrapper class. So in code what i do so far is something like this ...

How to check status of an SMTP server from Java?

In a Java program, what is the best way of determining if an SMTP server is ready to accept and send an email? ...

Is there a way to extract text from PostScript (.ps , .eps) files using Java?

I am looking for a solution similiar to PDFBox for PDFs of Apache Tika, however, for PS files. thanks. ...

Can Jetty pick up changes to WEB-INF/lib on hot deployment? How?

I am running several webapps on Jetty 6 through Apache. They are set to hot deploy using .xml files in the contexts/ directory. Those .xml files simply define WebAppContext instances and tell them where to look for a WAR file. `touch'-ing their contexts/.xml files picks up changes to JSPs defined in the relavnt WAR file, which is great. ...

Building Apache Hive - impossible to resolve dependencies

I am trying out the Apache Hive as per http://wiki.apache.org/hadoop/Hive/GettingStarted and am getting this error from Ivy: Downloaded file size doesn't match expected Content Length for http://archive.apache.org/dist/hadoop/core/hadoop-0.19.0/hadoop-0.19.0.tar.gz. Please retry. This error repeats 4 times for 4 different versions of ...

WCF Service, Java JApplet client, transport error 405

Hi all, I'm having a problem with a WCF Service and Java Client, I will try to give as much information as i can, thanks for your time. The Endpoint of the server is BasicHttpBinding, I tried hosting the server as a Windows Service and in IIS but nothing changed. The weird thing is that the Client works great if I use a simple class, in...

Detect whether Java class is loadable

I have two programs: one CLI program, and one GUI. The GUI is a frontend for the CLI, but also a GUI for another program as well. I am importing the CLI's classes and extending them in the GUI to add GUI elements to the classes, and all is great. But now I want to split the CLI that I currently have embedded in the GUI (as an include...

problem with getWidgetCount() gwt

Hi, I am using getWidgetCount() but it does not look like i am getting correct results. Here is the code where i have this function: public class ERD1 implements EntryPoint { private PickupDragController dragController; final AbsolutePanel boundaryPanel = new AbsolutePanel(); int i; public void onModuleLoad() { ...

How should I give images rounded corners in Android?

I would like to change an image I loaded to have round corners. Any hints, tutorials, best practices you know of? ...

WordPress url rewriting for Java

Hello stackoverflow, I currently work with Java JBoss Seam. I've been looking for some information on how to url rewriting, to accomplish something like what WordPress does. In WordPress you can create a page and give out a url for that page. Thats pretty sweet. How could I accomplish that in Java? preferably in Seam? Some reading w...

numerical differentiation and integration in Java

Hi This is a bit of a longshot. Suppose I am sampling signal at a fixed rate (say once per second). Is there mathematical Java Library I can use to calculate/extract the following metrics from the sampled data? 1) The rate of change of the signal 2) An extrapolation/prediction of what the signal value will be in X seconds/minutes time Th...

The name/identity of the invoker of a web service

I have a SOAP web service which I call from two clients using axis2. Can the web service know from which of these two clients the call originated from? If so, how do I know that during runtime? Is there any API provided to lookup the name of the invoker of a particular web service by that web service. Thanks. ...

how to integration test a DAO built with spring + iBatis

I asked a question, title of which might have been misleading so I'm going to try to ask the question again with much detailed stuff. (i know question seems long but please bear with me) What I'm trying to do: I simply want to write a test case for my DAO and make it work. I know my DAO's work fine inside the container (app server) but...

Relationship discovery using Neural networks.

Hi Suppose I am sampling a number of signals at a fixed rate (say once per second) and extracting some metrics from the signals such as, ratio of one to the other, the rate of change, relative rate of change, etc. I've heard that Neural Networks can be of use in discovering relationships. Is this true? If so, what books/internet resource...

How can i pass a form field as a action parameter by using Seam framework ?

Hi, I do not know whether it is possible but i want something like <f:view> <h:form> <div> <label for="accountId">Type your account id</label> <input type="text" name="accountId"/> </div> <div> <label for="amount">Type amount</label> <input type="text" name="amount"/> </div> <di...

floating value truncation java

Hi i want float value of 3 fraction digits after digit,i dont want to round of the value for example: float f=2.13275; i want f as 2.132 not 2.133 how can i do it in java? ...