Skip to main content

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.

Filter by
Sorted by
Tagged with
-1 votes
2 answers
138 views

Object oriented programming deque implementation (another second thought)

Another second thought from the second thoughts series Object oriented programming deque implementation (after second thought) led to disposing if statements ...
user294861's user avatar
2 votes
2 answers
809 views

Three non-negative integer encoding techniques in Java

Intro In this post, I will present three (3) non-negative integer encoding techniques: Elias gamma coding Elias delta coding Golomb-Rice coding Code ...
coderodde's user avatar
  • 32.1k
4 votes
3 answers
448 views

A simple method for compressing white space in text (Java) - Take II

Intro In this post, I will elaborate on A simple method for compressing white space in text (Java). Here, I have incorporated some advice offered by Chris. Also, this version preserves a single new ...
coderodde's user avatar
  • 32.1k
2 votes
2 answers
245 views

Benchmarking in Java some super linearithmic sorting algorithms

Intro A sort is called super linearithmic if its running time is ω(NlogN). For example, f(N)=ω(g(N)) means that f(N) grows "faster" than g(N). In this post, I ...
coderodde's user avatar
  • 32.1k
5 votes
1 answer
516 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, ...
coderodde's user avatar
  • 32.1k
-5 votes
1 answer
104 views

Object oriented programming deque implementation (after second thought)

The java.util.Deque implementation from Object oriented programming deque implementation that consists of three elements linked arrays, each array holding reference ...
user avatar
2 votes
1 answer
132 views

ShannonFanoEncoder.java - computing prefix codes in Java

Intro This time, I have implemented the Shannon-Fano coding. Code io.github.coderodde.compression.ShannonFanoEncoder.java ...
coderodde's user avatar
  • 32.1k
1 vote
1 answer
98 views

Jump point search in Java for faster pathfinding in grid mazes

