Data dodania Pytanie
2017-06-10 01:06 Java - Big O of bit manipulation? »
What is the Big O of this code? I know all the lines are O(1), except for the recursion part. I'm not sure what the big O of the recursion is, I have ...
(5) odpowiedzi
2017-06-10 00:06 Using Object variables to reference new data types/objects »
I have had a burning question for a long time now, relating to the Java syntax and why it allows this: Object object1 = new Integer(); Why can we d...
(4) odpowiedzi
2017-06-09 16:06 Java 8 ConcurrentHashMap »
I've observed that ConcurrentHashMap has been entirely rewritten in Java 8 to be more "lock-free". I've browsed the code of the get() method and see t...
(3) odpowiedzi
2017-06-09 15:06 Java8 : stream findFirst result »
I want to know that is there a way to get rid of the warning at findFirst().get() without using .orElse() if I 100% know there is every time a result,...
(5) odpowiedzi
2017-06-09 13:06 best practice to make a loop faster - is Multithreading an option? »
I call a Api Service with an index in the URL; for example the last index is: 420.555. I do this: for(int i =0; i <= 420555;i++){ url = new URl(...
(6) odpowiedzi
2017-06-08 21:06 Map Filter and Fold in C++ »
I have a problem that normally would be well suited for Java streams, but I'm currently using c++11. The way I would solve this problem in Java is: ...
(1) odpowiedzi
2017-06-08 18:06 Pagination in JSP using DataTables »
I am planning to implement pagination in my JSP using DataTables. I previously implemented it using DisplayTag Library but looks like it is getting ol...
(1) odpowiedzi
2017-06-08 15:06 intellij GWT debug configuration »
How can I override the default server intellij's GWT debug configuration ? Intellij takes a Jetty as default server but I want it to use a jboss serv...
(1) odpowiedzi
2017-06-08 14:06 CSRF token with Apache Shiro »
I have an existing web application based on Apache Shiro for the authentication/authorization parts. I want to implement a mechanism for generating/ch...
(1) odpowiedzi
2017-06-08 08:06 Find which element of the stream does not match the given predicate in allmatch »
I want to find out which element is failing the predicate in case of allmatch. List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5); boolean is...
(6) odpowiedzi
2017-06-08 07:06 Why does '<', '> ' work with wrapper classes while '==' doesn't ? »
I know that '==' doesn't work with values outside the range of [-128,127] as there is a cache maintained of Integer objects within this range and the ...
(1) odpowiedzi
2017-06-07 21:06 How do you properly synchronize threads on the native side of a JNI environment? »
Question Brief I am using C++ and Java in one process via JNI. For the use case in question, both a C++ thread and a Java thread are accessing the sa...
(1) odpowiedzi
2017-06-07 14:06 Non-capturing lambda seems to nevertheless capture the enclosing instance »
I wrote this code: import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.function.Supplier; public class Main { publi...
(2) odpowiedzi
2017-06-07 12:06 Jooq 3.9 doesn't link MySQL columns to enums »
I am updating jooq from version 3.4.1 to 3.9.3 and noticed that models for tables that have enum fields in MySQL 5.6 database are generated with Strin...
(0) odpowiedzi
2017-06-07 08:06 Android studio Action call to run USSD codes »
By using an app I want to run a USSD code, but the problem is it doesn't recognize the "#" symbol. If I want to run "*100#" it recognize the input onl...
(2) odpowiedzi
2017-06-07 07:06 What is the Java 9 reflection equivalent of --add-modules? »
I need a way to tell a newly created ClassLoader (with no set parent) about modules I want exposed to it (e.g. java.scripting). What's the reflection ...
(1) odpowiedzi
2017-06-07 02:06 Don't re-execute Retrofit call if it's still in progress using RxJava 2 »
My goal is a method that will execute a network call unless the network call is already in progress in which case the caller subscribes to the results...
(2) odpowiedzi
2017-06-06 15:06 Does Java automatically save an 'evaluate' statement in a Java variable? »
Say I perform a simple add/concatenation statement: variable + newInput Without setting the sum to a new variable, as in: variable = variable + ne...
(5) odpowiedzi
2017-06-06 11:06 Stream over a List of Map and collect specific key »
This is my List: [ {name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60} ]; I want to pluck name values and crea...
(3) odpowiedzi
2017-06-06 09:06 How do I forcefully close a connection from a connection pool when it's taking too much time to close? »
There are times closing connections takes a lot of time, like more than 10 minutes upto 1 hour, or worse, even for indefinite time, depending on how h...
(2) odpowiedzi
2017-06-06 08:06 How to dynamically choose the configurations based on the environment in JAVA? »
I have a utility class which has common configurations related to email-sender, the configurations changes based on the environment like Staging and P...
(8) odpowiedzi
2017-06-06 06:06 How do I do a cross platform encryption method working in both IOS and android (AES encryption only..)? »
I have been recently assigned a task of encrypting my links and parameters i pass in dataTaskWithRequest in swift. The main headache is it should prod...
(0) odpowiedzi
2017-06-05 21:06 Can an interrupted Java thread really skip a finally clause? »
I was checking into the oft repeated rumour that daemon threads on the JVM treat finally blocks in some special way (they don't, ok?), when I read thi...
(1) odpowiedzi
2017-06-05 18:06 Using select query with like operator and parameters in java »
I want to write this query: SELECT * FROM products WHERE name LIKE '%?%' OR description LIKE '%?%' and execute it through java in spring web appli...
(1) odpowiedzi
2017-06-05 17:06 How to pass system system properties from jruby to Rails server »
I'm running a local Rails server (WEBrick) via JRuby and want to test some code that will eventually be running on Torquebox. I'm trying to access so...
(1) odpowiedzi
2017-06-05 12:06 Max number of parametrs to private methods »
So there is some kind of a rule for clean code "No more then 3/4 parametrs to method". Am curious about should I follow this rule for private methods...
(2) odpowiedzi
2017-06-05 11:06 Why is this infinite for loop terminating after some time? »
I am running this infinite for loop. Why is this for loop terminating after some time? for(int i = 10; i > 0; i++) { } But if I print something ...
(2) odpowiedzi
2017-06-05 10:06 How to implement tuple unpacking for function parameters in Java? »
I have created some tuple classes, and put them into Java collection. But I don't want to use tuple as function parameters directly when iterating col...
(3) odpowiedzi
2017-06-04 21:06 How to share a deep link on social networks in react native »
as the title says, I'd like to know if there's a way to share URL deep link in a social network (eg: twitter, facebook, whatsaap, etc). I'm using this...
(1) odpowiedzi
2017-06-04 20:06 Android Java SQLite database: The database does not take 2 String inputs »
I am learing to code and made a stopwatch that saves the laptimes in a String and gets the date as a String as well. I want to put those in a SQLite d...
(2) odpowiedzi
2017-06-04 18:06 Java split function gives me a small length of result String array »
I have this code: String string = "_a_b___"; String[] parts = string.split("_"); The result is that variable parts has only three elements parts[...
(3) odpowiedzi
2017-06-04 17:06 Get ViewGroup(Layout) of custom view »
I made a custom View, called ColorPicker. I create my ColorPicker in my xml. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:andr...
(2) odpowiedzi
2017-06-04 16:06 Why doesn't the JVM emit prefetch instructions on Windows x86 »
As the title states, why doesn't the OpenJDK JVM emit prefetch instruction on Windows x86? See OpenJDK Mercurial @ http://hg.openjdk.java.net/jdk8u/jd...
(2) odpowiedzi
2017-06-04 09:06 When using java 8 map, filter and collect, does it create new objects or modify existing objects? »
I have the code below where I am doing filtering using a filter and replace function inside my map and then I am doing a collect to replace my origina...
(2) odpowiedzi
2017-06-04 08:06 Different out for same function in Java against Python »
I have a formula to evaluate ((x+y-1)*(x+y-2))/2 + x and get the string representation of it. So in Java 1.7 I write public static void main(Str...
(2) odpowiedzi