Oct
17
comment Why does this print method work? shouldn't it fail?
The problem is that null does not have a type, so this results in a compiler error, because java doesn't know which overloaded method to call. First cast the value to a String: System.out.println((String) null);
Oct
17
answered Running JUnit tests in terminal
Oct
8
comment Foolproof detection of OutOfmemory in Java
Here are some examples: stackoverflow.com/questions/1759831/…
Oct
6
revised How to represent empty char in Java Character class
added 6 characters in body
Sep
24
awarded Autobiographer
Sep
12
comment How to read all lines of a file in parallel in Java 8
I changed the method I used for testing, I seem to be wrong, as I accidentally limited the result size to 200 before doing the final operation (forEach(System.out::println) on the resulting stream. Actually, Files.lines(Path) reads the given file as a sequential stream. Moreover, most of the time was actually spent reading the file and not on computations, plus I ran into some GC problems. I timed Files.lines(Path).toArray() vs a method using a MappedByteBuffer(readonly, 0, file.size). The results were actually the quite same, MappedByteBuffer a bit slower here and there.
Sep
12
accepted How to read all lines of a file in parallel in Java 8
Sep
7
comment How to read all lines of a file in parallel in Java 8
I edited the question to clarify that there is practically no seeking time - compared to a hard disk. Even if I add the 2 seconds for splitting the file, there is still > 18 seconds difference.
Sep
7
revised How to read all lines of a file in parallel in Java 8
provided more pieces of information
Sep
7
comment How to read all lines of a file in parallel in Java 8
In bash, you can use split -l #lines, combine that with wc -l to split it into two halves. Micheal Petch understood my idea :)
Sep
7
asked How to read all lines of a file in parallel in Java 8
Aug
5
comment recordmydesktop Segmentation fault (core dumped)
Have you foudn a solution? I also have this problem
Jul
22
revised Calculating rotation angle X-Y-Z
added 11 characters in body
Jul
22
answered Calculating rotation angle X-Y-Z
Jul
6
awarded Popular Question
Jul
2
comment Studying Objects and Classes
In a sense you are right. But I wrote singleton for a purpose: All class instance share a reference to the single "static" instance, so modifications of the static values IS visible to all other instances.
Jul
2
comment Studying Objects and Classes
The static members of a class could be seen as a singleton instance of the class consisting only of the static members, as far as I can see.
Jul
2
awarded Curious
Jun
26
awarded Nice Question
Jun
23
awarded Yearling
1 2 3 4 5