(Refer to the entire repository in GitHub.) How it looks like Intro This time, I present my take on Jump point search that I translated from Javascript (PathFinding.js/src/finders/JumpPointFinderBase....
coderodde's user avatar
  • 32.1k
4 votes
1 answer
89 views

Dijkstra's algorithm for non-uniform undirected hypergraphs: Take II - bidirectional Dijkstra's algorithm with excellent performance

Intro (See the full repository here.) A non-uniform undirected hypergraph is a generalization of an undirected graph. It is defined as H=(X,E), where X is the set of vertices and \$E \...
coderodde's user avatar
  • 32.1k
4 votes
1 answer
179 views

API having flow - normal flow along with background poller(it also involves events which is not shown here)

We have an API in which we call external service with a tracking id.This first part of the API workflow makes an entry to the DB as SUBMITTED after the call to first external API say /E1 finishes and ...
yoda's user avatar
  • 277
0 votes
1 answer
80 views

Computing loan cuts leading to a global zero equity in a financial graph (Java)

Intro I won't specify the problem here, but instead, provide the link to the blog post discussing the problem and the full implementation. Code ...
coderodde's user avatar
  • 32.1k
4 votes
2 answers
139 views

Dijkstra's algorithm for non-uniform undirected hypergraphs

Intro (Repo here.) A non-uniform undirected hypergraph is a generalization of an undirected graph. It is defined as H=(X,E), where X is the set of vertices and EP(X)...
coderodde's user avatar
  • 32.1k
-4 votes
1 answer
109 views

Deque implementation around strategy design pattern

Implementation of java.util.Deque interface based on string of POJOs, that is plain old java object, encapsulating a field for holding reference to each object ...
user avatar
5 votes
2 answers
418 views

Ordinary insertion sort vs. straight insertion sort in Java (benchmark)

Intro So this time I wanted to find out which of the two insertion sort flavours are faster: Code io.github.coderodde.util.StraightInsertionSort.java: ...
coderodde's user avatar
  • 32.1k
0 votes
0 answers
59 views

Computing k most reliable paths in undirected probabilistic graphs in Java

Intro (See MostProbablePath.java.) This time, I elaborate on Computing most probable (reliable) path in a probabilistic graph (take II): instead of computing the most reliable path I now return k ...
coderodde's user avatar
  • 32.1k
4 votes
1 answer
285 views

Computing most probable (reliable) path in a probabilistic graph (take II)

Intro A probabilistic graph G=(V,E) is an undirected graph with weight function w:E[0,1]. In the most reliable path problem we -- given two terminal nodes sV ...
coderodde's user avatar
  • 32.1k
0 votes
0 answers
74 views

Wrap java.awt.GridBagLayout

I appreciate the GridBagLayout of Java very much. But, it has one huge disadvantage: it is very much boilerplate code. You have to type too much. I would like to use the GridBagLayout of Java in the ...
preitinger's user avatar
1 vote
0 answers
64 views

PathFinding.java: Drawing a random perfect maze via randomized DFS

Intro Still working on PathFinding.java. This time I concentrate on three private methods of GridModel that are responsible for generating random perfect mazes. A maze is perfect if for each two cells ...
coderodde's user avatar
  • 32.1k
2 votes
2 answers
106 views

Checking for weak string isomorphism in Java

Intro I call two n-strings s and z over the alphabet Σ weakly isomorphic if their character frequency multisets are equal. In other words, for an input strings s, we derive a ...
coderodde's user avatar
  • 32.1k
4 votes
1 answer
167 views

Checking for string isomorphism in Java

Intro Two n-strings s=s1sn and z=zzzn are considered isomorphic if and only if there exists a bijection f such that for all \$...
coderodde's user avatar
  • 32.1k
0 votes
0 answers
25 views

PathFinding.java: controller in MVC

Intro This time, I need to get reviewed the controller class (from MVC pattern) responsible for user interaction with the 2D grid graph. Code ...
coderodde's user avatar
  • 32.1k
0 votes
0 answers
23 views

PathFinding.java: SettingsPane class

Intro I am still working on PathFinding.java. This time I need to get reviewed the class responsible for choosing the heuristic function, the finder implementation, just to mention a few of settings ...
coderodde's user avatar
  • 32.1k
4 votes
1 answer
136 views

PathFinding.java: Beam search in Java

Intro I am currently working on this project (PathFinding.java). This time, I need to get the following class reviewed: Code ...
coderodde's user avatar
  • 32.1k
0 votes
0 answers
36 views

CodeView Custom JavaFX Node

I created this to learn about creating custom controls using Region. I did not do any testing of the Control, and it is limited to displaying Java only. I didn't need this for any reason other than ...
SedJ601's user avatar
  • 239
5 votes
1 answer
326 views

PathFinding.java: The grid view and model

Motivation I am really fond of qiao/PathFinding.js, and, so, I decided to start to do something similar (PathFinding.java). Also, this time, I am wishing to practice some MVC-patterns. It would seem ...
coderodde's user avatar
  • 32.1k
8 votes
2 answers
618 views

Own HTTP server implementation in Java with a simple template engine

I would like to hear what you think about my simple HTTP Server implementation with a template engine in Java. Have I overlooked any "pitfalls or caveats", or is there anything else to note? ...
Tobias Grothe's user avatar
3 votes
1 answer
177 views

Java: counting letters FROM A fractal algorithm shows prime number patterning

This example finds all "letter" structures. letter a = LMLMMM letter b = LMMMMM letter c = MMLMMM letter d = MMMMMM Symbol L = live = prime candidate number Symbol M = multiple = composite ...
dragoness's user avatar
  • 317
1 vote
3 answers
158 views

Is this exception handling missing anything?

This is the code. I'm uncertain about the last block. ...
yoda's user avatar
  • 277
2 votes
0 answers
60 views

Funny time with DNA: a k-mer index data structure in Java, Take II

(See the previous and initial iteration.) Intro This time, I decided to pack the genomic data such that 4 nucleotide bases are encoded into a single byte. In other words, ...
coderodde's user avatar
  • 32.1k
4 votes
1 answer
105 views

Funny time with DNA: a k-mer index data structure in Java

(See the next iteration.) This time I have programmed a simple data structure called k-mer index. The actual word k-mer is a synonym of substring of length k. This data structure is built ...
coderodde's user avatar
  • 32.1k
5 votes
1 answer
472 views

Java: prime number envelopes FROM A fractal algorithm shows prime number patterning

It implements prime number envelopes (page 3) from my paper: https://zenodo.org/records/16829092 The full working example is on github: https://github.com/cerebrummi/primeenvelopes "StartFA"...
dragoness's user avatar
  • 317
10 votes
2 answers
1k views

Java: A fractal algorithm shows prime number patterning

The fully working example finds all primes (theoretically). In real life the FA is constrained by stack size. The theoretical run is important, because it proves that all primes have a deterministic ...
dragoness's user avatar
  • 317
4 votes
3 answers
704 views

Multithreaded array summation in Java - best practice, structure, acceptable use of Constant classes. There is no concurrency?

The task is educational. The basic functionality is working. Here are some questions for my code. Please give me feedback. Main: Architecture & Design: Is the decomposition appropriate? Should ...
bonnyped's user avatar
5 votes
6 answers
977 views

The Haversine formula in Java for computing distance along the Earth between two locations expressed in geographical coordinates

This time, I have implemented the Haversine formula: io.github.coderodde.geom.Haversine.java: ...
coderodde's user avatar
  • 32.1k
4 votes
2 answers
297 views

Alternate two messages on mouse click using Java-FX

Write a program to display the text Welcome to Java and LearningJavaFX alternately with a mouse click. ...
Ghungroo's user avatar
5 votes
1 answer
405 views

Positive Integer Class Supporting Arbitrary Number of Digits

I have implemented an elementary positive integer class that supports addition, subtraction, and multiplication for an arbitrary number of digits using a singly linked list. ...
Kushagr Jaiswal's user avatar
2 votes
0 answers
110 views

Simple image captcha test in Java and JS (revised version)

Following on from my previous question, I would like to know what could be improved here and whether it is now secure. I had to use Java 8 because the Blade lib was built with it, and I want to extend ...
Tobias Grothe's user avatar
4 votes
1 answer
143 views

Implement a simple image captcha test yourself in Java and JS

First of all: I was looking for a simple image captcha solution for a website, but all I found were "Over-the-top" solutions for me. So I decided to write something to self. I mainly use two ...
Tobias Grothe's user avatar
2 votes
1 answer
109 views

Code to add order orderitems and payment details

This is order, orderitems and payment linked by foreign key. Controller: ...
yoda's user avatar
  • 277
4 votes
2 answers
178 views

SimpleStackMachine.java - A virtual stack machine written in Java

In this post, I present my most recent result, a stack-based virtual machine programmed in Java. Frankly, I am lazy to write the unit tests since I am pretty much burned out with it. The full ...
coderodde's user avatar
  • 32.1k
1 vote
0 answers
63 views

Lock free Leaky Bucket Rate Limiter

I want to validate my solution for a lock-free leaky bucket rate limiter. Given a queuing capacity and rate limit per second, it should queue requests till capacity is reached and it should allow only ...
Pritish Nayak's user avatar
1 vote
0 answers
44 views

Spring Boot RabbitMQ Publisher Configuration for Sending JSON Messages

The publisher class: ...
Tala Kafafi's user avatar
2 votes
3 answers
188 views

Calculating volume expressions of n -dimensional balls in Java - follow-up 2

(See the previous iteration.) This time, I have refactored my code a bit. It follows immediately: Code ...
coderodde's user avatar
  • 32.1k
4 votes
2 answers
242 views

Calculating volume expressions of n -dimensional balls in Java - follow-up

Intro (The previous/initial iteration is there.) (The next iteration is there.) This time, I have incorporated a nice answer by Martin R. Updated code ...
coderodde's user avatar
  • 32.1k
4 votes
1 answer
343 views

Calculating volume expressions of n-dimensional balls in Java

(See the next iteration.) Intro This time I have a Java program that prints some expression denoting the volumes of n-dimensional balls. All the math behind this is there. Code ...
coderodde's user avatar
  • 32.1k
1 vote
0 answers
71 views

Fixed BIDDFS (bidirectional iterative deepening depth first search) in Java

Intro I have this GitHub repository for doing pathfinding in directed unweighted graphs. This post is about BIDDFS proposed by Richard Korf in his paper. Code ...
coderodde's user avatar
  • 32.1k
2 votes
1 answer
126 views

IndexedLinkedList.java - A fast list data structure for large data, Take V/V (the finger list)

Intro This post is all about so called finger list, which is a data structure for speeding up the linked-list operations. Code ...
coderodde's user avatar
  • 32.1k
1 vote
0 answers
29 views

IndexedLinkedList.java - A fast list data structure for large data, Take IV/V (inner classes)

Intro This post is the continuation of IndexedLinkedList.java - A fast list data structure for large data, Take III/V (private API). Code ...
coderodde's user avatar
  • 32.1k
1 vote
0 answers
30 views

IndexedLinkedList.java - A fast list data structure for large data, Take III/V (private API)

Intro This post is the continuation of IndexedLinkedList.java - A fast list data structure for large data, Take II/V (package private API). It presents the private methods only. Code ...
coderodde's user avatar
  • 32.1k
1 vote
0 answers
33 views

IndexedLinkedList.java - A fast list data structure for large data, Take II/V (package private API)

Intro This post is the continuation of the IndexedLinkedList series. It presents the package private API: Code ...
coderodde's user avatar
  • 32.1k

1
2 3 4 5
219

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant