All Questions

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

Short wrapper for fetch (similar to axios)

I was looking to replace my use of axios with just fetch, but I didn't like how verbose fetch was with regard to handling JSON output (having to have a separate then...
2
votes
0answers
10 views

Rotational Symmetry Indexing in a 1D “Square” Array

I managed to find a way to rotate a slice in-place (previous question on SO). The slice is linear, but represents a 2d square of elements. Is this approach efficient? Please check the previous ...
1
vote
0answers
10 views

Arduino test pin and store or return result; help convert working function to library

I created an Arduino compatible checkDevice() function for a circuit designed to enable detecting devices that are plugged in. Essentially testing if a pin is HIGH or LOW and storing up to 8 boolean ...
1
vote
0answers
7 views
1
vote
0answers
11 views

A representation of the Mandelbrot Set

I've written up some code that represents the Mandelbrot set in an, admittedly, quite inefficient way. It probably looks awful due to the fact that I did this completely solo, without any external ...
2
votes
0answers
12 views

What is better to use for mapping value to Map of functions: tail recursion of foreach?

I want to map functions from my functions library (Map called as chain) to input string str. ...
1
vote
1answer
32 views

How do I make this function more efficient and faster?

I have this function that fetches the evolution chain information for pokemons using pokeapi. The pokemon page takes significantly longer time. Any ideas in how to make it more efficient and easier to ...
1
vote
0answers
18 views

Matrix Exponentiation in Python

I recently wrote a python code for matrix exponentiation. Here's the code: ...
1
vote
1answer
16 views

Clean up tags from a text

I have the concept of a tag as text surrounded in curly braces (e.g. {name}). I have written a simple code to clean up the tags (...
0
votes
1answer
20 views

How to simplify this ES6 Array code

I'm just wondering Is there any ways I could simplify the following code without making it too difficult: Actually I want to extract specific year data from content node based on lastNumberOfYears ...
0
votes
0answers
21 views
3
votes
0answers
20 views

Conjugate gradient method for a sparse matrix

I am very new to Rust. I have written a conjugate gradient algorithm function for CsMatrix structure from nalgebra ...
3
votes
2answers
56 views

API for a progress display function

I want to create an object, that represents a progress output. In a GUI this would be a progress bar, in a console application it may be a text output, that can only be written, but not changed ...
-1
votes
0answers
17 views

SPA: bootstrap-like classes vs css [closed]

Which approach from 2 below would you prefer in SPA + Vue SFC. The bound is important, cause: non-spa no-easy way to bundle the files other framework like react, no easy way of having css + html ...
0
votes
0answers
9 views

Handle login method with external users and LDAP users

I'm working with a ASP.NET Core (v2.2) Web Api project and implemented some APIs. However, I'm facing performance issues, hence trying to optimizing the code. Here is the login API code. ...
0
votes
0answers
11 views

Subset sum using the Horowitz-Sahni algorithm and pruning strategies

The subset sum problem asks if some subset of a set can be summed to a given number (equivalently, if they sum to 0). I recently had to implement it, under an additional restriction of all numbers ...
2
votes
1answer
27 views

Fast execution of function which resembles matrix multiplication

I am trying to make the following function as fast as possible on large matrices. The matrices can have dimensions in the range of 10K-100K. The matrix values are always between 0 and 1. The function ...
11
votes
3answers
340 views

Interactive Discord bot for tabletop RPG

I'm new to Python, but have experience in a variety of other languages. I've learnt that a code review early on would make sure I don't start with bad habits. Which are more difficult to get out the ...
0
votes
0answers
16 views

Rosetta Stone translation challenge

I recently came across this programming challenge and managed to find a workable solution. The challenge contains various type of data input and my code seems to have workable solution that fulfills ...
0
votes
0answers
26 views

Word finder/filter for sentences - Confusion with cased letters

I have a working code that checks a Requirements_example.txt text for different words. It reacts differently depending on the word it finds or does not find. It ...
2
votes
0answers
33 views

Filter a two dimension array

This is the function I've wrote to filter a two-dimension array. I use it mainly on forms with user-defined filter (categories, dates, search bar, etc). It works fine, but it's ugly. Do you have ...
3
votes
2answers
27 views

Atomic fixed-size parallel std::vector wrapper

I'm in need of a simple wrapper for a fixed-size std::vector that can ensure atomic insertion. Since my only real problem is with atomic insertion and I know ...
9
votes
4answers
680 views

Generic Heap Implementation in C#

This has been done a thousand times on here already, but here's another binary heap implementation. The implementation is generic in terms of heap elements, allows for injection of any type of ...
4
votes
1answer
56 views

Averaging students' scores

I'm still a beginner, so I'm still learning. I'm trying to take test scores for 3 different students, enter them in an array, then display the name, test scores and the average. Trying to also have ...
4
votes
2answers
452 views

CodeAbbey - Blackjack Counting

Here is my solution for CodeAbbey - Blackjack Counting My code passes all tests on Code Abbey but I think I have some poor implementation specifically with my handling of the Aces in the score but ...
3
votes
5answers
869 views

Small FizzBuzz program

After watching this video by Tom Scott, I decided to make a program that follows that idea. This is what I came up with: ...
3
votes
1answer
43 views

JS Object In --> HTML Out (from a Noob/hobbyist)

I would appreciate feedback especially if you would be embarrassed by this code, or if I was on your team and you would expect better and/or you would mention something. This code was derived from ...
1
vote
1answer
61 views

Remove multiple array elements by indices

I prepared a method to make possible to select elements of the array except for some indexes. ...
1
vote
3answers
37 views

What's the best way to tidy up a PHP array with both indexed entries and associative entries?

I have two closely related questions: 1) I have a mixed PHP array. Not mixed in that it contains strings, floats, booleans etc. but mixed in that it is a hybrid indexed / associative array. Most of ...
2
votes
1answer
43 views

