Data dodania Pytanie
2017-01-11 23:01 takeWhile, dropWhile laziness java9 »
In scala those methods works fine but in java9 dropWhile works differently I think. Here is example for takeWhile Stream.of("a", "b", "c", "de", "f"...
(4) odpowiedzi
2017-01-11 19:01 EJS variable only being changed in current scope »
I recognise that the issue here is to do with scope, although I don't understand how, the counter variable defined in EJS outputs 0,1,1 when the site...
(0) odpowiedzi
2017-01-11 12:01 Java 8 autoboxing + generics: different behaviour with variable vs. method »
I found a piece of code that after switching from Java 7 to Java 8 stopped compiling. It does not feature any of the new Java 8 stuff like lambda or s...
(4) odpowiedzi
2017-01-11 10:01 Java classloader tracing »
My webapplication throws the following ClassCastException: java.lang.ClassCastException: org.postgresql.jdbc4.Jdbc4ResultSetMetaData cannot be cast t...
(0) odpowiedzi
2017-01-11 10:01 Sbt update shows Server access Error: java.security.ProviderException: java.lang.NegativeArraySizeException »
Yesterday everything was working fine, but today when I execute sbt update I am getting: [info] Resolving org.log4s#log4s_2.11;latest.release ... [er...
(1) odpowiedzi
2017-01-11 10:01 Update parameters of a list in a method: return list or not »
I have a list of objects like the next class: class A { private String property1; private String property2; //Setters && Getters ...
(3) odpowiedzi
2017-01-11 08:01 Adding element to 2d arraylist in java »
ArrayList<Integer> a =new ArrayList<Integer>(); ArrayList<ArrayList<Integer>> j =new ArrayList<ArrayList<Integer>>...
(4) odpowiedzi
2017-01-10 20:01 Why does Spring MVC respond with a 404 and report "No mapping found for HTTP request with URI [...] in DispatcherServlet"? »
I'm writing a Spring MVC application, deployed on Tomcat. See the following minimal, complete, and verifiable example: public class Application exten...
(2) odpowiedzi
2017-01-10 16:01 Java 8 - Type mismatch: cannot convert from List<Serializable> to List<String> »
I have a list of Strings: List<String> list = Arrays.asList("a1,a2", "b1,b2"); Then to convert everything in a list like: "a1","a2","b1","b2"...
(1) odpowiedzi
2017-01-10 12:01 I'm creating a poker client, how can I make the exception handling more clean? »
I'm checking if the values are valid. The if parts looks still messy for me, checking a lot of || operator, and there is multiple InvalidArgumentExcep...
(3) odpowiedzi
2017-01-10 10:01 Factoring try catch »
I have a Java EE application with dozens of web services using the same pattern: public Response myWebService1() { try { // do something ...
(5) odpowiedzi
2017-01-09 16:01 How can I inject "variables" WHERE clauses into a query? »
I have a query: SELECT * FROM table_name WHERE name=? surname=? gender=?; and I have to inject the strings into the query (I use the prepared statem...
(2) odpowiedzi
2017-01-09 14:01 Java 8 GroupingBy into Peek »
I recently learned about streams in Java 8 and started to work with them. Now I have a question regarding the groupingBy collector method: Usually I ...
(2) odpowiedzi
2017-01-09 11:01 Java Swing - Localize Temperature »
Is there a way to localize Temperature in Java? Like temperature format will be based on the locale? Because for example, for Norwegian language temp...
(1) odpowiedzi
2017-01-09 10:01 Creating Objects According to an Input File »
I have a task that needs to be done but I am really stuck. Basically, I've some inheritance relations like this: Animal Pet WildAnimal Bird Cat ...
(2) odpowiedzi
2017-01-08 23:01 Is LIBGDX Slower in python than Java »
I've been developing games in Python & Pygame for a while now, Though one thing that's been in mind is my dislike to pygame's performance and lack...
(1) odpowiedzi
2017-01-08 21:01 While Loop Terminating after ResultSet.execute »
I am trying to make TABLE COMPB equivalent to TABLE COMPA by Update and Delete operations on Table COMPB based on Table COMPA. The code works perfectl...
(3) odpowiedzi
2017-01-08 17:01 RxJava Observable to Completable, how to avoid toBlocking() »
I am currently using RxJava on Android with Kotlin, but I have a problem and I can't solve without using toBlocking(). I have method in employee serv...
(2) odpowiedzi
2017-01-08 02:01 How can programs written in Java not require the JRE? »
I had a fresh install and before installing Java was able to run NetBeans and OpenOffice. If these programs were written in Java, how is this possible...
(2) odpowiedzi
2017-01-08 02:01 Stream of cartesian product of other streams, each element as a List? »
How can I implement a function using Java 8 to take some number of streams, and produce a stream in which each element is a list consisting of one mem...
(0) odpowiedzi
2017-01-08 02:01 Java Jersey Web Service: consume JSON request »
I have a web service made witj Java and Jersey. I want to receive a JSON request and parse the json for savethe values stores on the json on the datab...
(1) odpowiedzi
2017-01-08 02:01 SQLite insertions slow to a crawl over time »
I'm using the program below to insert values from very large .csv files (~2.5 million lines) into an SQLite DB. It starts very fast, but begins to slo...
(1) odpowiedzi
2017-01-08 01:01 onClickListener not working (properly) after ConfigurationChange in fragments »
Introduction Huh, this is a tough one. At least, I think so... To clear things up: I did not find any answers to my question after searching the ...
(1) odpowiedzi
2017-01-07 15:01 pass string without single quote in spring jdbctemplate »
my requirement is to create a insert statement through Spring JDBCTemplate in which I can pass oracle function which execute at database. e.g - lets...
(1) odpowiedzi
2017-01-07 11:01 How to get json objects embedded in html page result of js running by phantomJS and pass them to java code? »
I use js script code that described in this answer, but i don't want to save html result page in html file. I want to extract Json object from <div...
(0) odpowiedzi
2017-01-07 11:01 An efficient way to convert List<Integer> to int[] ( array ) without iteration »
public static int[] convertListToArray(List<Integer> listResult) { int[] result = new int[listResult.size()]; int i= 0; ...
(2) odpowiedzi
2017-01-07 09:01 after adding facebook sdk why the navigation view doesn't work »
I created a simple Navigation view project in android studio 2.1 then after i added facebook sdk(Maven central repositories) in my build.gradle .It wa...
(1) odpowiedzi
2017-01-07 09:01 java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow »
I need to fetch all data from a table,I used the following code to do the same in sqlite dbhelper class: public Cursor getData() { SQLiteData...
(1) odpowiedzi
2017-01-07 03:01 why are java's BigInteger gcd and modInverse so slow? »
I'm trying to use java.math.BigInteger for some exact integer matrix computations in which the scalar values get up to millions of digits. I've notice...
(1) odpowiedzi
2017-01-06 22:01 Java - A smarter way to determine the child class? »
I need an intelligent way to differentiate between multiple objects, all child classes from the same parent class. Consider this parent class and two...
(12) odpowiedzi
2017-01-06 12:01 Java generics: why is this output possible? »
I have this class: class MyClass<N extends Number> { N n = (N) (new Integer(8)); } And I want to get these outputs: System.out.println(n...
(4) odpowiedzi
2017-01-06 03:01 Is it worth to use slf4j with log4j2 »
I am not able to decide whether to use slf4j or not with log4j2. Based on online posts, does not look like it will have any performance hit but is it ...
(1) odpowiedzi
2017-01-05 16:01 How to manage two sets of properties at runtime? »
I'm building a web service that needs to switch between two sets of properties depending on the request URL coming in. I'm not sure which is the best ...
(3) odpowiedzi
2017-01-05 11:01 Google API authentication in Java without using environment variable »
I have set up a simple test app to interact with Google's Natural Language API. I created a service account, and downloaded the JSON credentials. I am...
(1) odpowiedzi
2017-01-05 00:01 Java native methods. Public vs. private »
Assume that we need to implement some java method in native code and expose it to user. We know that all work is done by native side, i.e. the only re...
(2) odpowiedzi