# All Questions

71,691 questions
Filter by
Sorted by
Tagged with
4 views

### Print a hierarchy tree that visualizes the bosses of employee groups

I am stuck with the following problem: I am given an Employee-class with a variable boss which is another Employee-class, but it is representing the boss of the ...
13 views

### Implementation of std::atomic<std::shared_ptr<T>> for C++20

As you may know, C++20 has added std::atomic<std::shared_ptr<T>> specialization to the standard, but sadly, most compilers have not implemented it yet. ...
6 views

### Filtering what strategy to use in strategy pattern

I have a situation where I've used the strategy pattern but got many different strategies that are available to the client code that needs to select the appropriate strategy, this is because there's a ...
8 views

...
11 views

### Go - keep installation status for multiple installations process

Im fairly new to Golang and I appreciate some feedback about how to make the code cleaner The code is called by go-routine and should update status (fail/success etc) of several installation process. <...
17 views

### Very slow Discord bot to play music

I have been writing a discord.py bot, running on replit.com. I gotten to he music bot part after finishing the queue part. My code is logically correct, however, the code is way too inefficient ...
8 views

### convert ID3DXMatrixStack to DirectXMath

Is it right it convert ID3DXMatrixStack to DirectXMath like that: ...
7 views

### Race Condition in ScheduledExecutorService.scheduleAtFixedRate

Im planning to use Strategy design pattern to put it in ScheduledExecutorService.scheduleAtFixedRate. I can use create as many scheduleAtFixedrate depends on the data to be pulled. Will this cause a ...
10 views

### convert GCCRandom(Mersenne Twister by Takuji Nishimura and Makoto Matsumoto) to stl random

I am trying to translate the book Game Coding Complete by Mike McShaffry 4E to modern C++17 standard and faced with the code of Mersenne Twister by Takuji Nishimura and Makoto Matsumoto. Is it right ...
21 views

### Box Blur algorithm

This is a challenge from CodeSignal. For image = [[1, 1, 1], [1, 7, 1], [1, 1, 1]] the output should be ...
11 views

### How can I save strings appended to a list in python? [closed]

I want to know if I can add values to a list and they will be saved the next time I run the code. For example: ...
16 views

### PHP Sort Associative Array first by relativity of value then by other value desc

I am trying to sort an associative array by following this scheme: Sort by 'qt': positives first, negatives after In positive part: sort by sa DESC In negative part: sort by sa DESC I managed to ...
21 views

### Robot OOP Class in Python

Hello everyone! Here is the thing. So I wanted at first to create Robot class, I want him to move around some board. Maybe 10x10 or something like that, then i wanted to invent a Robot fights class, I ...
9 views

### Working React App to display public Github Repositories of a user

