All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
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 ...
3
votes
0answers
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. ...
1
vote
0answers
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 ...
0
votes
0answers
8 views

Fitbit dashboard with Python

...
0
votes
0answers
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. <...
2
votes
0answers
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 ...
0
votes
0answers
8 views

convert ID3DXMatrixStack to DirectXMath

Is it right it convert ID3DXMatrixStack to DirectXMath like that: ...
1
vote
0answers
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 ...
2
votes
0answers
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 ...
0
votes
1answer
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 ...
-2
votes
0answers
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: ...
1
vote
1answer
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 ...
1
vote
1answer
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 ...
0
votes
0answers
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 ...
2
votes
1answer
19 views

React component to render price change

I've written this Card component which is composed of thumbnail image, name, symbol, ...
2
votes
3answers
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 ...
0
votes
0answers
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 ...
2
votes
1answer
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 ...
0
votes
0answers
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): ...
0
votes
0answers
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 ...
-2
votes
0answers
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: ...
0
votes
2answers
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 ...
1
vote
1answer
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. ...
0
votes
0answers
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 ...
2
votes
1answer
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 ...
4
votes
3answers
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: ...
0
votes
1answer
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 ...
1
vote
1answer
43 views

Python Rabin-Karp Code Optimization

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

PowerShell script binary-decimal-hexadecimal-ipv4 convertor

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 ...
2
votes
0answers
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, ...
1
vote
0answers
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 ...
0
votes
0answers
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 ...
1
vote
1answer
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: ...
1
vote
2answers
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. ...
-3
votes
3answers
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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 ...
0
votes
0answers
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 ...
-2
votes
0answers
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 ...
6
votes
2answers
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 ...
1
vote
0answers
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 ...
3
votes
1answer
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
2
votes
1answer
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 ...
-1
votes
0answers
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 ...
3
votes
1answer
41 views

Verifying calibration process on IoT device, python script

I have an IoT device with accelerating and gyroscope sensors. before my device can be used it needs to be calibrated. Basically, it means that I do measures for XYZ axes and for the gyro movements and ...
2
votes
2answers
44 views

What is the optimal way to write this small Todo List app

Hello I don't have any specific problem but I'm just interested how someone who is experienced in JavaScript would write this small toy program. it's a simple Todo List app, there are many approaches ...

15 30 50 per page
1
2 3 4 5
1434