Questions tagged [java]
Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.
10,908 questions
2
votes
1
answer
87
views
Simulating die streaks and counting the number of matches in Java
Intro
Suppose we throw a die \$N\$ times. Before writing this program, I was puzzled by a question: How should I approach each trial. I got two options:
Choose a single die number, count how many ...
5
votes
1
answer
218
views
ObjectBucketSort.java with running time statistics
Intro
This time, I present the ObjectBucketSort, a stable sorting algorithm for objects.
Code
...
4
votes
3
answers
564
views
ObjectCountingSort.java
Intro
This time, I was in the mood for generalizing counting sort to arbitrary (Comparable) objects.
Code
...
3
votes
1
answer
65
views
Wrapper / Utils for creating an instance of JCache's CacheManager implemented by Redisson or Caffeine
I want to provide an instance of JCache's CacheManager that either points to a distributed cache managed by Redisson (used in production), or a Caffeine instance (used for testing). I want this code ...
6
votes
1
answer
662
views
Batcher's sort in Java: a θ(N log N log N) sorting algorithm
Intro
This time I have implemented the Batcher's sort.
Code
io.github.coderodde.util.BatchersSort.java:
...
5
votes
5
answers
463
views
CompoundIterable.java - combining multiple Iterable<E> to a single one in Java
Intro
(My previous, more restricted attempt is at A list iterator combiner in Java.)
This time, I want to be able to do something like this:
...
3
votes
2
answers
436
views
TaskScheduler.java - a simple task scheduler in Java
Code
io.github.coderodde.util.Task.java:
...
5
votes
2
answers
374
views
JavaFX fleet management project
Today I worked on a JavaFX project about fleet management and wondered what else I could add or improve. Unfortunately, the code is written in German, as are any comments. I hope that's not a problem. ...
4
votes
2
answers
279
views
A list iterator combiner in Java
Intro
(The generalization of this post is CompoundIterable.java - combining multiple Iterable to a single one in Java.)
My idea this time was to be able to write something like this:
...
5
votes
1
answer
191
views
A fractal algorithm has a stability zone FROM A fractal algorithm shows prime number patterning
I implemented the "frozen window" from my preview paper A Fractal Streaming Algorithm, Prime Patterning and the Infinitude of Twin Primes
in order to count the "letters" in the ...
3
votes
2
answers
124
views
Implement a simple port knocking client (UDP or TCP) in Java
(I have also published this project on GitHub.) I am aware that some people view this as security through obscurity.
The aim is to implement the port knocking technique in Java. I would like to know ...
6
votes
1
answer
570
views
A simple method for compressing white space in text (Java)
(The story continues in A simple method for compressing white space in text (Java) - Take II.)
Intro
Now I have that text space compressor. For example,
...
1
vote
1
answer
65
views
Non-blocking Queue using JCTools
I've implemented a lock-free Multi-Producer Multi-Consumer (MPMC) queue with commit semantics in Java. The queue is designed for scenarios where entities need to be processed exactly once, with ...
4
votes
3
answers
463
views
A tiny Java framework for gathering running time statistics
Intro
(See the next iteration A tiny Java framework for gathering running time statistics - Take II.)
I have this tiny Java framework that allows users to gather running time statistics of a piece of ...
4
votes
2
answers
475
views
A tiny Java framework for gathering running time statistics - Take II
Intro
(The previous version is here.)
(The next version is here.)
Now I have incorporated nice answers made by Chris and Chip01.
What changed:
Fixed the computation of median,
...