When developing web application with Eclipse (Helios) the tomcat output is being sent to the console. Ok, but the messages are being translated to my OS language. In fact, my Eclipse is in English, but the Tomcat output (logging) is being translated to Portuguese. Probably it’s a Tomcat configuration is…
Tag: java
How to filter string for unwanted characters using regex?
Basically , I am wondering if there is a handy class or method to filter a String for unwanted characters. The output of the method should be the ‘cleaned’ String. Ie: Expecting result would be: A better example: I expect the result to be: Because, i let the cleaner know that ‘ ‘, R…
How to start a transaction in JDBC?
Connection.setTransactionIsolation(int) warns: Note: If this method is called during a transaction, the result is implementation-defined. This bring up the question: how do you begin a transaction in JDBC? It’s clear how to end a transaction, but not how to begin it. If a Connection starts inside in a t…
Moving items around in an ArrayList
I’ve been playing around with ArrayLists. What I’m trying to achieve is a method to do something like this: I’m trying to be able to move items up in the list, unless it is already at the top in which case it will stay the same. For example, if item 3 was moved the list would be: From my sma…
Eclipse Memory Analyzer – Leak Suspects Report doesn’t point to MY classes – why?
I’m trying to determine whether or not I have a memory leak in my webapp. I’m using VisualVM and JMeter to load test and watch the heap. I saved a heap dump to file and downloaded Eclipse Memory Analyzer yesterday…after much frustration with VisualVM, I thought Eclipse would pinpoint the lea…
OutOfMemory Exception – how does VisualVM help locate the memory leak with heapdump file?
I’ve been testing my webapp locally on my pc and monitoring it with VisualVM. I recently also started using JMeter, as it was suggested that I should do some load testing since I suspected that I have a slow memory leak somewhere. Today my webapp finally threw the OutOfMemory exception. I had the HeapDu…
Removing all whitespace characters except for ” “
I consider myself pretty good with Regular Expressions, but this one is appearing to be surprisingly tricky: I want to trim all whitespace, except the space character: ‘ ‘. In Java, the RegEx I have tried is: [s-[ ]], but this one also strips out ‘ ‘. UPDATE: Here is the particular str…
Using Java Source Code in my own project [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 7 years ago. Improve this question I wrote a program in Java 6.0, but it turns out that some of our cl…
Android:Problem in displaying text
I got a bulk of text in a file that has to be displayed in the textview The text should fit exactly in the screen and the remaining text in next page and so on ! Now the problem is how to get the …
Get the indices of an array after sorting?
Suppose the user enter an array, for example: which I did know the length of it the index array would be: Now, after sorting it using Arrays.sort(Array); newArray will be like: and the newIndex will be: The problem is: how can I find the newIndex from the input Array? Answer Don’t sort the array to star…