Data dodania Pytanie
2017-06-19 20:06 Is there a way to affect the range counter in Python? »
I'm trying to run a python program with a for loop which has a variable i increased by 1 every time from 1 to the length of my list. In java, my code ...
(6) odpowiedzi
2017-06-19 19:06 Why does parseInt warn of using valueOf »
When looking at the source code for Integer.parseInt(String s, int radix) (java 8, 1.8.0_131), I found the following comment block: /* * WARNING: Thi...
(2) odpowiedzi
2017-06-19 15:06 Java convention for unknown return type method »
I'm working on a workflow engine that will help customers to define their workflow on our product. In this workflow engine, i made a system of condit...
(1) odpowiedzi
2017-06-19 06:06 onSpinWait​() method of Thread class - Java 9 »
While learning Java-9 I come across a new method of Thread Class called onSpinWait​(). According to java docs this method is used to : Indicates...
(3) odpowiedzi
2017-06-19 05:06 Java - Elegant way of parsing date/period? »
From the ISO-8601 standards, there are 4 ways of expressing intervals/duration: Start and end, such as "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z" S...
(2) odpowiedzi
2017-06-18 17:06 How to map RuntimeExceptions in Java streams to "recover" from invalid stream elements »
Imagine I'm building a library, that will receive a Stream of Integers, and all the library code needs to do is return a stream of Strings with the st...
(2) odpowiedzi
2017-06-18 13:06 how ternary expression in java are evaluated? »
I have followed the tutorial provide here and in line: boolean t1 = false?false:true?false:true?false:true; the final value of t1 is false. but i e...
(3) odpowiedzi
2017-06-18 12:06 Checkbox becoming 'sticky' in RecyclerView »
I have a dialog which takes in user input through a list with checkboxes, whose layout is a RecyclerView. But when I select a CheckBox in the list, an...
(2) odpowiedzi
2017-06-18 11:06 Adding a user-defined constraint to an SQL table »
So i'm working with 2 tables: Persons and Marriage. Persons hold many attributes and his PK is person_id. Marrige is defined like that: CREATE TABLE ...
(2) odpowiedzi
2017-06-18 10:06 Testing a Fragment class in isolation using Mockito »
Added @VisibleForTesting and protected. My test can now this method: @VisibleForTesting protected void setupDataBinding(List<Recipe> rec...
(3) odpowiedzi
2017-06-18 02:06 Choosing one element from list according to preference »
I'm given an unordered list of objects of this form class Element { String property; // has value from the set ("A", "B", "C", "D") } where no tw...
(5) odpowiedzi
2017-06-17 23:06 Passing function code using java 8 supplier »
I am trying to understand lambdas in Java 8. I have this very simple example using a functional interface. This is not a working example and I under...
(1) odpowiedzi
2017-06-17 21:06 tomcat 8.5 csrf 403 Access Denied »
I deployed my application to Tomcat 8.5 server but cannot run it, I receive following response: Type Status Report Message Invalid CSRF Token...
(0) odpowiedzi
2017-06-17 18:06 Solving crosswords »
I have a crossword puzzle and a list of words which can be used to solve it (words can be placed multiple times or not even once). There is always a s...
(4) odpowiedzi
2017-06-17 16:06 How to call an overloaded java function from JRuby with an array parameter »
I have a java class with an overloaded method like the following one: public class Main { public void print(Object o) { System.out.println("p...
(1) odpowiedzi
2017-06-17 12:06 A partial match changes the Matcher's position »
When using Matcher's find() method, a partial match returns false but the matcher's position moves anyway. A subsequent invocation of find() omits tho...
(2) odpowiedzi
2017-06-17 10:06 How can I improve JRuby startup time in Java? »
I have just made a little java program: ScriptEngineManager scriptengineManager = new ScriptEngineManager(); ScriptEngine engine = scriptengineManage...
(0) odpowiedzi
2017-06-17 09:06 Glide: log each request »
Consider the code below: Glide.with(<your_context>) .load(<remote_file_url, local_file_path>) .into(<imageview>); Above G...
(1) odpowiedzi
2017-06-17 00:06 Regular Expression for any non-empty consecutive sequence of 0's enclosed between 1 »
I need to find all the groups in a String having consecutive sequence of 0's enclosed between 1 100001abc101 // 2 groups `100001` and `101` 1001ab010...
(3) odpowiedzi
2017-06-16 22:06 Why don't we add an "s" suffix to short types? »
Why don't we write s with short data type like short s = 2s; as we write with float e.g float f = 1.23f? I know when we write float by default the co...
(3) odpowiedzi
2017-06-16 17:06 Why calling get() before exceptional completion waits for exceptionally to execute? »
While answering this question, I noticed a strange behaviour of CompletableFuture: if you have a CompletableFuture cf and chain a call with cf.excepti...
(1) odpowiedzi
2017-06-16 16:06 utf8mb4 in MySQL Workbench and JDBC »
I've been working with a UTF-8 encoded MySQL DB that now needs to be able to store 4-byte emojis, so I decided to change from utf8 encoding to utf8mb4...
(3) odpowiedzi
2017-06-16 07:06 Calculation does not complete when using HashMap.computeIfAbsent to compute the Fibonacci sequence »
I'm trying to get the 1st to 20th term in the Fibonacci sequence using the function computeIfAbsent() in class HashMap. Here is the code: @Test publ...
(0) odpowiedzi
2017-06-15 18:06 Microservices Restful API - DTOs or not? »
REST API - DTOs or not? I would like to re-ask this question in Microservices' context. Here is the quote from original question. I am currently ...
(2) odpowiedzi
2017-06-15 16:06 What does Java's BST ZoneId represent? »
I have stored in the DB this Time Frame: any day from 15:00 to 16:00 in LONDON (BST) I need to execute a program IF when I receive an event is betwee...
(1) odpowiedzi
2017-06-15 14:06 using a stream based on the content of Optional<Map> »
I get a map from a service not under my control that might be null and want to process it, let's say, filter, map and reduce to a single element I nee...
(2) odpowiedzi
2017-06-14 23:06 Buck - java.lang.UnsatisfiedLinkError: couldn't find "libjni.so". How to solve it? »
A runtime exception is happening after executing the command buck install --run demo_app_android following this tutorial and this sample demo Then, t...
(1) odpowiedzi
2017-06-14 16:06 Time zone results differ with systimestamp »
I have an Oracle table which contains the following column definition: COLUMN_NAME : RESERVATIONDATE DATA_TYPE : TIMESTAMP(6) NULLABLE ...
(3) odpowiedzi
2017-06-14 14:06 Java convention with regard to code format »
Is it allowed in Java convention to write such code: public void nameOfTheFunction() { } A lot of people said me that it is prohibited according t...
(3) odpowiedzi
2017-06-14 13:06 Why does invokeLater execute in the main thread? »
I just encountered this "bug", but I'm not sure if this is intended: Code: public static Object someMethod(){ assert SwingUtilities.isEventDispat...
(2) odpowiedzi
2017-06-14 10:06 How to clone abstract objects with final fields in Java? »
In this question and this post is explained how to clone objects with final fields by using protected copy constructors. However, supposing that we h...
(4) odpowiedzi
2017-06-14 10:06 Hash generation using java digest gets slower in time »
I'm having a real curious situation, in a production environment using wildfly 8.2 and Java 1.7. The situation is that when the server is been up fo...
(3) odpowiedzi
2017-06-14 07:06 Java out of memory errors »
Why does this following code List<Object> list = new ArrayList<>(); while (true) { for(int i = 0; i < 1000000; i++){ list....
(8) odpowiedzi
2017-06-14 06:06 JPA (@OneToMany) query without joining child table »
I'm writing a service with JPA and Postgres db. I have a class named Student: public class Student { @id private String id; private Stri...
(3) odpowiedzi
2017-06-13 22:06 How to delete entity with JOINs using JPA and Hibernate »
I have following entities: I want to delete WordSet by id and username of the user using JPA. Here is entity declarations: User @Entity @Data @T...
(2) odpowiedzi