Data dodania Pytanie
2017-01-07 09:01 java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow »
I need to fetch all data from a table,I used the following code to do the same in sqlite dbhelper class: public Cursor getData() { SQLiteData...
(1) odpowiedzi
2017-01-07 03:01 why are java's BigInteger gcd and modInverse so slow? »
I'm trying to use java.math.BigInteger for some exact integer matrix computations in which the scalar values get up to millions of digits. I've notice...
(1) odpowiedzi
2017-01-06 22:01 Java - A smarter way to determine the child class? »
I need an intelligent way to differentiate between multiple objects, all child classes from the same parent class. Consider this parent class and two...
(12) odpowiedzi
2017-01-06 12:01 Java generics: why is this output possible? »
I have this class: class MyClass<N extends Number> { N n = (N) (new Integer(8)); } And I want to get these outputs: System.out.println(n...
(4) odpowiedzi
2017-01-06 03:01 Is it worth to use slf4j with log4j2 »
I am not able to decide whether to use slf4j or not with log4j2. Based on online posts, does not look like it will have any performance hit but is it ...
(1) odpowiedzi
2017-01-05 16:01 How to manage two sets of properties at runtime? »
I'm building a web service that needs to switch between two sets of properties depending on the request URL coming in. I'm not sure which is the best ...
(3) odpowiedzi
2017-01-05 11:01 Google API authentication in Java without using environment variable »
I have set up a simple test app to interact with Google's Natural Language API. I created a service account, and downloaded the JSON credentials. I am...
(1) odpowiedzi
2017-01-05 00:01 Java native methods. Public vs. private »
Assume that we need to implement some java method in native code and expose it to user. We know that all work is done by native side, i.e. the only re...
(2) odpowiedzi
2017-01-04 19:01 Fast bitwise operations on a long »
I know I can write the following method to calculate the set bit indexes of a long : private static List<Integer> bitPositions(long number) { ...
(3) odpowiedzi
2017-01-04 15:01 Trying to find the number of x's that satisfies n + x = n ^ x fails with timeout »
I'm trying to solve the following problem from the section Bit Manipulation at the Hacker Rank site using new features of Java 8 such as Streams. The...
(2) odpowiedzi
2017-01-04 10:01 Slow JRuby performance when running Ruby scripts from Java »
I'm using JRuby to run some Ruby scripts from Java and collect the results. Everything works fine, but performance is unacceptably slow - while execut...
(0) odpowiedzi
2017-01-04 07:01 How do i get all the classes of sun.font in jdk9 »
I have my old codebase which currently uses java8. I am migrating my codebase to use jdk9-ea. But it looks like all the sun.font classes are now not ...
(1) odpowiedzi
2017-01-04 06:01 regex to exclude a sentence which contains a specific word in java »
I am reading a file which contains lots of information like shown below: type dw_3 from u_dw within w_pg6p0012_01 boolean visible = false ...
(3) odpowiedzi
2017-01-03 15:01 Why is "this" in an ES6 class not implicit? »
I know that ES6 solved a lot of problems that existed with the this keyword in ES5, such as arrow functions and classes. My question relates to the u...
(1) odpowiedzi
2017-01-03 10:01 Where to run complex algorithms? Sever side or Client side? »
I am trying to develop an social networking android application which contains huge database of users. I am very new to Android App development and tr...
(6) odpowiedzi
2017-01-03 06:01 How do I find the percentage of similarity between two multiline Strings? »
I have got two multi-line strings. I'm using the following code to determine the similarity between two of them. This makes use of Levenshtein distan...
(3) odpowiedzi
2017-01-02 21:01 Wagner Fischer algorithm + display steps »
I made an implementation of Wagner Fischer algorithm in java with input cost, but I want to display all steps. I search but can't find any idea.After ...
(2) odpowiedzi
2017-01-02 19:01 Does Java have a "private protected" access modifier? »
I have seen some references refer to a access modifier in Java called private protected (both words together): private protected someMethod() { } ...
(5) odpowiedzi
2017-01-02 17:01 Negating Java 8 reference to Predicate method »
In Java 8, it is possible to refer to unary methods which return a boolean/Boolean (e.g. Collection.contains(Object)) using method reference syntax, r...
(0) odpowiedzi
2017-01-02 10:01 Implement Section ListView with Checkbox? »
I need section Listview with checkbox and every row have some have I need total of selected row. Here I have used Recyclerview due to Lazy Loading I h...
(1) odpowiedzi
2017-01-01 22:01 Benefits of Using Generics in a Base Class that Also Implement the Same Class »
I recently ran across this scenario in code that I didn't write and while there may be some design benefit to this approach, I can't seem to squeeze t...
(3) odpowiedzi
2017-01-01 18:01 Retry once using functional interface »
I'm new to functional programming (and Java) and I want to create something nice using it, but cannot figure out how. I'm using BiConsumer (java.util...
(0) odpowiedzi
2017-01-01 11:01 Java Infinite while Loop - float 123456789 »
I am currently learnig java float-point numbers. I know, that a float have a specific amount of significant digets. I also know, that a float is repre...
(1) odpowiedzi
2017-01-01 00:01 Java8 - idiomatic way to process a Stream<Callable<...>> in parallel delivering to a sequential consumer? »
Suppose I have a Stream<Callable<SomeClass>> stream;. The stream is accessing over a million objects which will not fit in memory. What i...
(4) odpowiedzi
2016-12-31 21:12 Java List Horrible Adding Performance »
I'm adding millions of entries of a custom object to a List. This turns out to be very slow and the graphical user interface keeps freezing randomly a...
(1) odpowiedzi
2016-12-31 19:12 Java program runs slower when code that is never executed is commented out »
I observed some strange behaviour in one of my Java programs. I have tried to strip the code down as much as possible while still being able to replic...
(3) odpowiedzi
2016-12-31 19:12 I try to upload image to imgur via code but I get 400 Bad Request, why and how can I fix? »
I try to make a code that uploads automatically image to imgur Here is my code: File image = new File("[image path]"); FileInputStream fis = ...
(0) odpowiedzi
2016-12-31 17:12 Will a Timer on Android scheduled to execute every second work during a leap second? »
Supposing I have a timer running in an Activity on Android (say, Android 6.0, in case it matters). Timer timer = new Timer(); timer.schedule(timerTas...
(1) odpowiedzi
2016-12-31 09:12 Deserialization of JavaScript array to Java LinkedHashSet using Jackson and Spring doesn't remove duplicates »
Let's say I have this client-side JSON input: { id: "5", types: [ {id: "1", types:[]}, {id: "2", types:[]}, {id: "1", types[]...
(3) odpowiedzi
2016-12-31 05:12 Uploading a String Array of dates into oracle »
I keep getting the following error when I try to upload my books table through eclipse: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number ...
(1) odpowiedzi
2016-12-30 20:12 Replace certain words in a sentence »
I'm developing an app in Android Studio that translates certain words that I've made up myself. I've got the part in the code that translates the word...
(3) odpowiedzi
2016-12-30 11:12 Reading multiple integers in multiple lines »
I am currently writing my Bachelor's thesis in graph theory and use the java scanner to convert a txt file with edges into my Java class graph. My txt...
(4) odpowiedzi
2016-12-30 10:12 Why UTF-8 is used in class file and UTF-16 in in runtime? »
Why .class is UTF-8, but runtime .class is UTF-16? ...
(3) odpowiedzi
2016-12-30 10:12 Why does the ExecutorService interface not implement AutoCloseable? »
Failing to call shutdown() on a thread executor will result in a never terminating application. Best practice to shut down the ExecutorService is this...
(4) odpowiedzi
2016-12-29 15:12 java-9 weakCompareAndSwap vs compareAndSwap »
This question is not about the difference between them - I know what spurious failure is and why it happens on LL/SC. My question is if I'm on intel x...
(2) odpowiedzi