All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Scraping (Selenium) [closed]

I can't seem to figure out how to click throw the load more until there is no more results. I've managed to scroll to the button in various ways. Can't seem to load to it and actually click. Help? <...
2
votes
3answers
113 views

Finding the sum of all numeric palindromes that are less than N

I wrote a function that finds the sum of all numeric palindromes lesser than N. ...
3
votes
1answer
39 views

LeetCode 894: All Possible Full Binary Trees

I'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time! Problem A full binary tree is a binary tree where each node has exactly 0 ...
-1
votes
1answer
50 views

Call method by condition

I apologize in advance for my English. I have a user search method. It's parameters - login and strict. The last one determines, ...
2
votes
0answers
21 views

Simple Pretty-Bytes Size (SI System)

This is a simple and short "Pretty Bytes" javascript function using the SI Decimal System for quantifying bytes. The code does not use complex maths such as ...
3
votes
1answer
30 views

Count the number of riders in each category

I have a code to get riders from certain teams and calculate the number of riders in those teams in that category: ...
3
votes
3answers
60 views

Ensuring threads running infinite loops are terminated before exiting the program

As a hobbyist programmer, I gain knowledge where I can find it from google searches. I tend to write code that utilizes threads that have infinite loops using while loops, where the while condition ...
8
votes
2answers
567 views

Optimize function that returns length of a subarray

I did an exercise today on where the task is to write a function that returns the length of the longest subarray where the difference between the smallest and biggest value in the subarray is no more ...
3
votes
2answers
50 views

Replace nested property for an interview

During an interview I was given this interesting JavaScript task: Given the code: ...
2
votes
0answers
14 views

Getting Graph and Block Animation to Run Smoothly Together

I have been working on some code that produces a live graphic of a graph and blocks moving. It works in theory but does not look like how I want. The animation runs very slow when showing both the ...
-5
votes
0answers
31 views

approach to solution and time complexicity

The city is rectangular in shape of size having 'r' rows and 'c' columns. The city is divided into 'r x c' cells. Each cell is either '#' or '.' denoting whether the cell is BURNING or is SAFE, ...
4
votes
1answer
39 views

Basic raytracer written in Rust

I come from a fairly strong background of C and thought that this project would be a good way to get a handle on Rust. Right now, I have everything in one file because I wasn't sure the best way to ...
1
vote
1answer
30 views

LeetCode 410: Split Array Largest Sum

I'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time! Problem Given an array which consists of non-negative integers and an ...
-2
votes
0answers
22 views

Primitive Calculator [closed]

Problem Introduction You are given a primitive calculator that can perform the following three operations with the current number 𝑥: multiply 𝑥 by 2, multiply 𝑥 by 3, or add 1 to 𝑥. Your goal is ...
1
vote
1answer
20 views

Filtering a Vec of structs and creating new vector of Strings or strs in Rust

I'm working through the Rust book, and it has the following example of how to use the filter method on Iterators (source): ...
2
votes
1answer
27 views

SelectionSort Algorithm using Python

I am a rookie and I need help optimizing this SelectionSort() algorithm which I have tried using Python. ...
4
votes
1answer
36 views

Using Newton Method in a Neural Network/

I programmed a Neural Network to do binary classification in python, and during the backpropagation step I used Newton-Raphson's method for optimization. Any kind of feedback would be appreciated, but ...
1
vote
1answer
16 views

Check that elements in list follow a specified date-format schema and are not null/na/nan

I'm practicing some data-analysis and I'm currently checking the integrity of my data. The elements that do not follow my date-schema, should be funneled to a new separate list so I can work on ...
0
votes
0answers
15 views

Using two handlers for a GraphQL project; handle query with the second one if the first one is not capable of

I'm trying to use both SuperGraph as-a-library and GqlGen. So I have two handlers: the first one is SuperGraph; this checks that it can carry out the operation the second one is GqlGen; this checks ...
8
votes
2answers
333 views

News site in ASP.NET Core

I am new to ASP.NET Core 3.1 with no background of MVC. I am just moving from Web Forms to ASP.NET Core. I asked elsewhere and I got the following comments regarding my code. The code is working fine ...
2
votes
0answers
10 views

Improvements, TicTacToe in Scala

I've just started my journey into functional programming and tried to implement a TicTacToe game Recursively without State in Scala. What I dislike is the JOptionPane but I don't know if i can solve ...
7
votes
0answers
54 views

Calculating a unique count within a rolling time window

I have a Pandas DataFrame that contains a row per member per day, expressing member interaction with a website. Members interact only on some days, each member is identified with an ID. Here is a ...
1
vote
2answers
52 views

JSX render method in react

Following is the piece of code which is working fine, but somehow it looks bit odd to me to have a function inside a render method and using it in both conditions. Let me know how can I improve this ...
3
votes
1answer
30 views

Simple program to print from a buffer until a newline is found

For practice, I wrote a small program that goes through a string in the data section (although, it could be easily adapted to take user input), and print out the characters in the string until it ...
1
vote
0answers
28 views

LeetCode 284: Peeking Iterator

I'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time! Problem Given an Iterator class interface with methods: ...
1
vote
0answers
30 views

events countdown OOP app

I wrote a JavaScript app with allows the user to add events and get countdown for every event. Also the events and their dates are stored in localStorage. I want a general review and I think that ...
0
votes
2answers
83 views

