Is it possible to change the prompt text that says “place the barcode inside the viewfinder…” when launching the Barcode scanner (zxing) via intent ? I want to have a prompt in my language, how should I do that? Answer Yes, plain and simple:
Tag: java
What is this: [Ljava.lang.Object;?
I get this when I call toString on an object I received from a function call. I know the type of the object is encoded in this string, but I don’t know how to read it. What is this type of encoding called? Answer [Ljava.lang.Object; is the name for Object[].class, the java.lang.Class representing the cl…
How to make a copy of ArrayList object which is type of List?
I studied that Java passes object references by value, and in order to make a local copy of an object I can either do clone() or copy-constructor. I also looked at deep/shallow copy as well as several posts on Stack Overflow. I am looking at this example: Only a few articles I read mention that ArrayList impl…
dynamically increasing java heap space
I have written a java program that tests the speed of a couple of multi-threading algorithms on different machines with various numbers of processors. On some machines, merge sort* fails because it requires a sizable heap space to work on very large arrays. I can easily change the java heap space myself befor…
Hibernate : dynamic-update dynamic-insert – Performance Effects
Using dynamic-update or dynamic-insert has positive, though generally slight only on performance, as also mentioned by http://www.mkyong.com/hibernate/hibernate-dynamic-update-attribute-example/ But the reference documentation mentions that this could have negative performance effects also as mentioned below …
How to print formatted BigDecimal values?
I have a BigDecimal field amount which represents money, and I need to print its value in the browser in a format like $123.00, $15.50, $0.33. How can I do that? (The only simple solution which I see myself is getting floatValue from BigDecimal and then using NumberFormat to make two-digit precision for the f…
Holidays – is there a java implementation?
I’d like to know if there is a jar-file out there that could do the following: If there isn’t, why? Surely there are lots of properly based rules for the holidays in 99% of the times. Right now we’re mainting a table in our database, with the countries + we have some implementation when it c…
How do I retrieve default validation messages from Hibernate Validator?
I’m trying to retrieve a default validation error-message using MessageSource. The code I’m working with uses reflection to retrieve the value of the message parameter. On a constraint that does not override the message parameter, I would like to retrieve the default error message. When I invoke t…
Why use finally
I never properly understood the use of the finally statement. Can anyone tell me what the difference is between: on the one hand and: On the other Answer They differ if the try-block completes by throwing a java.lang.Throwable that is not a java.lang.Exception, for instance because it is a java.lang.Error suc…
Why use inheritance at all? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, …