Description of the App:- A React app that shows the public Github repositories of a user. The app shows an input field where we can enter a Github username and a submit button. {It provides users the ...
19 views

### React component to render price change

I've written this Card component which is composed of thumbnail image, name, symbol, ...
40 views

### HTML/JavaScript temperature converter with rounding

I am looking to improve the performance of my code through best practices and cleaner code. My goal here is just to perform a conversion whenever there is a keyup. But I noticed that my code looks ...
27 views

### How to process 1 Million requests per hour with synchronous SpringBoot application [closed]

Context I've a scenario - I need to expose a rest endpoint and provide a post method , which will be used by a fronend to receive form values (name, email, address). With these details I need ti call ...
46 views

### Chain of Responsibility design

I'm trying to design a chain of responsibility pattern. It slightly differ from traditional way when handler does only one action on a request, f.e. handles http response considering status code. But ...
12 views

### Basic Espresso test

I am trying to get a grip on Android UI testing, and from a lot of trying and examples, I figured out this (working test): ...
18 views

### Repeated casting vs Saving two references [closed]

In unity I have some code that finds all components of an interface type IJump. I know these interfaces are also MonoBehaviors, otherwise they would not be on the GameObject. In one script I need to ...
37 views

### What is more efficient? using conditions before for loops? or vice versa? [closed]

I'd like to know what is more efficient and performant for the following two cases: Using conditions before for loops: ...
30 views

### Relative Strength Index algorithm for stock values

This is an Relative Strength Index algorithm able to buy and sell stock based on values from basic stock CSVs. It works correctly and well, but I'm not sure if it can be better optimized as it ...
30 views

### Asp.net core response caching with custom key values

I'm trying to build a response cache with custom key values (from headers and cookies). Here's the code I have so far, and it kinda works, but I need a second opinion or suggestions for improvements. ...
37 views

### OOP in Javascript with classes

I am learning OOP in Javascript and I have done two small projecs which i have uploaded onto Github. I would really appreciate it if someone checks out my code and sees if it is adequate enough. The ...
55 views

### Check if IP address list has subnet or is supernet

I need to iterate over a list of IP addresses, to check if the elements inside are subnets/supernets between them, for this I use the IP-address library. Currently I have the following problem: my ...
742 views

### De-/Serialization of structs representing TCP messages

I wrote two template functions to serialize and deserialize structs representing messages to be sent and received via a TCP socket: ...
35 views

### How do I divide Dao and Dao-Cache into different modules? [closed]

I want to improve performance for api. I design cache in dao layer. I use caffine cache. Basic code is: CacheConfig.java ...
43 views

### Python Rabin-Karp Code Optimization

Here's the Rabin-Karp implementation that I've written in Python: ...
22 views

This is a fully functional PowerShell script I wrote not long ago that converts data (numerical data) among 4 data formats: binary, decimal, hexadecimal and ipv4. It supports 12 conversions, it can ...
26 views

### AStar Implementation and Efficiency

This is my implementation of an AStar-like algorithm for maze solving. A quick summary of the problem I am trying to solve with my algorithm might be: A simple binary maze is given to you to solve, ...
16 views

### AVL Tree in C Criticism

I have made an AVL tree in C and coded the basic functionality of insertion, deletion, and search. I would love some criticism on my implementation especially on the insertion and deletion section of ...
20 views

### Simple Hangman implementation in Rust

I'm starting out with Rust and decided to implement a game of Hangman. Can you please provide general feedback on the code? I've already identified some lines (see comments ...
26 views

### Is this file a good starting point for accessing data inside this json file via javascript classes?

I was given a spreadsheet of data that I turned into a CSV file and then converted it into a JSON file. I threw it into my application and I am processing it in the following manner: ...
58 views

### How can I optimize this Binary Search Tree?

I've added some methods to a basic BST implementation for integers - if anyone can point out some ways that this could be written in a more efficient or clean manner, please let me know. ...
88 views

### Is there any way to use a single for Loop for this code?

I want to use only one for Loop for this code. Is this possible? If not then how can I optimise my code further? It works well for the constraint 1 ≤ T ≤ 10, 2 ≤ N ≤ 10^3, 1 ≤ M ≤ 10^5, but I am ...
10 views

### Android APP connect to FTP server in Java

I am attempting to build an Android APP with the ability to connect specified FTP server in Java. The connection operation has been performed in FTPconnection class ...
24 views

### Code for car sales platform designed with flexbox in HTML5

This is intended as a simple layout for an auto showroom site: Disclaimer Details changed from original for privacy ...
11 views

### dom manipulation of yeoman app using api data [closed]

my apologies if this is posted in the wrong place. im working on a Yo project and understand i can get my code reviewed here. for the life of me the js dom modifications arent showing up! please could ...
31 views

### A simple Dll injector using c# console [closed]

hey guys apolgies for this. completely new to coding and me and another guy have decided to make a menu for a game. i have made this so far ...
611 views

### Input validation

I am learning C from C Primer Plus, and am still a beginner. I have been introduced to only two functions for input, scanf() and ...
40 views

### Implementation of the square root for real time application

For the real time control software I need square root calculation. I have heard that the sqrt function from the standard library isn't good choice due to the unpredictable number of iterations used ...
106 views

### Remove indicies from vector

I am trying to optimise my remove-erase functions by using some attributes of C++ containers. This function should delete all indices defined in std::set form given vector. I am pretty sure that ...
26 views

### Consider both print code block are exactly the same, should I create another class which contains a static method does the job? [closed]

This code is to demo how Multithreading works in Java in the simplest form, where main thread creates a thread before running the print code block, which works as ...
40 views

### How to pass tests correctly in Typescript?

The problem: I'm trying to write a TypeScript function suitable for a previously written JEST test. There are 5 tests in total. The function I wrote passes all the tests, but unfortunately, I was ...
25 views

### Improving my solution to the Quiz project from Gophercises in Golang

I'm new to Go and I completed the first challenge from Gophercises. Any feedback would be highly appreciated. There are some things that I am unsure of if they are made in an optimal way. Github repo ...
35 views

### How can I make my resource mapping faster?

I have a Direct3D 11 application and recently I've started to implement a new feature on it, the UI(User Interface). It seems to work well, but I'm having one problem with optimization when it comes ...
40 views

### Is this thread pool implementation OK?

There are things that I am not 100% sure. Is it possible that dangling references can be create in add_task method? Is it possible that this implementation will deadlock? I had to use shared_ptr in ...
19 views

### Error in solving the two coupled equation using the odeint subroutine written in fortran90 [closed]

In the given code I tried to solve the two non linear coupled rate equations using Odeint subroutine. Odient subroutine is pre-written by someone else. I have written derivs subroutine and main part ...