java

Eclipse debugging "source not found"

I just started using Eclipse so go easy on me ;). But when trying to debug a JUnit test case I get a dialog that states the the source is not found when I get to this line in the code in my test method: Assert.assertEquals(1, contents.size()); I know I should probably go and try and download the source from somewhere, but I really don...

Size of a java ServerSocket queue

Can we get the state (free space) of a java ServerSocket queue ?? The goal is to throw an exception when it's full ... Some details about the ServerSocket queue : Class ServerSocket ... ServerSocket() ... The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connect...

How do I add thread to my server?

I'm a beginner in Java and I have an assignment to build P2p File Sharing Java application. I started by creating server and client. Client can send messages to server and server responds. I believe the next step should be inserting the Thread into the server class. I read all about it and tried it bud I just can't pull it off. I hope so...

What to learn for making Java web applications in Java EE 6?

My goal is to make web applications! I finished reading the Books "Headfirst - Java" and "Headfirst - Servlets and JSP". Because this topic (web applications) is so big and complicated, I would like to ask what I should learn next. I feel overstrained when I read catchwords like Java EE, EJB, JSF, JPA, Glassfish ... but I won't give up...

Any tutorial or code for Tf Idf in java

Hi All, I am looking for a simple java class that can compute tf-idf calculation. I want to do similarity test on 2 documents. I found so many BIG API who used tf-idf class. I do not want to use a big jar file, just to do my simple test. Please help ! Or atlest if some one can tell me how to find TF? and IDF? I will calculate the results...

Two sided (bidirectional) list in Java

Is there something like a two sided list in Java? Maybe a third party implementation? Here a little example to demonstrate what I have in mind. Original state: A: 0-1-2-3 | | | | B: 0-1-2-3 After removal of element 1 in B: Null | A: 0-1-2-3 | / / B: 0-1-2 The data structure must be accessible from both sides. So...

eclipse existing maven project add jpa support ?

how to add jpa support for existing maven project i tried project-->configure--> convert to jpa project (there is no this option) but for my other projects, such option available... can comment? I already have existing mven project and i want to generate jpa entity from tables. no need to create new jpa project right? ...

JTabbedPane on mac os

one of the Java application developed working properly on the microsoft windows xp,vista,2007 and on linux but on mac os when we clicked on tab its stop working not getting what happens any one having idea what may be the issue. ...

Hibernate Search querying ?

Greetings My domain model is as follows class Species { private String name; .. .. List<Family> families; } class Family{ private String name; private String locusId; .. List<Member> members; } class Members{ private String name; private String repTranscript; } I want to use 'Hibernate Search' to execute queries like o...

Mapping domain objects to web service proxy objects in Java

Hi, I am trying to find a way for mapping domain objects to web service proxy objects, generated by various Java web service stacks. Both the web service (.NET) and the Java code use implementations of a particular specification. The specification is meant to provide very detailed description of domain classes, which should be implement...

reading from serial port

to read from serial port do i need to install some package the get support in netbeans? which packages do i need to import at the start of program? the statement: import javax.comm.*; results in error saying package does not exist...what to do ...

getting strange results from framerate code in java

I'm trying to keep my game at 60fps, but I'm getting strange results from my code like "2-8000 fps" Why isn't this staying at 60? public void run(boolean fullscreen) { this.fullscreen = fullscreen; try { long lastFrame = 0; long frames = 0; init(); while (!done) { ...

import javax.comm*; error

do i need to install netbeans 6.8 for serial port support? import javax.comm*; gives an error in my netbeans 5.5.1 ... what could be the actual problem? i downloaded comm api jar folder from : http://www.oreilly.com.tw/bookcode/java%5Fio/ where to add this one so that import javax.comm.* won't give any error ...

A way to use a string for creating new classes

I have a string with the name of a class, is there a way (writing in Java) to use that string when creating a new instance of that class, to do something like this: object obj = new dataInString. So the dataInString is parsed from the string. ...

The difference between Executors.newSingleThreadExecutor().execute(command) and new Thread(command).start();

Well title says it, what is the difference between Executors.newSingleThreadExecutor().execute(command) and new Thread(command).start(); ...

BODMAS assignment

Hello All, Im working on a problem that goes like this - Implement a function that evaluates an expression consisting of following operands : '(', ')', '+', '-', '*', '/'. Each numbers in the expression could be large (as large as being represented by string of 1000 digits). The '/' (i.e. divide) operand returns the integer quotient. ...

Java debug probe

Hello, I want to find a way to do a debug probe in Java. I'm used to working in Wingware Python IDE and it lets me set a breakpoint and once the execution reaches it, I have a Python shell, where I can execute arbitrary Python code in the context of a place, where the execution is paused. So I want to do the same in Java, i.e. set a brea...

where to update classpath variable

where to update the classspath ?? i downloaded CommAPI so that import javax.comm.*; should not give error. ...

JUnit test ends with network connection error

I'm running some JUnit 4 tests in eclipse for my Java project which I know have functioned two days ago without problems. Today, though, I get errors: Could not connect to: : 40212 java.net.SocketException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect...

simple sample program for serial-port reading

can anyone give me a simple code for reading a byte from serial port... to start with i wish not to have many functions in it... is there any step wise approach where i can get the details.... a sample program to start using different functions associated with the serial port...any samples plz... ...