All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
99 views

My Drawing Finder

I developed this application for the company I work for. It became increasingly challenging to locate drawings within the myriad of folders, especially when searching for the most up-to-date versions. ...
shiblabi's user avatar
3 votes
1 answer
201 views

Project Euler 60: Prime Pair Sets

Project Euler Prime Pair Sets: The primes 3, 7, 109, and 673 are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 ...
peternish's user avatar
0 votes
0 answers
68 views

C# chess engine performance

I am creating my own bitboard chess engine in C#. I am trying to optimize my make move, unmake move, and move generating functions to get a good fast base. My C# skills are average and got some tips ...
eligolf's user avatar
  • 109
2 votes
0 answers
33 views

A recursive_fold_right_all Template Function Implementation in C++

This is a follow-up question for A recursive_fold_left_all Template Function Implementation in C++. Besides recursive_fold_left_all function, I am trying to ...
JimmyHu's user avatar
  • 3,996
0 votes
1 answer
56 views

Tracking people's check-in and check-out at an event

I have some logic that helps me calculate the data for a summary of an event, which should be rendered as something like this: ...
Andrey Namikaze's user avatar
4 votes
0 answers
21 views

Procedural macro to derive de/serialization trait from/to little endian bytes

I wrote a trait library that allows the de-/serialization of data structures from/to little endian bytes 1. For it I now wrote my first procedural macro 2 to be able to derive the traits ...
Richard Neumann's user avatar
1 vote
0 answers
33 views

Asp.net Core Razor Pages Complex Databinding Select List to Entity List

I'm new to Razor pages. I would like to bind a <select> list to an object's property that is a list of another object (Report.EventyTypes). Consider the ...
yougotiger's user avatar
-1 votes
1 answer
54 views

Handling exceptions of FileInputStream and XSSFWorkbook

Can you tear my code apart with code review comments? Below is a simple method which reads an XLSX file and does some stuff with it. I use FileInputStream and ...
AutoTester999's user avatar
11 votes
4 answers
2k views

Simple Key Value Database using C

I was recently doing an assignment for a job interview, which asked to create a simple key value database with 4 command line operations: create key value: Adds a key value pair/updates an existing ...
P4PL4's user avatar
  • 111
4 votes
2 answers
122 views

C++ heap allocator using an explicit free list

Description I've written a heap allocator in C++ using an explicit free list for organization. I've also written a series of unit tests and a microbenchmark using Catch2. At time of writing I've ...
pdm's user avatar
  • 307
-1 votes
1 answer
32 views

how to boost my script in fault tolerance ,performance and readability [closed]

...
xwj's user avatar
  • 9
1 vote
2 answers
68 views

Configurable 'swapping' order of loops

The code below groups a list by either number or letter, as seen below: 1A, 1B, 2A, 2B, 3A, 3B, 4A, 4B, 5A, 5B or 1A, 2A, 3A, 4A, 5A, 1B, 2B, 3B, 4B, 5B The option is configurable by the user via ...
Jsk's user avatar
  • 111
3 votes
1 answer
68 views

Multi producer/consumer lock-free queue

I would be grateful if you could review my code for a multi producer/consumer lock-free queue in C++. I am mainly after performance improvements, but all input is welcome. ...
Mr. Orange's user avatar
3 votes
1 answer
219 views

Find the closest named color

I have a .json file with name (string) and RGB (r, g, b: numbers) with 30.000 key-value pairs. I am looping the json multiple times per second to find the closest name to a given RGB color. Any idea ...
Relik8's user avatar
  • 31
2 votes
1 answer
81 views

delete rows based on references to other tables in a mysql database?

