java

why c is preferred instead of java in most of the real time appliaciotn.

why c is preferred instead of java in most of the real time appliaciotn. for example like air line system. i want the some of the reasons except that java is little slow. ...

about BEAN LAW in jsp

Hi I wanna know What is Bean law in JSP part as bean can not have constructor with arguments.When declaring bean object in java no-arg constructor of the bean will run. ...

In java, what time is the start of the day?

What time is the start of a day, say 01/01/2010? Is it 00:00:00:000 ? or is that midnight? [edit] It might be a stupid question but I'm confused because I used Calendar.set(Calendar.HOUR, 0) but this gives me a time of 12:00:00. and now I've realised I should be using HOUR_OF_DAY ...

"Program to an interface". What does it mean?

Hi, I keep coming across this term "Program to an interface" What exactly does it mean? A real life design scenario would be highly appreciated. Thanks ...

how to send through ServletOutputStream characters in UTF-8 encoding

My servlet code looks like that: response.setContentType("text/html; charset=UTF-8"); response.setCharacterEncoding("UTF-8"); ServletOutputStream out = response.getOutputStream(); out.println(...MY-UTF-8 CODE...); ... then I get the error: java.io.CharConversionException: Not an ISO 8859-1 character: ש javax.servlet.ServletOutputSt...

How do I place an error message in the corresponding row of a JSF DataTable?

Say I have a editable datatable, with a custom converter that throws an exception if the edited field is somehow wrong, how would I display the error message in the corresponding row of the datatable? here's some code, as simple as I can make it. <h:messages /> <h:datatable> <h:column> <h:inputText value="#{bean.property}">...

Why doesn't the JVM cache JIT compiled code?

The canonical JVM implementation from Sun applies some pretty sophisticated optimization to bytecode to obtain near-native execution speeds after the code has been run a few times. The question is, why isn't this compiled code cached to disk for use during subsequent uses of the same function/class. As it stands, every time a program is ...

what is ivy? and how it is related to ant?

I have seen many ivy files in my application's build projects. What is Ivy, and its relation with ant? ...

It is taking too much time to run my application in eclipse

Whenever i run my application in eclipse it starts building and then runs. As i am haing thousands of classes it taking too much time to build everytime. May i know the reason please and what i have to do to avoid it? ...

Java inverse matrix calculation

Hi, I'm trying to calculate the inverse matrix in Java. I'm following the adjoint method (first calculation of the adjoint matrix, then transpose this matrix and finally, multiply it for the inverse of the value of the determinant). It works when the matrix is not too big. I've checked that for matrixes up to a size of 12x12 the resul...

g++: How to unmangle exported symbols

I'm trying to compile a Java library that uses JNI. When I start the program, I see a crash with an UnsatisfiedLinkError, which says that a particular method could not be found in the DLL. On closer inspection, I found out that g++, which I use for compilation and linking, mangled my method names by adding suffixes such as "@8" or "@16"...

Google App Engine (Java) + Spring managed PersistenceManager

Hi, I've got kinda problem with JDO persistence of a list of just retrieved objects. What I want to do is to: Fetch list of "Orders" Modify one property "status" Make bulk update of "Orders" What I've got so far is "Object with id ... is managed by a different Object Manager". But wait, I haven't faced such a problem without Spring...

Illegal Character when trying to compile java code

I have a program that allows a user to type java code into a rich text box and then compile it using the java compiler. Whenever I try to compile the code that I have written I get an error that says that I have an illegal character at the beginning of my code that is not there. This is the error the compiler is giving me: C:\Users\Trav...

Check if int is between two numbers

Why can't do you this if you try to find out whether an int is between to numbers: if(10 < x < 20) Instead of it, you'll have to do if(10<x && x<20) which seems like a bit of overhead. ...

Logback SMTPAppender Limiting Rate

How can I limit the rate of emails a Logback SMTPAppender, so that it would email me at most once every n minutes? I have setup my logging according to the Logback appender, but I don't quite see how it be configured or subclassed to implement that. Is there a hidden feature? Did someone develop a subclass to handle this? ...

Best way to send an ArrayList<String[]> over TCP in Java?

Hello, I'm writing a client/server application in Java and I'm using TCP to transfer data which I'm storing in an ArrayList (i.e. An ArrayList of arrays of Strings). What is the best way to transfer that data from one to the other? Should I make one long string and use a PrintWriter's println() or is there a better way? Thanks very mu...

Determine AppEngine for Java environment programmatically

Is there a way to tell programmatically at run-time whether a Google App Engine application is running locally vs. hosted? I'm looking for a way to call some custom stub code when running in a local development environment and make different calls when running hosted. ...

Browsing the JDK docs more efficiently.

So far I've just been tacking "java 6" at the end of my class-name search queries in google, but sometimes I'm looking for classes that I don't know the name of, but are designed for what I want to do. Have any tips or tricks for browsing the JDK docs efficiently? ...

Equivalent in Java of EnumMap for use with enum type values?

I'm looking for a class like EnumMap, except for enum type values (ie. EnumValueMap<K,V extends Enum<V>>). http://java.sun.com/javase/6/docs/api/java/util/EnumMap.html Edit If I was mapping, say, a few million Objects to 10 enum types, I imagined it would at least be possible to create a more memory-efficient implementation than just ...

When to use an ESB? messaging with Email/XMPP/SMS

Hi all, I am adding some more depth to the application by supporting multiple methods for notification. Currently, if there is an exception on the site or an event occurs on the site, an email will be sent out to those users, but I want that to be more generic. I want the users to be able to prioritize their notification methods. If ...