Data dodania Pytanie
2017-12-07 08:12 import class file in Jruby »
I have several scripts written in Jruby that I would like to obfuscate by converting them to .class files. But I am running into an error when I tried...
(1) odpowiedzi
2017-12-07 05:12 multithreading in Ruby vs JRuby vs Java »
I am new to Ruby and the JRuby and I was trying to implement multithreaded code in Ruby and came to know that GIL doesn't allow my code to run in para...
(1) odpowiedzi
2017-12-06 21:12 Why bother using lambda expressions in logging APIs if the compiler can possibly inline the logging call »
Many logging frameworks (e.g., log4j) allow you to pass lambda expressions instead of Strings to the logging API. The argument is that if the string i...
(3) odpowiedzi
2017-12-06 14:12 How do I avoid NullPointerExceptions in lambda comparators? »
I want to compare two given objects which might be null at runtime. In my example: @Test public void shouldCompareAgents() { Agent a1 = new Agen...
(3) odpowiedzi
2017-12-06 10:12 Dagger 2 ContributesAndroidInjector provide activity to module »
I'm trying to figure out a less-boilerplate-y way to implement an ActivityModule that is used in all of my app activities. This is my current setup: ...
(1) odpowiedzi
2017-12-05 16:12 Hibernate two ManyToOne relations on one Table, the first gets Eager and the second LAZY loaded »
I have got the following Entities, an item which can has up to two categories, a primary and a secondary. Both categories are mapped ManyToOne to the ...
(1) odpowiedzi
2017-12-05 12:12 Why does changing the type lead to different usage of members? »
So I was testing with some code snippets to wrap my head around the concept of inheritance, when I came across this - for me - strange phenomenon. So...
(2) odpowiedzi
2017-12-05 10:12 Declare array of lambdas in Java »
I'd like to create an array of lambda. The problem is that the lambda could be different from each other. Example: private interface I0 { int int...
(4) odpowiedzi
2017-12-05 09:12 Is there a Scala equivalent to JaxRS »
If I am coding in Java I can use JaxRS for my REST APIs with easy RPC setup when its server-to-server communication. I can (roughly) do the following...
(0) odpowiedzi
2017-12-05 04:12 JAX WS Server implementation performance issue for Linux JVM? »
I've faced with a very weird problem. The built-in JAX WS server implementation works 100 times slower on linux machines then on Mac OS X or Windows. ...
(1) odpowiedzi
2017-12-05 03:12 Why does this date parsing fail? »
I'm trying to convert a string into a LocalDateTime object. @Test public void testDateFormat() { String date = "20171205014657111"; DateTimeFor...
(1) odpowiedzi
2017-12-04 15:12 Is there a way to compare multiple (non-boolean) things at once using | or & in Java, similar to how you can catch multiple exceptions using |? »
Normally, I would have to type something like if(a == x || b == x) {...} But I saw that when using try/catch blocks, you can do stuff like this: ...
(1) odpowiedzi
2017-12-04 11:12 Custom Glide ModelLoader for base64 images »
I have images from some SOAP API that are encoded in base64. To load them directly with Glide I decided to wrote custom ModelLoader. Glide Version: 4...
(1) odpowiedzi
2017-12-04 11:12 How to set the output of the Asynchronous Task to the text view of the Main Activity »
public class CheckLoginCredentialsTask extends AsyncTask<Boolean, Integer, EEmployeeHTTPResponse> { MainActivity obj = new MainActivity(); pr...
(6) odpowiedzi
2017-12-04 09:12 Why does Set.of() throw an IllegalArgumentException if the elements are duplicates? »
In Java 9 new static factory methods were introduced on the Set interface, called of(), which accept multiple elements, or even an array of elements. ...
(4) odpowiedzi
2017-12-04 07:12 How to add a sort query to my StructuredQueryBuilder before talking to Marklogic »
I am trying to add a sort/ordering query. At my java: StructuredQueryBuilder qb = new StructuredQueryBuilder(); QueryDefinition queryDef = qb.and(qb...
(1) odpowiedzi
2017-12-04 03:12 printf displays different values for the same variable »
I found this code online and when compiled it prints 5 and 10: int numbеr = 5; int number = 10; System.out.printf("Number one is %d and number two i...
(1) odpowiedzi
2017-12-03 21:12 Why can I create a two dimensional array with 0 rows but 5 columns in java? »
int[][] a = new int[0][5]; Why the above code is valid in java? ...
(2) odpowiedzi
2017-12-03 21:12 ScheduledExecutorService behaving unexpectedly »
I have the following code snippet, using a ScheduledExecutorService to run every 3'000 milliseconds a check whether it should call a function onOutTim...
(2) odpowiedzi
2017-12-03 12:12 Java: create a new variable or do multiple times the same calculation? »
i have this piece of code: // ... if (result[1] / (abs ? res[0] : 1 > highest) { highest = result[1] / (abs ? res[0] : 1); } and I'm wonderi...
(2) odpowiedzi
2017-12-03 09:12 OWASP CSRFGuard »
I'm trying to use CSRFGuard in order to use the anti csrf token as written in owasp csrfguard. I've added to my project everything needed (exactly as...
(0) odpowiedzi
2017-12-03 08:12 JavaFX TabPane tabs don't update position »
I noticed that when adding and deleting tabs from a TabPane, it fails to match the position of the order of tabs in the underlying list. This only hap...
(1) odpowiedzi
2017-12-03 00:12 How to have the java8 code that uses Unsafe working on jdk8 and jdk9? »
I am using sun.misc.Unsafe in my Java8 codebase. This does not work on Java9. I would like to have the fix for Java9, but with the same codebase that...
(1) odpowiedzi
2017-12-02 16:12 Issue checking if binary tree is also binary search tree »
I'm trying to solve this problem but I'm having some troubles: In a binary search tree (BST): The data value of every node in a node's lef...
(3) odpowiedzi
2017-12-02 11:12 How to simplify my code using stream or lambda »
String convSummary(String l) { String s = l.toLowerCase(), r =""; for(int i = 0 ; i < s.length() ;i++){ char c = s.charAt(i); ...
(3) odpowiedzi
2017-12-02 10:12 Facebook Login Android SDK ClassNotFoundException: com.facebook.gdp.LightWeightLoginParameters »
The app works in debug, but it crashes in a loop in release mode. The app is not crashing, the Facebook dialog is. I'm not using facebook's LoginButt...
(0) odpowiedzi
2017-12-02 09:12 Weird behavior accessing tuple from Java »
I am looking for explanation and/or versioning details (if possible) about a very strange behavior I found in Java accessing tuples created in Scala. ...
(2) odpowiedzi
2017-12-02 06:12 Parse a Bundle which is a JSONString in Remotemessage to JSON object »
I am trying to parse the notification data in FCM. I will try to explain my problem as detailed as i can. I have to two apps one is android and the ot...
(2) odpowiedzi
2017-12-01 15:12 JPA (Hibernate): "ORA-02289 Sequence does not exist", but it does »
I'm working with JPA entities. I created a new one like this: @Entity public class Entity { @Id @GeneratedValue(generator = "Entity_Sequenc...
(1) odpowiedzi
2017-12-01 14:12 Instanciation depending on type, generics, inheritance or both? »
I have a method instanciating a specific class depending on type send as parameter of this method. This works perfectly but I really don't like this i...
(5) odpowiedzi
2017-12-01 11:12 @EntityListeners Injection + jUnit Testing »
I use @EntityListeners to make operations before I save in my Db and after I load. Inside my Listener class I make a call to an Ecryptor (which needs ...
(0) odpowiedzi
2017-12-01 10:12 Compiler says "Variable might not have been initialized", although I have a flag variable to guarantee it »
Here is my code snippet: Someclass someObject; boolean success = true; try { someObject = someOperation(); } catch (Exception e) { success = ...
(7) odpowiedzi
2017-12-01 10:12 How is it possible that StringBuilder.setLength(0) invokes Arrays.fill? »
While investigating a performance test result I found the following stack trace reported in Java Flight Recorder's "Hot Methods": Stack Trace ...
(1) odpowiedzi
2017-11-30 22:11 MySQL JSON column loses decimal precision when JSON object inserted as a string literal »
I am trying to insert a JSON document into a MySQL JSON column and have noticed that decimal precision is lost in. {"value": 212765.700000000010000} ...
(1) odpowiedzi
2017-11-30 16:11 How to convert Map<Shape, int[]> to Map<Shape, Set<Integer>> in Java 8? »
I'm pretty new to Java 8 and I have the following requirement to convert: Map<Shape, int[]> --> Map<Shape, Set<Integer>> Any i...
(2) odpowiedzi