All Questions
77,245
questions
1
vote
0
answers
10
views
access arrow data
I am fetching arrow tabular data from an API. The content-type of the response is application/vnd.apache.arrow.stream. In my react code, I am trying to read the ...
0
votes
0
answers
8
views
Find and conditionally sort all venues matching a filter provided by an API client in PostgreSQL
I have an API where users can retrieve a list of "venues".
Every venue is a profile, but not every profile is a venue
Venues can be "parents" of other venues (think hotel - floor -...
-3
votes
0
answers
20
views
Melhorar jogo de basquete simples [closed]
Neste código, faça com que quando a tecla de espaço for pressionada, a bola deve completar o seu trajeto. Depois que a bola parar de cair, ela deve voltar para a mão do jogador, na sua posição inicial....
1
vote
0
answers
21
views
Advent of code 2023 day 3 in pure Bash
Yes I'll keep doing this until I cannot be bothered to do it in Bash ;-) (Well today is probably the last one ;-))
Part 1
To paraphrase the puzzle, given some input ("engine schematic") like ...
1
vote
0
answers
55
views
Python integer optimization with PuLP that I think can be faster
I have a problem where we are given multivariate polynomials in variables like y_i and z_j and the goal is to express them as sums of products of terms of the form y_i-z_j with nonnegative integer ...
0
votes
0
answers
9
views
Redouble each occurrence of char recursively, and add n
In following of this question, I would like to have a second review.
My code is working correctly now (I hope), but how to replace the "pre-"calculated map from line 7 to 25 with a simple ...
1
vote
0
answers
38
views
Advent of Code 2023 Day 2 in C#
To paraphrase the puzzle, Santa takes a walk with an Elf, and they play a game involving a bag of colorful cubes. In each game, there is an unknown number of each colored cubes in the bag, and the Elf ...
0
votes
0
answers
17
views
PHP And Reflection For Showing Available Formatters On A Report Column
I'm using reflection in PHP to load a list of available Formatter classes that all have methods that do formatting of a value in a specific CSV column.
e.g. for ...
1
vote
2
answers
30
views
A recursive_minmax Template Function Implementation in C++
This is a follow-up question for A Maximum Function For Various Type Arbitrary Nested Iterable Implementation in C++. Besides the function for finding maximum, I am trying to implement ...
-1
votes
0
answers
55
views
Best Practices For A Console Menu App
I am quite fresh to c# and creating programs. I wrote a very basic program which allows you to go through menu selections via up and down arrowkeys and select your selection along with sending you to ...
0
votes
1
answer
23
views
Make a script to call pager duty's API and update on call
I made this script it works, I'm just looking for ways to make it better/reading to get better.
...
1
vote
1
answer
62
views
Advent of Code Day 2 in Python
problem for day 2
Part 1
You're launched high into the atmosphere! The apex of your trajectory just barely reaches the surface of a large island floating in the sky. You gently land in a fluffy pile ...
6
votes
2
answers
1k
views
Advent of code 2023 day 2 in pure Bash
To paraphrase the puzzle, Santa takes a walk with an Elf, and they play a game involving a bag of colorful cubes. In each game, there is an unknown number of each colored cubes in the bag, and the Elf ...
5
votes
2
answers
144
views
Binary file reader and writer
I want to write a simple binary file reader and writer class. The class below can read or write file. main.cpp read 500 bytes from tmp.bin and copy at the end of ...
0
votes
1
answer
35
views
DB Layer of a project management CLI
I am (re)writing a project management CLI and want to put it on a solid foundation concerning the database connections and testing. My focus was to build a DB class which is easy to test and could be ...
2
votes
1
answer
46
views
A simple threadpool in C++17
Implemented a simple thread pool that executes task asyncly, and returns a simple future you can wait on. Can you please suggest improvements?
...
3
votes
1
answer
46
views
Simulating a Moving Average Process
I was studying stochastic processes and thought to independently simulate a moving average process.
...
2
votes
1
answer
40
views
How better methods of remaking the code by array without changing its functionality, and performance but reducing amount by ~10 times
Can anybody help me with examples of code?
How is the approach to optimize code relative to my example with using "switch case" to "arrays"? Without changing its functionality, but ...
1
vote
1
answer
40
views
Asynchronous OOP-based networking using the Epic EOS SDK
There is also a limitation from the Epic EOS SDK in the absence of thread safety, all "C" calls can only be made from one thread. And from the thread where the SDK was initialized.
Based on ...
5
votes
1
answer
103
views
Advent of code 2023 day 1 mostly in Bash
It's that time of the year again!
Although there's no more Winter Bash, we can still have all the Bash we want in winter ;-)
Part 1
To paraphrase the description:
For each line in the input:
Find ...
3
votes
0
answers
90
views
Parse two-digit numbers from text
I am participating in this year's Advent of Code for fun.
Challenge 1.2 states:
The newly-improved calibration document consists of lines of text; each line originally contained a specific ...
0
votes
0
answers
17
views
Managing users via SQLAlchemy DB model
I am currently in the process of writing a system application that will be operated by multiple users. This will require individual users to access the application while limiting access to those that ...
0
votes
1
answer
29
views
Print a hollow Rhombus [closed]
I am beginner in java, here is my code to print a hollow rhombus:
...
2
votes
0
answers
33
views
SEDE query to count questions, views and unanswered for a set of tags
This query selects the number of SO questions, the number of views and the number of unanswered questions for each tag (the list of the tags is the user input). It works fine when it works, but it ...
0
votes
0
answers
45
views
Is this iterative inorder traversal algorithm well-known?
I was concerned about the approach in Morris traversal algorithm and came up with simpler solution that uses parent pointers in nodes.
The constraints were following:
Time Complexity: O(n)
Space ...
-3
votes
0
answers
20
views
Raspi5 Throws "mmap of gpio registers failed" with pwm fan script [closed]
basically the title.
the following code
...
2
votes
1
answer
33
views
Finding the longest path on a grid with obstacles from the top to the bottom
I have a rectangle of . (platforms) and # (obstacles). I can start at any platform in the top row and go to the left, right or ...
3
votes
1
answer
58
views
C++ printing library with templates
I was mad C++ did not have support for printing containers. I also could not find a header only library for printing containers so I decided to make my own. My goals were: 1) practicing templates 2) ...
0
votes
0
answers
34
views
Todo application using Spring Boot 3, Dockerized Postgres, Java 17, Maven
I'd like to have code review for backend of todo app.
It has 2 main functionalities:
Authentication and authorization using Spring Security and JWT token.
CRUD for tasks
In particular I'd like to ...
2
votes
1
answer
66
views
Double each occurrence of a char recursively
The exercise is to write a recursive method that takes a String and a char parameter and returns a ...
-3
votes
0
answers
37
views
Printing more than one string variable with print in python [closed]
I am new to python and I having a hard time with a simple print of two strings. I am following some examples and I don't understand why it is giving me an error
...
-3
votes
0
answers
40
views
first snake game [closed]
I've just worked on my first game in C and have a few questions.
how would I make it where my box is nicer?
I'm having issues trying to figure out how to make the snake grow in size when it eats.
...
3
votes
1
answer
75
views
Simple hash table written in C with REPL
This is a simple hash table I've written in C. It is a closed-addressing hash table with TABLE_SIZE number of buckets. The hash ...
1
vote
1
answer
47
views
Simple .NET Web App for managing family budget
I am creating some small project for my portfolio. It will be an app written in .NET and React but for now I've done backend part and I seek code review. I wanted it to be aligned with DDD principles ...
2
votes
0
answers
23
views
Ringbuffer over a const generic Array in Rust
I implemented this generic ringbuffer over a const generic array with the usage of the MaybeUninit type.
Is there something which is maybe unsound (having the lines ...
1
vote
1
answer
36
views
LinearUpscale2DArrayInPlace in Unity Jobs
Well,
I have this function which is called in the Unity Job system, I'm profiling it:
The code:
...
1
vote
0
answers
26
views
Simple Todo app using latest React and TypeScript
I would like to ask your advice on the frontend code of todo app.
Main functionalities:
The app has authorization and authentication using backend.
The CRUD functionality for managing tasks
What may ...
1
vote
2
answers
84
views
Domain Driven Desing aggregate for ticket booking
What do you think about this aggregator (DDD) for booking and cancelling tickets? Is it ok, or would you do it differently somehow?
...
1
vote
1
answer
58
views
Simple text file encryption and decryption
Short introduction; recently I've completed a basic course on C but other than that I have no programming experience and I am a total beginner.
As a practice project and to practice reading from and ...
2
votes
1
answer
17
views
Do you think it's a good schema.prisma?
i'm trying to learn backend with Next JS, and i'm using Prisma + MongoDB. I want to create a simple website with a user with a cart and some products. here my schema :
...
6
votes
1
answer
75
views
Optimizing __getitem__ for a bioinformatics script in Python
I'm writing a script for a bioinformatics application in Python that iterates through several sequences looking for amino acids in specific positions to calculate their frequency in relation to a ...
0
votes
1
answer
72
views
Move timestamp to the next Monday 10:01 AM
I've been battling ChatGPT for hours now and can't get satisfied with this simple algorithm in TypeScript. These two (hopefully correct) TypeScript+ReactNative solutions should move the timestamp ...
2
votes
0
answers
75
views
NLP pre-processing function optimization as it is extremely low on 92Mb data set
I have a data set that is of 300,000 rows approximately and two columns, each row contains a string, some might be larger than others. All in all, the data set in a ...
10
votes
4
answers
2k
views
Number to text in Python
I'm kind of new to programming and I would need a suggestion whether there is a better way to solve this exercise.
I need to write a function dict_of_numbers() that ...
0
votes
0
answers
35
views
Waiting time display app in Python
This application is for restaurant patrons to know how long they have to wait in line.
We would like to design a more sophisticated GUI interface, but do not know how to go about it.
Please let me ...
4
votes
9
answers
236
views
In-memory cache class
The following is a simple cache that I have written in java. It uses the LRU replacement policy and also evicts items based on a refresh interval (default 5 secs). Right now, the class is not thread ...
-3
votes
0
answers
31
views
Python check is an ip in ip network list [closed]
I try to check is an IP address in network list, but alway get False
...
1
vote
0
answers
30
views
Go log file swapper
Please review my code. I left some comments where I think something might be wrong, but any comment is appreciated.
I am writing a package for a project I am currently building. Its purpose is simply ...
3
votes
1
answer
73
views
Implementing an Object type in C++
I'm currently working through the "Crafting Interpreters" book by Robert Nystrom. He uses Java to implement the visitor pattern in which the visitor functions return the Object type. C++ ...
4
votes
2
answers
435
views
Spatial radius search in Boid simulation
I am working on a Boid simulation with 10,000 boids. I've successfully utilized geometry shaders and an array<GLfloat[3], MAX_BOIDS> for vertices to enhance ...