Newest Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
7 views

Return breakdown of component from database into its constituent materials; correctly handle recursive scenarios

I’m working with a MySQL database that models product compositions and raw materials. There are two relevant tables with columns as shown: product_recipes: ...
Boom's user avatar
  • 101
3 votes
2 answers
51 views

Find SNR of a Laser-Optical Imaging System

...
keval_07's user avatar
-1 votes
0 answers
52 views

Backend E-Commerce API using Laravel

I want to know if I am ready to apply for a JR Laravel Backend Developer Role, and if my code meets the expectations for a JR or maybe even a Mid-Level Role. My Project isn't done fully: I am planning ...
Arthur's user avatar
  • 1
4 votes
2 answers
219 views

Strength of a Pyramid Top

I need to solve the following competitive programming problem from coderun.ru: Strength of a Pyramid Top The pyramid consists of n horizontal layers of blocks: the first layer contains n blocks, the ...
Stony's user avatar
  • 41
0 votes
0 answers
19 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
3 votes
1 answer
111 views

Reassignable reference_wrapper with empty state

I created a simple custom refernce_wrapper class template, which, in contrast to std::reference_wrapper, has some additional ...
Daniel Langr's user avatar
1 vote
0 answers
19 views

ReadWrite Lock compatible with coroutines

A while ago I wrote for my own needs a (non-reentrant) read-write lock for kotlin's coroutines. I got no reactions on the relevant github thread. I think it's a nice code, so I thought I'd share it ...
Al.G.'s user avatar
  • 111
5 votes
2 answers
761 views

Project Euler #909: L-Expressions I

I am trying to solve the 909th challenge of Project Euler. It is basically about replacing specific patterns in a string until no pattern is found. A given string like ...
polfosol's user avatar
  • 299
9 votes
3 answers
1k views

C++17: shared_mutex protected DNS cache (rare writes, many reads) return-by-value vs decltype(auto)?

I’d appreciate a review of this small DNS cache. It stores pairs of domain and IP address and uses a std::shared_mutex because reads are frequent and writes are ...
sam's user avatar
  • 369
5 votes
1 answer
268 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
  • 31.3k
8 votes
2 answers
530 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
6 votes
1 answer
265 views

Splitting a long introduction into collapsible elements easier to read and translate

Before I started, we had a few long introductory texts that were shown to users in different part of the editor window, depending on what type of object they are editing. The texts describe how to add ...
Lecker Kebap's user avatar
3 votes
0 answers
52 views

lanczos_resample Template Function Implementation for Image in C++

This is a follow-up question for Two dimensional bicubic interpolation implementation in C++. I am trying to implement Lanczos resampling for 2D image in this post. The experimental implementation <...
JimmyHu's user avatar
  • 7,224
-3 votes
0 answers
47 views

Role-based Access Control Class code [closed]

I want to know if the sequencing of my code acknowledges coding conventions, and is easy and maintainable to follow through. Here is my code: ...
hanzoera's user avatar
3 votes
1 answer
132 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
  • 315
-1 votes
2 answers
91 views

Feedback on Lazy Dependencies (Autofac) [closed]

This is a pattern I have adopted and have been refining with newer C# language features. The main objective of this pattern is to make unit testing and mocking a simpler process. When testing a class ...
Steve Py's user avatar
  • 107
10 votes
3 answers
2k views

A Rubik's Cube game in Python

I implemented this Rubik's Cube game in Python, using Canvas and Context2d for user interaction. This was mainly an exercise in &...
QuadmasterXLII's user avatar
0 votes
0 answers
31 views

Async Rust UdpServer with Clean-Shutdown (using Tokio)

I'm new to Rust and trying to build an async Server. The server should receive UDP packets, process them (which will include more network communication), and respond the result to the client. I had ...
x539's user avatar
  • 191
5 votes
1 answer
292 views

Wordsearch Generator (Tracking Success/Failure)

I'm creating a wordsearch generator that takes a list of words and outputs a 10x10 grid (2D array) of letters. This is roughly how it works: loop over words use boolean ...
Aya Noaman's user avatar
4 votes
1 answer
768 views

Using AI agent to solve the N-puzzle

I have just written this code here. The code is about creating a (local LLM based) AI agent to solve the N puzzle. I should stress that I am the one who wrote the code, and I did not use AI to write ...
Dang Manh Truong's user avatar
1 vote
3 answers
112 views

Is this exception handling missing anything?

This is the code. I'm uncertain about the last block. ...
yoda's user avatar
  • 225
2 votes
0 answers
51 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
  • 31.3k
6 votes
1 answer
95 views

Player controlled dungeon creation system

I'm making a game with a system inspired by the PSP Game Dungeon Dungeon maker 2 the hidden war: Visual Reference. I have everything set up but I feel there are ways to make the code more simple and ...
Jereco Merash's user avatar
4 votes
1 answer
90 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
  • 31.3k
5 votes
2 answers
136 views

Parsing HTTP headers from &HashMap<String, String> into http::HeaderMap

For context, I'm very new to Rust, and I'm trying to learn the best practices and nuances of it as I go. I've written this small function that takes a ...
Jessica's user avatar
  • 890
2 votes
0 answers
131 views
+50

Namespace-scope try_lock_for / try_lock_until pt. 2

This is my second iteration of implementing try_lock_for/try_lock_until function templates in which I've cherry-picked a bunch ...
Ted Lyngmo's user avatar
5 votes
1 answer
442 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
  • 315
3 votes
1 answer
85 views

OpenProcessing.org JavaScript program - Building a list of matrices

My openprocessing.org JavaScript code listed below produces the output I want but doesn’t seem very elegant to me especially the “.M” in “matrices[mat].M[row][col]”. Any comments to improve the ...
Will.Octagon.Gibson's user avatar
7 votes
1 answer
388 views

Button Debounce in Verilog

I'm learning FPGA development, and this is my first Verilog module - a button bouncer using a state machine. The code works as I expected it to be, but I would like some feedback on the code itself ...
Dang Quang Vinh's user avatar
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
  • 315

15 30 50 per page
1
2 3 4 5
2592