I have a database with the following hierarchy. A dataset can have multiple scans (foreign key scan.id_dataset -> dataset.id) A scan can have multiple labels (<...
Roland Deschain's user avatar
1 vote
2 answers
91 views

Simple service that wraps access to json file

I'm wondering if this is the best way to write the Java code I have written. It works, but looks overly verbose, is it possible to rewrite any of the code to make it more concise? Please ignore the ...
Professor of programming's user avatar
1 vote
2 answers
1k views

Calling fgets() twice

I am a beginner. I have really struggled with fgets() when using the function twice. I am on Windows with VS Code and C++ extension. My test program is working, but it is IMHO lengthy and complicated ...
mortenlund's user avatar
3 votes
1 answer
136 views

Filter: BMP Image Filtering Tool - follow-up

This is a follow-up of this quesiton: Filter: BMP Image Filtering Tool Changes: Added comments where necessary. Added checks for integer overflow. Added support for input and output redirection. ...
Harith's user avatar
  • 2,322
0 votes
1 answer
184 views

How to optimize the player movement code like in Tomb Of The Musk game?

I've written some code that performs movement similar to the Tomb Of The Musk game. The idea is that the objet should move in a certain direction until it encounters an obstacle. After that, the ...
Hanvil's user avatar
  • 3
1 vote
0 answers
38 views

Tkinter threadpool with callback implementation - alternative approach feedback

This is an attempt to create a usable alternative to the "normal" method of implementing concurrency with tkinter. The "normal" method seems to be by pro-actively polling a result ...
Michael Lundie's user avatar
1 vote
0 answers
54 views

Sequentially bidirectional find the indexes of an element into a collection (second thought)

Embodying the helpful tips from the “Sequentially find the indexes of an element into a collection” previous code review resulted in extending the implementation to bidirectional index lookup, that is ...
user avatar
3 votes
1 answer
142 views

Get HTTP status of many URLs

I'm brand new to using rust, so please bear with me. I'm trying to write a rust program which takes two arguments: A URL, and a wordlist. This wordlist has the following contents, and is several ...
TmDobbin's user avatar
2 votes
1 answer
53 views

JS animated string builder

Today, I tried to write a simple function that would display the characters of my string one by one by iterating over a string containing the letters of the alphabet and showing the steps on the ...
Luca Natale's user avatar
3 votes
0 answers
25 views

Topological sort in Prolog

I wanted to calculate topological sort given a few predicates asserting that one element should be before another in a sequence. order(a, b) means that ...
Jakub Nowak's user avatar
1 vote
1 answer
52 views

Extending die roll simulations for complex data science tasks

I've developed a Python script that simulates die rolls and analyses the results. I'm now looking to extend and modify this code for more complex data science tasks and simulations. Is this code ...
atlvd's user avatar
  • 101
4 votes
2 answers
132 views

Print the three most occurring chars in Java using streams

The three characters that occurs most in a given string should be printed by using streams/lambdas (functional programming). The order of characters that occur equally often should be preserved. My ...
Tobias Grothe's user avatar
7 votes
2 answers
1k views

Convert 64-bit Gray code to integer

This algorithm encodes a 64 bit integer. As input I have a 64 bit integer a, for example: (a is a single 64 bit number,which I split in 8 bytes for readability) <...
tutizeri's user avatar
  • 173
4 votes
2 answers
850 views

Identifying unnecessary attributes in a Python class?

I have commented out two attributes (in random_number_guesser.py) which I believe are unnecessary. Am I correct in assuming that, because the code runs correctly without their implementation, they ...
dylanbobbyromero1's user avatar
3 votes
1 answer
84 views

Sequentially find the indexes of an element into a collection

Util class to find into a collection the indexes of a given element with multiple occurrences from the first index or relative to a given index. ...
user avatar
0 votes
1 answer
73 views

Listener for property value changes in a Javascript object

The purpose of this code is add proxy on nested object for log changes on property. This is a debug utility! ...
Simone Nigro's user avatar
10 votes
2 answers
769 views

Leap Year Calculator Using If Elif and Else Only

I'm taking the 100 Days of Code (Python) taught by Angela Yu on Udemy. There have been a few other questions revolving around this lesson but I can't find one who came up with my specific question so ...
AGM's user avatar
  • 103
1 vote
0 answers
63 views

binary semaphores implementation pthread

Can someone see if have not made some stupid mistakes in the binary semaphore implementation? I know that some more checks have to be added but I have eventually lost the initial idea in the details. <...
0___________'s user avatar
2 votes
1 answer
92 views

Simple JS Password System

I created a simple password system using HTML, CSS, and JS to quiz myself on my variable, localstorage, and if and else ...
HTMLNerd_1's user avatar
0 votes
0 answers
36 views

Mac M1 .BF Compiler in Rust

I'm writing a brainfuck compiler in rust, that takes brainfuck instructions and converts them to a very basic assembly form, and then compiles that into binary, if you are not familiar with brainfuck ...
Jake Snell's user avatar
4 votes
1 answer
135 views

calculate the number of ways to pick two different indices

I'm working on a codesignal practice problem You are given an array of integers a and an integer k. Your task is to calculate the number of ways to pick two different indices i < j, such that a[i] ...
Josh's user avatar
  • 41
2 votes
2 answers
74 views

Merge three (or more) arrays based on specific index and create new array

I have three arrays in which first index is same, so I want to merge all three array into one array based on first index element Input: ...
Murtuza Z's user avatar
  • 121
2 votes
5 answers
436 views

Optimisation: Fastest way to multiply every number in an array by 2

I'm trying to find the fastest way to multiply every element in an array by a given number, in this case 2. So far I have written a SIMD instruction that performs at 33 ns multiplying every number in ...
Henners2002's user avatar
1 vote
1 answer
84 views

Python Django image upload API with 6 fixed slots

I built an image upload API with Python Django. There are a fixed number of 6 slots, which can either be null or filled with something. There are two entities, Profile, which contains the six photos, ...
code writer 3000's user avatar
1 vote
0 answers
27 views

Determine top t values with few calls to order(), a given procedure to order k values

Trying to write a decent answer to Most efficient way to get the largest 3 elements of an array using no comparisons but a procedure for ordering 5 elements descendantly, I came up with something ugly....
greybeard's user avatar
  • 6,104
-1 votes
0 answers
25 views

Python Flask Code clarification [duplicate]

...
Sindr's user avatar
  • 1
3 votes
2 answers
112 views

Adhering to Object-Oriented Principles in Fruits and Vegetables Scale Program

I've been working on a project related to a fruit and vegetable scale program for about a month, and I'm relatively new to programming. In this project, I'm trying to adhere to object-oriented ...
Kerem Tazedal's user avatar
2 votes
1 answer
90 views

Codeforces: Dasha & Nightmares

so I got started with competitive programming about a day ago and I got stuck on the first random question I tried on codeforces. It's called Dasha and Nightmares. Problem Description: The problem ...
st0n3r's user avatar
  • 73
2 votes
1 answer
276 views

Printing the elements of a forward linked list

I'm a sophomore in computer science who's working on a linked list class for his DSA class. I believe this code can be improved, but I'm not sure how because everything got really messy really fast. ...
o_22's user avatar
  • 23
5 votes
1 answer
121 views

RNG Minigame In Python - Best Practices & Possible Improvements?

Recently, I got into programming with Python as a fun little side hobby. After watching a bunch of YouTube tutorials (to learn about IDE's, variables, etc.), I finally got to the point where I was ...
dylanbobbyromero1's user avatar
4 votes
1 answer
229 views

200 line Brainfuck Interpreter

I wrote a simple brainfuck interpreter in C99. Coming from a background of C++ made the task easier, but still there is some stuff I had to get used too. The program accepts a path to a brainfuck file ...
William Redding's user avatar
0 votes
0 answers
180 views

Value at Risk forecast generator

I am developing a code to compute Value at Risk (VaR) using various models (see below). Currently, I am looking to implement a rolling window approach over a dataset spanning 4,000 days, with each ...
Oscar's user avatar
  • 1
1 vote
1 answer
50 views

Template for making distinct numeric type aliases

I've tried to make a small template for the creation of distinct (incompatible) numerical types. For example both row and column indices are usually represented as the same underlying type. However it ...
Sam Coutteau's user avatar
10 votes
3 answers
2k views

Cumulative grade-point-average calculator in C++

I wrote a simple Cumulative grade-point-average calculator in C++, and would like to ask for advices to improve the code in terms of best practices (efficiency, reliability) in the language. Here's my ...
kit.kat.code's user avatar
-2 votes
1 answer
65 views

Double set to -1 from function does not equal to -1 in comparison [closed]

I use the function trace() to calculate the trace of a matrix. This is not important. But for this specific matrix this value is -1. My variable "trace" is set to this from the function. ...
Lorde213423432e43434's user avatar
2 votes
2 answers
91 views

AES-GCM and AES-CBC-HMAC encryption methods

Looking for code reviews of these two encryption methods. And if GCM is better or worse than CBC with HMAC. AES-GCM ...
Bismofunyuns's user avatar

15 30 50 per page