java

iTextSharp diacritics

Hi, I am trying to typeset a pdf with iTextSharp library, but I cannot find anywhere how to handle diacritics. Since I found tables of contents of two books about iTextSharp where diacritics has a section, I suppose it is doable. So the question is How to typeset "ř" ? In addition, is there some guide or link about this problem? Than...

Java: Sort an unmodifiable list

How would one do this? I have tried creating a new, empty list, then copying unmodifiable list's elements to it, but I'm getting unsupported operation error. Any help is appreciated. ...

Providing a google search facility to a text box in java windows application

can we provide a google search facility to a text box in java windows application.. ...

Working around Java JIT bug

We seem to be subject to a strange bug in our Java environment. We've now had two occurrences of the same "can't happen" exception; in one case the problem occurred 42,551 times over a period of 48 minutes in a running process and then spontaneously cleared itself. The failing code is triggered by this line: return String.format("%1d%X...

How to convert an 18 Character String into a Unique ID ?

Hi, I have an 18 Character String that I need to convert into a unique long (in Java). A sample String would be: AAA2aNAAAAAAADnAAA My String is actually an Oracle ROWID, so it can be broken down if needs be, see: http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#CNCPT713 The long number generated, (1) Mus...

upload file with java servlet to app engine

Hi I would like to be able to have the user upload short audio samples to my app-engine application and store them in the provided datastore. I'm using the Java servlet version. My problem is using a multi-part form to upload a file. Using the normal request.getParameter() method returns null with multi-part forms. I have read abo...

How to resolve this error: "an unknown item is declared as the root of your mxml document"?

I'm working with eclipse, blazeds and Flex Plugin, and every time I create a Web Dynamic Project then add a Flex Project Nature to it this error: "An unknown item is declared as the root of your mxml document" appears just as the perspective view changes and I click on the design mode. As far as I know the only lines of code written on t...

Problem in XML parser program.

I am doing a simple XML parser program.I am running it in command prompt.The program (abc.java) compiles successfully.But it gives following error after running it: C:\Program Files\Java\jdk1.6.0_13\bin>java abc abc.xml [Fatal Error] abc.xml:1:8: The processing instruction target matching "[xX][mM][ lL]" is not allowed. Pars...

How to get eclipse to recognize preprocessor statements?

I've managed to get the IDE to compile the java project correctly by modifying the config.ini, but the IDE itself is still showing errors concerning the processor statements: //#ifdef VER_X public class Video extends FirstCanvas { //#else public class Video extends SecondCanvas { //#endif ... Is there a setting or a plug-in that would...

Jetty JNDI Java Mail

Hi all, I am using Jetty 7 with JBoss Seam and have 2 Java Mail Sessions configured, one for support notifications and another for general notifications. The problem I am having appears to be from JBoss Seam / JSF not being able to resolve the session which I set in the Event Context to the proper Java Mail Session prior to sending the...

Generating .class file for JVM

Hello Everybody, I am working on a project that requires me to generate a java ".class" file on the go that can be later on compiled on the JVM. After learning and working with MSIL (Microsoft IL) which is also a stack based intermediate programming language, the following are the problems I am facing : As compared to the IL (for C# or...

Numerical integration in Java?

Are there any libraries for Java to do numerical integration? I did ask google but failed to find anything, so should I implement my own methods (like trapeze method, simpson's method or whatever, it's been some time since I had my numerical analysis class)? ...

What type of java cache should be used in case data changes frequently?

I have a JSP which shows data by many aggregation types. E.g. By market, by category, by server type, etc.. What I have is the data by publisher and time. Publisher is the most granular level of data in my case. Now this data changes on every 1/2 an hour. The number of data per half an hour is almost 5K and anyone at a time looks data ...

JUnit: Enable assertions in class under test

I've been bit a few times by Java assert statements that didn't fail in the JUnit test suite because assertions weren't enabled in JUnit's JVM instance. To be clear, these are "black box" assertions inside implementations (checking invariants, etc) not the assertions defined by the JUnit tests themselves. Of course, I'd like to catch any...

read a JSON object in java

how can we read a JSON object in a JSP , Servlet or in any other java program? ...

Java Arrays- tranforming string with spaces into an array

public class MatrixMultiply{ public static void main(String[] args) { main(); } static void main() { int[] vec = { 1, 2, 3, 4, 5 }; System.out.println( mean( vec ) ); } static int mean(int[] v) { int total = 0; for (int i = 0 ; i < v.length ; i++ ) { total = tot...

Using a custom Servlet oriented framework, too many servlets, is this an issue

In our application, we structure different web applications by Servlet. There are many, many Servlets and Filters in our applications. We already use different frameworks but not for this particular legacy web application. One issue is that one application/servlet is completely separate from another. If you were to redesign your appl...

Convert high-resolution images to low-resolution

Hi , I am doing a web project on media manager. I upload high resolution images and need to convert these images to low resolution, so that the resulting image is compressed into a smaller size. How is this possible using Java? Please post source code, if possible. Thanks, Naveen ...

The easiest way to perform asynchronous operations in Java web applications

I have Java servlet-based web applications. I would like to implement some operations in asynchronous manner, like for example writing to a log. I would like to avoid JMS overhead and do something simple. Managing threads myself doesn’t seem such a good idea in a server environment, you would probably need to tap into server thread p...

How do I find out which JAXP implementation is in use and where it was loaded from?

I would like to provide diagnostic information about what JAXP implementation is in use, and which JAR file it was loaded from. One way to achieve this is to create in instance of, for example, a DocumentBuilderFactory, and then inspect the properties of that class: private static String GetJaxpImplementation() { DocumentBuilderFac...