Shorten and optimize php custom code for wordpress page template and use shortcodes

I'm pretty new to php coding, but i know wordpress for a long time. Also experimenting with bootstrap. I created a new Page Template and modified it a bit. What I'm looking for is to optimize this php ...
1
vote
0answers
45 views

Better way to Read /Write Memory<byte> to/from POCO

I am communicating with a machine that sends/received structured binary data to my netcore service. The machine supplier's new library uses Memory in their library's API. I have written the following ...
1
vote
3answers
67 views

Getting Rid of .Find in VBA Code

I have a range of two columns that I want to search for a "key" and then find the corresponding value in the directly adjacent column. The key is stored in a dictionary that I populated ...
1
vote
1answer
32 views

Recursive Function to Produce Constrained List of Integer Partitions

I have modified a recursive function designed to print all the integer partitions of a positive integer to create a function that returns all partitions of the "number" parameter if they ...
2
votes
0answers
26 views

Web scraper for driver's license test times

I have created a small selenium script that checks for available times to write a test for a drivers license. The program runs every minute and takes approx 50 seconds to run. I have noticed that it's ...
4
votes
1answer
90 views

Switching first names with surnames

The objective is to get a list of number and then switch the last person surname with the first person surname; when I type '$' it do the changes and finish the program! (POINTERS and DYNAMIC ...
-1
votes
0answers
42 views

Using Object.keys() in 'or' statement to determine key/value pair index

I need to check if the key of a key/value pair exists in the excel to json data I am reading. I will be reading multiple file and there is not an ability to have the data columns all renamed to match ...
4
votes
1answer
45 views

Bash Code optimization For ssh login on the remote device

I have below code which works fine as its written in bash, i am just posting it here to see if this can be better optimised as per the BASH way. I am have an ...
4
votes
3answers
87 views

Hotel booking with multiple options. Improvement through subclasses?

The code below runs perfectly fine as I want it to. I'd like to create more subclasses to get a better overview over the whole code. Can I place the setter and getter as well as the methods into the ...
6
votes
4answers
1k views

Computing the item price and vat for a given pricing, order, and exchange rate

How can I improve the readability of the below function using a list comprehension? Also, is there a way to improve items() performance? ...
-2
votes
0answers
23 views

Std::lower_bound not giving expected result [closed]

I'm trying to get a method to return the closest value to 0.5, and used std::lower_bound. Why does this return the incorrect value, and a value that isn't even in the array? ...
1
vote
1answer
53 views

Bash script backup program

I've started bash scripting recently and currently I'm working on a program that simplifies backuping using rsync . I'd appreciate any feedback on what I've done ...
-1
votes
0answers
32 views

Re-implementing a C++ library in Go [closed]

I need to re-implement three features of C++ OpenVDB library in Go language: Mesh to volume ...
5
votes
0answers
55 views

K nearest neighbours algorithm

Here is a project that I worked on for a few days in June 2020. Since the algorithm is extremely slow, I looked into methods in order to parallelize operations but did not obtain any satisfactory ...
3
votes
0answers
61 views

Particle Swarm Optimization template

I am trying to create a PSO algorithm template for my project. I've decide to make the Swarm as separate type and ...
3
votes
0answers
34 views

I wrote my first pathfinding algorithm

I'm currently writing a small game in Lua, using the Love2d framework. I guess I'm doing it as a practice of sorts, but it did give me the opportunity to write my first pathfinding algorithm. I wrote ...
0
votes
0answers
34 views

LeetCode 212: Word Search II

I'm posting my code for a LeetCode problem copied here. If you would like to review, please do so. Thank you for your time! Problem Given a 2D board and a list of words from the dictionary, find all ...
2
votes
1answer
71 views

Constexpr circular queue - follow-up #1

Follow up to my question here: Constexpr circular queue . I've taken the time to fix the many problems pointed out there and am asking for any tips/corrections for the new version below. The queue ...
-3
votes
1answer
65 views

Is there a means to combine the similar chunks of Vuejs code shown below? [closed]

I am currently working on a project and very recently came across Vuejs. I used it to create a dynamic form on my frontend, however, the approach I took does not seem right to me. Could someone take a ...
5
votes
1answer
90 views
+50

Create or update record via HTTP request

I have an external system that sends an HTTP request to a Jython script (in IBM's Maximo Asset Management platform). The Jython 2.7.0 script does this: Accepts an HTTP request: ...
0
votes
0answers
46 views

Can I replace instanceof if I cannot use a common interface (third pary API)?

I'm using Telegram API and I've different methods wich returns different type of information like this: ...
1
vote
2answers
86 views

Determine if the student has passing grades

I made a program in Java that asks for the student's name, course, and grades. After the required text inputs are filled, the program will then show the result. If the student passed, the program will ...
0
votes
1answer
30 views

LeetCode 652: Find Duplicate Subtrees

I'm posting my code for a LeetCode problem copied here. If you have time and would like to review, please do so. Thank you! Problem Given a binary tree, return all duplicate subtrees. For each kind ...
10
votes
1answer
152 views

Create a build order from a list of projects and their respective prerequisites

Another graph algorithm, this time to create a priority or build order. Provided with a starting List<Project> and ...

15 30 50 per page