All Questions

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

POSIX shell function to “dump” all given arguments

My today's idea was to create a POSIX shell function to dump all given arguments, typical use would be to call it from a fucntion, where you already know some arguments are not well set (empty; not ...
0
votes
0answers
9 views

Using several file system commands repeatedly. How can the code size be reduced?

In the following code there are some repeated commands. How can I reduce it and make the code more concise. A detailed explanation of code is given below in comments. ...
2
votes
1answer
47 views

Asynchronous TCP network server with a packet system

Removed content as is no longer relevant Moderator please Removed this Post thanks
0
votes
0answers
6 views

x86 Single Stage Bootloader

I'm learning OS development and have written a single stage bootloader that loads the kernel, enters to protected mode and finally jumps to the kernel. I'll very appreciate any feedback and ...
1
vote
1answer
21 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 (...
1
vote
1answer
34 views

Fetching the evolution chain information for Pokemon using PokeAPI

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

Assign random shift with restrictions

Based on this question Thought it was a nice puzzle Main idea: How to randomly assign shifts to employees based on these restrictions: As per the O.P.: Randomly write to cells "1" or "0" ...
11
votes
3answers
372 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
14 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
13 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 ...
0
votes
0answers
18 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 ...
4
votes
4answers
91 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 ...
2
votes
0answers
16 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
1answer
49 views
+50

NodeJS CLI application that uses exec() asynchronously

Background I crated a CLI tool which executes an npm command (to create a react app) and modifies the contents of the generated files. It was a practice attempt at ...
1
vote
1answer
62 views

Remove multiple array elements by indices

I prepared a method to make possible to select elements of the array except for some indexes. ...
9
votes
4answers
712 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 ...
2
votes
0answers
14 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. ...
10
votes
8answers
10k views

Printing staircase revisited

What can be more elegant ways to solve the given problem. # ## ### #### Code: ...
2
votes
1answer
44 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
22 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 ...
3
votes
2answers
28 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 ...
1
vote
0answers
22 views

Matrix Exponentiation in Python

I recently wrote a python code for matrix exponentiation. Here's the code: ...
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 ...
12
votes
2answers
4k views

Plotting a rectangular prism

I'm creating a rectangular prism function, whose output looks like this: I think that this code can be improved by optimizing the use of np.meshgrid with a Python ...
3
votes
2answers
57 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 ...
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 ...
3
votes
1answer
182 views

VBA syntax that compiles sub data into master sheet

I am using this syntax to bring in the names of all employees whom are active, then from there filter the data on subsequent worksheets and use a formula to bring the data over to the ...
2
votes
1answer
45 views

Quick sort algorithm in Rust

I have written this Rust code to implement the quick sort algorithm. Could you review it and tell me if it is idiomatic or not? Especially about my use of the slices? ...
1
vote
1answer
86 views

R: Optimize algorithm speed that estimates hourly temperature and relative humidity

I built an algorithm to estimate real-time temperature and humidity values ​based on daily values ​of the same variables. The algorithm works, however the speed with which it processes the information ...
-1
votes
0answers
18 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 ...
3
votes
5answers
876 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: ...
2
votes
1answer
45 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 ...
-2
votes
1answer
51 views

Calculate draws faster in VB.Net [closed]

I created this calculation algorithm, unfortunately, it works a little hard for more combinations. How should it be improved for faster operation? ...
4
votes
1answer
31 views

A fast generator of palindrome dates in chronological order

02/02/2020 is a palindrome day because reading the date left-to-right or right-to-left still refers to the same calendar date. And because it doesn't matter whether you use the DD/MM/YYYY format or ...
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 ...
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 ...
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 ...
4
votes
1answer
56 views

Inserting Elements Into a Sorted Array

Very new to JS (wrote my "Hello World" around 3 days ago), but not to programming in general. My documentation is inspired by the approach I followed for Python (since I haven't learned JS ...
3
votes
1answer
70 views

Censoring words in lua

(repost: https://stackoverflow.com/questions/59665338/censoring-words-in-lua#comment105491094_59665338, as advised) Im currently making a discord censor bot for my friend, and I was wondering if ...
1
vote
2answers
380 views

Encryption scripts using the module cryptography

Its meant to password protect python scripts by using encryption It should use os.urandom(40)'s output in hex as the salt. The kdf (cryptography.io) is using Scrypt ...
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
3answers
40 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 ...
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 ...
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 ...
5
votes
2answers
74 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 ...
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
36 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 ...
4
votes
2answers
454 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 ...

15 30 50 per page
1 2 3 4 5 1298