Skip to content

Generate a image with custom text in Android

I’m trying to make an app for create custom cards. I’d like to add some text over a custom background (a jpg image). What is the best way of doing it? I’d need to show the user a preview of the card before send it to the server. Thanks Answer Use below code to achieve your requirement You ha…

Cast Double to Integer in Java

Any way to cast java.lang.Double to java.lang.Integer? It throws an exception “java.lang.ClassCastException: java.lang.Double incompatible with java.lang.Integer” Answer A Double is not an Integer, so the cast won’t work. Note the difference between the Double class and the double primitive.…

Unix grep for Java logs

I am new to Unix grep and i would like some help to come up with a grep command. Currently, i have the following types of error in my application logs: 2012-02-31 10:21:41,333 ERROR [65] (GeneralAppliancesBean.java:135) – Exception java.net.ConnectException: Connection timed out 2012-01-31 10:24:41,843 …

Lucene: Multi-word phrases as search terms

I’m trying to make a searchable phone/local business directory using Apache Lucene. I have fields for street name, business name, phone number etc. The problem that I’m having is that when I try to search by street where the street name has multiple words (e.g. ‘the crescent’), no resu…