java

Streaming the desktop

I want to create a C++ cross-platform (Windows and MacOS X) application that sends the screen as a video stream to a server. The application is needed in the context of lecture capture. The end result will be a Flash based web page that plays back the lecture (presenter video and audio + slides/desktop). I am currently exploring a few ...

How can I test a .class file was created?

I want to unit test my code which will have to create a .java file compile it and then the corresponding .class file should be created. How can I create the test to see if the ".class" file is created? I have added test already for its existence, now I'm trying to test the file is a valid class file. I tried try { Class.forNam...

Undirected (Multi) Graph (Hierholzers Algorithm)

I am very stuck with the looping structure for my graph to work out Eulers tour. This is the graph I am drawing, remember it's undirected, so a journey from N1 to N4 is the same as a journey from N4 to N1 (don't mean to be patronizing just trying to increase my chances of help). The way to solve this problem is to find a collection of ...

Is HashMap in Java collision safe

Hi I am developing a parser that needs to put key value pairs in hashmap. But a key can have multiple values which i can do in this way HashMap<String,ArrayList<String>> . But what happens if number of keys are very large and it start matching with other key's hashcode. Will that rewrite previous key's value ? thanks -devSunday ...

Java JTextField with input hint

I would like to add a hint value to my JTextField. It should look like Firefox rendering of <input type="text" title="bla">. This creates a edit field with the text 'bla' in the background. If the textbox has focus the title-text disappeares and just reappears if the user leaves the editbox without text. Is there a (free) swing componen...

Is there a modbus implementation which uses Mina 2.x?

Is there a open source modbus implementation which uses Apache Mina 2.x? ...

where is the eclipse desktop framework

i'm new for java how can i add a button or others like Microsoft visual studio? ...

HTTPClient-java.net.SocketException: Unconnected sockets not implemented thrown

Iam using HTTPClient 4.0 to connect a remote server and transfer file using HTTPS. When i tried to connect i get the exception "java.net.SocketException: Unconnected sockets not implemented". Please look at the stack trace java.net.SocketException: Unconnected sockets not implemented at java.lang.Throwable.<init>(Throwable.java:196)...

Multiple Hibernate instances using C3P0

I am facing a weird problem and it seems to be c3p0 related. I am starting two instances of an app in the same java vm which interact with each other. After some operations "APPARENT DEADLOCK" messages appear in the log. I have the feeling that both app instances use the same connection pool although they use different session factory i...

Locating Libraries

I am playing with JNA on Mac OS X and Linux. My question is if i am looking for a function "if_nametoindex" how to figure out which library to load? Most of the example i could find concentrate on Windows and they load "kernel32". ...

Katta usage examples

Does anybody use Katta with Java? Are any samples avalible? ...

Deploying jax-ws on Tomcat

After noticing Java 6 includes javax.xml.ws, I'm able to create a standalone web service. How would I go about hosting that in Tomcat 6? ...

whats wrong with this code? It is not filtering the collection!!!

public class CollectionsFilter { public static void main(String[] args) { List<Integer> list = Arrays.asList(new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }); Collection<Integer> evenNumbers = Utils.filter(list, new Predicate<Integer>() { public boolean apply(Integer i) { if (i % 2 == 0) { ...

Use HTTPClient or HttpUrlConnection?

We're implementing a REST client on JRE 1.4. Seems two good options for a client REST framework are HttpClient and HttpUrlConnection. Is there a reason to use HttpClient over the JRE's HttpUrlConnection? ...

java ant buildfile for project with dependencies

I am new to ant, but am trying to create an ant script that builds my current proeject with another project as a dependency. I have the ant script building my current project, but am unsure how to add the other project to the classpath. Neither project get put into jar files at the moment. My current portion of the build.xml file is <t...

What is the difference between Go's multithreading and pthread or Java Threads?

What is the difference between Go's multithreading approach and other approaches, such as pthread, boost::thread or Java Threads? ...

Using DecimalFormat--keeping extra zeros

I'm using DecimalFormat to format doubles to 2 decimal places like this: DecimalFormat dec = new DecimalFormat("#.##"); double rawPercent = ( (double)(count.getCount().intValue()) / (double)(total.intValue()) ) * 100.00; double percentage = Double.valueOf(dec.format(rawPercent)); It works, but if i have a ...

Can Java Array objects be created dynamically at Runtime?

Can I do this in Java? At Runtime: int length = some arithmetic that loads length then I use length to do this: byte [] b = new byte[length]; Will this throw an Exception at Runtime? If so which one? ...

How do I diagnose "Unhandled Exceptions" in Java?

In a Java program I am currently getting "Unhandled Exception" at a certain point in the program and I can't seem to determine the location where this is being generated. Its also difficult to debug the code as the program contains streams that handle wireless data bytes sent and received. I can't seem to simulate that with a debugger. ...

Doesn't the fact that Go and Java use User space thread mean that you can't really take advantage of multiple core?

We've been talking about threads in my operating system class a lot lately and one question has come to my mind. Since Go, (and Java) uses User-space thread instead of kernel threads, doesn't that mean that you can't effectively take advantages of multiple cores since the OS only allocates CPU time to the process and not the threads th...