Looking for specific words in a string and noting the order

The problem: I have some text that I go through line-by-line, if I find a line containing the keyword DATA_TYPE_1 and/or ...
-1
votes
1answer
38 views

Copy a C# list into an out Parameter for better encapsulation [closed]

I have a class that needs to provide access to an internal List<int> member. The functions that use this class need to be able to work with that list, ...
4
votes
4answers
85 views

Statistics Library with Sample, SampleBuilder and Tests

Introduction I'm working on a Statistics Library that can record observations and produce a Summary of the statistics when there's enough observations. Right now, it's at its early stages and is ...
-1
votes
0answers
36 views

Player Ship Update function in an Asteroids-like game

In a Asteroids game, I have a player ship. In the code below, I have an Update function for Ship which will handle things like controls, collision and movement. What are your thoughts on this code? ...
8
votes
0answers
40 views

Generate a video of typing the contents of a file

I wrote a Python script to generate a video file of typing the contents of any program file. It works, but I'm really not very happy with how it works. I have several issues with it. In order to ...
0
votes
1answer
38 views

Binomial Expander

So I made a Python program to solve some of my A-level binomial questions or just to let me check my answer overall. I need advice on how to make it more compact and simplify it. This Python code is ...
1
vote
1answer
34 views

Dictionary of names and birthdays. Ask if you want to add

this code is to have a dictionary of names and birthdays. It will ask who's birthday it is that you're looking for. Then if it is in the dictionary, it will print back what that birthday is. If not, ...
3
votes
2answers
37 views

Raspberry PI switching from Soft Access Point to WIFI client

I am relatively new to C language and Linux systems I would like some feedback/review. The main function of the code is to read the dhcpcd file looking for the 3 lines and then either adding/removing ...
0
votes
0answers
26 views

Worksheet change and worksheet selection change slowing down my file

I have a file that i use as database. It has the records and in the row 1 several cells used as buttons, (open folder, copy text, send mail, ecc.) At any change on any column of any record the file ...
5
votes
2answers
73 views

Pythonic solution to display multi-dimensional tuple as a tree

I would like to show the tree-like structure contained in a multi-dimensional tuple by using the set of graphical glyphs that exist in Unicode fonts (e.g. \u2500, \u2502, \u2514 and others). Here is ...
1
vote
1answer
36 views

VBA: Calling one sub repeatedly and scope of variables

My code as a whole works for me without issues, but what I want to improve is a small part right out of the middle of it. I hope it's ok to post a simplified snippet here that just shows the structure ...
2
votes
0answers
9 views

intersection observer multiple animation

I want to achieve different animation for many elements on scroll, so instead of using window.scroll i'm using intersection observer api, but i want to know if my approach is effective and won't cause ...
-4
votes
0answers
15 views

how to refactor the following method [closed]

I have a method that I use to find out what role has the current user. I have used 3 if's, but I am wondering if it can be written in other way. Here is my method ...
-2
votes
1answer
39 views
-2
votes
0answers
42 views

Flipping Ts and CTs [closed]

This is my first code and I'm pretty proud. It's a coin flip but instead of tail it's T and CT. I have been coding for 2 weeks now and I think it's extremely fun. But if anybody want to build on it ...
1
vote
1answer
35 views

Minimal Property system in c++17

So I needed to represent by objects in terms in ini format and change their values from the ini as well, so I thought why don't implement a property system for this. I want it to be bit fast so I ...
8
votes
3answers
967 views

Reverse each word in the string. All spaces in the string should be retained

This was part of a code challenge. I use them to help me learn c++/c# along with tutorials and guides. Basically I was taking a string... The quick brown fox jumps over the lazy dog. ...and ...
9
votes
5answers
2k views

Transform dollars in exact change

The program was to turn an integer into exact change and uses a bunch of if statements. Are there steps a beginner like me can do to remove some or is it just how it will be? I can't find anything ...
-7
votes
0answers
45 views

i need help asap [closed]

I need help and its due in 2 hours. please help guys I am stuck printf("Input principal:"); printf("Input Principal: "); printf("Input Principal: ");
-2
votes
0answers
24 views

Correctly releasing allocated memory in C++ [closed]

Let me check if I could understand how to use delete operator ...
-1
votes
0answers
21 views

15 30 50 per page
1 2 3 4 5 1298