Data dodania Pytanie
2017-06-04 08:06 String returns in finally and try block »
I came across this question and I am unable to understand the reason of the output it is giving. The program is: public static String method(){ ...
(3) odpowiedzi
2017-06-03 19:06 How to implement a method with an unknown number of arguments? »
I have 1 interface and 3 class. I would like the class to be able to both implement the interface which need a transform method. This method must exis...
(5) odpowiedzi
2017-06-03 15:06 How to send data to php server and receive data to android »
I'm a newbie in android programming and I want to sent data to php server and receive data to show in android but I have no idea to create it, I don'...
(1) odpowiedzi
2017-06-03 12:06 Why is this C++ code execution so slow compared to java? »
I recently wrote a computation-intensive algorithm in Java, and then translated it to C++. To my surprise the C++ executed considerably slower. I have...
(2) odpowiedzi
2017-06-03 11:06 Why Matcher.group throwing IndexOutOfBoundsException Exception »
I've below code and in which i am trying to print all the matches in a String using Matcher.group(). public static void main(String[] args) { ...
(2) odpowiedzi
2017-06-02 21:06 Is there dynamic module discovery in JDK9? »
In the upcoming Java 9, is there a way to dynamically discover which modules are available? E.g.: Run some app with some module path While the app ...
(2) odpowiedzi
2017-06-02 21:06 Does method invoke cost remain constant with more interface implementions »
Lets say we have an interface "ISomething" with the method "DoSomething". And we create multiple classes that implement it. Example 5/10/100/1000 new ...
(3) odpowiedzi
2017-06-02 19:06 Why is the StringBuilder chaining pattern sb.append(x).append(y) faster than regular sb.append(x); sb.append(y)? »
I have a microbenchmark that shows very strange results: @BenchmarkMode(Mode.Throughput) @Fork(1) @State(Scope.Thread) @Warmup(iterations = 10, time ...
(1) odpowiedzi
2017-06-02 18:06 Why does my Oracle JVM create all these objects for a simple 'Hello World' program? »
I was playing around with jmap and found that simple "Hello World" Java program creates thousands of objects. Here is truncated list of objects Oracle...
(3) odpowiedzi
2017-06-02 09:06 AutoFormatting Lines in IntelliJ »
I was using the formatter in IntelliJ and the right margin was 100 Because of this, when I auto format my code: IntelliJ automatically split long sta...
(1) odpowiedzi
2017-06-02 08:06 Room - Schema export directory is not provided to the annotation processor so we cannot export the schema »
I am using Android Database Component Room I've configured everything, but when I compile, Android Studio gives me warning Schema export directory i...
(1) odpowiedzi
2017-06-02 08:06 Confused with Thread Pattern »
It may look a very funny and silly question.. I am trying to look around the Background operations with Runnables, Threads, Services and Intent Serv...
(2) odpowiedzi
2017-06-02 01:06 Oracle's to_date function returns a non existing date »
When java.util.Date is parsing "01/01/1901" to a Date objet, Java API is converting the date to “01/01/1901 0:08:39” instead of “01/01/1901 0:00...
(1) odpowiedzi
2017-06-01 22:06 Is Java ArrayList really this much slower than C++ vector? »
I do not want to start yet another pointless flamewar about whether Java or C++ is the better language in general. I want to know whether a comparison...
(1) odpowiedzi
2017-06-01 16:06 Applying a theme to AlertDialog Builder causes the title to not work correctly »
I am attempting to add a title to my AlertDialog Builder. When I add the theme, my title gets moves into the selection area. Here is the first examp...
(1) odpowiedzi
2017-06-01 09:06 Filter a list with condition on inner list »
I have a list of objects. Each object contains another list. I want to filter the list with condition on inner list. For example: There is a list o...
(2) odpowiedzi
2017-06-01 07:06 How do I compare two-dimensional (or nested) Java Arrays? »
From the Java docs for Arrays.equals(Object[] a, Object[] a2): Returns true if the two specified arrays of Objects are equal to one another. The...
(4) odpowiedzi
2017-06-01 05:06 Java 9 Interface vs Class »
As Java 9 is going to allow us to define private and private static methods too in interfaces, what would be the remaining difference in interface and...
(4) odpowiedzi
2017-05-31 17:05 Casting Java functional interfaces »
As always I was looking through JDK 8 sources and found very interesting code: @Override default void forEachRemaining(Consumer<? super Integer&gt...
(3) odpowiedzi
2017-05-31 15:05 How to get a custom type instead of Integer when using Collectors.summingInt? »
I am currently creating a Map<String, Map<LocalDate, Integer>> like this, where the Integer represents seconds: Map<String, Map<Loc...
(2) odpowiedzi
2017-05-31 15:05 What is the best way to declare on UI component in android with Kotlin? »
I'm trying to build android application using Kotlin for the first time. I want to declare on some buttons outside the OnCreate method and i can init...
(3) odpowiedzi
2017-05-31 13:05 convert postgresql query to Native Query »
I want to convert the below postgresql query to hibernate query or any type of query that supports in java WITH RECURSIVE tree(parent, idElement) AS...
(1) odpowiedzi
2017-05-31 13:05 Convert type X to Y in Map<K, Map<V, X>> using Java Stream API »
I want to convert inner map from map of maps. Old map: Map<String, Map<LocalDate, Integer>> Integer means seconds New map: Map<String...
(9) odpowiedzi
2017-05-31 13:05 Why is reference assignment atomic in Java? »
As far as I know reference assignment is atomic in a 64 bit JVM. Now, I assume the jvm doesn't use atomic pointers internally to model this, since oth...
(3) odpowiedzi
2017-05-31 05:05 Spring CSRF token issue »
I'm testing the upload file using spring mvc 4. I have this jsp file to upload a file: <c:url var="addAction" value="/create/uploadFile" ><...
(0) odpowiedzi
2017-05-31 03:05 converting ETrade Java code example to Coldfusion »
I'm implementing the ETrade Java SDK on a ColdFusion server. import com.etrade.etws.account.Account; import com.etrade.etws.account.AccountListRes...
(1) odpowiedzi
2017-05-30 20:05 Calculate all permutations for List(s) inside List »
Request As this question is dedicated to the Scala programming language, a solution in Java would do just as well. One minor thing to notice, however...
(2) odpowiedzi
2017-05-30 17:05 What date API should I use to avoid GC pauses? »
I am writing a solution for HFT ( High-Frequency Trading ), which processes the messages that contain dates, I need to work with date in each message....
(0) odpowiedzi
2017-05-30 17:05 Java 9 HttpClient hangs »
I'm experimenting with HTTP/2 client from jdk 9-ea+171. The code is taken from this example: HttpClient client = HttpClient.newHttpClient(); HttpReq...
(1) odpowiedzi
2017-05-30 14:05 Mathematical formula to a recursive method »
I need to implement current formula.It is for scoring the nodes in a taxonomy. Basically, the score of a node depends on the amount of child nodes and...
(1) odpowiedzi
2017-05-30 11:05 Implementation of Collection.stream() »
I have been working on JDK 1.8 for a few days now where I came across some piece of code which was similar to this: List<Integer> list = Array...
(4) odpowiedzi
2017-05-30 10:05 How to solve this error : ERROR: operator does not exist: character varying = integer »
I am a beginner in Java EE and spring. Actually I program an application and I spent several hours on an error that I can't correct. I want specify th...
(0) odpowiedzi
2017-05-29 19:05 lambda expression vs static method »
I had a question about reusability of lambda expression without code duplication. For example if I have a helper method I can easily code it as a stat...
(4) odpowiedzi
2017-05-29 17:05 Join a list of object's properties into a String »
I'm learning lambda right now, and I wonder how can I write this code by a single line with lambda. I have a Person class which includes an ID and na...
(4) odpowiedzi
2017-05-29 15:05 Need to insert 100000 rows in mysql using hibernate in under 5 seconds »
I am trying to insert 100,000 rows in a MYSQL table under 5 seconds using Hibernate(JPA). I have tried every trick hibernate offers and still can not ...
(4) odpowiedzi