java

Do you bother writing or reading package-level JavaDocs?

I'm wondering what portion of Java developers actually invest in writing package.html files, and what they write in them. I am particularly interested in packages that can serve as your public APIs. In addition, I'm wondering whether developers actually bother to read the package level documentation when they use unfamiliar APIs, and wh...

toString() in Java

A lead developer on my project has taken to referring to the project's toString() implementations as "pure cruft" and is looking to remove them from the code base. I've said that doing so would mean that any clients wishing to display the objects would have to write their own code to convert the object to string, but that was answered w...

Why are we getting ClosedByInterruptException from FileChannel.map in Java 1.6?

A customer of ours complains that, sporadically, calls of ours to FileChannel.map fail with a ClosedByInterruptException. The Javadoc does not list this as a legitimate possibility. Does anyone know what might be going on here? Cause0: java.nio.channels.ClosedByInterruptException Cause0-StackTrace: at java.nio.channels.spi.AbstractInte...

Copy Resource File to Folder?

I have a need to generate complicated text files from a Java desktop application. I've decided the code would be considerably easier to implement if I could copy a template file and tailor it to whatever needs to be constructed. I will only be distributing a jar to the customers. Is there a best-practice on how to handle this? Is it...

What is Java Data Mining, JDM?

I am looking at JDM. Is this simply an API to interact with other tools that do the actual data mining? Or is this a set of packages that contain the actual data mining algorithms? ...

How do you refer to a Java Class in the same Package from a Clojure?

I am starting Clojure development in Eclipse I have a new package called "apackage" under src. In it I have JavaClass.java and Test.clj. How do I call the constructor of the JavaClass from the clojure file? I tried (def a (new apackage.JavaClass)) but I am getting a ClassNotFoundException. What am I doing wrong? ...

What is the best tool to query delimited text files in Java?

I need to execute basic queries on a text file which consists of several columns. I tried to use StelsCSV which is a JDBC Driver for CSV files. It is good but commercial. Do you know other tools for the same task? ...

Compiler for Windows Mobile OS

I am looking for compilers ( command line / IDE ) that runs on Windows Mobile OS v6 for the following languages: C/C++ Java ...

How to redirect verbose garbage collection output to a file?

How to redirect verbose garbage collection output to a file? Suns site shows an example for unix but it doesn't work for windows. ...

Google Wave Sandbox

Is anyone developing robots and/or gadgets for Google Wave? I have been a part of the sandbox development for a few days and I was interested in seeing what others have thought about the Google Wave APIs. I was also wondering what everyone has been working on. Please share your opinions and comments! ...

Toplink & java storing word or pdf files

I'm creating a simple page with a form. Part of the form requires uploading a pdf or word document. This will be a small file, so ideally I would like to store it in my oracle database. I'm using ejb and toplink for all of my persistence. What object should my entity class have that will hold a word or pdf file, and how do I map it to ...

How to use EXT-GWT ComboBox

How do I use ComboBox in EXT-GWT with static data. For example I just want to hard code (for demo purposes) list of First Names and display it to the user. I don't want to use any dummy objects that they are using in their samples. Where can I find simple example with Strings? ...

SWT, Maintain default tab ordering when adding Key Listner

I've been creating a custom TabFolder extension that adds a key listener to allow quick tab switching using an ALT + # hotkey. By adding the KeyAdapter to my TabFolder, the event handler works properly only when you have a tab header selected (in which case the ALT + ARROW_LEFT/ARROW_RIGHT also work.). I need this hot key to be active w...

Any way to specify absolute paths in FTP URLs?

I'm using the Java URL and URLConnection classes to upload an file to a server using FTP. I don't need to do anything other than simply upload the file, so I'd like to avoid any external libraries and I'm wary of using the non-supported sun.net.ftp class. Is there any way to use absolute paths in the FTP connection string? I'd like to p...

Google protocol buffers and servlets

I am wondering how I can use google protocol buffers to accept a request and send a response back to a client? I am thinking about writing a servlet which will take a request. Is the following trail of thought the correct way to implement this: 1. Have a .proto file which is the message definition for the incoming request. 2. Write a ser...

Java development standards and tools (compared to C#)

I don't have any knowledge of Java platform and I wonder which tools (and methodologies) could be used to help developing maintainable code written in Java. I know one can use: Agile methodology in any environment jUnit/jMock for unit testing code (similar to NUnit/Moq in .net world) Checkstyle for coding standards - is this similar t...

BeansBinding a JTable in NetBeans

I want map a List of beans to a JTable. The idea is that each column will be a preselected field in the bean and each row will be a bean in the List. Slide #32 here looks very promising: http://swinglabs.org/docs/presentations/2007/DesktopMatters/beans-binding-talk.pdf However, NetBeans is not very friendly in letting me assign a bea...

Regular Expressions and GWT

My questions is: Is there a good solution to use regular expression in GWT? I'm not satisfied with the use of String.split(regex) for example. GWT translates the Code to JS and then uses the regex as a JS regex. But I cannot use something like the Java Matcher or Java Pattern. But I would need these for group matching. Is there any pos...

Maven, Jetty, JOTM

Hi all, I have been unable to configure JOTM ontop of Jetty inside a Maven build environment. The exception I get when I try to run my application is the following: 2009-07-21 19:47:23.499::WARN: Config error at <New id="UserTransaction" class="org.mortbay.jetty.plus.naming.Transaction"><Arg> <Ref id="ut"/> </Arg><...

Grab entire document tree with OpenOffice API

I would like to grab the entire tree for a Writer document in OpenOffice 3.1. I need to collect data on all the elements in the tree, not only the Text elements. By loading the XTextDocument and doing getText() will give the XText element. More specifically, using an XEnumerationAccess from the XText will only iterate over the TextRange...