Data dodania Pytanie
2017-04-09 16:04 Why must throw statements be enclosed with a full code block in a lambda body? »
If there is a single statement in a lambda function, we can omit defining the full code block for it: new Thread(() -> System.out.println()); Wh...
(3) odpowiedzi
2017-04-09 14:04 What is the order of array when derived from Linked hashMap? »
I have created one linked hash map and then using that map I have generated Map key array like this : - Map<String, String> map = new LinkedHa...
(1) odpowiedzi
2017-04-09 09:04 Why would you prefer Java 8 Stream API instead of direct hibernate/sql queries when working with the DB »
Recently I see a lot of code in few projects using stream for filtering objects, like: library.stream() .map(book -> book.getAuthor()) ...
(6) odpowiedzi
2017-04-08 21:04 How to generate given number of random objects with given number of attributes? »
My question is, how to generate a random challenge with a given number (4 - 8) of trials? A challenge is built from trials (see in code, below). The...
(3) odpowiedzi
2017-04-08 19:04 Hibernate : Objects are getting saved without transaction Object »
I am having following piece of code for saving the object in the database, import java.util.HashMap; import java.util.Map; import javax.persistence....
(1) odpowiedzi
2017-04-08 09:04 Collections.emptyList() vs guava's ImmutableList.of() »
The title says it all. It is a simple question really. Just wanted to understand how both these stuffs really work. Which would be the best option to ...
(1) odpowiedzi
2017-04-07 16:04 Return first non-null value »
I have a number of functions: String first(){} String second(){} ... String default(){} Each can return a null value, except the default. each func...
(7) odpowiedzi
2017-04-07 12:04 10-digits BigDecimal cannot be saved in NUMBER(10, 2) column »
In a Oracle 12 database, one of my column is defined with NUMBER(10,2). The goal is to store numbers like that one: 12345678.12. Actually, I can store...
(2) odpowiedzi
2017-04-07 11:04 Comparator.comparing(...) throwing non-static reference exception while taking String::compareTo »
Below are the two lines of my code snippet: List<String> listDevs = Arrays.asList("alvin", "Alchemist", "brutus", "larsen", "jason", "Kevin"); ...
(3) odpowiedzi
2017-04-07 09:04 Large string(40 mb) insertion in Database - logging / Performance issue »
Java version : 1.7 Database : PostgreSQL I need to insert large String in Database in multithreading application for each activity where Sting size ...
(0) odpowiedzi
2017-04-07 08:04 maximum limit on Java array »
I am trying to create 2D array in Java as follows: int[][] adjecancy = new int[96295][96295]; but it is failing with the following error: JVMDUMP0...
(5) odpowiedzi
2017-04-06 23:04 ForkJoinPool and Future.Get »
Assuming that I have a ForkJoinPool setup with degree of parallelism n, and that I call a parallel computation like this: workpool.submit( ...
(1) odpowiedzi
2017-04-06 19:04 Trying to use cfpdf to sign a pdf »
I'm trying to sign a pdf using the following... <cfpdf action="sign" source="#expandPath('.')#\tempFiles\unsigned\form - unsigned.pdf" destination...
(0) odpowiedzi
2017-04-06 19:04 Hibernate 5.2.9:@Basic(fetch = FetchType.LAZY) is not working »
I saw there are lot of questions asked earlier on the same thing in stack overflow in different ways. I looked at one of this issue on Hibernate forum...
(1) odpowiedzi
2017-04-06 15:04 Refactoring code to be Generics and functional interface »
I have two interfaces one can be used to find some statistics by Key and Value and the other is used to visit an object and iterate over it, the first...
(1) odpowiedzi
2017-04-06 12:04 Spring profile default behaviour »
I have a spring profile "DEV" and thats the only profile I have and I do NOT want to create a "production" profile. So only when profile is "DEV" I wo...
(2) odpowiedzi
2017-04-06 09:04 DELETE .. RETURNING rowid in JOOQ not working »
I have an oracle database, and am trying to delete a record based on the client number, with the query returning the rowid of the deleted record. Whe...
(1) odpowiedzi
2017-04-06 07:04 In Java9 how can I reflectively load a class if I don't know it's module? »
Suppose I have an application that given a well known package name and class, I need to load that class reflectively and invoke some methods from it. ...
(2) odpowiedzi
2017-04-06 00:04 What is the Tensorflow Java Api `toGraphDef` equivalent in Python? »
I am using the Tensorflow Java Api to load an already created Tensorflow model into the JVM. I am using this as an example: tensorflow/examples/LabelI...
(1) odpowiedzi
2017-04-05 22:04 Finding the smallest integer who's not a sum of a sorted array »
I just got back from an exam which had a question that I just don't know how to even approach: Given a sorted array (each element in the array is ...
(0) odpowiedzi
2017-04-05 17:04 Java duplicate generic definition »
I'm trying to implement a basic class to create, read, update and delete objects. I'm sure I could find a library to do that but I'm doing it myself f...
(1) odpowiedzi
2017-04-05 13:04 How Google calendar or Instagram make their apps all the time up and running even after force stop »
Looks like force stop should prevent app from running and it's even disable all app's alarms. However I found that notification in Google Calendar sti...
(3) odpowiedzi
2017-04-05 11:04 What is the difference in usage of primitive and wrapper data type and what is the need of wrapper data type? »
I searched it all over the web, but all the answers just consisted of the difference. I know the difference, but I don't understand the difference in ...
(3) odpowiedzi
2017-04-04 22:04 String to character array returning different result in Visual Studio and Android Studio »
The string that I want to convert into character array is ষ্টোর it is in Unicode and a Bengali word. The problem is when I am converting it...
(2) odpowiedzi
2017-04-04 22:04 With functionaljava HList, is there a way to pass each element of an arbitrary HList to a corresponding curried function? »
For example, if i had an HList: HList<A,HList<B,HList<C,HNil>>> list = ... Is there a way to apply each element to a curried funct...
(0) odpowiedzi
2017-04-04 22:04 Does the shuffle step in a MapReduce program run in parallel with Mapping? »
I was trying to understand a MapReduce program. While doing that, I noticed that the reduce tasks start executing almost immediately after all the map...
(1) odpowiedzi
2017-04-04 18:04 Create a TAR File (tarball) using Coldfusion\Java on a windows server »
I need to create a TAR file containing multiple files on a windows server using Coldfusion\Java. I have found lots of examples of unpacking them, but ...
(1) odpowiedzi
2017-04-04 15:04 Alternative of Java String.split for better performance »
In the process of adding data by import from a csv/tab seperated file, my code consumes a lot of time to upload data. Is there any alternative to do t...
(2) odpowiedzi
2017-04-04 05:04 Why do these PHP and Java key generators produce different output? »
I' m writting a key generator for an encryption script in PHP and I want it to be compatible with a class I wrote in Java, so that they can share reso...
(1) odpowiedzi
2017-04-04 02:04 How can I validate a local date time within daylight savings time? »
Mar 12, 2017 02:39:00 "America/Chicago" does not exist. When I set the date and time to this value it does not fail. The time gets set to Mar 12, 2017...
(2) odpowiedzi
2017-04-03 22:04 Creating an XsrfProtectedServiceServlet with a @Service stereotype throws a NullPointerException »
I am trying to add CSRF protection to our GWT RPC layer as per the guide in the GWT documentation. I am having issues with creating my RPC service im...
(1) odpowiedzi
2017-04-03 21:04 How should I name my Java 9 module? »
Suppose I have a library with groupId = org.abc and artifactId = myLibrary. What is the recommended name for the module name: myLibrary or org.abc.myL...
(1) odpowiedzi
2017-04-03 21:04 Java8 sublists of a List<> using lambdas »
I have a problem which I feel would be perfect for streams and/or lambdas. On the other hand I don't want to overcomplicate this, but since will use t...
(3) odpowiedzi
2017-04-03 18:04 Adding story on Facebook or Instagram - Android »
is there any way how to add story on Facebook, Instagram or Messenger using their api or website? I cant find any way in api. ...
(0) odpowiedzi
2017-04-03 13:04 How could I pass enum object with nested enum in it to a method as parameter? »
Suppose we have an enum object like this: public enum Action { FOO, BAR; public enum Move { UP, DOWN, LEFT...
(1) odpowiedzi