Data dodania Pytanie
2017-03-10 17:03 Java hexadecimal base double literal »
I am studying for java certification. And i'm curious about the java literals. I know it is possible to do something like this: int i = 0xAA; long l ...
(1) odpowiedzi
2017-03-10 16:03 How to combine two java8 stream operations - one terminal and one lazy - into a single operation? »
I'm doing some "algebra" of Java 8's streams, that is, I'm trying to code a simple operation Op that takes two streams as inputs and yields another st...
(4) odpowiedzi
2017-03-10 15:03 Performance of StringBuilder.append »
It's recommended (PMD rule AppendCharacterWithChar) to use StringBuilder.append(char) instead of StringBuilder.append(String). I agree with that. But...
(1) odpowiedzi
2017-03-10 14:03 Final field marked @NotNull is not initialized »
I have this code: public static class MyWebDriver extends RemoteWebDriver { @NotNull private final String nodeId; public MyRemoteWebDriv...
(4) odpowiedzi
2017-03-10 13:03 JSON error codename one Facebook api »
I am trying to fetch posts from Facebook using Graph api, but when I am passing response to JSONObject it throw an error. Below is my code: public vo...
(0) odpowiedzi
2017-03-10 12:03 SameSite cookie in JAVA app »
Is there any official JAVA Cookie implementation which allows to set a custom flag for cookie (like SameSite=strict)? ...
(0) odpowiedzi
2017-03-10 10:03 AssertEquals when list content is unordered »
How would you refactor the following if the products can be returned in any order? List<Product> products = get_products("test_produc"); assert...
(7) odpowiedzi
2017-03-10 09:03 Select all records whose specific field is not NULL »
I have a MySQL table named stars and one of its fields is id_num with default value NULL. I want to select all the records where id_num is not NULL th...
(4) odpowiedzi
2017-03-10 07:03 LinkedHashMap entrySet's order not being preserved in a stream (Android) »
I'm creating a very simple form validation utility for a sign up screen, and I'm running into some unexpected behavior concerning LinkedHashMap and a ...
(1) odpowiedzi
2017-03-09 17:03 How to create dynamic variables in Java? »
For example, in Haxe I can create strictly typed variables: var a:Float = 1.1; or var b:String = "hello" and also dynamic, if needed: var d:Dynamic =...
(3) odpowiedzi
2017-03-09 16:03 Java Stream: aggregate in list all not-Null collections received in map() »
I have collection idList that contains string IDs. Function getCollection returns for single ID a collection of items (type MyType). Also, it may retu...
(1) odpowiedzi
2017-03-09 11:03 Split a alphabetically sorted list into sublists based on alphabets in java »
I have a sorted list in java, i just want to split this list into sublists based on the first alphabet at each index of list. For example List contain...
(4) odpowiedzi
2017-03-09 05:03 How to get play and stop event callback from chromecast android »
I want to get callback event and perform some function when chromecast audio change there playback mode(play/stop) How can I get the play/stop event ...
(1) odpowiedzi
2017-03-09 00:03 Injecting JSON parameter in nativeQuery - Spring JPA »
This works when @Query(value = "SELECT * FROM person WHERE school = :schoolId AND details @> '{\"id\":\"1234\",\"name\":\"John\"}'", nativeQuery ...
(1) odpowiedzi
2017-03-08 22:03 Largest Java Short (32767) plus 1 not turning negative? »
recently I learned about the two's compliment method of representing both positive and negative integers in the base two system. I then tried to see t...
(5) odpowiedzi
2017-03-08 16:03 How can any single-threaded program is also a valid multithreaded program? »
I was reading the book "Java Concurrency In Practice". In second chapter, I read the statement any single-threaded program is also a valid multith...
(3) odpowiedzi
2017-03-08 14:03 One-to-many select in Jooq »
I am trying out JOOQ and trying to select from 3 tables (Author, Books and Articles) using a join statement. The ERD is as follows: Author ----< B...
(1) odpowiedzi
2017-03-08 14:03 How is a type argument inferred for a generic method invocation? »
Having a method like this? public <P, T extends List<P>> T getAwesomeList() { // ... } How come this compiles without any warnings...
(0) odpowiedzi
2017-03-08 10:03 Hibernate, PostgreSQL : Could not extract resultset, SQLState 25P02 »
I am working on one of our test-servers and getting an error from the hibernate when I am trying to call a method, where I get the Person object by it...
(1) odpowiedzi
2017-03-07 14:03 Calling servlet from GWT test case »
I have implemented a test case 'A' in one project and calling a class 'B' in that test case which is located in another project. Internally that class...
(0) odpowiedzi
2017-03-07 14:03 capture group with optional substring »
I'm working with data of the following form (four examples given, each separated by a new line): some publication, issue no. 3 another publication, i...
(1) odpowiedzi
2017-03-07 13:03 Scala with Spray Routing - accessing GET parameters? »
I'm currently working on an application built in Scala with Spray routing. So for dealing with a JSON document sent over POST, it's pretty easy to ac...
(2) odpowiedzi
2017-03-07 09:03 Programming to interface »
From my understanding, you program to an interface rather than a concrete class to restrict yourself from using methods that aren't part of the interf...
(3) odpowiedzi
2017-03-06 19:03 Java is there a syntax for specifying zero or one value passed to method? »
So I found that we have the 3 dot notation for zero or more but is there anything for zero or one? I'm needing to alter a method and rather than over...
(3) odpowiedzi
2017-03-06 16:03 Breaking java date into hours »
I receive the below startdate and enddate as input in my program. 2017-03-07 06:30:00 to 2017-03-07 11:35:00 (yyyy-mm-dd hh:mi:ss) I want to break t...
(3) odpowiedzi
2017-03-06 15:03 Why not showing progressBar in Android Studio? »
I was trying to work with Progressbar in android studio. What I wanted was simply that when I will click on the button of the MainActivity it will int...
(2) odpowiedzi
2017-03-06 09:03 Spotlight for Help in localized Java Swing applications on macOS »
In Java Swing applications on macOS, Cocoa automatically binds a search field called Spotlight for Help to the first menu labelled “Help” in a fra...
(1) odpowiedzi
2017-03-05 20:03 Facebook's Graph API is showing much less posts for a page's feed »
I am making a Java application for browsing newer and older posts from a Facebook public page. I have the following code for retrieving the complete ...
(0) odpowiedzi
2017-03-05 18:03 Printing Sysout logs from a jar file »
I have a Web service client jar. clint.class has a few messages logged to the Standard output (sysout). I am trying to invoke the class methods using...
(1) odpowiedzi
2017-03-05 13:03 I can't load any project after updating Android Studio to v2.3 »
I can't load any project after updating Android Studio to v2.3. Here is a picture of the error: and it reads: Cannot load project: com.intellij.ide...
(2) odpowiedzi
2017-03-05 12:03 passing and enforcing a member function in java »
I'm trying to create a work queue class (FooQueue) that has: a set of function members doing work (do*). Each one of them take one parameter, having...
(1) odpowiedzi
2017-03-05 05:03 JVM garbage collection - tracing live objects in young generation »
While collecting the young generation memory, JVM collectors scan only those root objects (obejcts in the heap directly accessible from the root set) ...
(2) odpowiedzi
2017-03-04 20:03 Accessing object's elements of Multiple ArrayList in java »
I cannot access Multiple ArrayList element. The code is given below and it cannot access the values 5 or 6. My IDE is not accepting the last statement...
(2) odpowiedzi
2017-03-04 14:03 Java Regex split string between delimiter and keep delimiter »
I have a java string that looks like this; (fname:jon)(lname:doe)(guaranteer: Sam (W) Willis)(age:35)(addr:1 Turnpike Plaza)(favcolor:blue) And I w...
(2) odpowiedzi
2017-03-04 10:03 Return type of generic method (Java) »
I have this generic function: public static <T extends Number> T sum(List<T> list){ Number tot = 0; for(Number n: list){ ...
(3) odpowiedzi