Data dodania Pytanie
2017-02-09 11:02 Why does this generic code in java compile? »
public static <T> T foo(T x, T x2) { return (T) (x + " " + x2); } public static void main(String args[]) { System.out.println(foo(33,...
(2) odpowiedzi
2017-02-09 04:02 Java 8 Comparator comparing doesn't chain »
Let's say I have a Pair class public class Pair<P, Q> { public P p; public Q q; public Pair(P p, Q q) { this.p = p; ...
(2) odpowiedzi
2017-02-08 16:02 Using java streams to put the last encountered value into a map »
I have some code as follows: Map<RiskFactor, RiskFactorChannelData> updateMap = updates.stream().filter(this::updatedValueIsNotNull). // Re...
(2) odpowiedzi
2017-02-08 15:02 What are jvm pre-allocated exceptions? »
I see references to pre-allocated JVM exceptions there: - http://www.oracle.com/technetwork/java/javase/relnotes-139183.html - http://dev.clojure.org/...
(2) odpowiedzi
2017-02-08 14:02 How to handle authentication popup in Chrome with Selenium WebDriver using Java »
I am trying to handle an authentication pop-up in one of my new Webdriver scripts. I have a working solution for IE, but I am struggling with Chrome....
(1) odpowiedzi
2017-02-08 13:02 Passing non final objects to method references »
What is the explanation that s.get() returns "ONE" the second time as well? String x = "one"; Supplier<String> s = x::toUpperCase; System.out.p...
(6) odpowiedzi
2017-02-08 12:02 loading inner class without loading the enclosing class »
I was bit confused when is the inner class (non static) gets loaded by the jvm . Is it dependent on the outer class. or can it be separately loaded w...
(1) odpowiedzi
2017-02-08 09:02 What's the correct way to escape the ? character in a JDBC PreparedStatement when using Oracle 12c MATCH_RECOGNIZE? »
The following query is correct in Oracle 12c: SELECT * FROM dual MATCH_RECOGNIZE ( MEASURES a.dummy AS dummy PATTERN (a?) DEFINE a AS (1 = 1) )...
(1) odpowiedzi
2017-02-08 08:02 What is the standard approach in Java »
I was given a task for coding a Java program for exporting database table records to flat files. I am confused with the approach my lead suggests to...
(0) odpowiedzi
2017-02-07 19:02 How does Apache Spark send functions to other machines under the hood »
I started playing with Pyspark to do some data processing. It was interesting to me that I could do something like rdd.map(lambda x : (x['somekey'],...
(2) odpowiedzi
2017-02-07 16:02 Why does a subclass of an inner class require an enclosing instance? »
Consider class OuterClass which has InnerClass public class OuterClass { class InnerClass { } } And the second class, which is trying to e...
(4) odpowiedzi
2017-02-07 16:02 API Laravel through Java application »
I have a LARAVEL API coded in PHP with MYSQL Database but i want to create a Desktop App for few users, but for this i have to call my API with token ...
(0) odpowiedzi
2017-02-07 14:02 OutOfMemoryError: Java heap space when trying to read 5 ints into an array »
I am practicing for Java fresher interview coding examples. I am trying to write a program to find duplicate numbers between 1 to N, where N is given ...
(3) odpowiedzi
2017-02-07 14:02 What's the correct way to fetch all (possibly implicit) results from an Oracle query with JDBC? »
Since Oracle 12c, we can fetch implicit cursors from clients. For instance, it is possible to run the following PL/SQL anonymous block in SQL Develope...
(1) odpowiedzi
2017-02-07 14:02 Is it considered bad to not use the API? »
When I started programming in Java, I was taught to always use the API and not reinvent the wheel by writing an own implementation of an already exist...
(1) odpowiedzi
2017-02-07 09:02 @NotNull on subclass getter affects parent class table »
I have a question related to javax.validation.constraints.NotNull annotation. In my project i do have classes tree like following : @Inheritance(stra...
(3) odpowiedzi
2017-02-07 03:02 Why/When you would not want to have Java 8 UseStringDeduplication enabled in JVM? »
Java 8 introduced String Deduplication that can be enabled by launching JVM with -XX:+UseStringDeduplication option allowing to save some memory by re...
(2) odpowiedzi
2017-02-06 23:02 SSLSocket via another SSLSocket »
I'm trying to create an SSLSocket on top of another SSLSocket in an Android app. The lower connection is an SSL-secured connection to a Secure Web Pro...
(1) odpowiedzi
2017-02-06 21:02 Difference between multiple System.out.print() and concatenation »
Basically, I was wondering which approach is better practice, for(int i = 0; i < 10000; i++){ System.out.print("blah"); } System.out.println("...
(5) odpowiedzi
2017-02-06 15:02 Pass class type as parameter to use in ArrayList? »
I need to write a java method which takes a class (not an object) and then creates an ArrayList with that class as the element of each member in the a...
(3) odpowiedzi
2017-02-06 14:02 Unable to fetch ID using Postgres Stored Function - Bad value for type int »
I am trying to get location information from the schema Location. Postgres version is 9.3.15 and maven jar used is 9.4-1200-jdbc4 ubuntu 14.04 LTS. F...
(1) odpowiedzi
2017-02-05 17:02 Why is AtomicInteger needed if writes and reads to int variables are atomic? »
I've read in Oracle docs that: Reads and writes are atomic for reference variables and for most primitive variables (all types except long an...
(4) odpowiedzi
2017-02-05 17:02 Memory allocation problems with android application »
I have an android application that performs image analysis, which is managed with an IntentService - the process takes a couple of seconds each time a...
(2) odpowiedzi
2017-02-05 13:02 google app engine taking too much time in giving response from endpoint android »
In my android project i have started building google cloud endpoints. But the response time is very slow. It is taking 21 seconds to fetch the respons...
(1) odpowiedzi
2017-02-05 12:02 Concern regarding piece of code »
I was looking at one of the open source project on github and I found following line of code in Java, static byte[] byteArray = new byte[1 << 1...
(1) odpowiedzi
2017-02-05 12:02 How to prevent auto-backup of an Android app? »
I face very weird situation on certain device (Nexus 5x with Android 7): when I clean its data and uninstall it, then install it with Studio, the app ...
(2) odpowiedzi
2017-02-05 11:02 android : adding SearchView inside a ListView with Custom Adaptor »
I'm creating a an app with 3 tab fragments . this is one of the fragments,, the data is shown in list-view. Im facing trouble in adding a search filte...
(2) odpowiedzi
2017-02-05 09:02 Method overloading : Single parameter vs alternating parameters »
This question might be similar to Java overload confusion I'm reading a book and there's a topic regarding method overloading from which a compiler m...
(2) odpowiedzi
2017-02-04 17:02 JNA two dimensional arrays »
I try to call a short** in C with JNA. The C looks like this: void compute(short** in, int row, int col) { for (int i = 0; i < row; i++) { ...
(1) odpowiedzi
2017-02-04 16:02 Is using Optional in Scala's case classes and classes fields a code smell? »
There were already quite a few discussions on Stackoverflow about proper ways of using Optional in Java (Discussions like this one, or this) As of n...
(2) odpowiedzi
2017-02-04 14:02 Is it mandatory to put inner try-with-resources or everything inside one of the try-with-resources will be autoclosed? »
Is it mandatory to put inner try-with-resources or everything inside one of the try-with-resources will be autoclosed? try (BasicDataSource ds = ...
(1) odpowiedzi
2017-02-04 12:02 Filtering on Java 8 List »
I have a list of type List in functional java using List type provided by fj.data.List import fj.data.List List<Long> managedCustomers I am ...
(3) odpowiedzi
2017-02-04 07:02 129 error and 133 error from Rxble while read and write operation »
BleGattException - occured during first read write operation sometimes it read and write correctly but after reconnects ble device get this exception....
(0) odpowiedzi
2017-02-03 22:02 Auto download offline speech recognition language on Android »
Is there any way in Java to detect if an Android device has an offline speech recognition language installed, and if it does not prompt the user to do...
(1) odpowiedzi
2017-02-03 15:02 Comparing two lists and getting differences »
I have two lists. They contain objects of different types, but both types contain id and name, and id is what I am comparing on. List one is fetched ...
(4) odpowiedzi