All Questions
77,309
questions
0
votes
1
answer
22
views
Double each occurrence of a char recursively
The exercise is to write a recursive method that takes a string and a char parameter and returns a string with each occurrence of the char doubled. Additionally, the number of doubling operations ...
-2
votes
0
answers
19
views
Printing more than one string variable with print in python [closed]
I am new to python and I having a hard time with a simple print of two strings. I am following some examples and I don't understand why it is giving me an error
...
-2
votes
0
answers
23
views
first snake game [closed]
I've just worked on my first game in C and have a few questions.
how would I make it where my box is nicer?
I'm having issues trying to figure out how to make the snake grow in size when it eats.
...
1
vote
1
answer
51
views
Simple hash table written in C with REPL
This is a simple hash table I've written in C. It is a closed-addressing hash table with TABLE_SIZE number of buckets. The hash ...
0
votes
0
answers
14
views
Simple .NET Web App for managing family budget
I am creating some small project for my portfolio. It will be app written in .NET and React but for now I've done backend part and I seek code review. I wanted it to be aligned with DDD principles and ...
2
votes
0
answers
16
views
Ringbuffer over a const generic Array in Rust
I implemented this generic ringbuffer over a const generic array with the usage of the MaybeUninit type.
Is there something which is maybe unsound (having the lines ...
0
votes
0
answers
13
views
How can I optimize this function LinearUpscale2DArrayInPlace in Unity Jobs
Well,
I have this function which is called in the Unity Job system, I'm profiling it:
The code:
...
0
votes
0
answers
20
views
Simple Todo app using latest React and TypeScript
I would like to ask your advice on the frontend code of todo app.
Main functionalities:
The app has authorization and authentication using backend.
The CRUD functionality for managing tasks
What may ...
1
vote
2
answers
68
views
Domain Driven Desing aggregate for ticket booking
What do you think about this aggregator (DDD) for booking and cancelling tickets? Is it ok, or would you do it differently somehow?
...
1
vote
1
answer
29
views
Simple text file encryption and decryption
Short introduction; recently I've completed a basic course on C but other than that I have no programming experience and I am a total beginner.
As a practice project and to practice reading from and ...
2
votes
1
answer
17
views
Do you think it's a good schema.prisma?
i'm trying to learn backend with Next JS, and i'm using Prisma + MongoDB. I want to create a simple website with a user with a cart and some products. here my schema :
...
6
votes
1
answer
63
views
Optimizing __getitem__ for a bioinformatics script in Python
I'm writing a script for a bioinformatics application in Python that iterates through several sequences looking for amino acids in specific positions to calculate their frequency in relation to a ...
0
votes
0
answers
35
views
Class design Java [closed]
I have a task: Implement various characteristics of the cells of the playing field (radiation, temperature, humidity, shading, etc.). So I have some class GamePanel ...
0
votes
1
answer
62
views
Move timestamp to the next Monday 10:01 AM
I've been battling ChatGPT for hours now and can't get satisfied with this simple algorithm in TypeScript. These two (hopefully correct) TypeScript+ReactNative solutions should move the timestamp ...
-4
votes
0
answers
28
views
Condition not correct? [closed]
I am using Joomla 5. In Joomla you can create articles and also show a summary of an article on a category page.
For SEO reasons I want to use an alternative title sometimes on the category page. I ...
2
votes
1
answer
65
views
NLP pre-processing function optimization as it is extremely low on 92Mb data set
I have a data set that is of 300,000 rows approximately and two columns, each row contains a string, some might be larger than others. All in all, the data set in a ...
9
votes
3
answers
1k
views
Number to text in Python
I'm kind of new to programming and I would need a suggestion whether there is a better way to solve this exercise.
I need to write a function dict_of_numbers() that ...
0
votes
0
answers
29
views
Waiting time display app in Python
This application is for restaurant patrons to know how long they have to wait in line.
We would like to design a more sophisticated GUI interface, but do not know how to go about it.
Please let me ...
5
votes
4
answers
111
views
In-memory cache class
The following is a simple cache that I have written in java. It uses the LRU replacement policy and also evicts items based on a refresh interval (default 5 secs). Right now, the class is not thread ...
-3
votes
0
answers
29
views
Python check is an ip in ip network list [closed]
I try to check is an IP address in network list, but alway get False
...
1
vote
0
answers
29
views
Go log file swapper
Please review my code. I left some comments where I think something might be wrong, but any comment is appreciated.
I am writing a package for a project I am currently building. Its purpose is simply ...
2
votes
1
answer
61
views
Implementing an Object type in C++
I'm currently working through the "Crafting Interpreters" book by Robert Nystrom. He uses Java to implement the visitor pattern in which the visitor functions return the Object type. C++ ...
4
votes
2
answers
425
views
Spatial radius search in Boid simulation
I am working on a Boid simulation with 10,000 boids. I've successfully utilized geometry shaders and an array<GLfloat[3], MAX_BOIDS> for vertices to enhance ...
1
vote
0
answers
49
views
Simple Tic-tac-toe in Python
I am a beginner programmer who coded a simple Tic-tac-toe in Python for practice. Any feedback, especially regarding best practices and tidying up the code, is appreciated.
...
-4
votes
0
answers
52
views
How to avoid duplicates technically (& console output) while storing elements into collection using Java? [closed]
I'm working with Java 11 & Selenium.
using the following snippet of the code as provided below:
...
1
vote
1
answer
81
views
Is it a correct way to read a file contents using paramiko (SSH, SFTP client)?
Is my implementation of _read_contents (3 lines) fine, or does it create a potential problem (e.g. passing part of an object that has to be destroyed, or a ...
6
votes
2
answers
2k
views
Gaussian elimination algorithm in C++
Given:
j-g-h-i=0
a+b-c-j=0
c+i-d-e=0
e+g-f=0
And known:
a=10
b=7
d=3
e=2
f=3
j=14
I want to solve this (or similar equations) ...
2
votes
1
answer
55
views
Data structure to hold elements for script execution
I am building a solution to iterate over Python scripts in a folder and execute them. Each script will return a Pandas data-frame which needs to be saved as a Parquet file. The first stage is the data ...
2
votes
2
answers
55
views
Dictionary additional function implementations
I've written a utility class BetterDict to help me on some of my other projects. I've implemented the &, ...
3
votes
1
answer
81
views
Pentomino solver in Python
When I was a child, I used to play Ubongo board game, recently I discovered Pentomino puzzle and I wanted to create a custom solver in python for it. Here is what I got:
...
-5
votes
0
answers
25
views
2
votes
1
answer
66
views
Casino Number Guessing Game
I have created a casino number guessing game in C++:
...
1
vote
1
answer
71
views
Rubik's cube scrambler with timer and list of solves
This is a work in progress Rubik's Cube scramble generator with timer and list of solves. The list of solves is stored using localstorage so that it stays on page reload. A solve can also be deleted ...
1
vote
1
answer
60
views
Lazy/deferred OOP-based networking using the Epic EOS SDK
For gaming applications, networking looks strange from the point of view of traditional approaches.
Much of the game logic is based on "ticks"; Most often this is a mandatory item of ...
-2
votes
0
answers
14
views
0
votes
1
answer
60
views
HackerRank Algorithm Problem: Climbing the Leaderboard (Python)
Here is the Hackerrank problem which is related to dense ranking and below is my solution which didn't pass the time limit cases. Any better way to optimize this?
...
1
vote
0
answers
53
views
My code.org Game Lab project is running really slowly, how can I optimize the code further?
I'm working on my final project, and it is a game made with Java Script in code.org's Game Lab. The code worked fine, and it was not slow at all, but as I worked on it, it became much slower! The ...
1
vote
0
answers
50
views
An implementation of encryption cascade
I'm looking for feedback on some source code, I have everything documented and have corrected some errors. Looking to see what I did correctly, incorrectly, and what can be improved.
...
0
votes
0
answers
37
views
PHP implementing Dependency Injection
I'm trying to implement Dependency Injection in one of my projects. It's a project that when I started I didn't had much experience with sotware development, but now I feel like it's time to do a bit ...
0
votes
0
answers
22
views
cubic spline routine
I tried to implement the cubic spline algorithm in cython. I want to ask how I can make the code more efficient in terms of speed. Any suggestions or references ...
3
votes
2
answers
85
views
Terminal Based Game [v2]
this is the second version of the Terminal Based Game I'm working on thanks to @user673679 for the suggestions, I did not implemented everything you said but it was really fun working on your ...
1
vote
2
answers
111
views
Thread-safe int wrapper in c#
My system is a .NET Core 7 console app, which starts some background threads. I need to pass some int values (counters, etc.) between the main and background ...
0
votes
1
answer
45
views
Python GUI Based IP location digger
Greetings.
I'm a newbie python developer who just started using PyQt5 as his major GUI development tool.
Because of this, I have started a side project known as NyvoAI, just for gaining more knowledge ...
4
votes
1
answer
144
views
My attempt at GNU echo in rust
This is my first post. I'm trying to learn Rust and I recently finished reading the Rust Book.
For further learning I decided to try to reimplement some GNU core utilities in Rust.
This is my approach ...
1
vote
0
answers
25
views
Making my code shine and pro: Python in Azure Function Retrieveing the Data From Rest API
The code retrieves the data from PBI API - it's my first one and I would like to learn how to make it pro.
Here is the list of my questions:
Can you please analyze 2 functions: GetReports and ...
1
vote
0
answers
40
views
Abstract Factory Config Loader [closed]
I've created a way to load a config file from JSON into an object and would like a review on the design pattern I used because the implementation feels a little "off" and I feel like there ...
-3
votes
0
answers
29
views
I want to give an alarm if the password is wrong and an alarm if it is correct [closed]
How should I use switches like the example above? I want the switch to work like an IF I want to give an alarm if the password is wrong and an alarm if it is correct - I'm just curious if this is ...
2
votes
1
answer
81
views
Settings and global variables in one place
I have a configuration (YAML) file used across related modules. I also have a few additional variables to be accessed globally in my modules. I want to have them at one place (an instance of a class ...
2
votes
1
answer
51
views
Implementation of aes-cbc-hmac combined with xchacha20-poly1305
I’m using two ciphers in this code that are in this order- encrypt plain text with xchacha20-poly1305 then encrypt the resulting ciphertext with aes-cbc-blake2b hmac.
I was told elsewhere rather than ...
2
votes
2
answers
65
views
Dynamic python config reader
I am looking for a code review on the following code. Say I have a simple example class, something like the following:
...