Skip to content

Multilanguage development

I would like to develop an application with two languages. Actually, the goal is to generate two differents application, one with a language (Java), the other on in another language (C#). I would like to use makefiles to help me generate one application or the other one, thanks to targets definition. I don&#8…

How to disable loggers of a class or of whole package?

I am using Apache Commons Logging ™. For now I wanted to use SimpleLog implementation, but when I changed the level, loggers from the libraries came out. I want it to turn them off. Is there a easy way to change log level for whole package (can Log4j do that)? I have tried to set org.apache.commons.logging.si…

HashMap with multiple values under the same key

Is it possible for us to implement a HashMap with one key and two values. Just as HashMap? Please do help me, also by telling (if there is no way) any other way to implement the storage of three values with one as the key? Answer You could: Use a map that has a list as the value. Map<KeyType, List<Value…

Remove multiple elements from ArrayList

I have a bunch of indexes and I want to remove elements at these indexes from an ArrayList. I can’t do a simple sequence of remove()s because the elements are shifted after each removal. How do I solve this? Answer Sort the indices in descending order and then remove them one by one. If you do that, the…

How to set eclipse console locale/language

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…

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 ‘ ‘, &#82…