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
4 votes
2 answers
404 views

From the previous post, I have incorporated the nice answers made by Chris and Chip01. Code ...
coderodde's user avatar
  • 32.3k
4 votes
2 answers
465 views

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, ...
coderodde's user avatar
  • 32.3k
4 votes
3 answers
452 views

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 ...
coderodde's user avatar
  • 32.3k
1 vote
1 answer
110 views

Intro (See the version 1.0.0.) (See the GitHub repository.) This time I have got rid of some generic classes and adapted the entire code base to deal with byte ...
coderodde's user avatar
  • 32.3k
5 votes
1 answer
471 views

Intro (See the version A Java program for compressing/decompressing files via Huffman algorithms (version 1.1.1).) (The full repository is here. It contains also some unit tests that do not fit in ...
coderodde's user avatar
  • 32.3k
2 votes
1 answer
160 views

Intro (This is the continuation of HuffmannEncoder.java - computing prefix codes for arbitrary (generic) alphabets.) (See the GitHub repository.) This time: I have fixed the misspelled ...
coderodde's user avatar
  • 32.3k
4 votes
2 answers
369 views

(See the continuation of this post at HuffmanEncoder.java - computing prefix codes for arbitrary (generic) alphabets - Take II.) I have this Java implementation of the Huffmann encoding. It looks like ...
coderodde's user avatar
  • 32.3k
-2 votes
2 answers
214 views

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

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.3k
4 votes
3 answers
492 views

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.3k
2 votes
2 answers
266 views

Intro A sort is called super linearithmic if its running time is \$\omega(N \log N)\$. For example, \$f(N) = \omega(g(N))\$ means that \$f(N)\$ grows "faster" than \$g(N)\$. In this post, I ...
coderodde's user avatar
  • 32.3k
5 votes
1 answer
541 views

(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.3k
-7 votes
1 answer
135 views

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
160 views

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

(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.3k
4 votes
1 answer
96 views

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.3k
4 votes
1 answer
185 views

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
91 views

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.3k
4 votes
2 answers
152 views

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 \$E \subseteq \mathcal{P}(X)\$...
coderodde's user avatar
  • 32.3k
-4 votes
1 answer
119 views

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
422 views

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.3k
0 votes
0 answers
62 views

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.3k
4 votes
1 answer
293 views

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

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
66 views

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.3k
2 votes
2 answers
123 views

Intro I call two \$n\$-strings \$s\$ and \$z\$ over the alphabet \$\Sigma\$ 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.3k
4 votes
1 answer
183 views

Intro Two \$n\$-strings \$s = \langle s_1 \ldots s_n \rangle \$ and \$z = \langle z_z \ldots z_n \rangle\$ are considered isomorphic if and only if there exists a bijection \$f\$ such that for all \$...
coderodde's user avatar
  • 32.3k
0 votes
0 answers
28 views

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.3k
0 votes
0 answers
24 views

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.3k
4 votes
1 answer
138 views

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.3k
0 votes
0 answers
38 views

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
329 views

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.3k
8 votes
2 answers
624 views

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
181 views

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
159 views

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

(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.3k
4 votes
1 answer
109 views

(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.3k
5 votes
1 answer
480 views

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

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
716 views

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
983 views

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

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
410 views

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
111 views

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
154 views

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
112 views

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

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.3k
1 vote
0 answers
66 views

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
47 views

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

(See the previous iteration.) This time, I have refactored my code a bit. It follows immediately: Code ...
coderodde's user avatar
  • 32.3k

1
2 3 4 5
219