How to get the last date of a particular month with JodaTime?

Java
I need to get the first date (as org.joda.time.LocalDate) of a month and the last one. Getting the first is trivial, but getting the last seems to nee...
3 years ago

Convert ArrayList<String> to String[] array

Java
I'm working in the android environment and have tried the following code, but it doesn't seem to be working. String [] stockArr = (String[]) stock_li...
3 years ago

Java calculate hex representation of a SHA-1 digest of a String

Java
I'm storing the user password on the db as a sha1 hash. Unfortunately I'm getting strange answers. I'm storing the string as this: MessageDigest cr...
3 years ago

Why doesn't AspectJ compile-time weaving of Spring's @Configurable work?

Java
Update 5: I've downloaded the latest Spring ToolsSuite IDE based on the latest Eclipse. When I import my project as a Maven project, Eclipse/STS appea...
3 years ago

Java Subtract 2 duration in HH:MM:SS

Java
I have 2 string in java (HH:MM:SS) please take note this is not time, but duration, i used end time - start time to get these values: Case1: duratio...
3 years ago

Why do I get an Stackoverflow Error?

Java
I have a little recursive algorithm which should guess a number. I call the method guessNumber and give a number and a lower value than the number and...
3 years ago

Getting 403 when trying to get StackOverflow's flair image with ImageIO

Java
I have written following code in my program url = new URL("http://stackoverflow.com/users/flair/3626698.png?theme=dark"); ImageIO.read(url); I am ...
3 years ago

HTTPS using Jersey Client

Java
How do I send GET requests using the Jersey Client API to a server which runs on the HTTPS protocol. Is there any sample code that I can use ?
3 years ago

How to customize the form of rounding

Java
My question may seem simple, but still can not get something that works. I need to customize the Math.round rounding format or something to make it wo...
3 years ago

How to inject mocked object into another already mocked object

Java
I have a class that I mocked like this: @Mock private MyClass1 mockMyClass1; Say this class looks like that: public class MyClass1 { @Autowired ...
3 years ago

What exactly does "Stream" and "Buffer" mean in Java I/O?

Java
I just learned about input/output using BufferedReader. I wanted to know what exactly are the meanings of the term Stream and Buffer? Also what does...
3 years ago

JAVA BitSet setting

Java
I'm developing in Java (JDK 1.8) and manipulating BitSets. I came accross a strange issue. I'm instantiating a BitSet of size 160 like: BitSet examp...
3 years ago

twitter4j configuration

Java
I'm trying to configure twitter4j to stream tweets I got (consumer key/secret, access token &amp; access secret) from twitter already I created a...
3 years ago

How can I set the value of "Double" type variable of my Class by JNI?

Java
If I just want to set value to Double type variable, I may code like: public static native int getDoubleVar(Double dobj); JNIEXPORT jint JNICALL test...
3 years ago

Change text field data color (Foreground color) based on condition in JasperReports

Java
I'm new to JasperReports. I'm designing a report using iReport. I have three values x,y,z. If z &lt; y then the data color for z should be changed to ...
3 years ago

LRU with Caffeine

Java
I'm trying to use Caffeine as LRU cache, so entries that were added first will be evicted first. Ran this code: final Cache&lt;Object, Object&gt; map...
3 years ago

Strange Error using Hibernate with MySQL in Java over JDBC

Java
I get the following exception after my program proceeding database oparations for around one minute: WARN : org.hibernate.util.JDBCExceptionReporter ...
3 years ago

I am trying to make the swipeable tab layout in android but getting null value in action bar

Java
I am trying to make the two tab layout for {profile} and {Child} which should be swipeable too. I have created the layout and fragment for both of the...
3 years ago

Can't get location and email using Facebook API

Java
In my Android application I developed this code to login with my account and get user property like name, location and email. The problem is I can get...
3 years ago

paintComponent on JPanel not working

Java
I've spent almost 2 hours now on it but I can't get it working. I just want to paint a image on a JPanel. I want to paint the imageChaser image on th...
3 years ago