Data dodania Pytanie
2017-10-11 23:10 Binary Search comparison »
So I have some code which performs a binary search. Why is it essential for L and U to be compared with <=. Would I not get the same result with &l...
(2) odpowiedzi
2017-10-11 21:10 Using JUnit 5 with Java 9 without Maven or Gradle »
The Description: I would like to create a JUnit test using JUnit 5 in Eclipse (Oxygen 4.7.1a). This JUnit test should be inside a seperate src folder...
(1) odpowiedzi
2017-10-11 16:10 arranging strings in ascending and descending order »
Alright so my code doesn't work : I'm trying to arrange inputted strings in both a "descending" and an "ascending" but sometimes strings just won't go...
(4) odpowiedzi
2017-10-11 14:10 Does the stream.spliterator() close the stream? »
Does the stream.spliterator() implicitly closes the stream, or there is a need to explicitly close it afterwards? Stream<String> stream = Strea...
(3) odpowiedzi
2017-10-10 15:10 Error when collecting IntStream to map »
The following code String[] values = ... .... Map<String, Object> map = new HashMap<>(); for (int i = 0; i < values.length; i++) { ...
(1) odpowiedzi
2017-10-10 10:10 How to use :: operator as this reference »
Converting a list of objects Foo having an id, to a Map<Integer,Foo> with that id as key, is easy using the stream API: public class Foo{ p...
(3) odpowiedzi
2017-10-10 10:10 Share multiple messages with same intent chooser in my app »
I have this code Intent sharingIntent = new Intent(Intent.ACTION_SEND); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) sharingInten...
(1) odpowiedzi
2017-10-10 09:10 Make application layer loosely coupled »
I have a Java Spring-boot application which has layers(packages): Controller(controller class) Service (business logic) Domain (database layer) ...
(2) odpowiedzi
2017-10-10 01:10 Java to Kotlin converter and nullable method arguments »
I had a case in which Java to Kotlin converter failed me miserably by not marking method arguments as nullable. Example: tracking activity lifecycle ...
(1) odpowiedzi
2017-10-09 20:10 Java EE, Spring clean code, can we use static methods? »
I need help, which version of code is better and why: @Component public class BodyEntityFactoryImpl implements BodyEntityFactory { public BodyEnt...
(0) odpowiedzi
2017-10-09 15:10 How to configuration DataSources on Weblogic persistence.xml »
I have a persistence.xml this -> <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/per...
(0) odpowiedzi
2017-10-09 13:10 How to recreate FragmentManager#getFragments() behavior from Android Support Library 25.3.0 »
My app uses FragmentManager#getFragments() method: https://developer.android.com/reference/android/support/v4/app/FragmentManager.html#getFragments()...
(0) odpowiedzi
2017-10-09 12:10 Understanding deeply spliterator characteristics »
In order to try to deeply understand java streams and spliterators, I have some subtle questions about spliterator characteristics: Q1: Stream.empty...
(1) odpowiedzi
2017-10-09 11:10 Slow queryAggreate in Aerospike with multithreading »
We're creating a Java client to write data directly into memory in Aerospike, and another Java client to read data from memory. Both clients are multi...
(2) odpowiedzi
2017-10-09 08:10 If you assign an Object to a final field, will other threads see previous updates of that Object's non-final/non-volatile fields? »
Reading the Java language specs, I found this excerpt about final fields: The usage model for final fields is a simple one: Set the final fields ...
(3) odpowiedzi
2017-10-08 22:10 Creating a new array with select elemnts of another array »
Preface: I'm terrible with java and just learning. Searched a ton, couldn't find an answer. We CANNOT use arraylists. I have a Book class that contai...
(3) odpowiedzi
2017-10-08 12:10 How split() method works in java? »
My question is why the following program: // Java program to demonstrate working of split(regex, // limit) with high limit. public class GFG { p...
(4) odpowiedzi
2017-10-08 06:10 Use netbeans to create oracle Jet application: Project folder is already NetBeans project (maybe only in memory) »
I can not create a O-Jet application because of "Project folder is already NetBeans project (maybe only in memory)." issue. I have googled this issue ...
(2) odpowiedzi
2017-10-08 02:10 How to detect the active application using C/java? »
I want to record the active application and save a history of my active applications. I say active application because if I run an application and It'...
(2) odpowiedzi
2017-10-08 01:10 Convert timezones in ColdFusion with Java but can't get new time »
I have a simple script <cfscript> public string function convertTimeZone( string toTimeZone = "America/New_York" , date thisDate =...
(1) odpowiedzi
2017-10-07 14:10 Why am I getting an IllegalArgumentException when creating a Map? »
I'm trying to create a map of cities and temperature, but it's throwing an IllegalArgumentException. Here's what I'm doing: Map<String, Integer&gt...
(2) odpowiedzi
2017-10-07 06:10 Transition from Button to EditText »
I want to have a transition in my android views on view is Button and other is EditText, transitions must be like this animation I tried in this w...
(3) odpowiedzi
2017-10-07 05:10 List modules in jar file »
I've created what I'm pretty sure is a modular jar file. But if possible, I'd like to double check. Given a jar file, is there a way to determine what...
(3) odpowiedzi
2017-10-07 03:10 Java 8 - how do I declare a method reference to an unbound non-static method that returns void »
Here's a simple class that illustrates my problem: package com.example; import java.util.function.*; public class App { public static void mai...
(2) odpowiedzi
2017-10-06 22:10 CSRF token exchange from server to AngularJS client »
I'm going crazy trying to figure out how to implement a CSRF protection for my Web app. I've read tons of pages but still cannot decide on the solutio...
(1) odpowiedzi
2017-10-06 21:10 JavaLangAccess and SharedSecrets in Java 9 »
It seems like the SharedSecrets and JavaLangAccess classes from the sun.misc package were removed in Java 9. Are there any replacements in Java 9 for...
(2) odpowiedzi
2017-10-06 16:10 Sorting a list of floats/double which are in String format with Comparator.comparing »
I want to sort a list of float values which are available in String format for e.g., "rate": "429.0", "rate": "129.0", "rate": "1129.0",... If I...
(1) odpowiedzi
2017-10-06 15:10 ArrayList find custom object quickly »
I'm using ArrayList to store CustomObjects, problem is that it takes time to find an object in that list in order to remove it. (around 100K elements)...
(1) odpowiedzi
2017-10-06 14:10 While querying my DB and showing results in form of a table, cannot choose other than first »
Currently I am displaying a table on my jsp by querying the mysql DB, I have several buttons that you can do things with this object. There is an upda...
(1) odpowiedzi
2017-10-06 10:10 Boolean.valueOf() produces NullPointerException sometimes »
I have this code: package tests; import java.util.Hashtable; public class Tests { public static void main(String[] args) { Hashtable&...
(5) odpowiedzi
2017-10-06 06:10 How to synchronize mp3 audio with text? »
Read all the previous answers and had no luck. Working on an android app in which I need to synchronize mp3 audio with text. As the mp3 played it keep...
(2) odpowiedzi
2017-10-06 02:10 Interval lock Implementation »
I am looking for an implementation of interval lock. Given an interval (x, y), a thread can acquire the lock if no-one else is acquiring any interval ...
(2) odpowiedzi
2017-10-05 19:10 Is this considered reflection? »
I had a job interview today and I was asked, if the code below is a good example/case of using reflection in C#: public abstract class Level{ pu...
(3) odpowiedzi
2017-10-05 16:10 How to make code easier to read when using anonymous inner classes in java for Android apps? »
In my experience with Android apps its not too uncommon to see lots anonymous inner classes. Right now I'm working on an auto update feature and have ...
(1) odpowiedzi
2017-10-05 15:10 Java 9 collections' convenience factory methods as an alternative to collection literals »
Consider this method (just for illustration): boolean isSmallNumber(String s) { return (n in ["one", "two", "three", "four"]); } That, of cours...
(1) odpowiedzi