All Questions

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

Simplify nested list comprehension

...
  • 773
0 votes
0 answers
2 views

React Native app with context - Search and Report functionality

I have a react native app. I have a search component, that I reuse in the SearchScreen (where I search for train stops) and again in my Report screen where I report (and first search station) not ...
0 votes
0 answers
2 views

Efficiency change between generic and classic function in rust

I recently started to program in Rust, having like 2 good years of experience in C++, I thought it would be possible to directly switch to Rust without following a lot of tutorials, especially knowing ...
  • 101
0 votes
0 answers
7 views

Adding multiple images to a html file using Jinja2

I am trying to load and add multiple figures from disk to a HTML file For adding a single image, I tried the following (ref.: https://stackoverflow.com/questions/35855777/jinja2-python-insert-a-images-...
  • 101
1 vote
0 answers
11 views

Benchmarking an improved wheel sieve

I followed your answers for my last questions (1st 2nd) and I came up with these new versions of my codes but I face some difficulties to measure the efficiency of my code, I use chrono library to ...
0 votes
1 answer
18 views

Iterating over JSON more effectively

Problem: I need to get data from JSON file containing information about "contributors". Each contributor has an atrribute jobs, which is a list of string-...
-1 votes
0 answers
14 views

Make C++ Task class similiar to C#'s Task

I am enjoying making various programs with C++. This is my first code review request. And I hope I can get some insights or might have good advice to make my code better. I make a task class using C++...
  • 11
1 vote
0 answers
12 views

Coordinate conversion program using pyqt

As an exercise in using PyQt, the Python switch statement and abstract classes, I made a little app to make conversions between geodetic (WGS84) and PSD93 (Oman) and UTM 40N projections (instead of ...
1 vote
0 answers
15 views

Tic-Tac-Toe Code

I'm a beginner in python programming, been doing it for only a few weeks and I decided to make a tic-tac-toe game in the python interpreter. I'm looking for feedback on the program and any way I can ...
1 vote
1 answer
17 views

How to using custom colormap with pixel calculation, gray scale value by opencv and make it workable on camera

I tried to implement the mcolor colormap in the paper at page 8 to 10. I developed the code to process a image file and it works ok. Now, I want to adopt this image processing method to the camera ...
1 vote
1 answer
33 views

General purpose 2D grid

I am developing (WIP) a mine sweeping game to get more familiar with Rust. I decided to represent the mine field as a 2D grid. While developing I realized that this grid can be outsourced as a general ...
1 vote
1 answer
34 views

input character name and age then print name and age list the characters that are older

Instead of using so many if and elif statements I want to organize the names and ages into a list and when a user input the name and age it will iterate through the list of ages to see if any of them ...
-1 votes
0 answers
11 views

Laundry machine tracking app using NgRx to track state [closed]

Essentially, I live in a flat on 9 people and it's a pain in the butt coming down from the 4th floor to find out the machine is in use and having to go back up with the laundry. I tried to use NgRx ...
2 votes
1 answer
24 views

Pairwise Max Product

This python program takes user input of the number of elements in a list in the variable b and then takes user input of the list elements in list a. It then finds out the maximum product of a pair of ...
2 votes
1 answer
17 views

API request into a dictionary

I have the code below which currently pulls pricing data for Ethereum from CoinGecko API. From this request I am building a dictionary that contains the pieces of information and returning it to be ...
1 vote
1 answer
17 views

Create URL's, then download and print each RSS feed text

Looking for a more efficient way of achieving this. In particular the combine_all_rss_lists so I don't need all those params. Feedparser module doesn't accept lists which is why I've had to initially ...
  • 45
0 votes
2 answers
22 views

VBA code which exports data from Access to Excel and then loops through the Excel file

I have a couple of VBA loops that work in the blink of eye when I execute them through Excel, but doing this as part of an Access VBA application takes like 15 minutes. The loops run through each row ...
6 votes
4 answers
340 views

SIngle-directional linked list in C

I'm learning algorithms and I wrote the single-directional linked list implementation in C. I need a code review of what can I improve in my code and I want to make sure there are no possible memory ...
  • 61
-1 votes
0 answers
26 views

Python: A function to check if any veraible (int, float, string, list ,etc. ) is a positive int [closed]

check if a given variable is positive integer: ...
0 votes
0 answers
19 views

Facebook API class for making access token requests

I am writing a bunch on integrations with some social media platforms and have been hacking around with the Facebook API. I would like a review on the code below as i'll most likely rinse and repeat ...
  • 55
3 votes
2 answers
94 views

K&R Exercise 5-11. Modify the "detab" - to accept a list of tab stops as arguments

So far I have reached chapter 5 of the K&R Book, Edition 2 from which I have been learning C. I spent a few days thinking of a solution to this program. I wrote two or three versions of the same ...
1 vote
0 answers
17 views

Trying to link Nodes together, process takes too slow though [closed]

...
-1 votes
0 answers
9 views

How can I change this code to a code using std-pair? [closed]

Before the question, I am a non-English speaker, so my English might be a little awkward This is Closest pair of points problem. I use array but using an array to list the coordinates one by one is ...
4 votes
3 answers
413 views

Auctionsite API Wrapper in Python

This is the first API wrapper I've written and I'm wondering what I can do to improve. I've read through the feedback of a few similar posts Readme Code ...
1 vote
0 answers
21 views

Dining Philosophers in golang

I'd appreciate any feedback on this code. The assignment was to have each philosopher eat three times. I introduced time into the problem where eating takes 20 minutes and then the philosopher ...
2 votes
0 answers
41 views

python pygame snake game

I used numpy for the O(n) parts, but I didn't add any ability to change grid size because I still wonder if there's a way to make it better than O(n). main.py: <...
-1 votes
0 answers
18 views

python turning aggregations into weighted aggregations [closed]

...
  • 9
-5 votes
0 answers
28 views

What is the use of ~ symbol in Rust? [closed]

I would very much appreciate if someone tell me what does ~ means in Rust. I have not yet came upon it in TRPL book but in std for example in Struct std::boxed::Box we see: ...
2 votes
0 answers
28 views

Followup: Use backtracking to put as many ships on a battleship-board as possible

I created a simple battleship game and wanted to be able to place as many ships on my board as possible. The logic to place the ships uses some kind of backtracking to find a correct placement. ...
  • 127
5 votes
2 answers
339 views

Number guessing game with difficulties and highscore

I'm sure you've heard this before, I'm a beginner, however I'm trying to break out of the basics and use more intermediate things like functions and such but I'm having a hard time understanding how ...
2 votes
1 answer
35 views

Pick two random cards from a standard deck

I wrote this code as a refactor of code I saw on Programiz. I thought about this refactor before going to bed and implemented it successfully in code. ...
  • 21
3 votes
1 answer
32 views

DmenuWacom: a front hand for wacom tablets

DmenuWacom During my raids, I came across and solved several problems, obviously in my style, very similar to the suckless.org approach and which still works quite well. In fact, I started writing a ...
  • 31
2 votes
1 answer
27 views

Quadratic equation solver using ABC and PQ formula

Getting my feet wet with Rust, I implemented a solver for quadratic equations. I implemented both, ABC and PQ formula solvers, to challenge myself with branch conditions. ...
2 votes
1 answer
43 views

plotting Monte Carlo Simulation from excel sheet

I have created the following code: Option Explicit ...
's user avatar
3 votes
1 answer
28 views

request data and print results

On last test, the below code takes approximately 10 seconds to download then print the data from 10 url's. I wish to speed this up as much as possible as later on I plan to expand this further and use ...
  • 45
2 votes
1 answer
50 views

Efficient List comprehension with multiple conditions using shift? [closed]

I am new to python. I am trying to get the total number of failures by checking first how did the transition of the column Failure Sensor. Then creating the Start column from devicetimestamp if the ...
1 vote
0 answers
18 views

Timeout middleware in Gin -Golang

This is an implementation of a custom timeout middleware. I am creating a context with a deadline in my middleware and using it in the rest handlers for timeouts (to wrap the query to DB eventually) ...
4 votes
0 answers
23 views

declarative package manager for Arch Linux

pacdef is my declarative package manager for Arch Linux. I have written it since I often found myself discovering a new tool at one of my PCs, using it there for a ...
  • 387
3 votes
2 answers
78 views

Longest substring without repeating characters

I have the following O(N) code submitted: ...
8 votes
1 answer
101 views

Convert integer to Roman numeral string

This is my 1st time developing PHP code and I am only 13 years old. I have experience in other programming languages like lua, python, and c++. This is a simple Number to Roman Numeral code I made for ...
-5 votes
0 answers
18 views

I have problem with programming code on language C. What should I do so that when c and b are equal, the condition is fulfilled? [closed]

...
-1 votes
0 answers
42 views

C++ continuation tasks

I was reading about the C++ proposal to drop continuation tasks (which supposedly should come since c++14) in favor of execution pool, executor, and sender/receiver semantics. Was wondering how hard ...
  • 212
4 votes
1 answer
66 views

Add two huge base-10 numbers

This is some assembly code I've written to add two base-10 numbers. The input and output are represented as null-terminated ASCII strings, with digits in big-endian order. I have also provided ...
  • 185
2 votes
2 answers
171 views

Generic observable type

I am writing an observer design pattern that is not too complex but I still feel there's a lot for me to learn about C++ be it little details (especially coming from C). A couple of observations: I ...
  • 362
0 votes
2 answers
48 views

Reversing a Python string using [::-1]

I'm learning how to reverse list and strings. Is there another way of reversing a string other than using [::-1] method? even if the other method is the long route i would much appreciate it ...
-2 votes
0 answers
12 views

How to optimize the Asp.net Core WebAPI code? [closed]

I am building a .Net Core 6.0 application that uses HttpClient I have a custom Httpclient as mentioned below ...
4 votes
3 answers
367 views

Immutable matrix class with mathematical methods

This was a homework assignment for a data structures course. The goal was to implement a given interface and the assignment was auto-graded by a system that ran some validation tests. Sadly I did not ...
  • 185
0 votes
0 answers
59 views

Function block diagram code in CPP to program Arduino

I have created a processing program (Java) with which a programmer can use a GUI to make a program for an Arduino using logic function blocks. It looks like this: Ofcourse it still needs some work. I ...
  • 136
0 votes
0 answers
29 views

Nested For and if loop performance issues [closed]

I am trying to do a conditional statement on lots of data to classify certain combinations of moves. My code works and gets the job done but it is rather slow. This took about a minute to run on about ...
0 votes
0 answers
9 views

Typescript nested exclude [closed]

In my code I have this monster: ...

15 30 50 per page
1
2 3 4 5
1529